You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

socket-emote-sample.cs 388 B

1234567891011
  1. private readonly DiscordSocketClient _client;
  2. public async Task ReactAsync(SocketUserMessage userMsg, string emoteName)
  3. {
  4. var emote = _client.Guilds
  5. .SelectMany(x => x.Emotes)
  6. .FirstOrDefault(x => x.Name.IndexOf(
  7. emoteName, StringComparison.OrdinalIgnoreCase) != -1);
  8. if (emote == null) return;
  9. await userMsg.AddReactionAsync(emote);
  10. }