ahhelperbot

package
v0.0.0-...-2c15e9f Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

Bot is a telegram bot which returns events and sends messages

func NewBot

func NewBot(storage storage.DataStorer, deliveryProvider DeliveryProvider) *Bot

NewBot returns an instance of Bot which implements Messenger interface tlgr - is an low-level abstraction for telegram API

func (*Bot) CheckDeliveries

func (b *Bot) CheckDeliveries()

CheckDeliveries checks delivery for subscripions

func (*Bot) DefaultMessageProcessor

func (b *Bot) DefaultMessageProcessor(msg domain.Message)

DefaultMessageProcessor is a processor for messages to bot

func (*Bot) SetMessenger

func (b *Bot) SetMessenger(messenger telegram.Messenger)

SetMessenger sets messenger, because messager includes message processing

type DefaultDeliveryProvider

type DefaultDeliveryProvider struct{}

DefaultDeliveryProvider default implementation

func (*DefaultDeliveryProvider) Get

Get returns schedule for AH

type DeliveryProvider

type DeliveryProvider interface {
	Get(postcode string) DeliverySchedule
}

DeliveryProvider defines provider schedule

type DeliverySchedule

type DeliverySchedule map[string][]DeliveryTimeSlotBase

DeliverySchedule is used to represent time schedule by date

func (DeliverySchedule) String

func (ds DeliverySchedule) String() string

type DeliveryTimeSlotBase

type DeliveryTimeSlotBase struct {
	Dl    int    `json:"dl"`
	From  string `json:"from"`
	To    string `json:"to"`
	State string `json:"state"`
}

DeliveryTimeSlotBase base struct of delivery time slot. Same for time and date schedule

Jump to

Keyboard shortcuts

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