📜  discord.py 事件 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:26.148000             🧑  作者: Mango

代码示例4
import discord

class MyClient(discord.Client):
    async def on_ready(self):
        print('Logged on as {0}!'.format(self.user))

    async def on_message(self, message):
        print('Message from {0.author}: {0.content}'.format(message))

client = MyClient()
client.run('my token goes here')