enum Discord::Permissions

Defined in:

discordcr/mappings/permissions.cr

Enum Members

CreateInstantInvite = 1_u64
KickMembers = 2_u64
BanMembers = 4_u64
Administrator = 8_u64
ManageChannels = 16_u64
ManageGuild = 32_u64
AddReactions = 64_u64
ViewAuditLog = 128_u64
PrioritySpeaker = 256_u64
Stream = 512_u64
ReadMessages = 1024_u64
SendMessages = 2048_u64
SendTTSMessages = 4096_u64
ManageMessages = 8192_u64
EmbedLinks = 16384_u64
AttachFiles = 32768_u64
ReadMessageHistory = 65536_u64
MentionEveryone = 131072_u64
UseExternalEmojis = 262144_u64
Connect = 1048576_u64
Speak = 2097152_u64
MuteMembers = 4194304_u64
DeafenMembers = 8388608_u64
MoveMembers = 16777216_u64
UseVAD = 33554432_u64
ChangeNickname = 67108864_u64
ManageNicknames = 134217728_u64
ManageRoles = 268435456_u64
ManageWebhooks = 536870912_u64
ManageEmojis = 1073741824_u64
UseApplicationCommands = 2147483648_u64
RequestToSpeak = 4294967296_u64
ManageThreads = 17179869184_u64
UsePrivateThreads = 68719476736_u64
UseExternalStickers = 137438953472_u64

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 deafen_members? #

[View source]
def embed_links? #

[View source]
def kick_members? #

[View source]
def manage_channels? #

[View source]
def manage_emojis? #

[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 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_tts_messages? #

[View source]
def speak? #

[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_private_threads? #

[View source]
def use_vad? #

[View source]
def view_audit_log? #

[View source]