add commands

This commit is contained in:
lyx0 2021-12-13 19:26:36 +01:00
parent 1919c3eb3c
commit 2ded1bc9ed
2 changed files with 4 additions and 0 deletions

View file

@ -37,6 +37,8 @@ func (l *logCommand) insert(nb *bot.Bot, commandName, name, channel, id, text st
return nil
}
// InsertCommand is called on every message that invokes a command
// and inserts the message and command details into the database.
func InsertCommand(nb *bot.Bot, commandName, name, channel, id, text string) {
err := (&logCommand{}).insert(nb, commandName, name, channel, id, text)
if err != nil {

View file

@ -35,6 +35,8 @@ func (l *logMessage) insert(nb *bot.Bot, name, channel, id, text string) error {
return nil
}
// InsertMessage is called on every message and logs message details
// into the database.
func InsertMessage(nb *bot.Bot, name, channel, id, text string) {
err := (&logMessage{}).insert(nb, name, channel, id, text)
if err != nil {