Documentation
¶
Index ¶
- Constants
- func GetTgBot(option TgBotOption) *tgbotapi.BotAPI
- func SendMessageDiscord(discordClient DiscordClient, message string) error
- func SendMessageSMTP(sender *Sender, message string)
- func SendMessageTG(bot *tgbotapi.BotAPI, id int64, message string) error
- type Author
- type DiscordClient
- type DiscordClientOptions
- type Embed
- type HttpRequestDoer
- type Notifier
- type PayloadWebHookDiscord
- type Sender
- func (sender Sender) SendMail(Dest []string, Subject, bodyMessage string)
- func (sender Sender) WriteEmail(dest []string, contentType, subject, bodyMessage string) string
- func (sender *Sender) WriteHTMLEmail(dest []string, subject, bodyMessage string) string
- func (sender *Sender) WritePlainEmail(dest []string, subject, bodyMessage string) string
- type TgBotOption
Constants ¶
View Source
const ( TELEGRAM = "telegram" DISCORD = "discord" SMTP = "smtp" )
View Source
const (
/**
Gmail SMTP Server
**/
SMTPServer = "smtp.gmail.com"
)
Variables ¶
This section is empty.
Functions ¶
func GetTgBot ¶
func GetTgBot(option TgBotOption) *tgbotapi.BotAPI
func SendMessageDiscord ¶
func SendMessageDiscord(discordClient DiscordClient, message string) error
func SendMessageSMTP ¶
Types ¶
type DiscordClient ¶
type DiscordClient interface { // PostMessage ... PostMessage(ctx context.Context, message string) error }
func NewDiscordClient ¶
func NewDiscordClient(options DiscordClientOptions) (DiscordClient, error)
NewDiscordClient ...
type DiscordClientOptions ¶
type DiscordClientOptions struct { // ServerHook url to use ServerHook string HttpClient *http.Client }
DiscordClientOptions ...
type HttpRequestDoer ¶
type PayloadWebHookDiscord ¶
type PayloadWebHookDiscord struct { Username string `json:"username,omitempty"` AvatarURL string `json:"avatar_url,omitempty"` Content string `json:"content,omitempty"` Embeds []Embed `json:"embeds,omitempty"` }
func (*PayloadWebHookDiscord) ToReader ¶
func (p *PayloadWebHookDiscord) ToReader() *strings.Reader
type TgBotOption ¶
Click to show internal directories.
Click to hide internal directories.