Documentation
¶
Index ¶
- Constants
- Variables
- func AddPhrase()
- func CQRegister(handle CQCommandHandler, command string) (err error)
- func Call(bot *tg.BotAPI, req *tg.Message)
- func Cancel(bot *tg.BotAPI, req *tg.Message)
- func Cooldown(bot *tg.BotAPI, req *tg.Message)
- func Del(bot *tg.BotAPI, req *tg.Message)
- func Done(bot *tg.BotAPI, req *tg.Message)
- func ExecPipeline(bot *tg.BotAPI, m *tg.Message, name string) (ret bool)
- func Help(bot *tg.BotAPI, req *tg.Message)
- func List(bot *tg.BotAPI, req *tg.Message)
- func LiveParty(bot *tg.BotAPI, req *tg.Message)
- func LivePartyAtAll(bot *tg.BotAPI, req *tg.Message)
- func LivePartyShowUser(bot *tg.BotAPI, req *tg.Message)
- func Lock(bot *tg.BotAPI, req *tg.Message)
- func Ping(bot *tg.BotAPI, req *tg.Message)
- func PipelinePush(p Pipe, name string) (err error)
- func Rank(bot *tg.BotAPI, req *tg.Message)
- func Register(handle CommandHandler, command string) (err error)
- func Remind(bot *tg.BotAPI, req *tg.Message)
- func TODO(bot *tg.BotAPI, req *tg.Message)
- func TODONow(bot *tg.BotAPI, req *tg.Message)
- func Test(bot *tg.BotAPI, req *tg.Message)
- func Track(bot *tg.BotAPI, req *tg.Message)
- func Unlock(bot *tg.BotAPI, req *tg.Message)
- func Users(bot *tg.BotAPI, req *tg.Message)
- func Weblogin(bot *tg.BotAPI, req *tg.Message)
- func Workon(bot *tg.BotAPI, req *tg.Message)
- type CQCommandHandler
- type CallError
- type CommandHandler
- type GameList
- type GameObj
- type Pipe
- type Pipeline
- type UserList
- type UserObj
Constants ¶
View Source
const ( CALL_ERR_OK = 0 CALL_ERR_REDIS = iota CALL_ERR_KEY_NOT_FOUND CALL_ERR_NOPERM CALL_ERR_MSGPACK_FAIL CALL_ERR_VALUE_EXIST CALL_ERR_NO_SUCH_GAME )
Variables ¶
View Source
var GroupUUID = uuid.Must(uuid.NewV4()).String()
Functions ¶
func CQRegister ¶
func CQRegister(handle CQCommandHandler, command string) (err error)
func ExecPipeline ¶
Note: here we can safely access pipeline concurrently TODO: concurrent access to pipeline
func LiveParty ¶
we use this id to determine whether we have a live party function or not LiveParty is a cgss group limited function
func LivePartyAtAll ¶
LivePartyAtAll will be registered as lpall
func LivePartyShowUser ¶
LivePartyShowUser will show the party table info
func PipelinePush ¶
func Register ¶
func Register(handle CommandHandler, command string) (err error)
Types ¶
type CQCommandHandler ¶
type CQCommandHandler func(*tg.BotAPI, *tg.CallbackQuery)
func CQLookup ¶
func CQLookup(cq *tg.CallbackQuery) (h CQCommandHandler, err error)
type CommandHandler ¶
TODO: merge command, cq command to a interface TODO: Change Handlers into interface
func Lookup ¶
func Lookup(command string) (h CommandHandler, err error)
type UserObj ¶
The data in redis should store like this 1. chat specified games list key = games.groupID, value = a list of msgpack string 2. chat specified usercall list key = call.groupID.gameName, value = a list of msgpack objects 3. chat specified default game key = defaut.groupID, value = empty or a msgpack string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.