Documentation ¶
Index ¶
- Constants
- func Address2Hash(address string, port int) (string, error)
- func RolePanelV2EditMenuEmbed[T rolePanelV2MessageBuilder[T]](r *RolePanelV2, locale discord.Locale, edit *RolePanelV2Edit, message T) T
- func RolePanelV2MessageButton[T rolePanelV2MessageBuilder[T]](r *RolePanelV2, locale discord.Locale, message T, config RolePanelV2Config) T
- func RolePanelV2MessageReaction[T rolePanelV2MessageBuilder[T]](r *RolePanelV2, locale discord.Locale, message T) T
- func RolePanelV2MessageSelectMenu[T rolePanelV2MessageBuilder[T]](r *RolePanelV2, locale discord.Locale, message T, config RolePanelV2Config) T
- func RolePanelV2PlaceMenuEmbed[T rolePanelV2MessageBuilder[T]](r *RolePanelV2, locale discord.Locale, place *RolePanelV2Place, message T) T
- type BumpStatus
- type Calc
- func (c *Calc) Back()
- func (c *Calc) CE()
- func (c Calc) Component() []discord.ContainerComponent
- func (c *Calc) Divide()
- func (c *Calc) Do()
- func (c Calc) ID() uuid.UUID
- func (c Calc) Indicator() CalcIndicator
- func (c *Calc) InputDo()
- func (c Calc) MarshalJSON() ([]byte, error)
- func (c *Calc) Message(formatter func([]discord.Embed) []discord.Embed) (discord.MessageCreate, error)
- func (c *Calc) Minus()
- func (c *Calc) Multiple()
- func (c *Calc) Plus()
- func (c *Calc) Reset()
- func (c *Calc) UnmarshalJSON(b []byte) error
- type CalcDB
- type CalcDBImpl
- type CalcIndicator
- type CalcMode
- type DB
- type DBConfig
- type EmbedDialog
- type EmbedDialogDB
- type GuildData
- type GuildDataConfig
- type GuildDataDB
- type GuildDataRolePanel
- type GuildDataUserLevel
- type GuildMessagePins
- type InteractionsDB
- type Mee6Guild
- type Mee6LeaderBoard
- type Mee6MonetizeOptions
- type Mee6Player
- type MessagePin
- type MessagePinDB
- type MessageSuffix
- type MessageSuffixRuleType
- type MinecraftPingResponse
- type MinecraftServer
- type MinecraftServerDB
- type MinecraftServerType
- type MinecraftStatusPanel
- type MinecraftStatusPanelDB
- type NoticeSchedule
- type NoticeScheduleBump
- type NoticeScheduleDB
- type NoticeScheduleType
- type Poll
- func (p *Poll) MessageComponent() []discord.ContainerComponent
- func (p *Poll) MessageEmbed() []discord.Embed
- func (p *Poll) SeeInfoComponent(tokenID uuid.UUID) []discord.ContainerComponent
- func (p *Poll) SeeResultComponent(tokenID uuid.UUID) []discord.ContainerComponent
- func (p *Poll) VoteComponent(tokenID uuid.UUID) []discord.ContainerComponent
- type PollChoice
- type PollCreate
- func (p *PollCreate) ChangeSettingsMenuComponent(t PollSettingsType) []discord.ContainerComponent
- func (v *PollCreate) Components() []discord.ContainerComponent
- func (v *PollCreate) ConfigEmbed() []discord.Embed
- func (p *PollCreate) CreatePoll(user discord.User) Poll
- func (p *PollCreate) EditChoiceComponent(choiceID uuid.UUID) []discord.ContainerComponent
- func (p *PollCreate) EditChoiceEmbed(choiceID uuid.UUID) []discord.Embed
- func (p *PollCreate) EditSettingsComponent() []discord.ContainerComponent
- func (p *PollCreate) EditSettingsEmbed() []discord.Embed
- type PollCreateChoice
- type PollCreateDB
- type PollDB
- type PollSettingShowType
- type PollSettings
- type PollSettingsBool
- type PollSettingsType
- type RolePanel
- func (r *RolePanel) BuildMessage(format func([]discord.Embed) []discord.Embed) discord.MessageCreate
- func (r RolePanel) MarshalJSON() ([]byte, error)
- func (r *RolePanel) UnmarshalJSON(data []byte) error
- func (r *RolePanel) UseMessage(format func([]discord.Embed) []discord.Embed, member discord.Member) discord.MessageCreate
- type RolePanelCreate
- func (r *RolePanelCreate) AddRoleMenuComponent() []discord.ContainerComponent
- func (r *RolePanelCreate) AddRoleMenuEmbed() []discord.Embed
- func (r RolePanelCreate) BackMainMenuButton() discord.ButtonComponent
- func (r RolePanelCreate) BaseMenuComponent() []discord.ContainerComponent
- func (r RolePanelCreate) BaseMenuEmbed() []discord.Embed
- func (r *RolePanelCreate) DeleteRole(id snowflake.ID)
- func (r *RolePanelCreate) EditPanelSettingsComponent() []discord.ContainerComponent
- func (r *RolePanelCreate) EditPanelSettingsEmbed() []discord.Embed
- func (r *RolePanelCreate) EditRoleMenuComponent(id snowflake.ID) discord.ContainerComponent
- func (r *RolePanelCreate) EditRoleMenuEmbed(id snowflake.ID) []discord.Embed
- func (r RolePanelCreate) GetRole(id snowflake.ID) (RolePanelCreateRole, bool)
- func (r RolePanelCreate) GetRoles() map[snowflake.ID]RolePanelCreateRole
- func (r RolePanelCreate) MarshalJSON() ([]byte, error)
- func (r *RolePanelCreate) SetRole(label, description string, roleID snowflake.ID, emoji *discord.ComponentEmoji)
- func (r *RolePanelCreate) UUID() uuid.UUID
- func (r *RolePanelCreate) UnmarshalJSON(b []byte) error
- func (r *RolePanelCreate) Validate()
- type RolePanelCreateDB
- type RolePanelCreateRole
- type RolePanelDB
- type RolePanelV2
- type RolePanelV2Config
- type RolePanelV2DB
- type RolePanelV2Edit
- type RolePanelV2EditDB
- type RolePanelV2Place
- type RolePanelV2PlaceDB
- type RolePanelV2Role
- type RolePanelV2Type
- type UserData
- type UserDataDB
- type UserDataLevel
- type UserLocation
Constants ¶
View Source
const ( MessageSuffixRuleTypeWarning = iota MessageSuffixRuleTypeDelete MessageSuffixRuleTypeWebhook )
View Source
const ( MinecraftServerTypeJava = "java" MinecraftServerTypeBedrock = "bedrock" )
View Source
const ( PollSettingShowTypeAlways = iota PollSettingShowTypeNever PollSettingShowTypeAfterVote )
View Source
const ( RolePanelV2TypeNone = "" RolePanelV2TypeReaction = "reaction" RolePanelV2TypeSelectMenu = "select_menu" RolePanelV2TypeButton = "button" )
View Source
const GuildDataVersion = 11
View Source
const (
NoticeScheduleTypeBump = iota + 1
)
View Source
const UserDataVersion = 1
Variables ¶
This section is empty.
Functions ¶
func RolePanelV2EditMenuEmbed ¶
func RolePanelV2EditMenuEmbed[T rolePanelV2MessageBuilder[T]](r *RolePanelV2, locale discord.Locale, edit *RolePanelV2Edit, message T) T
func RolePanelV2MessageButton ¶
func RolePanelV2MessageButton[T rolePanelV2MessageBuilder[T]](r *RolePanelV2, locale discord.Locale, message T, config RolePanelV2Config) T
func RolePanelV2MessageReaction ¶
func RolePanelV2MessageReaction[T rolePanelV2MessageBuilder[T]](r *RolePanelV2, locale discord.Locale, message T) T
func RolePanelV2MessageSelectMenu ¶
func RolePanelV2MessageSelectMenu[T rolePanelV2MessageBuilder[T]](r *RolePanelV2, locale discord.Locale, message T, config RolePanelV2Config) T
func RolePanelV2PlaceMenuEmbed ¶
func RolePanelV2PlaceMenuEmbed[T rolePanelV2MessageBuilder[T]](r *RolePanelV2, locale discord.Locale, place *RolePanelV2Place, message T) T
Types ¶
type BumpStatus ¶
type BumpStatus struct { BumpEnabled bool `json:"bump_enabled"` BumpChannel *snowflake.ID `json:"bump_channel"` BumpRole *snowflake.ID `json:"bump_role"` BumpMessage [2]string `json:"bump_message"` BumpRemind [2]string `json:"bump_remind"` LastBump time.Time `json:"last_bump"` LastBumpChannel *snowflake.ID `json:"last_bump_channel"` UpEnabled bool `json:"up_enabled"` UpChannel *snowflake.ID `json:"up_channel"` UpRole *snowflake.ID `json:"up_role"` UpMessage [2]string `json:"up_message"` UpRemind [2]string `json:"up_remind"` LastUp time.Time `json:"last_up"` LastUpChannel *snowflake.ID `json:"last_up_channel"` BumpCountMap map[snowflake.ID]uint64 `json:"bump_count_map"` UpCountMap map[snowflake.ID]uint64 `json:"up_count_map"` }
type Calc ¶
type Calc struct { Input string LastInput string Mode CalcMode // contains filtered or unexported fields }
func (Calc) Component ¶
func (c Calc) Component() []discord.ContainerComponent
func (Calc) Indicator ¶
func (c Calc) Indicator() CalcIndicator
func (Calc) MarshalJSON ¶
func (*Calc) UnmarshalJSON ¶
type CalcDBImpl ¶
type CalcDBImpl struct {
// contains filtered or unexported fields
}
type CalcIndicator ¶
type CalcIndicator rune
const ( CalcIndicatorNone CalcIndicator = '_' CalcIndicatorPlus CalcIndicator = '+' CalcIndicatorMinus CalcIndicator = '-' CalcIndicatorMultiple CalcIndicator = '×' CalcIndicatorDivide CalcIndicator = '÷' CalcIndicatorPercent CalcIndicator = '%' )
type DB ¶
type DB interface { Close() error PollCreate() PollCreateDB Poll() PollDB RolePanelCreate() RolePanelCreateDB RolePanel() RolePanelDB GuildData() GuildDataDB Calc() CalcDB MessagePin() MessagePinDB EmbedDialog() EmbedDialogDB UserData() UserDataDB MinecraftServer() MinecraftServerDB MinecraftStatusPanel() MinecraftStatusPanelDB NoticeSchedule() NoticeScheduleDB RolePanelV2() RolePanelV2DB RolePanelV2Edit() RolePanelV2EditDB RolePanelV2Place() RolePanelV2PlaceDB Interactions() InteractionsDB }
func SetupDatabase ¶
type EmbedDialog ¶
type EmbedDialog struct { ID uuid.UUID `json:"id"` HandlerName string `json:"handler_name"` Locale discord.Locale `json:"locale"` InteractionToken interactions.Token `json:"interaction_token"` *discord.EmbedBuilder `json:"embed"` }
func NewEmbedDialog ¶
func NewEmbedDialog(handler_name string, interaction_token interactions.Token, locale discord.Locale) *EmbedDialog
func (EmbedDialog) BaseMenu ¶
func (e EmbedDialog) BaseMenu() (mes discord.MessageUpdate)
func (EmbedDialog) TitleDescriptionMenu ¶
func (e EmbedDialog) TitleDescriptionMenu() (mes discord.MessageUpdate)
type EmbedDialogDB ¶
type GuildData ¶
type GuildData struct { ID snowflake.ID `json:"id"` RolePanel map[uuid.UUID]GuildDataRolePanel `json:"role_panel"` RolePanelLimit int `json:"role_panel_limit"` UserPermissions map[snowflake.ID]permissions.Permission `json:"user_permissions"` RolePermissions map[snowflake.ID]permissions.Permission `json:"role_permissions"` UserLevels map[snowflake.ID]GuildDataUserLevel `json:"user_levels"` Config GuildDataConfig `json:"config"` BumpStatus BumpStatus `json:"bump_status"` MCStatusPanel map[uuid.UUID]string `json:"mc_status_panel"` MCStatusPanelName map[string]int `json:"mc_status_panel_name"` MCStatusPanelMax int `json:"mc_status_panel_max"` MessageSuffix map[snowflake.ID]MessageSuffix `json:"message_suffix"` UserLevelExcludeChannels map[snowflake.ID]string `json:"user_level_exclude_channels"` RolePanelV2 map[uuid.UUID]string `json:"role_panel_v2"` RolePanelV2Name map[string]int `json:"role_panel_v2_name"` RolePanelV2Placed map[string]uuid.UUID `json:"role_panel_v2_placed"` RolePanelV2PlacedConfig map[string]RolePanelV2Config `json:"role_panel_v2_placed_config"` RolePanelV2Limit int `json:"role_panel_v2_limit"` RolePanelV2Editing map[uuid.UUID]uuid.UUID `json:"role_panel_v2_editing"` RolePanelV2EditingEmoji map[uuid.UUID][2]snowflake.ID `json:"role_panel_v2_emoji"` DataVersion *int `json:"data_version,omitempty"` }
func NewGuildData ¶
func NewGuildData(id snowflake.ID) GuildData
func (*GuildData) UnmarshalJSON ¶
type GuildDataConfig ¶
type GuildDataConfig struct { LevelUpMessage string `json:"level_up_message"` LevelUpMessageChannel *snowflake.ID `json:"level_up_message_channel"` }
type GuildDataDB ¶
type GuildDataRolePanel ¶
type GuildDataRolePanel struct {
OnList bool `json:"on_list"`
}
type GuildDataUserLevel ¶
type GuildDataUserLevel struct { UserDataLevel MessageCount int64 `json:"message_count"` LastMessageTime time.Time `json:"last_message_time"` }
func NewGuildDataUserLevel ¶
func NewGuildDataUserLevel() GuildDataUserLevel
type GuildMessagePins ¶
type GuildMessagePins struct { Enabled bool `json:"enabled"` Pins map[snowflake.ID]MessagePin `json:"pins"` }
func NewMessagePin ¶
func NewMessagePin() *GuildMessagePins
type InteractionsDB ¶
type Mee6Guild ¶
type Mee6Guild struct { AllowJoin bool `json:"allow_join"` ApplicationCommandsEnabled bool `json:"application_commands_enabled"` CommandsPrefix string `json:"commands_prefix"` Icon string `json:"icon"` ID string `json:"id"` InviteLeaderboard bool `json:"invite_leaderboard"` LeaderboardURL string `json:"leaderboard_url"` Name string `json:"name"` Premium bool `json:"premium"` }
type Mee6LeaderBoard ¶
type Mee6LeaderBoard struct { Admin bool `json:"admin"` BannerURL *string `json:"banner_url"` Country string `json:"country"` Guild Mee6Guild `json:"guild"` IsMember bool `json:"is_member"` MonetizeOptions Mee6MonetizeOptions `json:"monetize_options"` Page int `json:"page"` Player *Mee6Player `json:"player"` Players []Mee6Player `json:"players"` RoleRewards []any `json:"role_rewards"` UserGuildSettings any `json:"user_guild_settings"` XpPerMessage []int `json:"xp_per_message"` XpRate float64 `json:"xp_rate"` }
type Mee6MonetizeOptions ¶
type Mee6Player ¶
type Mee6Player struct { Avatar string `json:"avatar"` DetailedXp []int64 `json:"detailed_xp"` Discriminator string `json:"discriminator"` GuildID string `json:"guild_id"` ID snowflake.ID `json:"id"` IsMonetizeSubscriber bool `json:"is_monetize_subscriber"` Level int64 `json:"level"` MessageCount int64 `json:"message_count"` MonetizeXpBoost int64 `json:"monetize_xp_boost"` Username string `json:"username"` Xp int64 `json:"xp"` }
type MessagePin ¶
type MessagePin struct { WebhookMessageCreate discord.WebhookMessageCreate `json:"webhook_message_create"` ChannelID snowflake.ID `json:"channel_id"` LastMessageID *snowflake.ID `json:"last_message_id"` // contains filtered or unexported fields }
func (*MessagePin) CheckLimit ¶ added in v0.12.3
func (m *MessagePin) CheckLimit() bool
type MessagePinDB ¶
type MessagePinDB interface { Get(id snowflake.ID) (*GuildMessagePins, error) GetAll() (map[snowflake.ID]*GuildMessagePins, error) Set(id snowflake.ID, data *GuildMessagePins) error Del(id snowflake.ID) error }
type MessageSuffix ¶
type MessageSuffix struct { Target snowflake.ID `json:"target"` Suffix string `json:"suffix"` RuleType MessageSuffixRuleType `json:"rule_type"` }
func NewMessageSuffix ¶
func NewMessageSuffix(target snowflake.ID, suffix string, rule MessageSuffixRuleType) MessageSuffix
type MessageSuffixRuleType ¶
type MessageSuffixRuleType int
type MinecraftPingResponse ¶
type MinecraftPingResponse struct { ping.Infos Latency int64 Type MinecraftServerType `json:"type"` Succeed bool `json:"succeed"` }
func (MinecraftPingResponse) AnsiDescription ¶
func (r MinecraftPingResponse) AnsiDescription() string
type MinecraftServer ¶
type MinecraftServer struct { Hash string `json:"hash"` Type MinecraftServerType `json:"type"` Address string `json:"address"` Port uint16 `json:"port"` WatchingGuilds []snowflake.ID `json:"watching_guilds"` LastResponseTime time.Time `json:"last_response_time"` LastResponse *MinecraftPingResponse `json:"last_response"` }
func NewMinecraftServer ¶
func NewMinecraftServer(hash, address string, port uint16, s_type MinecraftServerType) MinecraftServer
func (*MinecraftServer) Fetch ¶
func (ms *MinecraftServer) Fetch() (r *MinecraftPingResponse, err error)
func (MinecraftServer) String ¶
func (m MinecraftServer) String() string
type MinecraftServerDB ¶
type MinecraftServerDB interface { Set(hash string, server MinecraftServer) error Get(hash string) (MinecraftServer, error) GetAll() ([]MinecraftServer, error) Del(hash string) error }
type MinecraftServerType ¶
type MinecraftServerType string
type MinecraftStatusPanel ¶
type MinecraftStatusPanel struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Hash string `json:"hash"` IsShowAddress bool `json:"is_show_address"` GuildID snowflake.ID `json:"guild_id"` ChannelID snowflake.ID `json:"channel_id"` MessageID snowflake.ID `json:"message_id"` }
func NewMinecraftStatusPanel ¶
func NewMinecraftStatusPanel(name string, guildID, channelID, messageID snowflake.ID, hash string, showAddress bool) MinecraftStatusPanel
func (MinecraftStatusPanel) Components ¶
func (m MinecraftStatusPanel) Components() []discord.ContainerComponent
func (MinecraftStatusPanel) Embed ¶
func (m MinecraftStatusPanel) Embed(address string, response *MinecraftPingResponse) discord.Embed
type MinecraftStatusPanelDB ¶
type NoticeSchedule ¶
type NoticeSchedule interface { Type() NoticeScheduleType ID() uuid.UUID }
func NewNoticeScheduleBump ¶
func NewNoticeScheduleBump(is_up bool, guildID, channelID snowflake.ID, schedule_time time.Time) NoticeSchedule
type NoticeScheduleBump ¶
type NoticeScheduleBump struct { IsUp bool `json:"is_up"` GuildID snowflake.ID `json:"guild_id"` ChannelID snowflake.ID `json:"channel_id"` ScheduledTime time.Time `json:"scheduled_time"` // contains filtered or unexported fields }
func (NoticeScheduleBump) ID ¶
func (n NoticeScheduleBump) ID() uuid.UUID
func (NoticeScheduleBump) MarshalJSON ¶
func (n NoticeScheduleBump) MarshalJSON() ([]byte, error)
func (NoticeScheduleBump) Type ¶
func (n NoticeScheduleBump) Type() NoticeScheduleType
func (*NoticeScheduleBump) UnmarshalJSON ¶
func (n *NoticeScheduleBump) UnmarshalJSON(data []byte) error
type NoticeScheduleDB ¶
type NoticeScheduleDB interface { Set(id uuid.UUID, data NoticeSchedule) error Get(id uuid.UUID) (NoticeSchedule, error) GetAll() ([]NoticeSchedule, error) GetByType(t NoticeScheduleType) ([]NoticeSchedule, error) Del(id uuid.UUID) error }
type NoticeScheduleType ¶
type NoticeScheduleType int
func (NoticeScheduleType) String ¶
func (t NoticeScheduleType) String() string
type Poll ¶
type Poll struct { Username string `json:"username"` UserAvatar string `json:"user_avatar"` Users map[snowflake.ID]bool `json:"users"` ID uuid.UUID `json:"id"` MessageID snowflake.ID `json:"message_id"` GuildId snowflake.ID `json:"guild_id"` ChannelID snowflake.ID Title string `json:"title"` Description string `json:"description"` EndAt int64 `json:"end_at"` MaxChoice int `json:"max"` MinChoice int `json:"min"` Choices map[uuid.UUID]PollChoice `json:"choices"` Locale discord.Locale `json:"locale"` Settings PollSettings `json:"settings"` Finished bool `json:"finished"` }
func (*Poll) MessageComponent ¶
func (p *Poll) MessageComponent() []discord.ContainerComponent
func (*Poll) MessageEmbed ¶
func (*Poll) SeeInfoComponent ¶
func (p *Poll) SeeInfoComponent(tokenID uuid.UUID) []discord.ContainerComponent
func (*Poll) SeeResultComponent ¶
func (p *Poll) SeeResultComponent(tokenID uuid.UUID) []discord.ContainerComponent
func (*Poll) VoteComponent ¶
func (p *Poll) VoteComponent(tokenID uuid.UUID) []discord.ContainerComponent
type PollChoice ¶
type PollCreate ¶
type PollCreate struct { ID uuid.UUID `json:"id"` Title string `json:"title"` Description string `json:"description"` EndAt int64 `json:"time_limit"` MaxChoice int `json:"max"` MinChoice int `json:"min"` Choices map[uuid.UUID]PollCreateChoice `json:"choices"` Locale discord.Locale `json:"locale"` Settings PollSettings `json:"settings"` }
func (*PollCreate) ChangeSettingsMenuComponent ¶
func (p *PollCreate) ChangeSettingsMenuComponent(t PollSettingsType) []discord.ContainerComponent
func (*PollCreate) Components ¶
func (v *PollCreate) Components() []discord.ContainerComponent
func (*PollCreate) ConfigEmbed ¶
func (v *PollCreate) ConfigEmbed() []discord.Embed
func (*PollCreate) CreatePoll ¶
func (p *PollCreate) CreatePoll(user discord.User) Poll
func (*PollCreate) EditChoiceComponent ¶
func (p *PollCreate) EditChoiceComponent(choiceID uuid.UUID) []discord.ContainerComponent
func (*PollCreate) EditChoiceEmbed ¶
func (p *PollCreate) EditChoiceEmbed(choiceID uuid.UUID) []discord.Embed
func (*PollCreate) EditSettingsComponent ¶
func (p *PollCreate) EditSettingsComponent() []discord.ContainerComponent
func (*PollCreate) EditSettingsEmbed ¶
func (p *PollCreate) EditSettingsEmbed() []discord.Embed
type PollCreateChoice ¶
type PollCreateDB ¶
type PollSettingShowType ¶
type PollSettingShowType int
type PollSettings ¶
type PollSettings struct { ShowUser PollSettingShowType `json:"show_user"` ShowCount PollSettingShowType `json:"show_count"` ShowTotalCount PollSettingsBool `json:"show_total_count"` ShowUserInResult PollSettingsBool `json:"show_user_in_result"` CanChangeTarget PollSettingsBool `json:"can_change_target"` }
type PollSettingsBool ¶
type PollSettingsBool bool
func (PollSettingsBool) EmojiString ¶
func (p PollSettingsBool) EmojiString() string
type PollSettingsType ¶
type PollSettingsType int
const ( PollSettingsTypeShowUser PollSettingsType = iota + 1 PollSettingsTypeShowCount PollSettingsTypeShowTotalCount PollSettingsTypeShowUserInResult PollSettingsTypeCanChangeTarget )
type RolePanel ¶
type RolePanel struct { *RolePanelCreate `json:"role_data"` ChannelID snowflake.ID `json:"channel_id"` MessageID snowflake.ID `json:"message_id"` GuildID snowflake.ID `json:"guild_id"` }
func NewRolePanel ¶
func NewRolePanel(panel RolePanelCreate) RolePanel
func (*RolePanel) BuildMessage ¶
func (RolePanel) MarshalJSON ¶
func (*RolePanel) UnmarshalJSON ¶
type RolePanelCreate ¶
type RolePanelCreate struct { Name string Description string Max int Min int // contains filtered or unexported fields }
func NewRolePanelCreate ¶
func NewRolePanelCreate(name, description string, locale discord.Locale) RolePanelCreate
func (*RolePanelCreate) AddRoleMenuComponent ¶
func (r *RolePanelCreate) AddRoleMenuComponent() []discord.ContainerComponent
func (*RolePanelCreate) AddRoleMenuEmbed ¶
func (r *RolePanelCreate) AddRoleMenuEmbed() []discord.Embed
func (RolePanelCreate) BackMainMenuButton ¶
func (r RolePanelCreate) BackMainMenuButton() discord.ButtonComponent
func (RolePanelCreate) BaseMenuComponent ¶
func (r RolePanelCreate) BaseMenuComponent() []discord.ContainerComponent
func (RolePanelCreate) BaseMenuEmbed ¶
func (r RolePanelCreate) BaseMenuEmbed() []discord.Embed
func (*RolePanelCreate) DeleteRole ¶
func (r *RolePanelCreate) DeleteRole(id snowflake.ID)
func (*RolePanelCreate) EditPanelSettingsComponent ¶
func (r *RolePanelCreate) EditPanelSettingsComponent() []discord.ContainerComponent
func (*RolePanelCreate) EditPanelSettingsEmbed ¶
func (r *RolePanelCreate) EditPanelSettingsEmbed() []discord.Embed
func (*RolePanelCreate) EditRoleMenuComponent ¶
func (r *RolePanelCreate) EditRoleMenuComponent(id snowflake.ID) discord.ContainerComponent
func (*RolePanelCreate) EditRoleMenuEmbed ¶
func (r *RolePanelCreate) EditRoleMenuEmbed(id snowflake.ID) []discord.Embed
func (RolePanelCreate) GetRole ¶
func (r RolePanelCreate) GetRole(id snowflake.ID) (RolePanelCreateRole, bool)
func (RolePanelCreate) GetRoles ¶
func (r RolePanelCreate) GetRoles() map[snowflake.ID]RolePanelCreateRole
func (RolePanelCreate) MarshalJSON ¶
func (r RolePanelCreate) MarshalJSON() ([]byte, error)
func (*RolePanelCreate) SetRole ¶
func (r *RolePanelCreate) SetRole(label, description string, roleID snowflake.ID, emoji *discord.ComponentEmoji)
func (*RolePanelCreate) UUID ¶
func (r *RolePanelCreate) UUID() uuid.UUID
func (*RolePanelCreate) UnmarshalJSON ¶
func (r *RolePanelCreate) UnmarshalJSON(b []byte) error
func (*RolePanelCreate) Validate ¶
func (r *RolePanelCreate) Validate()
type RolePanelCreateDB ¶
type RolePanelCreateDB interface { Get(uuid.UUID) (RolePanelCreate, error) Set(RolePanelCreate) error Del(uuid.UUID) error }
type RolePanelCreateRole ¶
type RolePanelCreateRole struct { Label string Description string RoleID snowflake.ID Emoji discord.ComponentEmoji // contains filtered or unexported fields }
func (RolePanelCreateRole) MarshalJSON ¶
func (r RolePanelCreateRole) MarshalJSON() ([]byte, error)
func (RolePanelCreateRole) Position ¶
func (r RolePanelCreateRole) Position() int
func (*RolePanelCreateRole) UnmarshalJSON ¶
func (r *RolePanelCreateRole) UnmarshalJSON(b []byte) error
type RolePanelDB ¶
type RolePanelV2 ¶
type RolePanelV2 struct { ID uuid.UUID `json:"uuid"` Name string `json:"name"` Description string `json:"description"` Roles []RolePanelV2Role `json:"roles"` }
func NewRolePanelV2 ¶
func NewRolePanelV2(name, description string) *RolePanelV2
func (*RolePanelV2) AddRole ¶
func (r *RolePanelV2) AddRole(id snowflake.ID, name string, emoji *discord.ComponentEmoji) bool
type RolePanelV2Config ¶
type RolePanelV2Config struct { PanelType RolePanelV2Type `json:"panel_type"` ButtonStyle discord.ButtonStyle `json:"button_style"` ButtonShowName bool `json:"show_name"` SimpleSelectMenu bool `json:"simple_select_menu"` }
func NewRolePanelV2Config ¶
func NewRolePanelV2Config() RolePanelV2Config
type RolePanelV2DB ¶
type RolePanelV2Edit ¶
type RolePanelV2Edit struct { ID uuid.UUID `json:"id"` CreatedAt time.Time `json:"created_at"` RolePanelID uuid.UUID `json:"role_panel_id"` GuildID snowflake.ID `json:"guild_id"` ChannelID snowflake.ID `json:"channel_id"` MessageID snowflake.ID `json:"message_id"` InteractionToken interactions.Token `json:"interaction_token"` EmojiMode bool `json:"emoji_mode"` EmojiLocale discord.Locale `json:"emoji_locale"` SelectedID *snowflake.ID }
func NewRolePanelV2Edit ¶
func NewRolePanelV2Edit(rolePanelID uuid.UUID, guildID, channelID snowflake.ID, token interactions.Token) *RolePanelV2Edit
func (RolePanelV2Edit) HasSelectedRole ¶
func (r RolePanelV2Edit) HasSelectedRole() bool
func (RolePanelV2Edit) IsSelected ¶
func (r RolePanelV2Edit) IsSelected(id snowflake.ID) bool
type RolePanelV2EditDB ¶
type RolePanelV2Place ¶
type RolePanelV2Place struct { ID uuid.UUID `json:"id"` CreatedAt time.Time `json:"created_at"` GuildID snowflake.ID `json:"guild_id"` PanelID uuid.UUID `json:"panel_id"` Config RolePanelV2Config `json:"config"` InteractionToken interactions.Token `json:"interaction_token"` }
func NewRolePanelV2Place ¶
func NewRolePanelV2Place(guild_id snowflake.ID, panel_id uuid.UUID, interaction_token interactions.Token) *RolePanelV2Place
type RolePanelV2PlaceDB ¶
type RolePanelV2Role ¶
type RolePanelV2Role struct { RoleID snowflake.ID `json:"role_id"` RoleName string `json:"role_name"` Emoji *discord.ComponentEmoji `json:"emoji"` }
type RolePanelV2Type ¶
type RolePanelV2Type string
type UserData ¶
type UserData struct { ID snowflake.ID `json:"id"` CreatedAt time.Time `json:"created_at"` BirthDay [2]int `json:"birth_day"` Location UserLocation `json:"location"` Locale discord.Locale `json:"locale"` LastMessageTime time.Time `json:"last_message_time"` MessageCount int64 `json:"message_count"` GlobalLevel UserDataLevel `json:"global_level"` GlobalMessageLevel UserDataLevel `json:"global_message_level"` GlobalVoiceLevel UserDataLevel `json:"global_voice_level"` DataVersion int `json:"data_version"` }
func NewUserData ¶
func (*UserData) UnmarshalJSON ¶
type UserDataDB ¶
type UserDataLevel ¶
func NewUserDataLevel ¶
func NewUserDataLevel() UserDataLevel
func (*UserDataLevel) Add ¶
func (u *UserDataLevel) Add(i *big.Int)
func (*UserDataLevel) AddRandom ¶
func (u *UserDataLevel) AddRandom()
func (UserDataLevel) Level ¶
func (u UserDataLevel) Level() *big.Int
func (UserDataLevel) ReqPoint ¶
func (u UserDataLevel) ReqPoint() *big.Int
func (UserDataLevel) SumReqPoint ¶
func (u UserDataLevel) SumReqPoint() *big.Int
type UserLocation ¶
func NewUserLocation ¶
func NewUserLocation(str string) (UserLocation, error)
func (UserLocation) MarshalJSON ¶
func (u UserLocation) MarshalJSON() ([]byte, error)
func (*UserLocation) UnmarshalJSON ¶
func (u *UserLocation) UnmarshalJSON(b []byte) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.