Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DeinFreund
Copy link
Member

@DeinFreund DeinFreund commented Oct 17, 2018

discord relay uses nicknames over usernames
allow zkls users to mention discord users by nick
image

fix #2423

…ion discord users by nick, disallow mentioning roles like [at]everyone
@DeinFreund DeinFreund requested a review from Licho1 October 17, 2018 14:20

//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), ""));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member Author

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?

Copy link
Member

@sprunk sprunk Oct 17, 2018

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?

@sprunk sprunk self-assigned this Oct 17, 2018
@Licho1
Copy link
Member

Licho1 commented Oct 19, 2018

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.

@sprunk sprunk removed their assignment Oct 19, 2018
@DeinFreund
Copy link
Member Author

See #2427 (comment) for an alternate solution.

@DeinFreund DeinFreund force-pushed the master branch 12 times, most recently from ce1528b to 242f4d7 Compare February 16, 2019 14:34
@DeinFreund DeinFreund force-pushed the master branch 7 times, most recently from 41ae30b to f3c5f37 Compare May 17, 2020 20:39
@Licho1
Copy link
Member

Licho1 commented Apr 6, 2024

@GoogleFrog general question, do we want official discord account linking ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discord: make sure Nightwatch's role grants all necessary privileges
3 participants