mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
feat(telegram-bots): add bot for ancient greek word of the day
This commit is contained in:
@@ -24,6 +24,7 @@ in {
|
||||
./autorenkalender.nix
|
||||
./proverb.nix
|
||||
./nachtischsatan.nix
|
||||
./tlg-wotd.nix
|
||||
<niveum/modules/telegram-bot.nix>
|
||||
];
|
||||
|
||||
|
||||
17
configs/telegram-bots/tlg-wotd.nix
Normal file
17
configs/telegram-bots/tlg-wotd.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
niveum.telegramBots.tlg-wotd = {
|
||||
enable = true;
|
||||
time = "8:00";
|
||||
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
||||
chatIds = [ "@tlgwotd" ];
|
||||
command = toString (pkgs.writers.writeDash "tlg-wotd" ''
|
||||
${pkgs.curl}/bin/curl -sSL http://stephanus.tlg.uci.edu/Iris/Wotd \
|
||||
| ${pkgs.recode}/bin/recode html..utf8 \
|
||||
| ${pkgs.jq}/bin/jq -r '
|
||||
"*\(.word)* '\'''\(.definition | rtrimstr(" "))'\'''\n\nFirst occurrence: \(.firstOccurrence)\nNumber of occurrences: \(.totalOccurrences)"
|
||||
'
|
||||
'');
|
||||
parseMode = "Markdown";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user