Last active
May 10, 2020 13:54
-
-
Save mgrbyte/39db7a00b116d0f450ab24098fcd981a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns clojurian.tgbot.multivote | |
(:require | |
[environ.core :refer [env]]) | |
(:import | |
(org.telegram.telegrambots ApiContextInitializer) | |
(org.telegram.telegrambots.bots TelegramLongPollingBot) | |
(org.telegram.telegrambots.meta TelegramBotsApi) | |
(org.telegram.telegrambots.meta.api.objects Message Update) | |
(org.telegram.telegrambots.meta.api.methods.send SendMessage)) | |
(:gen-class)) | |
(defn -main | |
"I don't do a whole lot ... yet." | |
[& args] | |
(ApiContextInitializer/init) | |
(let [api (TelegramBotsApi.) | |
bot (proxy [TelegramLongPollingBot] [] | |
(getBotUsername [] | |
(:tg-bot-username env)) | |
(getBotToken [] | |
(:tg-bot-token env)) | |
(onUpdateReceived [^Update upd] | |
;; todo: handle update upd (type: | |
(let [upd-id (.update-id update) | |
] | |
nil)))] | |
(.registerBot api bot) | |
(println (.getBotToken bot)) | |
(println "Hello, World!"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment