Skip to content

Commit 7f6992f

Browse files
committed
Displays image/thumbnail for config help
1 parent 894ad2f commit 7f6992f

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

cogs/utility.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,14 @@ def fmt(val):
895895
for note in info['notes']:
896896
note_text += f'- {fmt(note)}\n'
897897
if note_text:
898-
embed.add_field(name='Notes(s):', value=note_text, inline=False)
898+
embed.add_field(name='Note(s):', value=note_text, inline=False)
899+
900+
if info.get('image') is not None:
901+
embed.set_image(url=fmt(info['image']))
902+
903+
if info.get('thumbnail') is not None:
904+
embed.set_thumbnail(url=fmt(info['thumbnail']))
905+
899906
return await ctx.send(embed=embed)
900907

901908
@commands.group(aliases=["aliases"], invoke_without_command=True)

core/config_help.json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
]
4444
},
4545
"main_color": {
46-
"default": "Discord Blurple ([#7289DA](https://placehold.it/100/7289da?text=+))",
46+
"default": "Discord Blurple [#7289DA](https://placehold.it/100/7289da?text=+)",
4747
"description": "This is the main color for Modmail (help/about/ping embed messages, subscribe, move, etc.).",
4848
"examples": [
4949
"`{prefix}config set main_color olive green`",
@@ -54,7 +54,8 @@
5454
"notes": [
5555
"Available color names can be found on [Taki's Blog](https://taaku18.github.io/modmail/colors/).",
5656
"See also: `mod_color`, `recipient_color`."
57-
]
57+
],
58+
"thumbnail": "https://placehold.it/100/7289da?text=+"
5859
},
5960
"user_typing": {
6061
"default": "Disabled",
@@ -285,7 +286,7 @@
285286
"See also: `thread_close_title`, `thread_close_footer`, `thread_self_close_response`, `thread_creation_response`."
286287
]
287288
},
288-
"thread_self_close_response": {
289+
"thread_self_close_response": {
289290
"default": "\"You have closed this Modmail thread.\"",
290291
"description": "This is the message embed content sent to the recipient upon the closure of a their own thread.",
291292
"examples": [
@@ -300,7 +301,7 @@
300301
]
301302
},
302303
"recipient_color": {
303-
"default": "Discord Gold ([#F1C40F](https://placehold.it/100/f1c40f?text=+))",
304+
"default": "Discord Gold [#F1C40F](https://placehold.it/100/f1c40f?text=+)",
304305
"description": "This is the color of the messages sent by the recipient, this applies to messages received in the thread channel.",
305306
"examples": [
306307
"`{prefix}config set recipient_color dark beige`",
@@ -311,10 +312,11 @@
311312
"notes": [
312313
"Available color names can be found on [Taki's Blog](https://taaku18.github.io/modmail/colors/).",
313314
"See also: `main_color`, `mod_color`."
314-
]
315+
],
316+
"thumbnail": "https://placehold.it/100/f1c40f?text=+"
315317
},
316318
"mod_color": {
317-
"default": "Discord Green ([#2ECC71](https://placehold.it/100/2ecc71?text=+))",
319+
"default": "Discord Green [#2ECC71](https://placehold.it/100/2ecc71?text=+)",
318320
"description": "This is the color of the messages sent by the moderators, this applies to messages within in the thread channel and the DM thread messages received by the recipient.",
319321
"examples": [
320322
"`{prefix}config set mod_color dark beige`",
@@ -325,7 +327,8 @@
325327
"notes": [
326328
"Available color names can be found on [Taki's Blog](https://taaku18.github.io/modmail/colors/).",
327329
"See also: `main_color`, `recipient_color`."
328-
]
330+
],
331+
"thumbnail": "https://placehold.it/100/2ecc71?text=+"
329332
},
330333
"mod_tag": {
331334
"default": "The moderator's highest role",
@@ -345,9 +348,9 @@
345348
"`{prefix}config set anon_username Incognito Mod`"
346349
],
347350
"notes": [
348-
"A detailed labeling of anonymous message configurations: https://i.imgur.com/SKOC42Z.png.",
349351
"See also: `anon_avatar_url`, `anon_tag`."
350-
]
352+
],
353+
"image": "https://i.imgur.com/SKOC42Z.png"
351354
},
352355
"anon_avatar_url": {
353356
"default": "Server avatar",
@@ -356,9 +359,9 @@
356359
"`{prefix}config set anon_avatar_url https://path.to/your/avatar.png` (you will need to upload the avatar to somewhere)"
357360
],
358361
"notes": [
359-
"A detailed labeling of anonymous message configurations: https://i.imgur.com/SKOC42Z.png.",
360362
"See also: `anon_username`, `anon_tag`."
361-
]
363+
],
364+
"image": "https://i.imgur.com/SKOC42Z.png"
362365
},
363366
"anon_tag": {
364367
"default": "\"Response\"",
@@ -367,8 +370,8 @@
367370
"`{prefix}config set anon_tag Support Agent`"
368371
],
369372
"notes": [
370-
"A detailed labeling of anonymous message configurations: https://i.imgur.com/SKOC42Z.png.",
371373
"See also: `anon_avatar_url`, `anon_username`, `mod_tag`."
372-
]
374+
],
375+
"image": "https://i.imgur.com/SKOC42Z.png"
373376
}
374377
}

0 commit comments

Comments
 (0)