Upload to gitea
This commit is contained in:
commit
d3d25c68f9
12 files changed
+500
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import os
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
from config import VERSION
|
||||
|
||||
EXTENSIONS = [
|
||||
"cogs.voice_rooms",
|
||||
"cogs.signin",
|
||||
"cogs.settings",
|
||||
]
|
||||
|
||||
|
||||
class LunarHelper(commands.Bot):
|
||||
def __init__(self):
|
||||
intents = discord.Intents.default()
|
||||
intents.message_content = True # 偵測簽到文字(需在 Developer Portal 開啟)
|
||||
super().__init__(command_prefix=commands.when_mentioned, intents=intents)
|
||||
|
||||
async def setup_hook(self):
|
||||
for ext in EXTENSIONS:
|
||||
await self.load_extension(ext)
|
||||
await self.tree.sync()
|
||||
|
||||
async def on_ready(self):
|
||||
print(f"Logged in as {self.user},版本{VERSION}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
token = os.getenv("DISCORD_BOT_TOKEN")
|
||||
if not token:
|
||||
raise SystemExit("請設定環境變數 DISCORD_BOT_TOKEN")
|
||||
LunarHelper().run(token, root_logger=True)
|
||||
Reference in new issue
Block a user