Spaces:
seawolf2357
/
Running on CPU Upgrade

kai-math / app.py
seawolf2357's picture
Update app.py
9f7d4a9 verified
raw
history blame
997 Bytes
import discord
import logging
# ๋กœ๊น… ์„ค์ •
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s:%(levelname)s:%(name)s: %(message)s',
handlers=[logging.StreamHandler()]) # ๋กœ๊ทธ๋ฅผ ์ฝ˜์†”์— ์ถœ๋ ฅ
# Intents ์ƒ์„ฑ
intents = discord.Intents.default()
intents.messages = True
class MyClient(discord.Client):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
async def on_ready(self):
logging.info(f'Logged on as {self.user}!')
async def on_message(self, message):
if message.author == self.user:
logging.info('Ignoring message from self.')
return
response = message.content + " hello"
logging.debug(f'Responding to message: {message.content}')
await message.channel.send(response)
# ๋ด‡ ๊ฐ์ฒด ์ƒ์„ฑ ๋ฐ ์‹คํ–‰
client = MyClient(intents=intents)
client.run('MTIyODQyNTQxNDk0MzQ0MTEwNw.Gfd_ri.rrG_6-Sfp0FYvSIbv-zZ98dpHI-G_Fh9MFCzco')