Documentation ¶
Index ¶
- Variables
- func BuildPermissions(permissions ...Permission) uint64
- func CanInteractWith(ctx context.Context, shard *gateway.Shard, guildId, userId, targetId uint64) bool
- func CanSelfInteractWith(ctx context.Context, shard *gateway.Shard, guildId, targetId uint64) (bool, error)
- func GetBasePermissions(ctx context.Context, shard *gateway.Shard, guildId uint64) (uint64, error)
- func GetChannelBasePermissions(ctx context.Context, shard *gateway.Shard, guildId, channelId uint64, ...) (uint64, error)
- func GetChannelMemberPermissions(ctx context.Context, shard *gateway.Shard, userId, channelId uint64, ...) (uint64, error)
- func GetChannelTotalRolePermissions(ctx context.Context, shard *gateway.Shard, guildId, userId, channelId uint64, ...) (uint64, error)
- func GetEffectivePermissions(ctx context.Context, shard *gateway.Shard, guildId, userId uint64) (uint64, error)
- func GetEffectivePermissionsChannel(ctx context.Context, shard *gateway.Shard, guildId, userId, channelId uint64) (uint64, error)
- func GetGuildTotalRolePermissions(ctx context.Context, shard *gateway.Shard, guildId, userId uint64, ...) (uint64, error)
- func GetHighestRolePosition(ctx context.Context, shard *gateway.Shard, guildId, userId uint64) int
- func HasPermissionRaw(permissions uint64, permission Permission) bool
- func HasPermissions(ctx context.Context, shard *gateway.Shard, guildId, userId uint64, ...) bool
- func HasPermissionsChannel(ctx context.Context, shard *gateway.Shard, guildId, userId, channelId uint64, ...) bool
- type Permission
Constants ¶
This section is empty.
Variables ¶
View Source
var AllPermissions = []Permission{ CreateInstantInvite, KickMembers, BanMembers, Administrator, ManageChannels, ManageGuild, AddReactions, ViewAuditLog, PrioritySpeaker, Stream, ViewChannel, SendMessages, SendTTSMessages, ManageMessages, EmbedLinks, AttachFiles, ReadMessageHistory, MentionEveryone, UseExternalEmojis, ViewGuildInsights, Connect, Speak, MuteMembers, DeafenMembers, MoveMembers, UseVAD, ChangeNickname, ManageNicknames, ManageRoles, ManageWebhooks, ManageEmojis, UseApplicationCommands, RequestToSpeak, ManageEvents, ManageThreads, CreatePublicThreads, CreatePrivateThreads, UseExternalStickers, SendMessagesInThreads, UseEmbeddedActivities, ModerateMembers, }
Functions ¶
func BuildPermissions ¶
func BuildPermissions(permissions ...Permission) uint64
func CanInteractWith ¶
func CanSelfInteractWith ¶
func GetBasePermissions ¶
func GetEffectivePermissions ¶
func GetHighestRolePosition ¶
func HasPermissionRaw ¶
func HasPermissionRaw(permissions uint64, permission Permission) bool
func HasPermissions ¶
func HasPermissionsChannel ¶
Types ¶
type Permission ¶
type Permission uint64
const ( CreateInstantInvite Permission = 1 << iota KickMembers BanMembers Administrator ManageChannels ManageGuild AddReactions ViewAuditLog PrioritySpeaker Stream ViewChannel // Read messages SendMessages SendTTSMessages ManageMessages EmbedLinks AttachFiles ReadMessageHistory MentionEveryone UseExternalEmojis ViewGuildInsights Connect Speak MuteMembers DeafenMembers MoveMembers UseVAD // Use voice activity ChangeNickname ManageNicknames ManageRoles // Manage permissions ManageWebhooks ManageEmojis UseApplicationCommands RequestToSpeak ManageEvents ManageThreads CreatePublicThreads CreatePrivateThreads UseExternalStickers SendMessagesInThreads UseEmbeddedActivities ModerateMembers )
func GetAllPermissions ¶
func (Permission) String ¶
func (p Permission) String() string
Click to show internal directories.
Click to hide internal directories.