forked from cibere/discord-bot-made-with-no-communication
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
40 lines (26 loc) · 1.09 KB
/
main.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
import discord
from discord.ext import commands
import config
class Bot(commands.Bot):
def __init__(self) -> None:
import logging
import logger
logger.init()
self._logger = logging.getLogger()
intents = discord.Intents.default()
intents.message_content = True
intents.members = True
allowed_mentions = discord.AllowedMentions(everyone=False, roles=False, replied_user=False)
super().__init__(intents=intents, allowed_mentions=allowed_mentions, command_prefix=self.get_prefix)
async def get_prefix(self, *stupid_args_to_make_pylance_happy) -> list[str]:
return ['!', '?']
async def setup_hook(self) -> None:
import loader
self._handler = loader.Handler(self)
# Iterates through all the .py files inside the `cogs` folder and attempts to load them.
await self._handler.cog_auto_loader()
await self.load_extension("jishaku")
async def on_ready(self):
self._logger.info('discord-bot-made-with-no-communication is ready...')
bot = Bot()
bot.run(config.token)