什么是我尝试使用on_message的好方法

时间:2018-08-01 02:01:19

标签: python discord discord.py

import discord
from discord.ext import commands

client = discord.Client()
@client.event
async def on_ready():
    print("The bot is Online!")
    await client.change_presence(game=discord.Game(name="Botting Around"))
@client.event
async def on_message(message):
    if message.content.startswith('hey'):
        await client.send_message(message.channel, 'Heya')

@client.event
async def on_message(message):
    if message.content.startswith('bye'):
        await client.send_message(message.channel, 'Cya')

@client.event
async def on_message(message):
    if message.content.startswith('ping'):
        await client.send_message(message.channel, 'pong')

@client.event
async def on_message(message):
    if message.content.startswith('popdaisy2'):
        await client.send_message(message.channel, 'ew')

@client.event
async def on_message(message):
    if message.content.startswith('haha'):
        await client.send_message(message.channel, 'Ahahaha!')

client.run(filler)

请为该代码请求替代方法!就像拥有输入字词并提供一定输出的方法一样。现在,我知道您只能使用一个on_message。

0 个答案:

没有答案