Spaces:
Runtime error
Runtime error
import discord | |
from discord.ext import commands | |
from discord.ext.commands import Bot | |
import os | |
# ๋์ค์ฝ๋ ๋ด ํ ํฐ | |
ISC = "YISC" | |
# ๋์ค์ฝ๋ ๋ด ํด๋ผ์ด์ธํธ ์์ฑ | |
client = Bot(commandprefix='!') | |
# ๋ฉ์์ง ์ฒ๋ฆฌ ํจ์ | |
async def processmessage(message): | |
# ๋ฉ์์ง๋ฅผ ๋ฐ์ ์ฒ๋ฆฌ | |
if message.author == client.user: | |
return | |
# ๋ฉ์์ง ์ฒ๋ฆฌ ๋ก์ง ์ถ๊ฐ | |
await message.channel.send(f"AI: {message.content}") | |
# ์ด๋ฒคํธ ํธ๋ค ๋ฑ๋ก | |
async def onready(): | |
print(f'{client.user} ๋ด์ด ์ค๋น๋์์ต๋๋ค.') | |
async def onmessage(message): | |
await processmessage(message) | |
# ๋ด ์คํ | |
client.run(ISC) |