messagesender

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL