-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
39 lines (32 loc) · 1.11 KB
/
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
36
37
38
39
from config import cfg
from cogs.misc import Misc
from cogs.music import Music
import discord
from discord.ext import commands
class Bot(commands.Bot):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if cfg:
print("Configuration loaded successfully!")
intents = discord.Intents.default()
intents.message_content = True
intents.voice_states = True
bot = commands.Bot(command_prefix=commands.when_mentioned_or(cfg.configured_prefix),
description='Music streaming bot based on YTDL for various platforms', intents=intents, help_command=None)
@bot.event
async def on_ready():
print(f"Logged in as {bot.user} - {bot.user.id})")
print("------")
print(f"Bot owner ID is {cfg.owner_id}")
print(f"Configured command prefix is {cfg.configured_prefix}")
await bot.add_cog(Music(bot))
await bot.add_cog(Misc(bot))
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandNotFound):
return
raise error
def main():
bot.run(cfg.kaori_token, reconnect=True)
if __name__ == "__main__":
main()