Optionally use Discord nicknames

This commit is contained in:
archfan 2019-08-29 08:36:25 -04:00 committed by GitHub
parent b70ce6e79e
commit cb9fd7b06e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View File

@ -30,6 +30,7 @@ port = 8080
channel_id = 576585506658189332
allow_logins = true
clean_invites = true
use_nicknames = true
```
4. Set `discord.port` in your `minetest.conf` to match the port you used in `relay.conf`. You may also set `discord.text_color` to a hex color string if you'd like to color relayed messages from Discord.

View File

@ -6,3 +6,4 @@ port = 8080
channel_id = <Discord channel ID goes here>
allow_logins = true
clean_invites = true
use_nicknames = true

View File

@ -50,6 +50,7 @@ port = int(config['RELAY']['port'])
token = config['BOT']['token']
logins_allowed = True if config['RELAY']['allow_logins'] == 'true' else False
do_clean_invites = True if config['RELAY']['clean_invites'] == 'true' else False
do_use_nicknames = True if config['RELAY']['use_nicknames'] == 'true' else False
last_request = 0
@ -113,7 +114,7 @@ async def on_message(message):
if check_timeout():
if (message.channel.id == channel_id) and (message.author.id != bot.user.id):
msg = {
'author': message.author.name,
'author': message.author.name if not do_use_nicknames else message.author.display_name,
'content': message.content.replace('\n', '/')
}
if do_clean_invites: