functions

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRole

func AddRole(guildID string, memberID, roleID string) error

AddRole adds a given roleID to a user

func DeleteMessage

func DeleteMessage(channelID, messageID string, delay ...time.Duration) error

DeleteMessage deletes a given message immediately or an option delay

func EditBasicMessage

func EditBasicMessage(channelID, messageID, message string) error

EditBasicMessage edits a 'basic' message and allows replacement of the message content

func EditMessage

func EditMessage(channelID string, messageID string, message *discordgo.MessageSend) error

EditMessage edits a 'complex' message and allows replacement of all message objects

func GetChannel

func GetChannel(guildID, channel string) (*discordgo.Channel, error)

GetChannel returns the channel object if possible from a channel ID

func GetGuild

func GetGuild(guildID string) *discordgo.Guild

GetGuild returns the full guild object for a guild

func GetMember

func GetMember(guildID string, userStr string) (*discordgo.Member, error)

GetMember returns the member object if possible of a user ID/Mention

func GetRole

func GetRole(guildID, roleStr string) (role *discordgo.Role, err error)

GetRole returns the full guild role object for a role ID/mention

func GetUser

func GetUser(userStr string) (*discordgo.User, error)

GetUser returns the user object if possible of a user ID/mention

func GuildBanMember

func GuildBanMember(guildID, userID, reason string) error

GuildBanMember bans a user from the current guild

func GuildKickMember

func GuildKickMember(guildID, userID, reason string) error

GuildKickMember kicks a user from the current guild

func GuildUnbanMember

func GuildUnbanMember(guildID, userID string) error

GuildUnbanMember unbans a member from the current guild

func HighestRole

func HighestRole(guildID string, member *discordgo.Member) (role *discordgo.Role)

HighestRole returns the role object of a members highest role Will return nil if no role is found

func IsMemberHigher

func IsMemberHigher(guildID string, memberA, memberB *discordgo.Member) bool

IsMemberHigher returns true is memberA has a higher highest role than memberB

func IsRoleHigher

func IsRoleHigher(higher, lower *discordgo.Role) bool

IsRoleHigher returns a boolean if the position of role A is higher than role B If they are both 1 (denoting a new role), we check against the ID

func RemoveRole

func RemoveRole(guildID, memberID, roleID string) error

AddRole removes a given roleID to a user

func SendBasicMessage

func SendBasicMessage(channelID string, message string, delay ...time.Duration) (msg *discordgo.Message, err error)

SendBasicMessage sends a string as message content to the given channel If a delay is included, then the message is deleted after X seconds.

func SendDM

func SendDM(userID string, message *discordgo.MessageSend) error

SendDM sends complex message objects to a given users DM channel. Supporting, embed, components etc.

func SendMessage

func SendMessage(channelID string, message *discordgo.MessageSend, delay ...time.Duration) (msg *discordgo.Message, err error)

SendMessage sends complex message objects to a given channel. Supporting, embed, components etc. If a delay is included, then the message is deleted after X seconds

func SetRoles

func SetRoles(guildID, memberID string, roleIDs []string) error

SetRoles flushes a users roles and reassigns them to the given roleIDs

func SetStatus

func SetStatus(statusText string)

Misc

func ToInt64

func ToInt64(conv any) int64

ToInt64 takes the value of an int, float or string and returns it as a whole 64-bit integer if possible or 0 when not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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