Spaces:
Sleeping
Sleeping
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') # μ¬κΈ°μ μμ νκ² ν ν°μ μ μ₯νμΈμ.
|