#🔒 Button with embed
20 messages · Page 1 of 1 (latest)
@hoary halo
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
As far as i know they can coexist the bigger problem how to make buttons
I know. I make button as class and enter in view but it dosen't work
Can u show an example code the token excluded?
class acceptbutton(discord.ui.View):
def __init__(self):
super().__init__(timeout=None)
discord.ui.Button(label="Откликнуться", style=discord.ButtonStyle.green)
async def accept(self, intercation: discord.Interaction, button: discord.Button):
pass
@bot.hybrid_command(name="заказ"
)
async def order(ctx, цель, количество_нужных_фрилансеров, тип_работы):
embed = discord.Embed(colour=discord.Colour.green(), title="Новый заказ от" + str(ctx.author),
description="Цель:" + str(цель) + " \n Нужное количество работников: " + str(
количество_нужных_фрилансеров))
if тип_работы == "Билдер":
channel = bot.get_channel(1218449220487352421)
await channel.send(embed=embed)
await ctx.send("Заказ успешно сформирован")
if тип_работы == "Скриптер":
channel = bot.get_channel(1218449286388387881)
await channel.send(content="", view=acceptbutton())
await ctx.send("Заказ успешно сформирован")
if тип_работы == "Моделер":
channel = bot.get_channel(1218449340050309120)
await channel.send(embed=embed)
await ctx.send("Заказ успешно сформирован")
No
I don't get any errors
As far as i know u need to use view to append or something like that buttons to it and u define a button by ui.button and than overwrite the func responsible for the callback
Find a tutorial
Ill soon be home (max 20m) than with a computer and past code of mine i can trz to help
Ok
Accually a bit more 15 is the train and i also have to take a bus from there but ill find u the ansver as soon as i get home
No problem!
f
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.