import { Emoji , GuildMember , integer , Internal , snowflake } from '.' ; /** https://discord.com/developers/docs/resources/channel#reaction-object-reaction-structure */ export interface Reaction { /** times this emoji has been used to react */ count : integer ; /** whether the current user reacted using this emoji */ me : boolean ; /** emoji information */ emoji : Partial < Emoji > ; } export namespace Reaction { export namespace Event { /** https://discord.com/developers/docs/topics/gateway#message-reaction-add-message-reaction-add-event-fields */ export interface Add { /** the id of the user */ user_id : snowflake ; /** the id of the channel */ channel_id : snowflake ; /** the id of the message */ message_id : snowflake ; /** the id of the guild */ guild_id ? : snowflake ; /** the member who reacted if this happened in a guild */ member ? : GuildMember ; /** the emoji used to react - example */ emoji : Partial < Emoji > ; } /** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-message-reaction-remove-event-fields */ export interface Remove { /** the id of the user */ user_id : snowflake ; /** the id of the channel */ channel_id : snowflake ; /** the id of the message */ message_id : snowflake ; /** the id of the guild */ guild_id ? : snowflake ; /** the emoji used to react - example */ emoji : Partial < Emoji > ; } /** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all-message-reaction-remove-all-event-fields */ export interface RemoveAll { /** the id of the channel */ channel_id : snowflake ; /** the id of the message */ message_id : snowflake ; /** the id of the guild */ guild_id ? : snowflake ; } /** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji-message-reaction-remove-emoji */ export interface RemoveEmoji { /** the id of the channel */ channel_id : snowflake ; /** the id of the guild */ guild_id ? : snowflake ; /** the id of the message */ message_id : snowflake ; /** the emoji that was removed */ emoji : Partial < Emoji > ; } } export interface GetParams { /** get users after this user ID */ after ? : snowflake ; /** max number of users to return (1-100) */ limit ? : integer ; } } declare module './gateway' { interface GatewayEvents { /** user reacted to a message */ MESSAGE_REACTION_ADD : Reaction . Event . Add ; /** user removed a reaction from a message */ MESSAGE_REACTION_REMOVE : Reaction . Event . Remove ; /** all reactions were explicitly removed from a message */ MESSAGE_REACTION_REMOVE_ALL : Reaction . Event . RemoveAll ; /** all reactions for a given emoji were explicitly removed from a message */ MESSAGE_REACTION_REMOVE_EMOJI : Reaction . Event . RemoveEmoji ; } } declare module './internal' { interface Internal { see https createReaction ( channel_id , message_id , emoji ) : Promise < void > ; see https deleteOwnReaction ( channel_id , message_id , emoji ) : Promise < void > ; see https deleteUserReaction ( channel_id , message_id , emoji , user_id ) : Promise < void > ; see https getReactions ( channel_id , message_id , emoji , params ? ) : Promise < Reaction [ ] > ; see https deleteAllReactions ( channel_id , message_id ) : Promise < void > ; see https deleteAllReactionsForEmoji ( channel_id , message_id , emoji ) : Promise < void > ; } } Internal . define ( { '/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me' : { PUT : 'createReaction' , DELETE : 'deleteOwnReaction' , } , '/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}' : { DELETE : 'deleteUserReaction' , } , '/channels/{channel.id}/messages/{message.id}/reactions/{emoji}' : { GET : 'getReactions' , DELETE : 'deleteAllReactionsforEmoji' , } , '/channels/{channel.id}/messages/{message.id}/reactions' : { DELETE : 'deleteAllReactions' , } , } ) ;