enum Servo::Model::Permissions
Overview
Permissions in Discord are a way to limit and grant certain abilities to users.
Defined in:
model/permissions.crEnum 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
- #add_reactions?
- #administrator?
- #attach_files?
- #ban_members?
- #change_nickname?
- #connect?
- #create_instant_invite?
- #create_private_threads?
- #create_public_threads?
- #deafen_members?
- #embed_links?
- #kick_members?
- #manage_channels?
- #manage_emojis_and_stickers?
- #manage_events?
- #manage_guild?
- #manage_messages?
- #manage_nicknames?
- #manage_roles?
- #manage_threads?
- #manage_webhooks?
- #mention_everyone?
- #moderate_members?
- #move_members?
- #mute_members?
- #none?
- #priority_speaker?
- #read_message_history?
- #read_messages?
- #request_to_speak?
- #send_messages?
- #send_messages_in_threads?
- #send_tts_messages?
- #speak?
- #start_embeded_activities?
- #stream?
-
#to_json(json : JSON::Builder)
Serializes this enum member by name.
- #use_application_commands?
- #use_external_emojis?
- #use_external_stickers?
- #use_vad?
- #view_audit_log?
- #view_guild_insights?
Constructor Detail
Instance Method Detail
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.