Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

commented Aug 15, 2016

$RANDOM ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.