Spaces:
Build error
Build error
File size: 591 Bytes
78efe79 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import discord
class MyClient(discord.Client):
async def on_ready(self):
print(f'Logged on as {self.user}!')
async def on_message(self, message):
# ๋ฉ์์ง๋ฅผ ๋ณด๋ธ ์ฌ๋์ด ๋ด ์์ ์ด๋ฉด ๋ฐ์ํ์ง ์์
if message.author == self.user:
return
# ์
๋ ฅ๋ฐ์ ํ
์คํธ์ "hello"๋ฅผ ๋ํด์ ์๋ต
response = message.content + " hello"
await message.channel.send(response)
# ๋ด ๊ฐ์ฒด ์์ฑ ๋ฐ ์คํ
client = MyClient()
client.run('your_token_here') # ์ฌ๊ธฐ์ ์์ ํ๊ฒ ํ ํฐ์ ์ ์ฅํ์ธ์.
|