-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
39 lines (28 loc) · 1.04 KB
/
main.py
File metadata and controls
39 lines (28 loc) · 1.04 KB
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
import nextcord
from nextcord.ext import commands
from nextcord import Interaction
import os
from dotenv import load_dotenv
from web import open_web
load_dotenv()
bot_token = os.environ.get("BOT_TOKEN")
# admin = os.environ.get("ADMIN")
intents = nextcord.Intents.all()
# bot = commands.Bot(intents=intents, owner_id=int(admin))
bot = commands.Bot(intents=intents)
@bot.event
async def on_ready():
print(f'We have logged in as {bot.user}')
# print(f"admin: {admin}")
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
bot.load_extension(f"cogs.{filename[:-3]}")
# @bot.slash_command(name="reload", description="Reload all cogs")
# @commands.is_owner()
# async def reload(interaction: Interaction):
# for filename in os.listdir("./cogs"):
# if filename.endswith(".py"):
# bot.reload_extension(f"cogs.{filename[:-3]}")
# await interaction.response.send_message("reloaded all commands")
open_web() # 다른 사이트 호스팅 용도, 로컬로 호스팅 시 필요없음
bot.run(bot_token)