permissions

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Overwrite

type Overwrite struct {
	ID    snowflake.ID  `json:"id"`
	Type  OverwriteType `json:"type"`
	Allow Permission    `json:"allow"`
	Deny  Permission    `json:"deny"`
}

type OverwriteType

type OverwriteType uint8
const (
	RoleOverwrite OverwriteType = iota
	MemberOverwrite
)

type Permission

type Permission uint64
const (
	CreateInstantInvite Permission = 1 << iota
	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
	ManageEmojisAndStickers
	UseApplicationCommands
	RequestToSpeak
	ManageEvents
	ManageThreads
	CreatePublicThreads
	CreatePrivateThreads
	UseExternalStickers
	SendMessagesInThreads
	UseEmbeddedActivities
	ModerateMembers

	All = 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 |
		ManageEmojisAndStickers |
		UseApplicationCommands |
		RequestToSpeak |
		ManageEvents |
		ManageThreads |
		CreatePublicThreads |
		CreatePrivateThreads |
		UseExternalStickers |
		SendMessagesInThreads |
		UseEmbeddedActivities |
		ModerateMembers
)

func (*Permission) Add

func (b *Permission) Add(a ...Permission)

func (Permission) Administrator

func (x Permission) Administrator() bool

func (*Permission) Clear

func (b *Permission) Clear(a ...Permission)

func (Permission) Has

func (x Permission) Has(perm Permission) bool

func (Permission) MarshalJSON

func (b Permission) MarshalJSON() (dst []byte, err error)

func (Permission) Serialize

func (b Permission) Serialize() (data map[Permission]bool)

func (Permission) String

func (p Permission) String() string

String returns string representation of permission

func (*Permission) UnmarshalJSON

func (b *Permission) UnmarshalJSON(bytes []byte) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL