I am using Tkinter and discord.py together, and I want it to change the user's nickname on the press of a button. to change the nickname, discord.py uses the command yield from client.change_nickname(server.me, string)
but when I run that code in the command of a button, the function never get's ran. I have used a print statement to make sure, and none of the function gets ran. I have tried to use multi-threading to start the function, and that didn't work, any help would be appreciated
async def test2():
server = client.get_server("345548250432012298")
await client.change_nickname(server.me, "testing")
def test():
threading.Thread(target=test2).start()
def makeThing(nicks):
frame = Tk()
for i in range(0, len(nicks)):
Button(frame, text=nicks[i], command= test).grid(row=i)
frame.mainloop()