Documentation ¶
Index ¶
- Variables
- func Blacklist(chats ...int64) tele.MiddlewareFunc
- func BotInit()
- func DataBaseInit(file string) gorm.DB
- func DownloadFile(filepath string, url string) (err error)
- func ErrorReporting(err error, context tele.Context)
- func FFmpegConvert(context tele.Context, filePath string, targetType string) error
- func FindUserInMessage(context tele.Context) (tele.User, int64, error)
- func ForwardPost(context tele.Context) error
- func GetBless() string
- func GetHtmlText(message tele.Message) string
- func GetNope() string
- func GetStartOfDay() int64
- func GetUserFromDB(findstring string) (tele.User, error)
- func IsAdmin(userid int64) bool
- func IsAdminOrModer(userid int64) bool
- func MentionUser(user *tele.User) string
- func OnChatMember(context tele.Context) error
- func OnText(context tele.Context) error
- func OnUserJoined(context tele.Context) error
- func OnUserLeft(context tele.Context) error
- func RandInt(min int, max int) int
- func Remove(context tele.Context) error
- func ReplyAndRemove(message string, context tele.Context) error
- func Restrict(v RestrictConfig) tele.MiddlewareFunc
- func RestrictionTimeMessage(seconds int64) string
- func StringInSlice(a string, list []string) bool
- func UserFullName(user *tele.User) string
- func UserName(user *tele.User) string
- func Whitelist(chats ...int64) tele.MiddlewareFunc
- type AntiSpam
- type Bets
- type Bless
- type Configuration
- type Duelist
- type Get
- type Nope
- type PidorList
- type PidorStats
- type RestrictConfig
- type Stats
- type StatsWords
- type Warn
Constants ¶
This section is empty.
Variables ¶
View Source
var Bot tele.Bot
View Source
var Config = ConfigInit("config.json")
View Source
var DB = DataBaseInit("bot.db")
View Source
var GotdClient *telegram.Client
View Source
var GotdContext tdctx.Context
Functions ¶
func Blacklist ¶
func Blacklist(chats ...int64) tele.MiddlewareFunc
func BotInit ¶
func BotInit()
BotInit initializes Telegram Bot Moved from auto init to manual init to make the code in utils package testable
func DataBaseInit ¶
func DownloadFile ¶
func ErrorReporting ¶
func FFmpegConvert ¶
func GetHtmlText ¶
func GetStartOfDay ¶
func GetStartOfDay() int64
func IsAdminOrModer ¶
func MentionUser ¶
func OnChatMember ¶
func OnUserJoined ¶
func OnUserLeft ¶
func Restrict ¶
func Restrict(v RestrictConfig) tele.MiddlewareFunc
func RestrictionTimeMessage ¶
func StringInSlice ¶
func UserFullName ¶
func Whitelist ¶
func Whitelist(chats ...int64) tele.MiddlewareFunc
Types ¶
type Configuration ¶
type Configuration struct { Token string `json:"token"` AppID int `json:"app_id"` AppHash string `json:"app_hash"` BotApiUrl string `json:"bot_api_url"` AllowedUpdates []string `json:"allowed_updates"` Listen string `json:"listen"` EndpointPublicURL string `json:"endpoint_public_url"` MaxConnections int `json:"max_connections"` Chat int64 `json:"chat"` ReserveChat int64 `json:"reserve_chat"` CommentChat int64 `json:"comment_chat"` StreamChannel int64 `json:"stream_channel"` Channel int64 `json:"channel"` Admins []int64 `json:"admins"` Moders []int64 `json:"moders"` SysAdmin int64 `json:"sysadmin"` CurrencyKey string `json:"currency_key"` OpenAIKey string `json:"openai_key"` ReleasesUrl string `json:"releases_url"` NHentaiCookie string `json:"nhentai_cookie"` YandexSummarizerToken string `json:"yandex_summarizer_token"` }
func ConfigInit ¶
func ConfigInit(file string) Configuration
type PidorStats ¶
type RestrictConfig ¶
type RestrictConfig struct { Chats []int64 In, Out tele.HandlerFunc }
type StatsWords ¶
Click to show internal directories.
Click to hide internal directories.