utils

package
v0.0.0-...-b33156b Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasePermissions

func BasePermissions(g *discordgo.Guild, m *discordgo.Member) int64

Computes the 'base permissions' of a member

func CheckAllPermissions

func CheckAllPermissions(basePerms int64, permissions []int64) bool

Check if a permission list has all permissions

func CheckPermission

func CheckPermission(basePerms int64, permission int64) bool

Check if a permission int64 has a permission

func IconURL

func IconURL(iconHash, staticIconURL, animatedIconURL, size string) string

https://github.com/bwmarrin/discordgo/blob/master/util.go#L111

func MemberChannelPerms

func MemberChannelPerms(basePerms int64, g *discordgo.Guild, m *discordgo.Member, c *discordgo.Channel) int64

Returns the permissions of a member in a channel

func Pointer

func Pointer[T any](v T) *T

Types

type ParsedWebhookUrl

type ParsedWebhookUrl struct {
	ID    string
	Token string
}

func ParseWebhookURL

func ParseWebhookURL(webhookURL string) (pwUrl *ParsedWebhookUrl, err error)

ParseURL parses the given Discord webhook URL.

Directories

Path Synopsis
Package mapofmu provides locking per-key.
Package mapofmu provides locking per-key.
Extensions to the mewld clustering system
Extensions to the mewld clustering system
Concurrent safe value wrapper
Concurrent safe value wrapper
Sourced from https://www.reddit.com/r/golang/comments/twucb0/is_there_already_a_generic_threadsafe_map/
Sourced from https://www.reddit.com/r/golang/comments/twucb0/is_there_already_a_generic_threadsafe_map/

Jump to

Keyboard shortcuts

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