ALTER TABLE `bots` DROP `whoisbot` ;
ALTER TABLE `bots` DROP `bindFrom` ;
+CREATE TABLE IF NOT EXISTS `help` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `lang` varchar(6) NOT NULL,
+ `ident` varchar(64) NOT NULL,
+ `text` text NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+CREATE TABLE IF NOT EXISTS `language` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `lang` varchar(5) NOT NULL,
+ `ident` varchar(64) NOT NULL,
+ `text` varchar(256) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+ALTER TABLE `bot_channels` ADD `suspended` TINYINT( 1 ) NOT NULL;
\ No newline at end of file
putsock(client, "MODE %s +%s", client->user->nick, row[0]);
}
- printf_mysql_query("SELECT `channel_name`, `channel_key` FROM `bot_channels` LEFT JOIN `channels` ON `chanid` = `channel_id` WHERE `botid` = '%d'", client->clientid);
+ printf_mysql_query("SELECT `channel_name`, `channel_key` FROM `bot_channels` LEFT JOIN `channels` ON `chanid` = `channel_id` WHERE `botid` = '%d' AND `suspended` = '0'", client->clientid);
res = mysql_use();
while ((row = mysql_fetch_row(res)) != NULL) {
static const struct default_language_entry msgtab[] = {
{"MODCMD_LESS_PARAM_COUNT", "This command requires more parameters."},
- {"MODCMD_CHAN_REQUIRED", "You must provide the name of a channel that exists."},
+ {"MODCMD_CHAN_REQUIRED", "You must provide the name of a channel that exists and the bot is on."},
{"MODCMD_AUTH_REQUIRED", "You need to be authenticated with AuthServ to use this command."},
+ {"MODCMD_CHAN_SUSPENDED", "This channel is currently suspended."},
{"MODCMD_PRIVILEGED", "$b%s$b is a privileged command."}, /* {ARGS: "god"} */
{"MODCMD_PUBCMD", "Public commands in $b%s$b are restricted."}, /* {ARGS: "#TestChan"} */
{"MODCMD_ACCESS_DENIED", "Access denied."},
reply(tmp_text_client, user, "MODCMD_CHAN_REQUIRED");
return;
}
- printf_mysql_query("SELECT `botid` FROM `bot_channels` LEFT JOIN `bots` ON `bot_channels`.`botid` = `bots`.`id` WHERE `chanid` = '%d' AND `botclass` = '%d'", chan->channel_id, client->botid);
+ printf_mysql_query("SELECT `botid`, `suspended` FROM `bot_channels` LEFT JOIN `bots` ON `bot_channels`.`botid` = `bots`.`id` WHERE `chanid` = '%d' AND `botclass` = '%d'", chan->channel_id, client->botid);
res = mysql_use();
if ((row = mysql_fetch_row(res)) == NULL) {
reply(tmp_text_client, user, "MODCMD_CHAN_REQUIRED");
return;
+ } else if(!strcmp(row[1], "1")) {
+ reply(tmp_text_client, user, "MODCMD_CHAN_SUSPENDED");
+ return;
}
}
if((cbind->func->flags & CMDFLAG_REQUIRE_GOD) && !isGodMode(user)) {