-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path__main__.py
49 lines (39 loc) · 1.33 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
41
42
43
44
45
46
47
48
49
import os
import discord
from discord.ext import commands
from config import config, DLDIR
from help import Help
from music import Music
from manage import Manage
from fun import Fun
if config.FoxDotEnabled is True:
from foxdot import Foxdot
if __name__ == "__main__":
if os.path.isdir(DLDIR):
for f in os.listdir(DLDIR):
os.remove(DLDIR + f)
else:
os.mkdir(DLDIR)
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix=lambda e, f: config.getPrefix(), help_command=None, intents=intents)
@bot.event
async def on_ready():
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name=config.getPrefix()+"help"))
print('Logged in as {0} ({0.id})'.format(bot.user))
print('------')
@bot.event
async def on_message(message):
if message.author.id == bot.user.id or message.author.bot:
return
if config.FoxDotEnabled is True:
await Foxdot.send_command(message)
await Fun.chocolatine(message)
await bot.process_commands(message)
bot.add_cog(Music(bot))
bot.add_cog(Fun(bot))
bot.add_cog(Manage(bot))
bot.add_cog(Help(bot))
if config.FoxDotEnabled is True:
bot.add_cog(Foxdot(bot))
bot.run(config.token)