我正在尝试通过 响应玩家的命令@bot.command,但绝对没有任何效果。看来我根据wiki做的一切都是正确的,但它不起作用
(函数中只有text_line())
import asyncio
import discord
from discord.ext import commands
from functions import *
# Vars
client = discord.Client()
bot = commands.Bot(command_prefix="!")
# Functions
@client.event
async def on_ready():
text_line("Discord bot")
print("[!] Auth as {0.user}".format(client))
print("[!] Latency: {0.latency}".format(client))
print("[!] Activity: {0.activity}".format(client))
print("[!] Nitro status: {0.user.premium_type}".format(client))
@bot.command(pass_context=True)
async def say(ctx):
await ctx.send("hello")
# All messages
@client.event
async def on_message(message):
if message.author == client.user:
# Log bot messages
print("[+] Bot send message in {0.channel}: {0.content}".format(message))
return
# Log player messages
print("[+] New message from {0.author} in {0.channel}: {0.content}".format(message))
# Run
client.run(ur_token)
问题是我忘记更改
client.run为bot.run