UNPKG

@averagehelper/corde

Version:

A simple library for Discord bot tests. (Republished fork to demonstrate a bugfix)

170 lines (169 loc) 5.4 kB
export declare type RolePermission = "CREATE_INSTANT_INVITE" | "KICK_MEMBERS" | "BAN_MEMBERS" | "ADMINISTRATOR" | "MANAGE_CHANNELS" | "MANAGE_GUILD" | "ADD_REACTIONS" | "VIEW_AUDIT_LOG" | "PRIORITY_SPEAKER" | "STREAM" | "VIEW_CHANNEL" | "SEND_MESSAGES" | "SEND_TTS_MESSAGES" | "MANAGE_MESSAGES" | "EMBED_LINKS" | "ATTACH_FILES" | "READ_MESSAGE_HISTORY" | "MENTION_EVERYONE" | "USE_EXTERNAL_EMOJIS" | "VIEW_GUILD_INSIGHTS" | "CONNECT" | "SPEAK" | "MUTE_MEMBERS" | "DEAFEN_MEMBERS" | "MOVE_MEMBERS" | "USE_VAD" | "CHANGE_NICKNAME" | "MANAGE_NICKNAMES" | "MANAGE_ROLES" | "MANAGE_WEBHOOKS" | "MANAGE_EMOJIS"; /** * Enum with of all current permissions of Discord, their integer values in hexadecimal. * * https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags */ export declare enum Permission { /** * Allows creation of instant invites * @summary For **Text** and **Voice** Channel */ CREATE_INSTANT_INVITE = 1, /** * Allows kicking members * @summary Indifferent of channel */ KICK_MEMBERS = 2, /** * Allows banning members * @summary Indifferent of channel */ BAN_MEMBERS = 4, /** * Allows all permissions and bypasses channel permission overwrites. * @summary Indifferent of channel */ ADMINISTRATOR = 8, /** * Allows management and editing of channels * @summary For **Text** and **Voice** Channel */ MANAGE_CHANNELS = 16, /** * Allows management and editing of the guild * @summary For **Text** and **Voice** Channel */ MANAGE_GUILD = 32, /** * Allows for the addition of reactions to messages * @summary For **Text** Channel only */ ADD_REACTIONS = 64, /** * Allows for viewing of audit logs * @summary For **Text** and **Voice** Channel */ VIEW_AUDIT_LOG = 128, /** * Allows guild members to view a channel, which includes reading messages in text channels * @summary Indifferent of channel */ VIEW_CHANNEL = 1024, /** * Allows for sending messages in a channel * @summary For **Text** Channel only */ SEND_MESSAGES = 2048, /** * Allows for sending of /tts messages * @summary For **Text** Channel only */ SEND_TTS_MESSAGES = 4096, /** * Allows for deletion of other users messages * @summary For **Text** Channel only */ MANAGE_MESSAGES = 8192, /** * Links sent by users with this permission will be auto-embedded * @summary For **Text** Channel only */ EMBED_LINKS = 16384, /** * Allows for uploading images and files * @summary For **Text** Channel only */ ATTACH_FILES = 32768, /** * Allows for reading of message history * @summary For **Text** Channel only */ READ_MESSAGE_HISTORY = 65536, /** * Allows for using the @everyone tag to notify all users in a channel, * and the @here tag to notify all online users in a channel * @summary For **Text** Channel only */ MENTION_EVERYONE = 131072, /** * Allows the usage of custom emojis from other servers * @summary For **Text** Channel only */ USE_EXTERNAL_EMOJIS = 262144, /** * Allows for joining of a voice channel * @summary For **Voice** Channel only */ CONNECT = 1048576, /** * Allows for speaking in a voice channel * @summary For **Voice** Channel only */ SPEAK = 2097152, /** * Allows for muting members in a voice channel * @summary For **Voice** Channel only */ MUTE_MEMBERS = 4194304, /** * Allows for deafening of members in a voice channel * @summary For **Voice** Channel only */ DEAFEN_MEMBERS = 8388608, /** * Allows for moving of members between voice channels * @summary For **Voice** Channel only */ MOVE_MEMBERS = 16777216, /** * Allows for using voice-activity-detection in a voice channel * @summary For **Voice** Channel only */ USE_VAD = 33554432, /** * Allows for using priority speaker in a voice channel * @summary For **Voice** Channel only */ PRIORITY_SPEAKER = 256, /** * Allows for modification of own nickname * @summary Indifferent of channel */ CHANGE_NICKNAME = 67108864, /** * Allows for modification of other users nicknames * @summary Indifferent of channel */ MANAGE_NICKNAMES = 134217728, /** * Allows management and editing of roles * @summary For **Text** and **Voice** Channel */ MANAGE_ROLES = 268435456, /** * Allows management and editing of webhooks * @summary For **Text** and **Voice** Channel */ MANAGE_WEBHOOKS = 536870912, /** * Allows management and editing of emojis * @summary Indifferent of channel */ MANAGE_EMOJIS = 1073741824, /** * Allows the user to go live * @summary For **Voice** Channel only */ STREAM = 512, /** * Allows for viewing guild insights * @summary Indifferent of channel */ VIEW_GUILD_INSIGHTS = 524288 } /** * Convert a list of permissions into an integer value. * @param permissions Permissions to be converted */ export declare function calcPermissionsValue(...permissions: Permission[]): Permission;