aboutsummaryrefslogtreecommitdiff
path: root/telegram
diff options
context:
space:
mode:
Diffstat (limited to 'telegram')
-rw-r--r--telegram/commands.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/telegram/commands.go b/telegram/commands.go
index 74406f5..b26a971 100644
--- a/telegram/commands.go
+++ b/telegram/commands.go
@@ -423,6 +423,26 @@ func (c *Client) ProcessChatCommand(chatID int64, cmdline string) (string, bool)
return err.Error(), true
}
}
+ // blacklists current user
+ case "block":
+ if chatID > 0 {
+ _, err := c.client.BlockUser(&client.BlockUserRequest{
+ UserId: int32(chatID),
+ })
+ if err != nil {
+ return err.Error(), true
+ }
+ }
+ // unblacklists current user
+ case "unblock":
+ if chatID > 0 {
+ _, err := c.client.UnblockUser(&client.UnblockUserRequest{
+ UserId: int32(chatID),
+ })
+ if err != nil {
+ return err.Error(), true
+ }
+ }
case "help":
return helpString(helpTypeChat), true
default: