Documentation
¶
Index ¶
- Constants
- func AddNonEmpty[T any](m map[string]T, name string, value T)
- func AppendCommand(cmds []*discordgo.ApplicationCommand, cmdData [2]string, ...) (string, []*discordgo.ApplicationCommand)
- func AuthorizedCmd(s *discordgo.Session, i *discordgo.InteractionCreate, infos GuildAndConfInfo, ...)
- func BuildMsgWithNameValueList(baseMsg string, nameToValue map[string]string) string
- func CleanMessage(msg string) string
- func ExtractNick(member *discordgo.Member) (nick string)
- func IdInSet(ids []string, idSet StringSet) bool
- func IdMatch(ids []string, idToValue map[string]string, targetValue string) bool
- func InitChecker(rule string) func(string) bool
- func LaunchTickers(number int, interval time.Duration) []chan time.Time
- func LogBeforeShutdown()
- func MembersCmd(s *discordgo.Session, i *discordgo.InteractionCreate, ...)
- func ProcessMembers(guildMembers []*discordgo.Member, cmdEffect func(*discordgo.Member) int) int
- func SendTick(tickSender chan<- bool, interval time.Duration)
- func UpdateGameStatus(session *discordgo.Session, games []string, interval time.Duration)
- type ChannelSenderManager
- type Empty
- type GuildAndConfInfo
- type Messages
- type MultipartMessage
- type StringSet
Constants ¶
View Source
const ( CmdPlaceHolder = "{{cmd}}" NumErrorPlaceHolder = "{{numError}}" RolePlaceHolder = "{{role}}" GroupPlaceHolder = "{{group}}" )
View Source
const MemberCallLimit = 1000
max number of members returned by Discord API (as stated in Session.GuildMembers documentation)
Variables ¶
This section is empty.
Functions ¶
func AddNonEmpty ¶
func AppendCommand ¶
func AppendCommand(cmds []*discordgo.ApplicationCommand, cmdData [2]string, options []*discordgo.ApplicationCommandOption) (string, []*discordgo.ApplicationCommand)
func AuthorizedCmd ¶ added in v1.4.0
func AuthorizedCmd(s *discordgo.Session, i *discordgo.InteractionCreate, infos GuildAndConfInfo, cmdEffect func() string)
func CleanMessage ¶ added in v1.4.0
Remove "{{cmd}}" place holder and replace multiple space in row by one space
func ExtractNick ¶
func InitChecker ¶
func LogBeforeShutdown ¶ added in v1.4.0
func LogBeforeShutdown()
func MembersCmd ¶
func MembersCmd(s *discordgo.Session, i *discordgo.InteractionCreate, messageSender chan<- MultipartMessage, infos GuildAndConfInfo, msgs Messages, cmdEffect func(*discordgo.Member))
func ProcessMembers ¶ added in v1.4.0
Types ¶
type ChannelSenderManager ¶
type ChannelSenderManager struct {
// contains filtered or unexported fields
}
func MakeChannelSenderManager ¶
func MakeChannelSenderManager(session *discordgo.Session) ChannelSenderManager
func (ChannelSenderManager) AddChannel ¶
func (m ChannelSenderManager) AddChannel(channelId string)
func (ChannelSenderManager) Get ¶
func (m ChannelSenderManager) Get(channelId string) chan<- MultipartMessage
type GuildAndConfInfo ¶
type GuildAndConfInfo struct { GuildId string OwnerId string DefaultRoleId string AuthorizedRoleIds StringSet ForbiddenRoleIds StringSet IgnoredRoleIds StringSet ForbiddenAndignoredRoleIds StringSet AdminitrativeRoleIds StringSet CmdRoleIds StringSet SpecialRoleIds StringSet RoleIdToPrefix map[string]string Prefixes []string RoleIdToDisplayName map[string]string Msgs Messages }
type Messages ¶ added in v1.4.0
type Messages struct { Ok string ErrGlobalCmd string ErrPartialCmd string Count string Prefix string NoChange string EndedCmd string Owner string ErrGlobal string ErrPartial string }
func (Messages) ReplaceCmdPlaceHolder ¶ added in v1.4.0
type MultipartMessage ¶
Click to show internal directories.
Click to hide internal directories.