forked from emso-c/pekofy-bot
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbot.py
35 lines (27 loc) · 828 Bytes
/
bot.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
import logging
import os
from discord import Intents
from discord.ext import commands
# set up logging
logging.basicConfig(
level=logging.INFO,
format="(%(asctime)s) [%(levelname)s] %(message)s",
datefmt="%H:%M:%S",
handlers=[
logging.FileHandler(filename="discord.log", encoding="utf-8"),
logging.StreamHandler()
]
)
# initialize intents
intents = Intents.default()
# enable the required intents
intents.message_content = True
# initialize the bot with the prefix and intents
bot = commands.Bot(command_prefix="!", help_command=None, intents=intents)
# load extensions
bot.load_extension("extensions.events")
bot.load_extension("extensions.pekofy")
bot.load_extension("extensions.reactions")
bot.load_extension("extensions.help")
# run the bot
bot.run(os.getenv("DISCORD_TOKEN"))