-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
48 lines (37 loc) · 1.3 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
40
41
42
43
44
45
46
47
48
import asyncio
import discord
from discord.ext import commands
import settings
import traceback
initial_cogs = [
'cogs.owner',
'cogs.general',
'cogs.utility',
'cogs.party',
'cogs.fun',
'cogs.profile',
'cogs.tags',
'cogs.shop',
]
class KodsBot(commands.Bot):
async def setup_hook(self):
print(f'\nLogged in as: {self.user.name} - {self.user.id}\nVersion: {discord.__version__}\n')
for cog in initial_cogs:
try:
await self.load_extension(cog)
print(f'Cog: {cog} Loaded!')
except Exception as e:
print(f'Error: \nType: {type(e).__name__} \nInfo - {traceback.print_exc()}')
intents = discord.Intents.all()
intents.message_content = True
client = KodsBot(command_prefix=['k.', 'K.', 'alexa '], case_insensitive=True, intents=intents,
help_command=commands.DefaultHelpCommand())
@client.check
async def bot_check(ctx):
check1 = not ctx.author.bot
check2 = ctx.guild == client.get_guild(settings.GUILD_ID)
check3 = (ctx.channel.id not in settings.BLACKLIST_CHANNELS) or client.is_owner(ctx.author)
if not check3:
await ctx.send(f'{ctx.author.mention} Bot commands cant be used in this channel!')
return check1 and check2 and check3
client.run(settings.TOKEN)