-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
36 lines (27 loc) · 1.06 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
from os import getenv
from nextcord.ext import commands
from utils import create_collection, increase_xp_guild, bot_owner_ids, bot_prefix
import nextcord
from extensions import initial_extensions
class Bot(commands.Bot):
def __init__(self,*args,**kwargs):
super().__init__(*args,**kwargs)
async def on_message(self, message : nextcord.Message):
await create_collection(guild_id=message.guild.id)
await self.process_commands(message)
if message.author.bot:
return
await increase_xp_guild(guild_id=message.guild.id, user_id=message.author.id)
intents = nextcord.Intents.default()
intents.members = True
intents.message_content = True
bot = Bot(command_prefix=bot_prefix, owner_ids = set(bot_owner_ids), intents=intents, case_insensitive=True)
@bot.event
async def on_ready():
print(
f'Logged in as {bot.user} ({bot.user.id}) ({nextcord.__version__})'
)
if __name__ == '__main__':
for extension in initial_extensions:
bot.load_extension(extension)
bot.run(getenv('TOKEN'), reconnect=True)