enum Servo::Model::Permissions

Overview

Permissions in Discord are a way to limit and grant certain abilities to users.

Defined in:

model/permissions.cr

Enum Members

CreateInstantInvite = 1_u64

Allows creation of instant invites.

KickMembers = 2_u64

Allows kicking members.

BanMembers = 4_u64

Allows banning members.

Administrator = 8_u64

Allows all permissions and bypasses channel permission overwrites.

ManageChannels = 16_u64

Allows management and editing of channels.

ManageGuild = 32_u64

Allows management and editing of the guild.

AddReactions = 64_u64

Allows for the addition of reactions to messages.

ViewAuditLog = 128_u64

Allows for viewing of audit logs.

PrioritySpeaker = 256_u64

Allows for using priority speaker in a voice channel.

Stream = 512_u64

Allows the user to go live.

ReadMessages = 1024_u64

Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels.

SendMessages = 2048_u64

Allows for sending messages in a channel (does not allow sending messages in threads).

SendTTSMessages = 4096_u64

Allows for sending of /tts messages.

ManageMessages = 8192_u64

Allows for deletion of other users messages.

EmbedLinks = 16384_u64

Links sent by users with this permission will be auto-embedded.

AttachFiles = 32768_u64

Allows for uploading images and files.

ReadMessageHistory = 65536_u64

Allows for reading of message history.

MentionEveryone = 131072_u64

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.

UseExternalEmojis = 262144_u64

Allows the usage of custom emojis from other servers.

ViewGuildInsights = 524288_u64

Allows for viewing guild insights.

Connect = 1048576_u64

Allows for joining of a voice channel.

Speak = 2097152_u64

Allows for speaking in a voice channel.

MuteMembers = 4194304_u64

Allows for muting members in a voice channel.

DeafenMembers = 8388608_u64

Allows for deafening of members in a voice channel.

MoveMembers = 16777216_u64

Allows for moving of members between voice channels.

UseVAD = 33554432_u64

Allows for using voice-activity-detection in a voice channel.

ChangeNickname = 67108864_u64

Allows for modification of own nickname.

ManageNicknames = 134217728_u64

Allows for modification of other users nicknames.

ManageRoles = 268435456_u64

Allows management and editing of roles.

ManageWebhooks = 536870912_u64

Allows management and editing of webhooks.

ManageEmojisAndStickers = 1073741824_u64

Allows management and editing of emojis and stickers.

UseApplicationCommands = 2147483648_u64

Allows members to use application commands, including slash commands and context menu commands.

RequestToSpeak = 4294967296_u64

Allows for requesting to speak in stage channels. (This permission is under active development and may be changed or removed.)

ManageEvents = 8589934592_u64

Allows for creating, editing, and deleting scheduled events .

ManageThreads = 17179869184_u64

Allows for deleting and archiving threads, and viewing all private threads.

CreatePublicThreads = 34359738368_u64

Allows for creating public and announcement threads.

CreatePrivateThreads = 68719476736_u64

Allows for creating private threads.

UseExternalStickers = 137438953472_u64

Allows the usage of custom stickers from other servers.

SendMessagesInThreads = 274877906944_u64

Allows for sending messages in threads.

StartEmbededActivities = 549755813888_u64

Allows for launching activities (applications with the EMBEDDED flag) in a voice channel.

ModerateMembers = 1099511627776_u64

Allows for timing out users to prevent them from sending or reacting to messages in chat and threads, and from speaking in voice and stage channels.

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

def add_reactions? #

[View source]
def administrator? #

[View source]
def attach_files? #

[View source]
def ban_members? #

[View source]
def change_nickname? #

[View source]
def connect? #

[View source]
def create_instant_invite? #

[View source]
def create_private_threads? #

[View source]
def create_public_threads? #

[View source]
def deafen_members? #

[View source]
def embed_links? #

[View source]
def kick_members? #

[View source]
def manage_channels? #

[View source]
def manage_emojis_and_stickers? #

[View source]
def manage_events? #

[View source]
def manage_guild? #

[View source]
def manage_messages? #

[View source]
def manage_nicknames? #

[View source]
def manage_roles? #

[View source]
def manage_threads? #

[View source]
def manage_webhooks? #

[View source]
def mention_everyone? #

[View source]
def moderate_members? #

[View source]
def move_members? #

[View source]
def mute_members? #

[View source]
def none? #

[View source]
def priority_speaker? #

[View source]
def read_message_history? #

[View source]
def read_messages? #

[View source]
def request_to_speak? #

[View source]
def send_messages? #

[View source]
def send_messages_in_threads? #

[View source]
def send_tts_messages? #

[View source]
def speak? #

[View source]
def start_embeded_activities? #

[View source]
def stream? #

[View source]
def to_json(json : JSON::Builder) #
Description copied from struct Enum

Serializes this enum member by name.

For non-flags enums, the serialization is a JSON string. The value is the member name (see #to_s) transformed with String#underscore.

enum Stages
  INITIAL
  SECOND_STAGE
end

Stages::INITIAL.to_json      # => %("initial")
Stages::SECOND_STAGE.to_json # => %("second_stage")

For flags enums, the serialization is a JSON array including every flagged member individually serialized in the same way as a member of a non-flags enum. None is serialized as an empty array, All as an array containing all members.

@[Flags]
enum Sides
  LEFT
  RIGHT
end

Sides::LEFT.to_json                  # => %(["left"])
(Sides::LEFT | Sides::RIGHT).to_json # => %(["left","right"])
Sides::All.to_json                   # => %(["left","right"])
Sides::None.to_json                  # => %([])

ValueConverter.to_json offers a different serialization strategy based on the member value.


[View source]
def use_application_commands? #

[View source]
def use_external_emojis? #

[View source]
def use_external_stickers? #

[View source]
def use_vad? #

[View source]
def view_audit_log? #

[View source]
def view_guild_insights? #

[View source]