-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbot.py
executable file
·37 lines (27 loc) · 978 Bytes
/
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
import os
import discord
from discord.ext import commands
import aiohttp
TOKEN = open('data/TOKEN.txt', 'r').readline().strip()
intents = discord.Intents.default() # even default is more than we actually need
intents.members = True # For AoC
bot = commands.Bot(command_prefix=";", intents=intents, owner_ids=[420338564354801664, 185725754821050368])
bot.remove_command('help')
async def create_aiohttp_session():
bot.aiohttp_session = aiohttp.ClientSession(loop=bot.loop)
@bot.event
async def on_ready():
print('Logged in as')
print(bot.user.name)
print('------')
for cog in os.listdir("./cogs"):
if cog.endswith(".py") and not cog.startswith("_"):
try:
cog = f"cogs.{cog.replace('.py', '')}"
bot.load_extension(cog)
except Exception as e:
print(f"{cog} can not be loaded:")
raise e
bot.load_extension("jishaku")
bot.loop.run_until_complete(create_aiohttp_session())
bot.run(TOKEN)