Add logging

This commit is contained in:
aNNiMON 2024-08-15 00:26:29 +03:00
parent 274a09390a
commit ed167eb37c

View File

@ -1,4 +1,4 @@
use std, functional, types, regex use std, functional, types, regex, date
include "own-modules/telegram-bot/TelegramBot.own" include "own-modules/telegram-bot/TelegramBot.own"
include "config.own" include "config.own"
@ -44,7 +44,8 @@ def processUpdate(update) {
def processPost(id, chatId, msgId) { def processPost(id, chatId, msgId) {
post = api.getPost(id) post = api.getPost(id)
println "Got post: " + post url = "https://danbooru.donmai.us/posts/" + id
println "%s: %s".sprintf(newDate(), url)
if !post.isImage() return 0 if !post.isImage() return 0
blacklistTags = config.danbooru.blacklistTags blacklistTags = config.danbooru.blacklistTags
if post.containsTags(blacklistTags) return 0 if post.containsTags(blacklistTags) return 0