telegram

package
v0.0.0-...-31745e9 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2018 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallbackInfo

func CallbackInfo(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Callback handler to update a find by alias request after a user button is clicked

func ConfirmBan

func ConfirmBan(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Handles the callback when the user presses the final ban confirmation button

func ControlChannelHelp

func ControlChannelHelp(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Help response for control channel

func DebugShowID

func DebugShowID(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

DebugShowID helps in getting channel IDs.

func DisplayAliases

func DisplayAliases(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Callback handler to update a get user info response to add all known user aliases

func DisplayWarnings

func DisplayWarnings(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Callback handler to update a get user info response to add warnings for the user

func E621IDLookup

func E621IDLookup(id string) string

func E621MD5Lookup

func E621MD5Lookup(id string) string

func FALookup

func FALookup(id string) string

func FNLookup

func FNLookup(id string) int

func FindUserByUserID

func FindUserByUserID(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Get user information by telegram ID

func FindUserByUsername

func FindUserByUsername(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Get user information by username

func GetBotStatus

func GetBotStatus(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Returns uptime of the bot

func GetE621IDRating

func GetE621IDRating(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Handles normal E621 links

func GetE621MD5Rating

func GetE621MD5Rating(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Handles direct image E621 links

func GetFARating

func GetFARating(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Handles furaffinity links

func GetFNRating

func GetFNRating(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Handles furry network links

func GetUserInfoResponse

func GetUserInfoResponse(user *models.ChatUser) tgbotapi.MessageConfig

Helper method to generate the response object for the info requests

func HandleUsers

func HandleUsers(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Handles non-command messages to record user information/changes

func InitBot

func InitBot(botToken string)

func LookupAlias

func LookupAlias(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Look up users by their alias

func MainChannelHelp

func MainChannelHelp(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Help response for main channel

func MakeAliasInlineKeyboard

func MakeAliasInlineKeyboard(aliases []models.ChatUser) tgbotapi.InlineKeyboardMarkup

Helper method to generate the buttons for the lookup by alias command

func MakeBanConfirmInlineKeyboard

func MakeBanConfirmInlineKeyboard(userId int64) tgbotapi.InlineKeyboardMarkup

Helper method to generate the buttons for the final ban request

func MakeBanInlineKeyboard

func MakeBanInlineKeyboard(userId int64) tgbotapi.InlineKeyboardMarkup

Helper method to generate the buttons for a pre ban request

func MakeUserInfoInlineKeyboard

func MakeUserInfoInlineKeyboard(userId int64) tgbotapi.InlineKeyboardMarkup

Helper method to generate the buttons for an initial info request

func MakeUserInfoInlineKeyboardRefreshAliasButton

func MakeUserInfoInlineKeyboardRefreshAliasButton(userId int64, curAliasPage int64, aliasPagesTotal int64) tgbotapi.InlineKeyboardMarkup

Helper method to generate the buttons for an info request after view aliases button is pressed

func MakeUserInfoInlineKeyboardRefreshWarnButton

func MakeUserInfoInlineKeyboardRefreshWarnButton(userId int64) tgbotapi.InlineKeyboardMarkup

Helper method to generate the buttons for an info request after view warnings button is pressed

func PreBan

func PreBan(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Handles the first step in the ban process by displaying the target to a user

func PreConfirmBan

func PreConfirmBan(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Handles the callback when a user presses the first confirm ban button

func ProcessCallback

func ProcessCallback(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

func ProcessMessage

func ProcessMessage(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

func Register

func Register(regexIn string, chanIn int64, handleFunc func(tgbotapi.Update, *tgbotapi.BotAPI))

func RegisterCallback

func RegisterCallback(regexIn string, handleFunc func(tgbotapi.Update, *tgbotapi.BotAPI))

func SummonMods

func SummonMods(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Handles the /mods command

func TestCmd

func TestCmd(updateIn tgbotapi.Update, botIn *tgbotapi.BotAPI)

func ToggleMods

func ToggleMods(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Handles toggling of a user's ability to use /mods

func WarnUserByID

func WarnUserByID(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Warn a user by telegram ID

func WarnUserByUsername

func WarnUserByUsername(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

Warn a user by username

func YesOrNo

func YesOrNo(upd tgbotapi.Update, bot *tgbotapi.BotAPI)

c/d questions

Types

type BotCommand

type BotCommand struct {
	MatchCmd   *regexp.Regexp
	Chan       int64
	HandleFunc func(tgbotapi.Update, *tgbotapi.BotAPI)
}

type FurryNetwork

type FurryNetwork struct {
	Rating int `json:"rating"`
}

type MemberCommand

type MemberCommand struct {
	Chan       int64
	HandleFunc func(tgbotapi.Update, *tgbotapi.BotAPI)
}

type StringRating

type StringRating struct {
	Rating string `json:"rating"`
}

Jump to

Keyboard shortcuts

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