X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2Fbot_NeonHelp.c;h=3473d3c09f536c2b57ea8477d7c31ce2af4c3ee0;hp=03e9ce9c7be0f931b29920409ab35d089e3ef8a1;hb=0b17bccd2d7fbef5652168d11d4f0af1f41252d3;hpb=44436a96352a38631237978c9fd431cef3d85cfb diff --git a/src/bot_NeonHelp.c b/src/bot_NeonHelp.c index 03e9ce9..3473d3c 100644 --- a/src/bot_NeonHelp.c +++ b/src/bot_NeonHelp.c @@ -53,10 +53,17 @@ static void neonhelp_trigger_callback(int clientid, struct ChanNode *chan, char MYSQL_RES *res; MYSQL_ROW row; loadChannelSettings(chan); - printf_mysql_query("SELECT `trigger` FROM `bot_channels` LEFT JOIN `bots` ON `botid` = `bots`.`id` WHERE `chanid` = '%d' AND `botclass` = '%d'", chan->channel_id, BOTID); + if(!(chan->flags & CHANFLAG_CHAN_REGISTERED)) { + strcpy(trigger, "!"); + return; + } + printf_mysql_query("SELECT `trigger`, `defaulttrigger` FROM `bot_channels` LEFT JOIN `bots` ON `botid` = `bots`.`id` WHERE `chanid` = '%d' AND `botclass` = '%d'", chan->channel_id, BOTID); res = mysql_use(); row = mysql_fetch_row(res); - strcpy(trigger, (strlen(row[0]) ? row[0] : "!")); + if(row[0] && *row[0]) + strcpy(trigger, row[0]); + else + strcpy(trigger, ((row[1] && *row[1]) ? row[1] : "!")); } static void start_bots() {