不和谐的赛尔伯特Python

2024-10-08 18:23:25 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在为一个服务器做一个自助机器人,我和一些irl朋友合作。 Atm我有点卡住了,不知道如何修复python代码。 机器人应该说“lmao”当我说“ayy”和“ayy”时我说“lmao” 只是一些有趣的事情:) 如果可能的话,我希望selfbot只回应我,而不回应其他人。在

import discord
from discord.ext.commands import Bot
from discord.ext import commands
import asyncio

#TOKEN
TOKEN = "Token goes here"

client = discord.Client()
b = Bot(command_prefix = "ayy")

@b.event
async def on_ready():
    print("ayy lmao")

@b.event
async def on_message(message):
    if message.content == "ayy":
        away.b.send_message(message.channel, "lmao")

b.run(TOKEN, bot = False)

错误:

^{pr2}$

Tags: fromimporttokeneventmessageasyncondef

热门问题