#๐ Discord emoji not working in embed (discord bot)
22 messages ยท Page 1 of 1 (latest)
@lyric gate
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.
any help would be very appreciated!
Hey that looks like my symbol lol
You need to change the Unicode encoder
What library are you using?
Discordpy
wat is it
The button on my embed says "interaction failed" after like 10 minutes
how do i make it so the button works forever
You have to set a timeout timer
I think timeout = 99999999 might work
yeah im 100% not sure how to do that
I dont know where i would add that in the code
lol
Sum like this works for me
import discord
from discord.ui import View, Button
class MyView(View):
def __init__(self, *, timeout=180):
super().__init__(timeout=timeout)
self.add_item(Button(label="Click Me"))
async def on_timeout(self):
for child in self.children:
child.disabled = True
await self.message.edit(view=self)
async def interaction_check(self, interaction: discord.Interaction):
if interaction.user.id != self.user_id:
await interaction.response.send_message("This isn't your button!", ephemeral=True)
return False
return True
async def start(self, ctx):
self.message = await ctx.send("This is my view!", view=self)
self.user_id = ctx.author.id
view = discord.ui.View()
select = discord.ui.Select(
placeholder="Make a selection",
options=[
discord.SelectOption(label="BTC", emoji=":bitcoin:"),
discord.SelectOption(label="ETH", emoji=":ethereum:"),
discord.SelectOption(label="LTC", emoji=":litecoin:"),
discord.SelectOption(label="SOL", emoji=":solana:"),
],
custom_id=f"crypto_select_{ctx.author.id}_{int(time.time())}"
@winter crest
where do i add the timeout to infinite?
This help channel has been closed. 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.