Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Commit

Permalink
more hset
Browse files Browse the repository at this point in the history
  • Loading branch information
BennyThink committed Feb 5, 2021
1 parent 5c8a10f commit 5d3244b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,21 @@ func messageHandler(m *tb.Message) {
}

func onJoinHandler(m *tb.Message) {
rdb.HSet(ctx, fmt.Sprintf("%v", m.Chat.ID), m.ID, time.Now().Unix())
_ = b.Notify(m.Chat, tb.Typing)
_, _ = b.Send(m.Chat, "You need to promote me to admin first. And then optionally call /settings to set TTL."+
"Default TTL is 48h.")
}

func startHandler(m *tb.Message) {
rdb.HSet(ctx, fmt.Sprintf("%v", m.Chat.ID), m.ID, time.Now().Unix())
_ = b.Notify(m.Chat, tb.Typing)
_, _ = b.Send(m.Chat, "Welcome! I can help deleting group/channel messages. Please add me to your group as admin."+
"See /settings for more.")
}

func helpHandler(m *tb.Message) {
rdb.HSet(ctx, fmt.Sprintf("%v", m.Chat.ID), m.ID, time.Now().Unix())
_ = b.Notify(m.Chat, tb.Typing)

helpMsg := `A bot that will help you automatically delete group messages.
Expand Down Expand Up @@ -93,6 +96,7 @@ func helpHandler(m *tb.Message) {
}

func settingsHandler(m *tb.Message) {
rdb.HSet(ctx, fmt.Sprintf("%v", m.Chat.ID), m.ID, time.Now().Unix())
if !permissionCheck(m) {
return
}
Expand Down

0 comments on commit 5d3244b

Please sign in to comment.