Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commands/update.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sub main {
# Use list form to prevent shell injection via config values
my $old_dir = Cwd::getcwd();
chdir($DCBSettings::cwd) or die "Cannot chdir to $DCBSettings::cwd: $!";
$output = capture("git", "pull", "origin", $DCBSettings::config->{version});
$output = capture("git", "pull");
chdir($old_dir) or die "Cannot chdir back to $old_dir: $!";
# temporarily removing the git log from the output as first time clones will not be able to run it
#; " . 'git log @{1}.. --oneline');
Expand Down
8 changes: 5 additions & 3 deletions odchbot.pl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use DCBCommon;
use DCBUser;

our $VERSION = '3.0.1';

# Enable the logger and load configuration.
# Read config and resolve relative paths against the script's directory so
# the embedded Perl inside opendchub works regardless of the hub's CWD.
Expand Down Expand Up @@ -79,8 +81,8 @@
odch::register_script_name($DCBSettings::config->{botname});
odch_sendmessage("","",1,"\$HubName $DCBSettings::config->{topic}");
my $loadtime = tv_interval ( $start_time ) ;
odch_sendmessage("","",4,"$DCBSettings::config->{botname} version $DCBSettings::config->{version} - loaded in $loadtime seconds!");
$logger->debug("$DCBSettings::config->{botname} version $DCBSettings::config->{version} - loaded in $loadtime seconds!");
odch_sendmessage("","",4,"$DCBSettings::config->{botname} version $VERSION - loaded in $loadtime seconds!");
$logger->debug("$DCBSettings::config->{botname} version $VERSION - loaded in $loadtime seconds!");
}

sub data_arrival() {
Expand Down Expand Up @@ -180,7 +182,7 @@
return;
}

my $tag = "$DCBSettings::config->{bottag} V:$DCBSettings::config->{version},M:P,H:1/3/3,S:7";
my $tag = "$DCBSettings::config->{bottag} V:$VERSION,M:P,H:1/3/3,S:7";
odch_sendmessage($user->{name}, "", 11, "\$MyINFO \$ALL $DCBSettings::config->{botname} " .
"$DCBSettings::config->{botdescription}<$tag>\$\$\$$DCBSettings::config->{botspeed}>" .
"\$$DCBSettings::config->{botemail}\$$DCBSettings::config->{botshare}\$");
Expand Down Expand Up @@ -243,13 +245,13 @@
my @return = @_;

foreach (@return) {
if ($_->{param} eq "message") {

Check failure on line 248 in odchbot.pl

View workflow job for this annotation

GitHub Actions / Perl 5.40

Use of uninitialized value in string eq

Check failure on line 248 in odchbot.pl

View workflow job for this annotation

GitHub Actions / Perl 5.38

Use of uninitialized value in string eq

Check failure on line 248 in odchbot.pl

View workflow job for this annotation

GitHub Actions / Perl 5.34

Use of uninitialized value in string eq
odch_sendmessage($_->{user}, $_->{fromuser}, $_->{type}, $_->{message});
}
elsif ($_->{param} eq "action") {

Check failure on line 251 in odchbot.pl

View workflow job for this annotation

GitHub Actions / Perl 5.40

Use of uninitialized value in string eq

Check failure on line 251 in odchbot.pl

View workflow job for this annotation

GitHub Actions / Perl 5.38

Use of uninitialized value in string eq

Check failure on line 251 in odchbot.pl

View workflow job for this annotation

GitHub Actions / Perl 5.34

Use of uninitialized value in string eq
odch_odch($_->{action}, $_->{user}, $_->{arg});
}
elsif ($_->{param} eq "log") {

Check failure on line 254 in odchbot.pl

View workflow job for this annotation

GitHub Actions / Perl 5.40

Use of uninitialized value in string eq

Check failure on line 254 in odchbot.pl

View workflow job for this annotation

GitHub Actions / Perl 5.38

Use of uninitialized value in string eq

Check failure on line 254 in odchbot.pl

View workflow job for this annotation

GitHub Actions / Perl 5.34

Use of uninitialized value in string eq
$logger->debug("Structure: ", { filter => \&Dumper, value => $_ });
}
}
Expand Down
1 change: 0 additions & 1 deletion odchbot.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ config:
timezone: Australia/Canberra
username_anonymous: Anonymous
username_max_length: 35
version: 3.0.1
6 changes: 4 additions & 2 deletions opchat.pl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
use DCBSettings;
use DCBUser;

our $VERSION = '1.0.0';

# Enable the logger and load configuration.
# Read config and resolve relative paths against the script's directory so
# the embedded Perl inside opendchub works regardless of the hub's CWD.
Expand Down Expand Up @@ -52,7 +54,7 @@ sub main {
our $c = DCBCommon::common_escape_string("$DCBSettings::config->{cp}");
odch::register_script_name($DCBSettings::config->{botname});
my $loadtime = tv_interval ( $start_time ) ;
$logger->debug("$DCBSettings::config->{botname} version $DCBSettings::config->{version} - loaded in $loadtime seconds!");
$logger->debug("$DCBSettings::config->{botname} version $VERSION - loaded in $loadtime seconds!");
}

sub data_arrival {
Expand Down Expand Up @@ -154,7 +156,7 @@ sub opchat_login {
$oplist->{lc($name)} = \%user;
}

my $tag = "$DCBSettings::config->{bottag} V:$DCBSettings::config->{version},M:P,H:1/3/3,S:7";
my $tag = "$DCBSettings::config->{bottag} V:$VERSION,M:P,H:1/3/3,S:7";
my $botmessage = "\$MyINFO \$ALL $DCBSettings::config->{botname} " .
"$DCBSettings::config->{botdescription}<$tag>\$\$\$$DCBSettings::config->{botspeed}>" .
"\$$DCBSettings::config->{botemail}\$$DCBSettings::config->{botshare}\$";
Expand Down
1 change: 0 additions & 1 deletion opchat.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ config:
cp: "-"
debug: 1
topic: Welcome to OPChat
version: 1.0.0
Loading