domain

package
v0.0.0-...-bafbf86 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BasicTables = []interface{}{ChatInfo{}, ChatUserInfo{}, ChatUser{}}

BasicTables - list of known basic tables

Functions

This section is empty.

Types

type Activity

type Activity struct {
	MesssageID     int
	Text           string
	ChatID         int64
	LeftChatMember *User
	NewChatMembers *[]User
	RepliedTo      *Activity
	Command        string // comamnd, sent straight to bot using messenger
}

Activity - received notification Telegram receives message and this one describes it

type ChatInfo

type ChatInfo struct {
	ID        uint `gorm:"AUTO_INCREMENT"`
	CreatedAt time.Time
	Name      string
	ChatID    int64 `gorm:"not null;unique"`
	Enabled   bool  `gorm:"not null;default:'true'"`
}

ChatInfo - describes chat room info known to bot

type ChatUser

type ChatUser struct {
	ID           uint `gorm:"AUTO_INCREMENT"`
	CreatedAt    time.Time
	UserID       int    `gorm:"unique"`
	UserName     string `gorm:"unique"`
	ChatID       int64
	ChatUserInfo ChatUserInfo `gorm:"foreignkey:ChatUserRef"`
}

ChatUser - describes one chat member

type ChatUserInfo

type ChatUserInfo struct {
	ChatUserRef  uint `gorm:"primary_key"`
	SentMessages uint
	FirstName    string
	LastName     string
}

ChatUserInfo - detailed user info

type User

type User struct {
	ID       int
	UserName string
	IsBot    bool
}

User - user representation

Jump to

Keyboard shortcuts

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