-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAddReaction.cs
29 lines (28 loc) · 977 Bytes
/
AddReaction.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System.Linq;
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
using Discord.WebSocket;
using System.IO;
namespace bot.Handlers
{
public class AddReaction
{
public static async Task AddReactionAsync(SocketMessage message)
{
var channel = message.Channel as SocketGuildChannel;
var messageAuthor = (message.Author.Id).ToString();
var banList = (await File.ReadAllLinesAsync("banlist.txt")).ToList();
var roles = channel.Guild.GetUser(Global.MyId).Roles;
var eventType = message.Content.Split("\n")[0];
foreach (var myRole in roles)
{
if (myRole.Name == eventType && myRole.Id != Global.EveryoneId && !banList.Contains(messageAuthor))
{
await message.AddReactionAsync(Global.ThumbUp);
return;
}
}
}
}
}