-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
32 lines (26 loc) · 935 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
import os
import asyncio
import discord
from discord.ext import commands
from cogwatch import watch
from config import VERSION, DISCORD_API_TOKEN
class PACBot(commands.Bot):
def __init__(self):
super().__init__(command_prefix='!')
for filename in os.listdir("commands"):
if filename.endswith(".py"):
self.load_extension(f"commands.{filename[:-3]}")
@watch(path='commands')
async def on_ready(self):
print(f'{self.user.name} v{VERSION} 연결')
await self.change_presence(status=discord.Status.online, activity=None)
#await ctx.send(f'출석봇 출석\n현재 버전: v{VERSION}')
async def on_message(self, message):
if message.author.bot:
return
await self.process_commands(message)
async def main():
client = PACBot()
await client.start(DISCORD_API_TOKEN)
if __name__ == '__main__':
asyncio.run(main())