From: Andreas Scherbaum Date: Sat, 19 May 2012 21:32:43 +0000 (+0200) Subject: - verify if commandchannel is joined, before posting something X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=eec518f7d3b2aa742f2d1272b5f3623ab21483f9;p=docbot.git - verify if commandchannel is joined, before posting something --- diff --git a/docbot.pl b/docbot.pl index 26afe09..686eb1b 100755 --- a/docbot.pl +++ b/docbot.pl @@ -928,6 +928,12 @@ sub send_to_commandchannel { my $commandchannel = config_get_key2('bot', 'commandchannel'); + if (!session_for_channel($commandchannel)) { + print_msg("commandchannel: $msg", DEBUG); + print_msg("commandchannel ($commandchannel) not joined!", ERROR); + return; + } + print_msg("commandchannel: $msg", DEBUG); send_to_channel(config_get_key2('bot', 'commandchannel'), $msg) }