Documentation ¶
Index ¶
- type AsyncMessage
- type BackendSignupMessageButtonConfiguration
- type BoostRequestMessenger
- func (messenger *BoostRequestMessenger) CancelDelayedMessage(id int64) error
- func (messenger *BoostRequestMessenger) Destroy()
- func (messenger *BoostRequestMessenger) SendAdvertiserChosenDMToAdvertiser(br *repository.BoostRequest) (*discordgo.Message, error)
- func (messenger *BoostRequestMessenger) SendAdvertiserChosenDMToRequester(br *repository.BoostRequest) (*discordgo.Message, error)
- func (messenger *BoostRequestMessenger) SendAutoSignupMessages(guildID string, userID string, expiresAt time.Time) ([]*repository.DelayedMessage, <-chan error)
- func (messenger *BoostRequestMessenger) SendBackendAdvertiserChosenMessage(br *repository.BoostRequest) ([]*discordgo.Message, error)
- func (messenger *BoostRequestMessenger) SendBackendSignupMessage(br *repository.BoostRequest, channelID string, ...) (*discordgo.Message, error)
- func (messenger *BoostRequestMessenger) SendBoostRequestCreatedDM(br *repository.BoostRequest) (*discordgo.Message, error)
- func (messenger *BoostRequestMessenger) SendCreditsUpdateDM(userID string, credits int) (*discordgo.Message, error)
- func (messenger *BoostRequestMessenger) SendLogChannelMessage(br *repository.BoostRequest, channelID string) (*discordgo.Message, error)
- func (messenger *BoostRequestMessenger) SendPreferredAdvertiserReminder(br *repository.BoostRequest) (*repository.DelayedMessage, <-chan error)
- func (messenger *BoostRequestMessenger) SendRoll(channelID string, br *repository.BoostRequest, ...) (*discordgo.Message, error)
- type DelayedMessage
- type DestinationType
- type DiscordSender
- type DiscordSenderAndDeleter
- type Message
- type MessageBroker
- func (mb *MessageBroker) Destroy()
- func (mb *MessageBroker) Send(dest *MessageDestination, mg MessageGenerator) (*discordgo.Message, error)
- func (mb *MessageBroker) SendDelayed(dest *MessageDestination, mg MessageGenerator, delay time.Duration, ...) (<-chan *discordgo.Message, <-chan error)
- func (mb *MessageBroker) SendTemporaryMessage(dest *MessageDestination, mg MessageGenerator, duration time.Duration) (*discordgo.Message, <-chan error)
- type MessageDestination
- type MessageGenerator
- type Sendable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncMessage ¶
type AsyncMessage struct {
// contains filtered or unexported fields
}
func NewAsyncMessage ¶
func NewAsyncMessage(sendable Sendable) *AsyncMessage
func (*AsyncMessage) Send ¶
func (m *AsyncMessage) Send(discord DiscordSender) (<-chan *discordgo.Message, <-chan error)
type BackendSignupMessageButtonConfiguration ¶
type BackendSignupMessageButtonConfiguration = messages.BackendSignupMessageButtonConfiguration
type BoostRequestMessenger ¶
type BoostRequestMessenger struct { Destroyed bool // contains filtered or unexported fields }
func NewBoostRequestMessenger ¶
func NewBoostRequestMessenger( discord *discordgo.Session, bundle *i18n.Bundle, delayedMessageRepository repository.DelayedMessageRepository, ) *BoostRequestMessenger
func (*BoostRequestMessenger) CancelDelayedMessage ¶
func (messenger *BoostRequestMessenger) CancelDelayedMessage(id int64) error
func (*BoostRequestMessenger) Destroy ¶
func (messenger *BoostRequestMessenger) Destroy()
func (*BoostRequestMessenger) SendAdvertiserChosenDMToAdvertiser ¶
func (messenger *BoostRequestMessenger) SendAdvertiserChosenDMToAdvertiser( br *repository.BoostRequest, ) (*discordgo.Message, error)
func (*BoostRequestMessenger) SendAdvertiserChosenDMToRequester ¶
func (messenger *BoostRequestMessenger) SendAdvertiserChosenDMToRequester( br *repository.BoostRequest, ) (*discordgo.Message, error)
func (*BoostRequestMessenger) SendAutoSignupMessages ¶
func (messenger *BoostRequestMessenger) SendAutoSignupMessages( guildID string, userID string, expiresAt time.Time, ) ([]*repository.DelayedMessage, <-chan error)
func (*BoostRequestMessenger) SendBackendAdvertiserChosenMessage ¶
func (messenger *BoostRequestMessenger) SendBackendAdvertiserChosenMessage( br *repository.BoostRequest, ) ([]*discordgo.Message, error)
func (*BoostRequestMessenger) SendBackendSignupMessage ¶
func (messenger *BoostRequestMessenger) SendBackendSignupMessage( br *repository.BoostRequest, channelID string, buttonConfiguration BackendSignupMessageButtonConfiguration, ) (*discordgo.Message, error)
func (*BoostRequestMessenger) SendBoostRequestCreatedDM ¶
func (messenger *BoostRequestMessenger) SendBoostRequestCreatedDM(br *repository.BoostRequest) (*discordgo.Message, error)
func (*BoostRequestMessenger) SendCreditsUpdateDM ¶
func (*BoostRequestMessenger) SendLogChannelMessage ¶
func (messenger *BoostRequestMessenger) SendLogChannelMessage( br *repository.BoostRequest, channelID string, ) (*discordgo.Message, error)
Logs the creation of a boost request to a channel only moderators can view
func (*BoostRequestMessenger) SendPreferredAdvertiserReminder ¶
func (messenger *BoostRequestMessenger) SendPreferredAdvertiserReminder(br *repository.BoostRequest) (*repository.DelayedMessage, <-chan error)
func (*BoostRequestMessenger) SendRoll ¶
func (messenger *BoostRequestMessenger) SendRoll( channelID string, br *repository.BoostRequest, rollResults *weighted_picker.WeightedPickerResults[string], ) (*discordgo.Message, error)
type DelayedMessage ¶
type DelayedMessage struct {
// contains filtered or unexported fields
}
func NewDelayedMessage ¶
func NewDelayedMessage(sendable Sendable, delay time.Duration, cancel <-chan struct{}) *DelayedMessage
func (*DelayedMessage) Send ¶
func (m *DelayedMessage) Send(discord DiscordSender) (*discordgo.Message, error)
type DestinationType ¶
type DestinationType int
const ( DestinationChannel DestinationType = iota DestinationUser )
type DiscordSender ¶
type DiscordSender interface {
// contains filtered or unexported methods
}
type DiscordSenderAndDeleter ¶
type DiscordSenderAndDeleter interface { DiscordSender // contains filtered or unexported methods }
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶
func NewMessage(dest *MessageDestination, mg MessageGenerator) *Message
type MessageBroker ¶
type MessageBroker struct {
// contains filtered or unexported fields
}
func NewMessageBroker ¶
func NewMessageBroker(discord DiscordSenderAndDeleter) *MessageBroker
func (*MessageBroker) Destroy ¶
func (mb *MessageBroker) Destroy()
func (*MessageBroker) Send ¶
func (mb *MessageBroker) Send(dest *MessageDestination, mg MessageGenerator) (*discordgo.Message, error)
func (*MessageBroker) SendDelayed ¶
func (mb *MessageBroker) SendDelayed( dest *MessageDestination, mg MessageGenerator, delay time.Duration, cancel <-chan struct{}, ) (<-chan *discordgo.Message, <-chan error)
func (*MessageBroker) SendTemporaryMessage ¶
func (mb *MessageBroker) SendTemporaryMessage(dest *MessageDestination, mg MessageGenerator, duration time.Duration) (*discordgo.Message, <-chan error)
type MessageDestination ¶
type MessageDestination struct { DestinationID string DestinationType DestinationType FallbackChannelID string }
func (*MessageDestination) ResolveChannelID ¶
func (dest *MessageDestination) ResolveChannelID(discord discordUserChannelCreate) (string, error)
type MessageGenerator ¶
type MessageGenerator interface {
Message() (*discordgo.MessageSend, error)
}
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_messenger is a generated GoMock package.
|
Package mock_messenger is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.