Documentation
¶
Index ¶
- Constants
- Variables
- func AddNoteToDb(chatId string, noteName string, noteData string, msgtype int, buttons []Button, ...)
- func AddToBlacklist(chatId string, trigger string)
- func AddWarnFilter(chatId string, keyword string, reply string)
- func AllFedChats(fedId string) []string
- func ChatJoinFed(fedId string, chatId string) bool
- func ChatLeaveFed(chatId string) bool
- func DelFed(fedId string)
- func EnsureBotInDb(u *gotgbot.Updater)
- func FbanUser(fedId string, userId string, reason string)
- func GetFedId(chatId string) string
- func GetWarnSetting(chatId string) (int, bool)
- func GetWarns(userId string, chatId string) (int, []string)
- func IsUserFedAdmin(fedId string, userId string) string
- func IsUserFedOwner(userId string, fedId string) bool
- func NewFed(ownerId string, fedId string, fedName string) bool
- func RemoveWarn(userId string, chatId string) bool
- func RemoveWarnFilter(chatId string, keyword string) bool
- func ResetWarns(userId string, chatId string)
- func RmFromBlacklist(chatId string, trigger string) bool
- func RmNote(chatId string, noteName string) bool
- func SetWarnLimit(chatId string, warnLimit int)
- func SetWarnStrength(chatId string, softWarn bool)
- func UnFbanUser(fedId string, userId string)
- func UpdateUser(userId int, username string, chatId string, chatName string)
- func UserDemoteFed(fedId string, userId string)
- func UserPromoteFed(fedId string, userId string)
- func WarnUser(userId string, chatId string, reason string) (int, []string)
- type BlackListFilters
- type Button
- type Chat
- type FedAdmin
- type FedBan
- type FedChat
- type Federation
- type Note
- type User
- type WarnFilters
- type WarnSettings
- type Warns
Constants ¶
View Source
const ( TEXT = 0 BUTTON_TEXT = 1 STICKER = 2 DOCUMENT = 3 PHOTO = 4 AUDIO = 5 VOICE = 6 VIDEO = 7 )
Variables ¶
View Source
var SESSION *gorm.DB
Functions ¶
func AddNoteToDb ¶
func AddToBlacklist ¶
func AddWarnFilter ¶
func AllFedChats ¶
func ChatJoinFed ¶
func ChatLeaveFed ¶
func EnsureBotInDb ¶
func GetWarnSetting ¶
func IsUserFedAdmin ¶
func IsUserFedOwner ¶
func RemoveWarn ¶
func RemoveWarnFilter ¶
func ResetWarns ¶
func RmFromBlacklist ¶
func SetWarnLimit ¶
func SetWarnStrength ¶
func UnFbanUser ¶
func UserDemoteFed ¶
func UserPromoteFed ¶
Types ¶
type BlackListFilters ¶
type BlackListFilters struct {
ChatId string `gorm:"primary_key"`
Trigger string `gorm:"primary_key"`
}
func GetChatBlacklist ¶
func GetChatBlacklist(chatId string) []BlackListFilters
type Button ¶
type Button struct {
Id uint `gorm:"primary_key;AUTO_INCREMENT"`
ChatId string `gorm:"primary_key"`
NoteName string `gorm:"primary_key"`
Name string `gorm:"not null"`
Url string `gorm:"not null"`
SameLine bool `gorm:"default:false"`
}
func GetButtons ¶
type FedAdmin ¶
func GetAllFedsAdminsGlobal ¶
func GetAllFedsAdminsGlobal() []FedAdmin
func GetFedAdmins ¶
type FedBan ¶
type FedBan struct {
FedRef string `gorm:"primary_key"`
UserId string `gorm:"primary_key"`
Reason string
}
func GetAllFbanUsers ¶
func GetAllFbanUsersGlobal ¶
func GetAllFbanUsersGlobal() []FedBan
func GetFbanUser ¶
type Federation ¶
type Federation struct {
Id string `gorm:"primary_key"`
OwnerId string
FedName string
FedAdmins []FedAdmin `gorm:"foreignkey:Id"`
//FedChats []FedChat `gorm:"foreignkey:Id"`
FedBans []FedBan `gorm:"foreignkey:FedRef"`
}
func GetChatFed ¶
func GetChatFed(chatId string) *Federation
func GetFedFromOwnerId ¶
func GetFedFromOwnerId(ownerId string) *Federation
func GetFedInfo ¶
func GetFedInfo(fedId string) *Federation
func GetUserFbans ¶
func GetUserFbans(userId string) []Federation
type Note ¶
type Note struct {
ChatId string `gorm:"primary_key"`
Name string `gorm:"primary_key"`
Value string `gorm:"not null"`
File string
IsReply bool `gorm:"default:false"`
HasButtons bool `gorm:"default:false"`
Msgtype int `gorm:"default:1"`
}
func GetAllChatNotes ¶
type User ¶
func GetUserIdByName ¶
type WarnFilters ¶
type WarnFilters struct {
ChatId string `gorm:"primary_key"`
Keyword string `gorm:"primary_key"`
Reply string `gorm:"not null"`
}
func GetChatWarnTriggers ¶
func GetChatWarnTriggers(chatId string) []WarnFilters
func GetWarnFilter ¶
func GetWarnFilter(chatId string, keyword string) *WarnFilters
func (WarnFilters) String ¶
func (wf WarnFilters) String() string
type WarnSettings ¶
Click to show internal directories.
Click to hide internal directories.