Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageSender ¶
type MessageSender struct {
// contains filtered or unexported fields
}
MessageSender represents a struct for broadcasting messages on a channel, holding essential information for broadcasting.
func New ¶
func New(interval time.Duration, channelName string, chatMessageSender chatClient, logger *zap.Logger) *MessageSender
New creates an instance of MessageSender for regularly sending messages in the chat.
func (*MessageSender) AddMessages ¶
func (ms *MessageSender) AddMessages(message ...string)
AddMessages adds a message to the list of broadcasted messages.
func (*MessageSender) Start ¶
func (ms *MessageSender) Start(ctx context.Context)
Start runs a cron job for posting messages on the chat. This method blocks the execution of your code, use Goroutine with this method.
Click to show internal directories.
Click to hide internal directories.