This repository has been archived by the owner on Apr 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
734 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package main | ||
|
||
import ( | ||
log "github.com/kirillDanshin/dlog" | ||
tg "github.com/toby3d/telegram" | ||
) | ||
|
||
// actions function check Message update on commands, sended stickers or other user stuff | ||
func actions(msg *tg.Message) { | ||
state, err := dbGetUserState(msg.From.ID) | ||
errCheck(err) | ||
|
||
log.Ln("state:", state) | ||
switch state { | ||
case stateAddSticker: | ||
actionAdd(msg, false) | ||
case stateAddPack: | ||
actionAdd(msg, true) | ||
case stateDeleteSticker: | ||
actionDelete(msg, false) | ||
case stateDeletePack: | ||
actionDelete(msg, true) | ||
case stateReset: | ||
actionReset(msg) | ||
default: | ||
err = dbChangeUserState(msg.From.ID, stateNone) | ||
errCheck(err) | ||
|
||
actionError(msg) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.