penelope
created pr with
114.1
added 114.2
1: 3c7cbc2 = 1: 3c7cbc2 convert to environment variables
-: ------- > 2: 5798fe8 change port env name to avoid collision
cmds
checkout latest patchset:
ssh pr.pico.sh print 114 | git am -3checkout any patchset in a patch request:
ssh pr.pico.sh print 114.[rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 114
Patchset
114.2
convert to environment variables
Melanie Kat
2026-02-25T00:26:38ZSemantic diff summary
0 added,
0 modified,
0 signature changed,
0 removed
across 0 analyzed files
(2 files skipped: unsupported file type)
+8
-7
bot.php
#
| ... | ... | @@ -3,17 +3,18 @@ | |
| 3 | 3 | // The omg.lol generic IRC bot framework lol | |
| 4 | 4 | // Based on https://github.com/Hammster/php-irc-bot/tree/master | |
| 5 | 5 | ||
| 6 | - | // Configure your bot's details here | |
| 7 | - | $nickname = 'your-bot'; | |
| 8 | - | $hostname = 'example.com'; | |
| 9 | - | $password = 'correct-horse-battery-stapler'; | |
| 10 | - | $server = 'irc.example.com'; | |
| 11 | - | $port = 6697; | |
| 6 | + | // Configure your bot's details | |
| 7 | + | // with environment variables | |
| 8 | + | $nickname = $_ENV["NICKNAME"]; | |
| 9 | + | $hostname = $_ENV["HOSTNAME"]; | |
| 10 | + | $password = $_ENV["PASSWORD"]; | |
| 11 | + | $server = $_ENV["SERVER"]; | |
| 12 | + | $port = $_ENV["PORT"]; | |
| 12 | 13 | ||
| 13 | 14 | // In order to update the bot's code while it's connected to IRC, we need a separate "functions" script. | |
| 14 | 15 | // This script will receive a stream of the IRC activity, and then it'll "do stuff" and send the response | |
| 15 | 16 | // back to *this* script. If that makes sense. I hope it does. | |
| 16 | - | $functions_script_command = '/usr/bin/php /path/to/bot_functions.php'; | |
| 17 | + | $functions_script_command = 'NICKNAME=$nickname /usr/bin/php -d variables_order=EGPCS ./bot_functions.php'; | |
| 17 | 18 | ||
| 18 | 19 | // Finally, you can plop a URL to an avatar image here for IRCv3 avatars, or set to 'false' to disable | |
| 19 | 20 | $avatar_url = false; |