Documentation ¶
Index ¶
- Constants
- Variables
- func AddReactions(channelID, messageID int64) error
- func NextUpdateTime(m *models.RSVPSession) time.Time
- func ParticipantField(state ParticipantState, participants []*models.RSVPParticipant, ...) *discordgo.MessageEmbedField
- func RegisterPlugin()
- func UpdateEventEmbed(m *models.RSVPSession) error
- type ParticipantState
- type Plugin
- type SetupSession
- type SetupState
- type UpdatingSession
Constants ¶
View Source
const ( EmojiJoining = "✅" EmojiMaybe = "❔" EmojiNotJoining = "❌" EmojiWaitlist = "🕐" )
Variables ¶
View Source
var DBSchemas = []string{`
CREATE TABLE IF NOT EXISTS rsvp_sessions (
message_id BIGINT PRIMARY KEY,
guild_id BIGINT NOT NULL,
channel_id BIGINT NOT NULL,
local_id BIGINT NOT NULL,
author_id BIGINT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
starts_at TIMESTAMP WITH TIME ZONE NOT NULL,
title TEXT NOT NULL,
description TEXT NOT NULL,
max_participants INT NOT NULL,
send_reminders BOOLEAN NOT NULL,
sent_reminders BOOLEAN NOT NULL
);
`, `
CREATE TABLE IF NOT EXISTS rsvp_participants (
user_id BIGINT NOT NULL,
rsvp_sessions_message_id BIGINT NOT NULL REFERENCES rsvp_sessions(message_id) ON DELETE CASCADE,
guild_id BIGINT NOT NULL,
join_state SMALLINT NOT NULL,
reminder_enabled BOOLEAN NOT NULL,
marked_as_participating_at TIMESTAMP WITH TIME ZONE NOT NULL,
PRIMARY KEY(rsvp_sessions_message_id, user_id)
);
`}
View Source
var EventReactions = []string{EmojiJoining, EmojiNotJoining, EmojiWaitlist, EmojiMaybe}
View Source
var UTCRegex = regexp.MustCompile(`(?i)\butc\b`)
Functions ¶
func AddReactions ¶
func NextUpdateTime ¶
func NextUpdateTime(m *models.RSVPSession) time.Time
func ParticipantField ¶
func ParticipantField(state ParticipantState, participants []*models.RSVPParticipant, users []*dstate.MemberState, name string) *discordgo.MessageEmbedField
func RegisterPlugin ¶
func RegisterPlugin()
func UpdateEventEmbed ¶
func UpdateEventEmbed(m *models.RSVPSession) error
Types ¶
type ParticipantState ¶
type ParticipantState int16
const ( ParticipantStateJoining ParticipantState = 1 ParticipantStateMaybe ParticipantState = 2 ParticipantStateNotJoining ParticipantState = 3 ParticipantStateWaitlist ParticipantState = 4 )
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) AddCommands ¶
func (p *Plugin) AddCommands()
func (*Plugin) PluginInfo ¶
func (p *Plugin) PluginInfo() *common.PluginInfo
type SetupSession ¶
type SetupSession struct { CreatedOnMessageID int64 GuildID int64 AuthorID int64 SetupChannel int64 State SetupState MaxParticipants int Title string Channel int64 When time.Time LastAction time.Time // contains filtered or unexported fields }
func (*SetupSession) Finish ¶
func (s *SetupSession) Finish()
type SetupState ¶
type SetupState int
const ( SetupStateChannel SetupState = iota SetupStateTitle SetupStateMaxParticipants SetupStateWhen SetupStateWhenConfirm )
type UpdatingSession ¶
Spam update protection, forces 5 seconds between each update
Click to show internal directories.
Click to hide internal directories.