Skip to content

Commit 804265d

Browse files
committed
Add ability to customise embed colors
1 parent bddfbdc commit 804265d

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

bot.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,32 @@ def blocked_users(self):
156156
@property
157157
def prefix(self):
158158
return self.config.get('prefix', '?')
159+
160+
@property
161+
def mod_color(self):
162+
color = self.config.get('mod_color')
163+
if not color:
164+
return discord.Color.green()
165+
try:
166+
color = int(color.strip('#'), base=16)
167+
except:
168+
print('Invalid mod_color provided')
169+
return discord.Color.green()
170+
else:
171+
return color
172+
173+
@property
174+
def recipient_color(self):
175+
color = self.config.get('recipient_color')
176+
if not color:
177+
return discord.Color.gold()
178+
try:
179+
color = int(color.strip('#'), base=16)
180+
except:
181+
print('Invalid recipient_color provided')
182+
return discord.Color.gold()
183+
else:
184+
return color
159185

160186
@staticmethod
161187
async def get_pre(bot, message):
@@ -375,8 +401,6 @@ async def on_message_edit(self, before, after):
375401
embed = msg.embeds[0]
376402
matches = str(embed.author.url).split('/')
377403
if matches and matches[-1] == str(before.id):
378-
if ' - (Edited)' not in embed.footer.text:
379-
embed.set_footer(text=embed.footer.text + ' - (Edited)')
380404
embed.description = after.content
381405
await msg.edit(embed=embed)
382406
break

0 commit comments

Comments
 (0)