mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-13 00:30:58 +00:00
Implement backlog and test it
This commit is contained in:
parent
44bcd7df05
commit
8ba87e1a27
8 changed files with 649 additions and 83 deletions
|
@ -39,9 +39,10 @@ type CommandHandler func(*websocket.Conn, *ClientInfo, ClientMessage) (ClientMes
|
|||
var CommandHandlers = map[Command]CommandHandler{
|
||||
HelloCommand: HandleHello,
|
||||
"setuser": HandleSetUser,
|
||||
"ready": HandleReady,
|
||||
|
||||
"sub": HandleSub,
|
||||
"unsub": HandleUnsub,
|
||||
"sub": HandleSub,
|
||||
"unsub": HandleUnsub,
|
||||
|
||||
"track_follow": HandleTrackFollow,
|
||||
"emoticon_uses": HandleEmoticonUses,
|
||||
|
@ -335,7 +336,7 @@ func (cm *ClientMessage) ArgumentsAsString() (string1 string, err error) {
|
|||
}
|
||||
|
||||
// Convenience method: Parse the arguments of the ClientMessage as a single int.
|
||||
func (cm *ClientMessage) ArgumentsAsInt() (int1 int, err error) {
|
||||
func (cm *ClientMessage) ArgumentsAsInt() (int1 int64, err error) {
|
||||
var ok bool
|
||||
var num float64
|
||||
num, ok = cm.Arguments.(float64)
|
||||
|
@ -343,7 +344,7 @@ func (cm *ClientMessage) ArgumentsAsInt() (int1 int, err error) {
|
|||
err = ExpectedSingleInt
|
||||
return
|
||||
} else {
|
||||
int1 = int(num)
|
||||
int1 = int64(num)
|
||||
return int1, nil
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue