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.

emoji.cs 643 B

123456789101112131415161718
  1. // bail if the message is not a user one (system messages cannot have reactions)
  2. var usermsg = msg as IUserMessage;
  3. if (usermsg == null) return;
  4. // standard Unicode emojis
  5. Emoji emoji = new Emoji("👍");
  6. // or
  7. // Emoji emoji = new Emoji("\uD83D\uDC4D");
  8. // custom guild emotes
  9. Emote emote = Emote.Parse("<:dotnet:232902710280716288>");
  10. // using Emote.TryParse may be safer in regards to errors being thrown;
  11. // please note that the method does not verify if the emote exists,
  12. // it simply creates the Emote object for you.
  13. // add the reaction to the message
  14. await usermsg.AddReactionAsync(emoji);
  15. await usermsg.AddReactionAsync(emote);