Open
Conversation
…ion discord users by nick, disallow mentioning roles like [at]everyone
1a5edf0 to
5ab43b4
Compare
sprunk
reviewed
Oct 17, 2018
ZkLobbyServer/DiscordRelaySource.cs
Outdated
|
|
||
| //Block any mentions of an entire role via Name | ||
| var roleNames = discord.GetGuild(serverID).Roles.Select(x => x.Name).ToList(); | ||
| roleNames.ForEach(role => m.Message = m.Message.Replace(string.Format("@{0}", role), "")); |
Member
There was a problem hiding this comment.
How about
Suggested change
| roleNames.ForEach(role => m.Message = m.Message.Replace(string.Format("@{0}", role), "")); | |
| roleNames.ForEach(role => m.Message = m.Message.Replace(string.Format("@{0}", role), role)); |
For stuff like
is any @admin online?
Member
Author
There was a problem hiding this comment.
I thought about that, but what about @@Admin?
Member
There was a problem hiding this comment.
Replace with string.Format(" {0}", role) or string.Format("@{1}{0}", role, <zero width space>) or somesuch then?
Member
|
We should verify that .Users on discord server does not actually call some REST API to discord. This could slow/lag our server when spammed. |
Member
Author
|
See #2427 (comment) for an alternate solution. |
ce1528b to
242f4d7
Compare
41ae30b to
f3c5f37
Compare
Member
|
@GoogleFrog general question, do we want official discord account linking ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
discord relay uses nicknames over usernames

allow zkls users to mention discord users by nick
fix #2423