Chatbottest3 / app.py
Raven7's picture
Update app.py
4a77f8a verified
raw
history blame contribute delete
681 Bytes
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}")
# ์ด๋ฒคํŠธ ํ•ธ๋“ค ๋“ฑ๋ก
@client.event
async def onready():
print(f'{client.user} ๋ด‡์ด ์ค€๋น„๋˜์—ˆ์Šต๋‹ˆ๋‹ค.')
@client.event
async def onmessage(message):
await processmessage(message)
# ๋ด‡ ์‹คํ–‰
client.run(ISC)