-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.py
More file actions
27 lines (22 loc) · 857 Bytes
/
main.py
File metadata and controls
27 lines (22 loc) · 857 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
import disnake
from disnake.ext import commands
from config import token
#В настройках бота на сайте включить все вкладки с INTENTS
intents = disnake.Intents.all()
bot = commands.Bot(command_prefix="s!", intents=intents, activity=disnake.Game(name="/start в ЛС"))
#список когов
cogs = ['shop']
#ивент готовности бота для подгрузок когов
@bot.event
async def on_ready():
for cog in cogs:
bot.load_extension(f"cogs.{cog}")
print('[Log]: Бот запущен!')
#команда рестарт когов (s!reload)
@bot.command()
async def reload(inter):
for cog in cogs:
bot.reload_extension(f"cogs.{cog}")
await inter.send('рестартнул коги')
#запуск бота
bot.run(token)