-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
34 lines (23 loc) · 768 Bytes
/
main.py
File metadata and controls
34 lines (23 loc) · 768 Bytes
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
# main.py
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
from keep_alive import keep_alive
load_dotenv()
keep_alive()
class MyBot(commands.Bot):
def __init__(self):
super().__init__(
command_prefix='$',
intents=discord.Intents.all()
)
async def setup_hook(self):
await self.load_extension(f"cogs.announcements")
await bot.tree.sync(guild=discord.Object(id=1085622890344480879))
async def on_ready(self):
guild = discord.utils.get(bot.guilds, name=os.getenv('DISCORD_GUILD'))
print(f'{self.user} is connected to the following guild: '
f'{guild.name}(id: {guild.id})')
bot = MyBot()
bot.run(os.getenv('DISCORD_TOKEN'))