-
Notifications
You must be signed in to change notification settings - Fork 22
/
DiscordManimator.py
48 lines (35 loc) · 1.02 KB
/
DiscordManimator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import asyncio
import os
import traceback
import config
import discord
import logging
from discord.ext import commands
from pathlib import Path
intents = discord.Intents.default()
intents.message_content = True
discord.utils.setup_logging()
bot = commands.Bot(
description="Manim Community Discord Bot",
activity=discord.Game("Animating with Manim"),
help_command=None,
command_prefix=config.PREFIX,
case_insensitive=True,
strip_after_prefix=True,
intents=intents,
)
@bot.event
async def on_ready():
logging.info(f"Logged in as {bot.user.name}")
await bot.tree.sync()
async def load_cogs():
for extension in os.listdir(Path(__file__).parent / "cogs/"):
if extension.endswith(".py"):
try:
await bot.load_extension(f"cogs.{extension[:-3]}")
except Exception:
logging.error(f"{extension} couldn't be loaded.")
traceback.print_exc()
if __name__ == "__main__":
asyncio.run(load_cogs())
bot.run(config.TOKEN)