Prepare for code cleanup and deeplink
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
parent
b92cce96b5
commit
63e08ca1c6
1 changed files with 7 additions and 2 deletions
|
@ -27,9 +27,14 @@ proc generate_hash(): string=
|
||||||
const API_KEY = getEnv("TELEGRAM_TOKEN")
|
const API_KEY = getEnv("TELEGRAM_TOKEN")
|
||||||
|
|
||||||
proc updateHandler(b: Telebot, u: Update): Future[bool] {.async, gcsafe.} =
|
proc updateHandler(b: Telebot, u: Update): Future[bool] {.async, gcsafe.} =
|
||||||
var response = u.message.get
|
let response = u.message.get
|
||||||
if response.document.isSome:
|
if response.text.isSome:
|
||||||
|
let message = response.text.get
|
||||||
|
if message.contains("/start"):
|
||||||
|
let deeplink = message.split(" ")
|
||||||
|
var fileid = ""
|
||||||
let filehash = generate_hash()
|
let filehash = generate_hash()
|
||||||
|
if response.document.isSome:
|
||||||
var censordoc = NewCensoredData("document", filehash, response.document.get.fileId, "")
|
var censordoc = NewCensoredData("document", filehash, response.document.get.fileId, "")
|
||||||
with dbConn:
|
with dbConn:
|
||||||
insert censordoc
|
insert censordoc
|
||||||
|
|
Loading…
Reference in a new issue