RuntimeWarning: coroutine 'send' was never awaited self.tk.mainloop(n) RuntimeWarning: Enable tracemalloc to get the object allocation traceback
I keep getting the above error on my pycord code. I can't figure out why and have looked at multiple discussions.
Here is the code.
root = Tk()
frm = ttk.Frame(root, padding=10)
frm.grid()
server = StringVar()
channel = StringVar()
text = StringVar()
e1 = Entry(frm, textvariable=server)
e1.grid(column=0, row=0)
e1.insert(0, 'Server')
e2 = Entry(frm, textvariable=channel)
e2.grid(column=0, row=1)
e2.insert(0, 'Channel')
e3 = Entry(frm, textvariable=text)
e3.grid(column=0, row=2)
e3.insert(0, 'Text')
async def send():
for guild in bot.guilds:
if guild.name == server.get():
for channel1 in guild.channels:
if channel1.name == channel.get():
await channel1.send(text)
ttk.Button(frm, text="Send", command=send).grid(column=0, row=4)
def run():
bot.run('token')
t = threading.Thread(target=run)
def start():
t.start()
ttk.Button(frm, text="Run", command=start).grid(column=0, row=3)
root.mainloop()
source https://stackoverflow.com/questions/77740337/using-pycord-and-tkinter-together-returning-error
Comments
Post a Comment