Handle everyone mentions a little more properly
This commit is contained in:
@@ -215,6 +215,13 @@ namespace Discord
|
|||||||
.Select(x => _client.Users[x.Id, Channel.Server?.Id])
|
.Select(x => _client.Users[x.Id, Channel.Server?.Id])
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
if (model.IsMentioningEveryone != null)
|
||||||
|
{
|
||||||
|
if (model.IsMentioningEveryone.Value && User.GetPermissions(channel).MentionEveryone)
|
||||||
|
MentionedRoles = new Role[] { Server.EveryoneRole };
|
||||||
|
else
|
||||||
|
MentionedRoles = new Role[0];
|
||||||
|
}
|
||||||
if (model.Content != null)
|
if (model.Content != null)
|
||||||
{
|
{
|
||||||
string text = model.Content;
|
string text = model.Content;
|
||||||
@@ -222,18 +229,18 @@ namespace Discord
|
|||||||
|
|
||||||
//var mentionedUsers = new List<User>();
|
//var mentionedUsers = new List<User>();
|
||||||
var mentionedChannels = new List<Channel>();
|
var mentionedChannels = new List<Channel>();
|
||||||
var mentionedRoles = new List<Role>();
|
//var mentionedRoles = new List<Role>();
|
||||||
text = Mention.CleanUserMentions(_client, server, text/*, mentionedUsers*/);
|
text = Mention.CleanUserMentions(_client, server, text/*, mentionedUsers*/);
|
||||||
if (server != null)
|
if (server != null)
|
||||||
{
|
{
|
||||||
text = Mention.CleanChannelMentions(_client, server, text, mentionedChannels);
|
text = Mention.CleanChannelMentions(_client, server, text, mentionedChannels);
|
||||||
text = Mention.CleanRoleMentions(_client, User, channel, text, mentionedRoles);
|
//text = Mention.CleanRoleMentions(_client, User, channel, text, mentionedRoles);
|
||||||
}
|
}
|
||||||
Text = text;
|
Text = text;
|
||||||
|
|
||||||
//MentionedUsers = mentionedUsers;
|
//MentionedUsers = mentionedUsers;
|
||||||
MentionedChannels = mentionedChannels;
|
MentionedChannels = mentionedChannels;
|
||||||
MentionedRoles = mentionedRoles;
|
//MentionedRoles = mentionedRoles;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (server != null)
|
if (server != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user