2022-03-10 21:52:12 +01:00
|
|
|
{
|
|
|
|
|
pkgs,
|
2023-02-22 10:02:55 +01:00
|
|
|
config,
|
2023-07-04 16:28:26 +02:00
|
|
|
lib,
|
2022-03-10 21:52:12 +01:00
|
|
|
...
|
2025-12-27 22:22:54 +01:00
|
|
|
}:
|
|
|
|
|
let
|
|
|
|
|
nachtischsatan-bot =
|
|
|
|
|
{ tokenFile }:
|
|
|
|
|
pkgs.writers.writePython3 "nachtischsatan-bot"
|
|
|
|
|
{
|
|
|
|
|
libraries = [ pkgs.python3Packages.python-telegram-bot ];
|
|
|
|
|
}
|
|
|
|
|
''
|
|
|
|
|
from telegram.ext import Application, ContextTypes, MessageHandler, filters
|
|
|
|
|
from telegram import Update
|
|
|
|
|
import random
|
|
|
|
|
import time
|
2020-04-09 16:57:24 +02:00
|
|
|
|
|
|
|
|
|
2025-12-27 22:22:54 +01:00
|
|
|
async def flubber(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
|
|
|
|
time.sleep(random.randrange(4000) / 1000)
|
|
|
|
|
await update.message.reply_text("*flubberflubber*")
|
2020-04-09 16:57:24 +02:00
|
|
|
|
|
|
|
|
|
2025-12-27 22:22:54 +01:00
|
|
|
with open('${tokenFile}', 'r') as tokenFile:
|
|
|
|
|
token = tokenFile.read().strip()
|
|
|
|
|
application = Application.builder().token(token).build()
|
|
|
|
|
application.add_handler(MessageHandler(filters.ALL, flubber))
|
|
|
|
|
application.run_polling()
|
|
|
|
|
'';
|
|
|
|
|
in
|
|
|
|
|
{
|
2020-04-09 16:57:24 +02:00
|
|
|
systemd.services.telegram-nachtischsatan = {
|
2025-12-27 22:22:54 +01:00
|
|
|
wantedBy = [ "multi-user.target" ];
|
2020-04-09 16:57:24 +02:00
|
|
|
description = "*flubberflubber*";
|
|
|
|
|
enable = true;
|
|
|
|
|
script = toString (nachtischsatan-bot {
|
2023-02-22 10:02:55 +01:00
|
|
|
tokenFile = config.age.secrets.telegram-token-nachtischsatan.path;
|
2020-04-09 16:57:24 +02:00
|
|
|
});
|
|
|
|
|
serviceConfig.Restart = "always";
|
|
|
|
|
};
|
2022-05-22 11:47:59 +02:00
|
|
|
|
2023-07-04 16:28:26 +02:00
|
|
|
age.secrets.telegram-token-nachtischsatan.file = ../../secrets/telegram-token-nachtischsatan.age;
|
2023-02-22 10:02:55 +01:00
|
|
|
|
2022-05-22 11:47:59 +02:00
|
|
|
niveum.passport.services = [
|
|
|
|
|
{
|
|
|
|
|
title = "Nachtischsatan-Bot";
|
|
|
|
|
link = "https://t.me/NachtischsatanBot";
|
|
|
|
|
description = "*flubberflubber*";
|
|
|
|
|
}
|
|
|
|
|
];
|
2020-04-09 16:57:24 +02:00
|
|
|
}
|