access

package
v0.0.0-...-9b2646f Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessManager

type AccessManager struct {
	// contains filtered or unexported fields
}

func New

func New(state *discordgo.State, session *discordgo.Session) *AccessManager

func (*AccessManager) CheckChannelAccessForRequest

func (m *AccessManager) CheckChannelAccessForRequest(c *fiber.Ctx, channelID string) error

func (*AccessManager) CheckGuildAccessForRequest

func (m *AccessManager) CheckGuildAccessForRequest(c *fiber.Ctx, guildID string) error

func (*AccessManager) ComputeBotPermissionsForChannel

func (m *AccessManager) ComputeBotPermissionsForChannel(channelID string) (int64, error)

func (*AccessManager) ComputeUserPermissionsForChannel

func (m *AccessManager) ComputeUserPermissionsForChannel(userID string, channelID string) (int64, error)

func (*AccessManager) GetChannelAccessForUser

func (m *AccessManager) GetChannelAccessForUser(userID string, channelID string) (ChannelAccess, error)

func (*AccessManager) GetGuildAccessForUser

func (m *AccessManager) GetGuildAccessForUser(userID string, guildID string) (GuildAccess, error)

func (*AccessManager) GetGuildMember

func (m *AccessManager) GetGuildMember(guildID string, userID string) (*discordgo.Member, error)

type ChannelAccess

type ChannelAccess struct {
	UserPermissions int64
	BotPermissions  int64
}

func (*ChannelAccess) BotAccess

func (c *ChannelAccess) BotAccess() bool

func (*ChannelAccess) UserAccess

func (c *ChannelAccess) UserAccess() bool

type GuildAccess

type GuildAccess struct {
	HasChannelWithUserAccess bool
	HasChannelWithBotAccess  bool
}

Jump to

Keyboard shortcuts

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