Lock admin actions behind a env variable
ADMIN_ID is comma-separated values of the user-ids of admins who will have access to /ban Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
parent
5bf33a49ea
commit
b27f910362
1 changed files with 6 additions and 5 deletions
|
@ -69,6 +69,7 @@ proc updateHandler(b: Telebot, u: Update): Future[bool] {.async, gcsafe.} =
|
|||
if message == "/start":
|
||||
discard await b.sendMessage(response.chat.id, "Hey, To create a censored post, you can share any album, video, photo, gif, sticker, etc. The messages could then be forwarded to any chat for them to view")
|
||||
elif message.contains("/ban"):
|
||||
if $response.chat.id in AdminID:
|
||||
let user = message.split(" ")
|
||||
var BannedUser = NewBannedUsers(int64(parseInt(user[1])), epochTime(), "permanent")
|
||||
with dbConn:
|
||||
|
|
Loading…
Reference in a new issue