Modify the functions to reflect the change in schema
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
parent
2dea576b58
commit
e8efd87f71
1 changed files with 5 additions and 5 deletions
|
@ -27,8 +27,8 @@ let AdminID = getEnv("ADMIN_ID").split(",")
|
||||||
|
|
||||||
let dbConn* = getDb()
|
let dbConn* = getDb()
|
||||||
|
|
||||||
func NewCensoredData*(ftype = ""; fhash = ""; fileid = ""; caption = ""):
|
func NewCensoredData*(ftype = ""; fhash = ""; fileid = ""; time = 0.0; caption = ""):
|
||||||
CensoredData = CensoredData(ftype: ftype, fhash: fhash, fileid: fileid, caption: caption)
|
CensoredData = CensoredData(ftype: ftype, fhash: fhash, fileid: fileid, time: time, caption: caption)
|
||||||
|
|
||||||
func NewBannedUsers*(userid = int64(0), bantime = 0.0, bantype = ""):
|
func NewBannedUsers*(userid = int64(0), bantime = 0.0, bantype = ""):
|
||||||
BannedUsers = BannedUsers(userid: userid, bantime: bantime, bantype: bantype)
|
BannedUsers = BannedUsers(userid: userid, bantime: bantime, bantype: bantype)
|
||||||
|
@ -143,19 +143,19 @@ proc updateHandler(b: Telebot, u: Update): Future[bool] {.async, gcsafe.} =
|
||||||
if parseInt(response.mediaGroupId.get) notin GroupMedia.keys().toSeq():
|
if parseInt(response.mediaGroupId.get) notin GroupMedia.keys().toSeq():
|
||||||
let filehash = generate_hash()
|
let filehash = generate_hash()
|
||||||
GroupMedia[parseInt(response.mediaGroupId.get)] = filehash
|
GroupMedia[parseInt(response.mediaGroupId.get)] = filehash
|
||||||
var CensoredRow = NewCensoredData(ftype, filehash, fileid, fcaption)
|
var CensoredRow = NewCensoredData(ftype, filehash, fileid, epochTime(), fcaption)
|
||||||
with dbConn:
|
with dbConn:
|
||||||
insert CensoredRow
|
insert CensoredRow
|
||||||
discard await b.sendMessage(response.chat.id, "Censored --> " & "tg://resolve?domain=botbotbotnotabot&start=" & filehash)
|
discard await b.sendMessage(response.chat.id, "Censored --> " & "tg://resolve?domain=botbotbotnotabot&start=" & filehash)
|
||||||
else:
|
else:
|
||||||
let filehash = GroupMedia[parseInt(response.mediaGroupId.get)]
|
let filehash = GroupMedia[parseInt(response.mediaGroupId.get)]
|
||||||
var CensoredRow = NewCensoredData(ftype, filehash, fileid, fcaption)
|
var CensoredRow = NewCensoredData(ftype, filehash, fileid, epochTime(), fcaption)
|
||||||
with dbConn:
|
with dbConn:
|
||||||
insert CensoredRow
|
insert CensoredRow
|
||||||
|
|
||||||
else:
|
else:
|
||||||
let filehash = generate_hash()
|
let filehash = generate_hash()
|
||||||
var CensoredRow = NewCensoredData(ftype, filehash, fileid, fcaption)
|
var CensoredRow = NewCensoredData(ftype, filehash, fileid, epochTime(), fcaption)
|
||||||
with dbConn:
|
with dbConn:
|
||||||
insert CensoredRow
|
insert CensoredRow
|
||||||
discard await b.sendMessage(response.chat.id, "Censored --> " & "tg://resolve?domain=botbotbotnotabot&start=" & filehash)
|
discard await b.sendMessage(response.chat.id, "Censored --> " & "tg://resolve?domain=botbotbotnotabot&start=" & filehash)
|
||||||
|
|
Loading…
Reference in a new issue