Skip to content

Commit 70b6d00

Browse files
Added custom emojis to the donate commands crypto selection
1 parent 9afd866 commit 70b6d00

10 files changed

Lines changed: 32 additions & 15 deletions

File tree

13.5 KB
Loading

src/assets/emojis/crypto_bnb.png

10.3 KB
Loading
1.56 KB
Loading
2.97 KB
Loading

src/assets/emojis/crypto_ltc.png

15.5 KB
Loading
4.64 KB
Loading
2.06 KB
Loading

src/assets/emojis/crypto_tron.png

8.94 KB
Loading

src/cogs/donations/cog.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@
2727
INVOICE_LIFETIME: int = 60 # minutes
2828

2929
CURRENCIES = [
30-
("USDT", "Tether", "💵"),
31-
("ETH", "Ethereum", "🔷"),
32-
("BTC", "Bitcoin", "🟠"),
33-
("BNB", "BNB", "🟡"),
34-
("LTC", "Litecoin", "⬜"),
35-
("DOGE", "Dogecoin", "🐕"),
36-
("TRX", "TRON", "🔴"),
37-
("XMR", "Monero", "🔒"),
30+
("USDT", "Tether", f"{get_emoji('crypto_tether_usdt')}"),
31+
("ETH", "Ethereum", f"{get_emoji('crypto_ethereum')}"),
32+
("BTC", "Bitcoin", f"{get_emoji('crypto_bitcoin')}"),
33+
("BNB", "BNB", f"{get_emoji('crypto_bnb')}"),
34+
("LTC", "Litecoin", f"{get_emoji('crypto_ltc')}"),
35+
("DOGE", "Dogecoin", f"{get_emoji('crypto_dogecoin')}"),
36+
("TRX", "TRON", f"{get_emoji('crypto_tron')}"),
37+
("XMR", "Monero", f"{get_emoji('crypto_monero')}"),
3838
]
3939

4040

4141
# ─────────────────── UI helpers ───────────────────
4242

43-
def _currency_view(cog: "DonationCog", amount: float, user_id: int) -> discord.ui.View:
43+
def _currency_select(cog: "DonationCog", amount: float, user_id: int) -> discord.ui.ActionRow:
4444
"""Return a View containing a currency Select for `amount` USD."""
45-
view = discord.ui.View(timeout=180)
45+
view = discord.ui.ActionRow()
4646
options = [
4747
discord.SelectOption(
4848
label=f"{label} ({code})",
@@ -60,7 +60,7 @@ async def _cb(interaction: discord.Interaction):
6060
"This isn't your donation menu!", ephemeral=True
6161
)
6262
sel.disabled = True
63-
await interaction.message.edit(view=view)
63+
# await interaction.message.edit(view=view)
6464
await cog._handle_currency_choice(interaction, amount, user_id, sel.values[0])
6565

6666
sel.callback = _cb
@@ -300,18 +300,19 @@ async def donate(self, ctx: commands.Context, amount: float = 5.0):
300300
f"and role in the support server.\n\n"
301301
f"Select a cryptocurrency below to proceed:"
302302
)
303-
)
303+
),
304+
_currency_select(self, amount, ctx.author.id)
304305
)
305306
)
306307

307-
currency_sel = _currency_view(self, amount, ctx.author.id)
308+
# currency_sel = _currency_view(self, amount, ctx.author.id)
308309

309310
if ctx.interaction:
310311
await ctx.interaction.followup.send(view=intro_view, ephemeral=True)
311-
await ctx.interaction.followup.send(view=currency_sel, ephemeral=True)
312+
# await ctx.interaction.followup.send(view=currency_sel, ephemeral=True)
312313
else:
313314
await ctx.send(view=intro_view)
314-
await ctx.send(view=currency_sel)
315+
# await ctx.send(view=currency_sel)
315316

316317
@commands.hybrid_command(
317318
name="donationstatus",

src/config/emojis.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@ def get_emoji(emoji_name: str):
4646
return "<:cpu:1520864674361381038>"
4747
if emoji_name == "credit_card":
4848
return "<a:credit_card:1520827346926440638>"
49+
if emoji_name == "crypto_bitcoin":
50+
return "<:crypto_bitcoin:1526343246609911908>"
51+
if emoji_name == "crypto_bnb":
52+
return "<:crypto_bnb:1526343249755639818>"
53+
if emoji_name == "crypto_dogecoin":
54+
return "<:crypto_dogecoin:1526343252708692019>"
55+
if emoji_name == "crypto_ethereum":
56+
return "<:crypto_ethereum:1526343255506157770>"
57+
if emoji_name == "crypto_ltc":
58+
return "<:crypto_ltc:1526343258739834930>"
59+
if emoji_name == "crypto_monero":
60+
return "<:crypto_monero:1526343262061989918>"
61+
if emoji_name == "crypto_tether_usdt":
62+
return "<:crypto_tether_usdt:1526343264834293862>"
63+
if emoji_name == "crypto_tron":
64+
return "<:crypto_tron:1526343268395126804>"
4965
if emoji_name == "dbl":
5066
return "<:dbl:1520827352127377410>"
5167
if emoji_name == "disconnect":

0 commit comments

Comments
 (0)