Discord Message Components
A python library that adds message component support to discord bots
Usage
I will add proper documentation very soon
from discord_message_components import *
from discord.ext.commands import Bot
import discord
bot = Bot("prefix")
components = ComponentHelper()
button = Button("visible label", 1, "custom_id")
components.addComponent(button)
@bot.event
async def on_socket_raw_receive(msg):
interaction = await websocket_wrap(msg)
if interaction is not None:
await respond(interaction,f"{interaction.member_data.username} clicked button {components.getFirstComponent(interaction.data.custom_id)}")
@bot.command()
async def mycommand(ctx):
await send_message(ctx.channel,"content",components=components)
config.token = "My Token"