Skip to content

feat(plugin): AllowedMentions#1998

Open
arHSM wants to merge 47 commits into
Vendicated:mainfrom
arHSM:allowed-mentions
Open

feat(plugin): AllowedMentions#1998
arHSM wants to merge 47 commits into
Vendicated:mainfrom
arHSM:allowed-mentions

Conversation

@arHSM
Copy link
Copy Markdown

@arHSM arHSM commented Nov 17, 2023

AllowedMentions

Fine grained control over whom to ping when sending or editing a message.

PS: Editing allowed_mentions in a message requires changing the content as the API persists the mentions if content is not changed

@lewisakura
Copy link
Copy Markdown
Collaborator

I do wonder if this is actually safe to do for users since this is mainly a feature for bots, no? Just curious if this has the potential to flag.

Copy link
Copy Markdown
Collaborator

@lewisakura lewisakura left a comment

Choose a reason for hiding this comment

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

Plugin needs a README.md

…owed-mentions

Signed-off-by: Han Seung Min - 한승민 <hanseungmin.ar@gmail.com>
@arHSM arHSM requested a review from lewisakura November 29, 2023 16:55
Comment thread src/plugins/allowedMentions/README.md Outdated
@arHSM arHSM requested a review from lewisakura November 29, 2023 17:50
Copy link
Copy Markdown
Contributor

@jamesbt365 jamesbt365 left a comment

Choose a reason for hiding this comment

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

I can't seem to figure out why you can't toggle everyone mentions when you don't have the permission to do so in the guild but you do in the channel, but this change is requires as the roles field is not directly present when you use the getGuild method anymore.

function getDisplayableRoleName(roleId: string, guildId: string | null) {
// You *can* mention roles in DMs but is it really worth adding the UI for
// it in DMs
const role = guildId ? Object.values(GuildStore.getGuild(guildId).roles).find(r => r.id === roleId)?.name : undefined;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You need to do this now.

Suggested change
const role = guildId ? Object.values(GuildStore.getGuild(guildId).roles).find(r => r.id === roleId)?.name : undefined;
const role = guildId ? GuildStore.getRole(guildId, roleId)?.name : undefined;

@jamesbt365
Copy link
Copy Markdown
Contributor

Seems that some recent changes broke about half the patches.

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.

3 participants