notification

package
v0.0.0-...-583d1ee Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package notification provides implementations for various notification services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTelegram

func NewTelegram(controller *order.Controller, settings *core.Settings, log core.Logger, options ...Option) (
	core.NotifierWithStart,
	error,
)

NewTelegram creates and initializes a new Telegram service

Types

type Mail

type Mail struct {
	// contains filtered or unexported fields
}

Mail handles email notifications for the application

func NewMail

func NewMail(params MailParams, log core.Logger) Mail

NewMail creates a new Mail instance with the provided parameters

func (Mail) Notify

func (m Mail) Notify(text string)

Notify sends an email notification with the given text

func (Mail) OnError

func (m Mail) OnError(err error)

OnError sends an error notification

func (Mail) OnOrder

func (m Mail) OnOrder(order core.Order)

OnOrder sends an order notification based on its status

type MailParams

type MailParams struct {
	SMTPServerPort    int
	SMTPServerAddress string
	To                string
	From              string
	Password          string
}

MailParams contains all parameters needed to initialize a Mail instance

type Option

type Option func(telegram *Telegram)

Option is a function that configures a telegram instance

type Telegram

type Telegram struct {
	// contains filtered or unexported fields
}

Telegram implements the core.NotifierWithStart interface

func (*Telegram) BalanceHandle

func (t *Telegram) BalanceHandle(m *tb.Message)

BalanceHandle shows the balance of all assets

func (*Telegram) BuyHandle

func (t *Telegram) BuyHandle(m *tb.Message)

BuyHandle processes buy commands

func (*Telegram) HelpHandle

func (t *Telegram) HelpHandle(m *tb.Message)

HelpHandle displays available commands

func (*Telegram) Notify

func (t *Telegram) Notify(text string)

Notify sends a message to all authorized users

func (*Telegram) OnError

func (t *Telegram) OnError(err error)

OnError notifies users about errors

func (*Telegram) OnOrder

func (t *Telegram) OnOrder(order core.Order)

OnOrder notifies users about order status changes

func (*Telegram) ProfitHandle

func (t *Telegram) ProfitHandle(m *tb.Message)

ProfitHandle shows trading results

func (*Telegram) SellHandle

func (t *Telegram) SellHandle(m *tb.Message)

SellHandle processes sell commands

func (*Telegram) Start

func (t *Telegram) Start()

Start begins the Telegram bot and notifies all authorized users

func (*Telegram) StartHandle

func (t *Telegram) StartHandle(m *tb.Message)

StartHandle starts the bot operation

func (*Telegram) StatusHandle

func (t *Telegram) StatusHandle(m *tb.Message)

StatusHandle displays the current bot status

func (*Telegram) StopHandle

func (t *Telegram) StopHandle(m *tb.Message)

StopHandle stops the bot operation

Jump to

Keyboard shortcuts

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