#Python Buttons/Interactions

15 messages · Page 1 of 1 (latest)

young pier
#

assuming this is discord

#

are you using discord,py or pycord

#

assuming that

#

discord,py is similar to pycord these days

#

the 1 and only position paramter of the .send() function is the message also called content in the backend, which means that you cannot pass and id into the function

#

interaction.channel refers to the channel where the button was pressed

#

to send the message to a different channel you will need to first fetch the channel

#

in pycord to do this you would

#

from discord.utils import get

#

and get(guild.channel, id="id here")

#

frmo there you can await channel.send("your message here")

smoky carbonBOT
#

@steel berry, you just advanced to level 1 !

hushed charm
#

You have to have a listener on the button press and then execute the code

#

In JavaScript this is not the hardest but requires a few listener files