From 3767df26f963b0a82702b0a22bcec2a49eef0ed2 Mon Sep 17 00:00:00 2001 From: gwyn Date: Wed, 4 Mar 2026 14:43:36 -0500 Subject: [PATCH] changed how module loads --- Secrets.pm.example | 18 ++++++++++++++++++ bridge.pl | 8 ++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 Secrets.pm.example diff --git a/Secrets.pm.example b/Secrets.pm.example new file mode 100644 index 0000000..4047011 --- /dev/null +++ b/Secrets.pm.example @@ -0,0 +1,18 @@ +package Secrets; +use strict; +use warnings; +use Exporter 'import'; + +our @EXPORT_OK = qw( + TELEGRAM_TOKEN + TELEGRAM_USER_ID + NICKSERV_PASSWORD + IRC_CHANNEL +); + +use constant TELEGRAM_TOKEN => 'Bot Token' +use constant TELEGRAM_USER_ID => 123456789; +use constant NICKSERV_PASSWORD => 'supersecretpassword'; +use constant IRC_CHANNEL => '#lobby'; + +1; diff --git a/bridge.pl b/bridge.pl index 9fa22c5..fe08ba4 100644 --- a/bridge.pl +++ b/bridge.pl @@ -4,8 +4,12 @@ use warnings; use POE; use POE::Component::IRC; use WWW::Telegram::BotAPI; -require './.secrets.pm'; - +use Secrets qw( + TELEGRAM_TOKEN + TELEGRAM_USER_ID + NICKSERV_PASSWORD + IRC_CHANNEL +); my $IRC_SERVER = '127.0.0.1'; my $IRC_PORT = 6667; my $IRC_NICK = 'Jerry';