Skip to content

Commit 04b23c4

Browse files
Added custom emojis to the suggestion commands
1 parent 54d68d7 commit 04b23c4

6 files changed

Lines changed: 70 additions & 66 deletions

File tree

src/assets/emojis/icon_cross.png

-5.24 KB
Loading

src/assets/emojis/icon_tick.png

-1.37 KB
Loading

src/assets/emojis/thumbs_down.png

561 Bytes
Loading

src/assets/emojis/thumbs_up.png

552 Bytes
Loading

src/cogs/social/suggestions.py

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -29,101 +29,101 @@
2929
MESSAGES = {
3030
"normal": {
3131
"en": {
32-
"no_channel": "No suggestion channel configured. An admin must run `suggest channel <channel>` first.",
33-
"submitted": "Suggestion submitted in {channel} — ID `#{id}`.",
34-
"channel_set": "Suggestion channel set to {channel}.",
32+
"no_channel": "No suggestion channel configured. An admin must run `suggest channel <channel>` first.",
33+
"submitted": "Suggestion submitted in {channel} — ID `#{id}`.",
34+
"channel_set": "Suggestion channel set to {channel}.",
3535
"config_title": "### {icon} Suggestion Config",
3636
"config_body": "**Channel:** {channel}",
37-
"missing": "⚠️ No suggestion with ID `#{id}` found.",
38-
"approved": "Suggestion `#{id}` approved.",
39-
"denied": "Suggestion `#{id}` denied.",
37+
"missing": "No suggestion with ID `#{id}` found.",
38+
"approved": "Suggestion `#{id}` approved.",
39+
"denied": "Suggestion `#{id}` denied.",
4040
"title_open": "### {icon} Suggestion #{id}",
41-
"title_approved": "### {icon} Suggestion #{id} · Approved",
42-
"title_denied": "### {icon} Suggestion #{id} · Denied",
41+
"title_approved": "### {icon} Suggestion #{id} · {tick} Approved",
42+
"title_denied": "### {icon} Suggestion #{id} · {cross} Denied",
4343
"body": "{text}\n\n-# By {author}",
44-
"votes": "👍 `{up}` 👎 `{down}`",
44+
"votes": "{up_emoji} `{up}` {down_emoji} `{down}`",
4545
"verdict": "**Verdict by {who}:** {reason}",
4646
},
4747
"de": {
48-
"no_channel": "Kein Vorschlagskanal konfiguriert. Ein Admin muss zuerst `suggest channel <channel>` ausführen.",
49-
"submitted": "Vorschlag in {channel} eingereicht — ID `#{id}`.",
50-
"channel_set": "Vorschlagskanal auf {channel} gesetzt.",
48+
"no_channel": "Kein Vorschlagskanal konfiguriert. Ein Admin muss zuerst `suggest channel <channel>` ausführen.",
49+
"submitted": "Vorschlag in {channel} eingereicht — ID `#{id}`.",
50+
"channel_set": "Vorschlagskanal auf {channel} gesetzt.",
5151
"config_title": "### {icon} Vorschlags-Konfiguration",
5252
"config_body": "**Kanal:** {channel}",
53-
"missing": "⚠️ Kein Vorschlag mit ID `#{id}` gefunden.",
54-
"approved": "Vorschlag `#{id}` angenommen.",
55-
"denied": "Vorschlag `#{id}` abgelehnt.",
53+
"missing": "Kein Vorschlag mit ID `#{id}` gefunden.",
54+
"approved": "Vorschlag `#{id}` angenommen.",
55+
"denied": "Vorschlag `#{id}` abgelehnt.",
5656
"title_open": "### {icon} Vorschlag #{id}",
57-
"title_approved": "### {icon} Vorschlag #{id} · Angenommen",
58-
"title_denied": "### {icon} Vorschlag #{id} · Abgelehnt",
57+
"title_approved": "### {icon} Vorschlag #{id} · {tick} Angenommen",
58+
"title_denied": "### {icon} Vorschlag #{id} · {cross} Abgelehnt",
5959
"body": "{text}\n\n-# Von {author}",
60-
"votes": "👍 `{up}` 👎 `{down}`",
60+
"votes": "{up_emoji} `{up}` {down_emoji} `{down}`",
6161
"verdict": "**Urteil von {who}:** {reason}",
6262
},
6363
"es": {
64-
"no_channel": "No hay canal de sugerencias configurado. Un admin debe ejecutar `suggest channel <canal>` primero.",
65-
"submitted": "Sugerencia enviada en {channel} — ID `#{id}`.",
66-
"channel_set": "Canal de sugerencias establecido en {channel}.",
64+
"no_channel": "No hay canal de sugerencias configurado. Un admin debe ejecutar `suggest channel <canal>` primero.",
65+
"submitted": "Sugerencia enviada en {channel} — ID `#{id}`.",
66+
"channel_set": "Canal de sugerencias establecido en {channel}.",
6767
"config_title": "### {icon} Configuración de Sugerencias",
6868
"config_body": "**Canal:** {channel}",
69-
"missing": "⚠️ No se encontró sugerencia con ID `#{id}`.",
70-
"approved": "Sugerencia `#{id}` aprobada.",
71-
"denied": "Sugerencia `#{id}` denegada.",
69+
"missing": "No se encontró sugerencia con ID `#{id}`.",
70+
"approved": "Sugerencia `#{id}` aprobada.",
71+
"denied": "Sugerencia `#{id}` denegada.",
7272
"title_open": "### {icon} Sugerencia #{id}",
73-
"title_approved": "### {icon} Sugerencia #{id} · Aprobada",
74-
"title_denied": "### {icon} Sugerencia #{id} · Denegada",
73+
"title_approved": "### {icon} Sugerencia #{id} · {tick} Aprobada",
74+
"title_denied": "### {icon} Sugerencia #{id} · {cross} Denegada",
7575
"body": "{text}\n\n-# Por {author}",
76-
"votes": "👍 `{up}` 👎 `{down}`",
76+
"votes": "{up_emoji} `{up}` {down_emoji} `{down}`",
7777
"verdict": "**Veredicto de {who}:** {reason}",
7878
},
7979
},
8080
"cafe": {
8181
"en": {
82-
"no_channel": "no suggestions corner set yet — admin needs to run `suggest channel <channel>` first ☕",
83-
"submitted": "pinned your idea in {channel} — `#{id}` ☕✨",
84-
"channel_set": "suggestions corner is now {channel} ☕",
82+
"no_channel": "no suggestions corner set yet — admin needs to run `suggest channel <channel>` first ☕",
83+
"submitted": "pinned your idea in {channel} — `#{id}` ☕✨",
84+
"channel_set": "suggestions corner is now {channel} ☕",
8585
"config_title": "### {icon} suggestions corner ☕",
8686
"config_body": "**channel:** {channel}",
87-
"missing": "⚠️ no idea with id `#{id}` here hun~",
88-
"approved": "idea `#{id}` brewed and approved ☕✨",
89-
"denied": "idea `#{id}` gently set aside ☕",
87+
"missing": "no idea with id `#{id}` here hun~",
88+
"approved": "idea `#{id}` brewed and approved ☕✨",
89+
"denied": "idea `#{id}` gently set aside ☕",
9090
"title_open": "### {icon} idea #{id} ☕",
91-
"title_approved": "### {icon} idea #{id} · approved ☕✨",
92-
"title_denied": "### {icon} idea #{id} · set aside ☕",
91+
"title_approved": "### {icon} idea #{id} · {tick} approved ☕✨",
92+
"title_denied": "### {icon} idea #{id} · {cross} set aside ☕",
9393
"body": "{text}\n\n-# by {author}",
94-
"votes": "👍 `{up}` 👎 `{down}`",
94+
"votes": "{up_emoji} `{up}` {down_emoji} `{down}`",
9595
"verdict": "**verdict by {who}:** {reason}",
9696
},
9797
"de": {
98-
"no_channel": "noch keine vorschlags-ecke — admin muss erst `suggest channel <channel>` machen ☕",
99-
"submitted": "deine idee in {channel} angepinnt — `#{id}` ☕✨",
100-
"channel_set": "die vorschlags-ecke ist jetzt {channel} ☕",
98+
"no_channel": "noch keine vorschlags-ecke — admin muss erst `suggest channel <channel>` machen ☕",
99+
"submitted": "deine idee in {channel} angepinnt — `#{id}` ☕✨",
100+
"channel_set": "die vorschlags-ecke ist jetzt {channel} ☕",
101101
"config_title": "### {icon} vorschlags-ecke ☕",
102102
"config_body": "**kanal:** {channel}",
103-
"missing": "⚠️ keine idee mit id `#{id}` hier hun~",
104-
"approved": "idee `#{id}` gebraut und angenommen ☕✨",
105-
"denied": "idee `#{id}` sanft beiseite gelegt ☕",
103+
"missing": "keine idee mit id `#{id}` hier hun~",
104+
"approved": "idee `#{id}` gebraut und angenommen ☕✨",
105+
"denied": "idee `#{id}` sanft beiseite gelegt ☕",
106106
"title_open": "### {icon} idee #{id} ☕",
107-
"title_approved": "### {icon} idee #{id} · angenommen ☕✨",
108-
"title_denied": "### {icon} idee #{id} · beiseite gelegt ☕",
107+
"title_approved": "### {icon} idee #{id} · {tick} angenommen ☕✨",
108+
"title_denied": "### {icon} idee #{id} · {cross} beiseite gelegt ☕",
109109
"body": "{text}\n\n-# von {author}",
110-
"votes": "👍 `{up}` 👎 `{down}`",
110+
"votes": "{up_emoji} `{up}` {down_emoji} `{down}`",
111111
"verdict": "**urteil von {who}:** {reason}",
112112
},
113113
"es": {
114-
"no_channel": "aún no hay rincón de sugerencias — un admin debe correr `suggest channel <canal>` primero ☕",
115-
"submitted": "pegué tu idea en {channel} — `#{id}` ☕✨",
116-
"channel_set": "el rincón de sugerencias ahora es {channel} ☕",
114+
"no_channel": "aún no hay rincón de sugerencias — un admin debe correr `suggest channel <canal>` primero ☕",
115+
"submitted": "pegué tu idea en {channel} — `#{id}` ☕✨",
116+
"channel_set": "el rincón de sugerencias ahora es {channel} ☕",
117117
"config_title": "### {icon} rincón de sugerencias ☕",
118118
"config_body": "**canal:** {channel}",
119-
"missing": "⚠️ no hay idea con id `#{id}` aquí~",
120-
"approved": "idea `#{id}` preparada y aprobada ☕✨",
121-
"denied": "idea `#{id}` apartada con cariño ☕",
119+
"missing": "no hay idea con id `#{id}` aquí~",
120+
"approved": "idea `#{id}` preparada y aprobada ☕✨",
121+
"denied": "idea `#{id}` apartada con cariño ☕",
122122
"title_open": "### {icon} idea #{id} ☕",
123-
"title_approved": "### {icon} idea #{id} · aprobada ☕✨",
124-
"title_denied": "### {icon} idea #{id} · apartada ☕",
123+
"title_approved": "### {icon} idea #{id} · {tick} aprobada ☕✨",
124+
"title_denied": "### {icon} idea #{id} · {cross} apartada ☕",
125125
"body": "{text}\n\n-# por {author}",
126-
"votes": "👍 `{up}` 👎 `{down}`",
126+
"votes": "{up_emoji} `{up}` {down_emoji} `{down}`",
127127
"verdict": "**veredicto de {who}:** {reason}",
128128
},
129129
},
@@ -175,7 +175,7 @@ def _save(d: dict):
175175

176176
class _UpBtn(discord.ui.Button):
177177
def __init__(self, sid: int):
178-
super().__init__(emoji="👍", style=discord.ButtonStyle.success,
178+
super().__init__(emoji=f"{get_emoji('thumbs_up')}", style=discord.ButtonStyle.success,
179179
custom_id=f"sug_up:{sid}")
180180
self.sid = sid
181181

@@ -187,7 +187,7 @@ async def callback(self, interaction: discord.Interaction):
187187

188188
class _DownBtn(discord.ui.Button):
189189
def __init__(self, sid: int):
190-
super().__init__(emoji="👎", style=discord.ButtonStyle.danger,
190+
super().__init__(emoji=f"{get_emoji('thumbs_down')}", style=discord.ButtonStyle.danger,
191191
custom_id=f"sug_down:{sid}")
192192
self.sid = sid
193193

@@ -206,11 +206,11 @@ def _build_view(s: dict, ctx_like) -> discord.ui.LayoutView:
206206
else:
207207
title_key = "title_open"
208208

209-
title = msg(ctx_like, title_key, icon=get_emoji("icon_lightbulb"), id=s["id"])
209+
title = msg(ctx_like, title_key, icon=get_emoji("icon_lightbulb"), id=s["id"], tick=get_emoji("icon_tick"), cross=get_emoji("icon_cross"))
210210
author = ctx_like.guild.get_member(s["author_id"]) if (ctx_like and ctx_like.guild) else None
211211
author_str = author.mention if author else f"<@{s['author_id']}>"
212212
body = msg(ctx_like, "body", text=s["text"], author=author_str)
213-
votes = msg(ctx_like, "votes", up=s.get("up", 0), down=s.get("down", 0))
213+
votes = msg(ctx_like, "votes", up=s.get("up", 0), down=s.get("down", 0), up_emoji=get_emoji("thumbs_up"), down_emoji=get_emoji("thumbs_down"))
214214

215215
full = title + "\n" + body + "\n\n" + votes
216216
if s.get("verdict"):
@@ -273,7 +273,7 @@ async def _submit(self, ctx: commands.Context, text: str):
273273
g = self._g(ctx.guild.id)
274274
ch = ctx.guild.get_channel(g.get("channel_id") or 0) if g.get("channel_id") else None
275275
if not ch:
276-
return await ctx.send(msg(ctx, "no_channel"))
276+
return await ctx.send(f"{get_emoji('icon_cross')} {msg(ctx, 'no_channel')}")
277277
sid = g["next_id"]
278278
g["next_id"] = sid + 1
279279

@@ -301,9 +301,9 @@ async def _submit(self, ctx: commands.Context, text: str):
301301
pass
302302

303303
if ctx.interaction:
304-
await ctx.send(msg(ctx, "submitted", channel=ch.mention, id=sid), ephemeral=True)
304+
await ctx.send(f"{get_emoji('icon_tick')} {msg(ctx, 'submitted', channel=ch.mention, id=sid)}", ephemeral=True)
305305
else:
306-
await ctx.send(msg(ctx, "submitted", channel=ch.mention, id=sid))
306+
await ctx.send(f"{get_emoji('icon_tick')} {msg(ctx, 'submitted', channel=ch.mention, id=sid)}")
307307

308308
@suggest.command(
309309
name="channel",
@@ -315,7 +315,7 @@ async def suggest_channel(self, ctx: commands.Context, channel: discord.TextChan
315315
g = self._g(ctx.guild.id)
316316
g["channel_id"] = channel.id
317317
_save(self.data)
318-
await ctx.send(msg(ctx, "channel_set", channel=channel.mention))
318+
await ctx.send(f"{get_emoji('icon_tick')} {msg(ctx, 'channel_set', channel=channel.mention)}")
319319

320320
@suggest.command(
321321
name="config",
@@ -354,7 +354,7 @@ async def _verdict(self, ctx, sid: int, status: str, reason: str, ack_key: str):
354354
g = self._g(ctx.guild.id)
355355
s = g["items"].get(str(sid))
356356
if not s:
357-
return await ctx.send(msg(ctx, "missing", id=sid))
357+
return await ctx.send(f"{get_emoji('warning')} {msg(ctx, 'missing', id=sid)}")
358358
s["status"] = status
359359
s["verdict"] = {"by": ctx.author.mention, "reason": reason[:500]}
360360
_save(self.data)
@@ -365,7 +365,7 @@ async def _verdict(self, ctx, sid: int, status: str, reason: str, ack_key: str):
365365
await m.edit(view=_build_view(s, ctx))
366366
except Exception:
367367
pass
368-
await ctx.send(msg(ctx, ack_key, id=sid))
368+
await ctx.send(f"{get_emoji('icon_tick')} {msg(ctx, ack_key, id=sid)}")
369369

370370
# ───── voting ───────────────────────────────
371371

src/config/emojis.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def get_emoji(emoji_name: str):
6565
if emoji_name == "icon_categories":
6666
return "<:icon_categories:1520864681185509396>"
6767
if emoji_name == "icon_cross":
68-
return "<:icon_cross:1520827411510329415>"
68+
return "<:icon_cross:1525890239632117800>"
6969
if emoji_name == "icon_danger":
7070
return "<:icon_danger:1520827415616557196>"
7171
if emoji_name == "icon_disk":
@@ -163,7 +163,7 @@ def get_emoji(emoji_name: str):
163163
if emoji_name == "icon_support":
164164
return "<:icon_support:1520858088301920346>"
165165
if emoji_name == "icon_tick":
166-
return "<:icon_tick:1520827701584203896>"
166+
return "<:icon_tick:1525890242446627047>"
167167
if emoji_name == "icon_ticket":
168168
return "<:icon_ticket:1520861880699064363>"
169169
if emoji_name == "icon_trash":
@@ -218,6 +218,10 @@ def get_emoji(emoji_name: str):
218218
return "<:spotify:1520827772069740705>"
219219
if emoji_name == "star":
220220
return "<:star:1520898541424218283>"
221+
if emoji_name == "thumbs_down":
222+
return "<:thumbs_down:1525890245365858304>"
223+
if emoji_name == "thumbs_up":
224+
return "<:thumbs_up:1525890248406597874>"
221225
if emoji_name == "tiktok":
222226
return "<:tiktok:1520827778344161390>"
223227
if emoji_name == "trash":

0 commit comments

Comments
 (0)