-
Notifications
You must be signed in to change notification settings - Fork 52
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
Improve discord relay mentions #2424
base: master
Are you sure you want to change the base?
Conversation
…ion discord users by nick, disallow mentioning roles like [at]everyone
1a5edf0
to
5ab43b4
Compare
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), "")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that, but what about @@Admin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with string.Format(" {0}", role)
or string.Format("@{1}{0}", role, <zero width space>)
or somesuch then?
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. |
See #2427 (comment) for an alternate solution. |
ce1528b
to
242f4d7
Compare
41ae30b
to
f3c5f37
Compare
@GoogleFrog general question, do we want official discord account linking ? |
discord relay uses nicknames over usernames
allow zkls users to mention discord users by nick
fix #2423