Discord-S.C.U.M
Discord-S.C.U.M copied to clipboard
Click button
from discum.utils.button import Buttoner
buts = Buttoner(message["components"])
bot.click(
message["webhook_id"],
channelID=message["channel_id"],
guildID=message.get("guild_id"),
messageID=message["id"],
messageFlags=message["flags"],
data=buts.getButton("First"),
)
What is First and how you get customId of button?
Hi, the "First" thing specified is the custom ID from the button component in the example, however, I believe that example is outdated and won't work, an example that would work for button click is this one
message = bot.getMessage(channel_id, message_id)
try:
data = message.json()[0]
buts = Buttoner(data["components"])
bot.click(
data["author"]["id"],
channelID=data["channel_id"],
guildID=guild_id,
messageID=data["id"],
messageFlags=data["flags"],
data=buts.getButton(customID="First"))
)
If you don't know the custom ID of the button you need to make a function to fetch that ID