Skip to content

Commit 5d655b4

Browse files
committed
Make mod_tag dynamic by default
1 parent 3125be3 commit 5d655b4

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
# v2.10.1
8+
9+
### Changed
10+
- Use reply author's top role for the mod tag by default.
711

812
# v2.10.0
913

bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
SOFTWARE.
2323
"""
2424

25-
__version__ = '2.10.0'
25+
__version__ = '2.10.1'
2626

2727
import asyncio
2828
import uvloop

core/thread.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ async def send(self, message, destination=None, from_mod=False, note=False, anon
247247

248248
if anonymous and from_mod and not isinstance(destination, discord.TextChannel):
249249
# Anonymously sending to the user.
250-
name = self.bot.config.get('anon_username', self.bot.config.get('mod_tag', 'Moderator'))
250+
tag = self.bot.config.get('mod_tag', str(message.author.top_role))
251+
name = self.bot.config.get('anon_username', tag)
251252
avatar_url = self.bot.config.get('anon_avatar_url', self.bot.guild.icon_url)
252253
else:
253254
# Normal message
@@ -315,7 +316,8 @@ def is_image_url(u, _):
315316
if anonymous and isinstance(destination, discord.TextChannel): # Anonymous reply sent in thread channel
316317
em.set_footer(text='Anonymous Reply')
317318
elif not anonymous:
318-
em.set_footer(text=self.bot.config.get('mod_tag', 'Moderator')) # Normal messages
319+
tag = self.bot.config.get('mod_tag', str(message.author.top_role))
320+
em.set_footer(text=tag) # Normal messages
319321
else:
320322
em.set_footer(text=self.bot.config.get('anon_tag', 'Response')) # Anonymous reply sent to user
321323

0 commit comments

Comments
 (0)