Documentation ¶
Index ¶
- Constants
- func Channel(c *discordgo.Channel) string
- func EscapeEveryoneMention(in string) string
- func GetAllGuildMembers(session *discordgo.Session, guildID string) ([]*discordgo.Member, error)
- func GetRole(rID string, roles []*discordgo.Role) *discordgo.Role
- func GetRoleByName(roles []*discordgo.Role, name string) *discordgo.Role
- func GetUser(uID string, users []*discordgo.User) *discordgo.User
- func Guild(g *discordgo.Guild) string
- func HasPermission(requestedPermission Permission, flags int) bool
- func HasRole(member *discordgo.Member, roleID string) bool
- func HasRoleByName(member *discordgo.Member, roles []*discordgo.Role, name string) bool
- func IsChannelAbove(a, b *discordgo.Channel) bool
- func IsMemberAllowed(s *discordgo.Session, u *discordgo.User, g *discordgo.Guild, perm Permission) bool
- func IsRoleAbove(a, b *discordgo.Role) bool
- func Mention(u *discordgo.User) string
- func NewEmbedField(key string, value interface{}) *discordgo.MessageEmbedField
- func NewEmbedMessage(embed *discordgo.MessageEmbed) []*discordgo.MessageSend
- func NewInlineEmbedField(key string, value interface{}) *discordgo.MessageEmbedField
- func QuoteMarkdown(msg string) string
- func RuneByIndex(s string, runePos int) (rune, int)
- func SplitSendMessage(message string) []*discordgo.MessageSend
- func SplitSendMessagePS(message string, prefix, suffix string, prefixStart, suffixEnd bool) []*discordgo.MessageSend
- func StrSplit(s string, runeCount int) (split, rest string)
- func User(u *discordgo.User) string
- type Channels
- type ManagedMessage
- type Permission
- type Roles
Constants ¶
const ( PermissionCreateInstantInvite Permission = 0x00000001 PermissionKickMembers = 0x00000002 PermissionBanMembers = 0x00000004 PermissionAdministrator = 0x00000008 PermissionManageChannels = 0x00000010 PermissionManageGuild = 0x00000020 PermissionAddReactions = 0x00000040 PermissionViewAuditLog = 0x00000080 PermissionViewChannel = 0x00000400 PermissionSendMessages = 0x00000800 PermissionSendTTSMessages = 0x00001000 PermissionManageMessages = 0x00002000 PermissionEmbedLinks = 0x00004000 PermissionAttachFiles = 0x00008000 PermissionReadMessageHistory = 0x00010000 PermissionMentionEveryone = 0x00020000 PermissionUseExternalEmojis = 0x00040000 PermissionConnect = 0x00100000 PermissionSpeak = 0x00200000 PermissionMuteMembers = 0x00400000 PermissionDeafenMembers = 0x00800000 PermissionMoveMembers = 0x01000000 PermissionUseVAD = 0x02000000 PermissionChangeNickname = 0x04000000 PermissionManageNicknames = 0x08000000 PermissionManageRoles = 0x10000000 PermissionManageWebhooks = 0x20000000 PermissionManageEmojis = 0x40000000 )
Variables ¶
This section is empty.
Functions ¶
func EscapeEveryoneMention ¶
func GetAllGuildMembers ¶
func HasPermission ¶
func HasPermission(requestedPermission Permission, flags int) bool
func HasRoleByName ¶
func IsChannelAbove ¶
func IsMemberAllowed ¶
func IsMemberAllowed(s *discordgo.Session, u *discordgo.User, g *discordgo.Guild, perm Permission) bool
TODO: channel specific overrides
func IsRoleAbove ¶
func NewEmbedField ¶
func NewEmbedField(key string, value interface{}) *discordgo.MessageEmbedField
func NewEmbedMessage ¶
func NewEmbedMessage(embed *discordgo.MessageEmbed) []*discordgo.MessageSend
func NewInlineEmbedField ¶
func NewInlineEmbedField(key string, value interface{}) *discordgo.MessageEmbedField
func QuoteMarkdown ¶
func RuneByIndex ¶
RuneByIndex returns the string index from the rune position Panics if utf8.RuneCountInString(s) <= runeIndex or runePos < 0
func SplitSendMessage ¶
func SplitSendMessage(message string) []*discordgo.MessageSend
SplitSendMessage is a helper for sending potentially long messages If the message is longer than 2k characters it will split at Last newline before 2k or last whitespace before 2k or if that fails (no whitespace) just split at 2k
func SplitSendMessagePS ¶
func SplitSendMessagePS(message string, prefix, suffix string, prefixStart, suffixEnd bool) []*discordgo.MessageSend
SplitSendMessagePS is a helper for sending potentially long messages If the message is longer than 2k characters it will split at Last newline before 2k or last whitespace before 2k or if that fails (no whitespace) just split at 2k Prefix is added to the start of each message sent (usefull for codeblocks), Prefix is not not added to the first one if prefixStart is false Suffix is added to the end of each message, and not the last message if suffixend is false Cancel the context to stop this process
Types ¶
type ManagedMessage ¶
type ManagedMessage struct {
// contains filtered or unexported fields
}
func NewManagedMessage ¶
func (*ManagedMessage) UpdateChannel ¶
func (m *ManagedMessage) UpdateChannel(channel string) (err error)
func (*ManagedMessage) UpdateMessage ¶
func (m *ManagedMessage) UpdateMessage(embed *discordgo.MessageEmbed) (err error)
type Permission ¶
type Permission int