【发布时间】:2021-02-06 08:18:51
【问题描述】:
我一直在尝试创建一个 Discord 自我机器人,它根据另一个程序上的按钮输入在特定频道中发布消息。我不断收到此错误,并已尽一切努力修复它:'RuntimeWarning: coroutine 'Command.call' was never waiting'.任何帮助将不胜感激!
import tkinter as tk
from discord.ext import commands
import asyncio
bot = commands.Bot('', self_bot=True)
@bot.command()
async def on_command():
channel = bot.get_channel('ID')
await channel.send('Message')
root = tk.Tk()
root.title("Test")
root.geometry("1280x720")
root.configure(background="#161616")
pathBtn = tk.Button(root, height=1, width=10, text="Text", background="#282828", command=lambda: on_command()).pack()
spaceLabel = tk.Label(root, text="", height=1, background="#161616").pack()
root.mainloop()
bot.run("TOKEN", bot=False)
【问题讨论】:
标签: python asynchronous url-rewriting discord.py