Skip to content

Make mod_tag dynamic by default #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# v2.10.1

### Changed
- Use reply author's top role for the mod tag by default.

# v2.10.0

Expand Down
2 changes: 1 addition & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
SOFTWARE.
"""

__version__ = '2.10.0'
__version__ = '2.10.1'

import asyncio
import uvloop
Expand Down
6 changes: 4 additions & 2 deletions core/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ async def send(self, message, destination=None, from_mod=False, note=False, anon

if anonymous and from_mod and not isinstance(destination, discord.TextChannel):
# Anonymously sending to the user.
name = self.bot.config.get('anon_username', self.bot.config.get('mod_tag', 'Moderator'))
tag = self.bot.config.get('mod_tag', str(message.author.top_role))
name = self.bot.config.get('anon_username', tag)
avatar_url = self.bot.config.get('anon_avatar_url', self.bot.guild.icon_url)
else:
# Normal message
Expand Down Expand Up @@ -315,7 +316,8 @@ def is_image_url(u, _):
if anonymous and isinstance(destination, discord.TextChannel): # Anonymous reply sent in thread channel
em.set_footer(text='Anonymous Reply')
elif not anonymous:
em.set_footer(text=self.bot.config.get('mod_tag', 'Moderator')) # Normal messages
tag = self.bot.config.get('mod_tag', str(message.author.top_role))
em.set_footer(text=tag) # Normal messages
else:
em.set_footer(text=self.bot.config.get('anon_tag', 'Response')) # Anonymous reply sent to user

Expand Down