Skip to content

Instantly share code, notes, and snippets.

@FiveYellowMice
Created August 14, 2016 13:58
Show Gist options
  • Save FiveYellowMice/b34314d17209c30748b2afb7d0428d7d to your computer and use it in GitHub Desktop.
Save FiveYellowMice/b34314d17209c30748b2afb7d0428d7d to your computer and use it in GitHub Desktop.
Yoitsu Horo bot
[Unit]
Description=Run Yoitsu Horo bot once
[Service]
Type=oneshot
WorkingDirectory=/home/alex/Projects/yoitsuhorobot
ExecStart=/home/alex/Projects/yoitsuhorobot/yoitsuhorobot.sh
#!/bin/bash
rand=$(tr -dc 0-1 < /dev/urandom | head -c1)
if [ $rand = 1 ]; then
emoji="%F0%9F%98%82"
else
emoji="%F0%9F%98%8B"
fi
rand=$(tr -dc 1-5 < /dev/urandom | head -c1)
for (( i=0; i<$rand; i++ )); do
msg="$msg$emoji"
done
#echo "$msg"
for chat in $(cat chats); do
curl "https://api.telegram.org/bot$(cat token)/sendMessage?chat_id=$chat&text=$msg"
done
[Unit]
Description=Yoitsu Horo bot
[Timer]
OnActiveSec=5
OnUnitActiveSec=30m
RandomizedDelaySec=1h30m
[Install]
WantedBy=default.target
@hexchain
Copy link

$RANDOM ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment