/// <summary> /// Deletes all reactions of a specific reaction for this message. /// </summary> /// <param name="emoji">The emoji to clear, either an emoji or name:id.</param> /// <returns></returns> /// <exception cref="Exceptions.UnauthorizedException">Thrown when the client does not have the <see cref="Permissions.ManageMessages"/> permission.</exception> /// <exception cref="Exceptions.NotFoundException">Thrown when the emoji does not exist.</exception> /// <exception cref="Exceptions.BadRequestException">Thrown when an invalid parameter was provided.</exception> /// <exception cref="Exceptions.ServerErrorException">Thrown when Discord is unable to process the request.</exception> public Task DeleteReactionsEmojiAsync(DiscordEmoji emoji) => this.Discord.ApiClient.DeleteReactionsEmojiAsync(this.ChannelId, this.Id, emoji.ToReactionString());
/// <summary> /// Deletes another user's reaction. /// </summary> /// <param name="emoji">Emoji for the reaction you want to remove, either an emoji or name:id.</param> /// <param name="user">Member you want to remove the reaction for</param> /// <param name="reason">Reason for audit logs.</param> /// <returns></returns> /// <exception cref="Exceptions.UnauthorizedException">Thrown when the client does not have the <see cref="Permissions.ManageMessages"/> permission.</exception> /// <exception cref="Exceptions.NotFoundException">Thrown when the emoji does not exist.</exception> /// <exception cref="Exceptions.BadRequestException">Thrown when an invalid parameter was provided.</exception> /// <exception cref="Exceptions.ServerErrorException">Thrown when Discord is unable to process the request.</exception> public Task DeleteReactionAsync(DiscordEmoji emoji, DiscordUser user, string reason = null) => this.Discord.ApiClient.DeleteUserReactionAsync(this.ChannelId, this.Id, user.Id, emoji.ToReactionString(), reason);
/// <summary> /// Gets users that reacted with this emoji. /// </summary> /// <param name="emoji">Emoji to react with.</param> /// <param name="limit">Limit of users to fetch.</param> /// <param name="after">Fetch users after this user's id.</param> /// <returns></returns> /// <exception cref="Exceptions.NotFoundException">Thrown when the emoji does not exist.</exception> /// <exception cref="Exceptions.BadRequestException">Thrown when an invalid parameter was provided.</exception> /// <exception cref="Exceptions.ServerErrorException">Thrown when Discord is unable to process the request.</exception> public Task <IReadOnlyList <DiscordUser> > GetReactionsAsync(DiscordEmoji emoji, int limit = 25, ulong?after = null) => this.GetReactionsInternalAsync(emoji, limit, after);
/// <summary> /// Creates a reaction to this message /// </summary> /// <param name="emoji">The emoji you want to react with, either an emoji or name:id</param> /// <returns></returns> /// <exception cref="Exceptions.UnauthorizedException">Thrown when the client does not have the <see cref="Permissions.AddReactions"/> permission.</exception> /// <exception cref="Exceptions.NotFoundException">Thrown when the emoji does not exist.</exception> /// <exception cref="Exceptions.BadRequestException">Thrown when an invalid parameter was provided.</exception> /// <exception cref="Exceptions.ServerErrorException">Thrown when Discord is unable to process the request.</exception> public Task CreateReactionAsync(DiscordEmoji emoji) => this.Discord.ApiClient.CreateReactionAsync(this.ChannelId, this.Id, emoji.ToReactionString());
/// <summary> /// Constructs a new component emoji from an existing <see cref="DiscordEmoji"/>. /// </summary> /// <param name="emoji">The emoji to use.</param> public DiscordComponentEmoji(DiscordEmoji emoji) { this.Id = emoji.Id; this.Name = emoji.Name; // Name is ignored if the Id is present. // }
/// <summary> /// Gets users that reacted with this emoji /// </summary> /// <param name="emoji">Emoji to react with.</param> /// <returns></returns> public Task <IReadOnlyList <DiscordUser> > GetReactionsAsync(DiscordEmoji emoji) => this.Discord.ApiClient.GetReactionsAsync(this.Channel.Id, this.Id, emoji.ToReactionString());
internal void UpdateWith(string state, DiscordEmoji emoji) { this.Name = state; this.Emoji = emoji; }
internal DiscordCustomStatus(DiscordCustomStatus other) { this.Name = other.Name; this.Emoji = other.Emoji; }