/* msgtab.h
 * (C) Peter Salanki 2002
 * This program is copyright, and covered by the Gnu Public License.
 * The Natasha bot.
 * sorcer@linux.se
 */

/*
 * Global authlevels as follows:
 * 0: Just everyone not logged in
 * 1: Normal user
 * 2: Service Friend
 * 3-6: Reserved for future stuff
 * 7: Helper
 * 8: Queue worker
 * 9: Reserved for future stuff
 * 10-19: Reserved for future stuff
 * 20: tech-guy
 * 21: Master tech-guy 
 * 22: IRC Operator
 * 23-29: Reserved for future stuff
 * 30: Borrowable arm
 * 31: Free
 * 32: Free
 * 33: Free
 * 34: Free
 * 35: Free
 * 36: Private or not borrowable arm.
 * 37: Free
 * 39: Free
 * 40: Checker service.
 * 41-50: Reserved for future special services
 */

#ifndef Q_AUTOAUTH
void m_hello (char *a, struct arm *arm);
void m_auth (char *a, struct arm *arm);
void m_email (char *a, struct arm *arm);
void m_newpass (char *a, struct arm *arm);
#else
void m_ident (char *a, struct arm *arm);
void m_sync (char *a, struct arm *arm);
#endif
void m_showcommands (char *a, struct arm *arm);
void m_help (char *a, struct arm *arm);
void m_whoami (char *a, struct arm *arm);
void m_whois (char *a, struct arm *arm);
void m_join (char *a, struct arm *arm);
void m_part (char *a, struct arm *arm);
void m_cycle (char *a, struct arm *arm);
void m_listachanusers (char *a, struct arm *arm);
#ifdef Q
void m_requestop (char *a, struct arm *arm);
#endif
void m_move (char *a, struct arm *arm);
void m_quit (char *a, struct arm *arm);
void m_rehash (char *a, struct arm *arm);
void m_status (char *a, struct arm *arm);
void m_armstatus (char *a, struct arm *arm);
void m_gban (char *a, struct arm *arm);
void m_ban (char *a, struct arm *arm);
void m_unban (char *a, struct arm *arm);
void m_access (char *a, struct arm *arm);
void m_chanset (char *a, struct arm *arm);
void m_userlev (char *a, struct arm *arm);
void m_greet (char *a, struct arm *arm);
void m_op (char *a, struct arm *arm);
void m_voice (char *a, struct arm *arm);
void m_invite (char *a, struct arm *arm);
void m_deop (char *a, struct arm *arm);
void m_devoice (char *a, struct arm *arm);
void m_devoiceall (char *a, struct arm *arm);
void m_kick (char *a, struct arm *arm);
void m_say (char *a, struct arm *arm);
void m_staffmsg (char *a, struct arm *arm);
void m_staffnotice (char *a, struct arm *arm);
void m_allsay (char *a, struct arm *arm);
void m_flushlog (char *a, struct arm *arm);
void m_broadcast (char *a, struct arm *arm);
void m_listauth (char *a, struct arm *arm);
void m_badchan (char *a, struct arm *arm);
void m_regexbadchan (char *a, struct arm *arm);
void m_unbadchan (char *a, struct arm *arm);
void m_reloadmod (char *a, struct arm *arm);
void m_loadmod (char *a, struct arm *arm);
void m_unloadmod (char *a, struct arm *arm);
void m_modstats (char *a, struct arm *arm);
#ifndef Q_AUTOAUTH
void m_oper (char *a, struct arm *arm);
#endif
void m_accept (char *a, struct arm *arm);
void m_addarm (char *a, struct arm *arm);
void m_delarm (char *a, struct arm *arm);
void m_armmode (char *a, struct arm *arm);
#ifdef OUTGOING_VHOST
void m_vhost (char *a, struct arm *arm);
#endif
void m_connectarms (char *a, struct arm *arm);
void m_syncarm (char *a, struct arm *arm);
void m_version (char *a, struct arm *arm);

struct MsgtabEntry
{
  char *msg;
  void (*func) (char *a, struct arm *arm);
  char *summary;
  char *help;
  int level;
};

struct MsgtabEntry msgtab[] =
{
  {"OP", m_op, "Gives someone +o on a channel.", "/msg %s OP <channel> <nick>\nThis sets mode +o <nick> on <channel> - You must have chanop or higher on that channel.\n", NORMAL},
  {"VOICE", m_voice, "Gives someone +v on a channel.", "/msg %s VOICE <channel> <nick>\nGives <nick> +v (voice) on a channel. You must have chanop or higher on that channel.\n", NORMAL},
  {"DEOP", m_deop, "Removes someone's op on a channel.", "/msg %s DEOP <channel> <nick>\nRemoves op on <nick> on <channel> - You must have chanop or higher on that channel.\n", NORMAL},
  {"DEVOICE", m_devoice, "Removes someone's voice on a channel.", "/msg %s DEVOICE <channel> <nick>\nRemoves voice on <nick> on a <channel>. You must have chanop or higher on that channel.\n", NORMAL},
  {"DEVOICEALL", m_devoiceall, "Devoices everyone in a channel that doesen't have voice flag in the bot.", "/msg %s DEVOICEALL <channel>\n", TECHNICIAN},
  {"INVITE", m_invite, "Invites you to a channel.", "/msg %s INVITE <channel>\nInvites you to a channel that is +i. You need to have friend or higher access on that channel.\n", NORMAL},
  {"KICK", m_kick, "Kicks someone from a channel.", "/msg %s KICK <channel> <nick>\nKicks <nick> from <channel>. You must have chanop or higher on that channel.\n", NORMAL},
  {"SAY", m_say, "Makes the bot say something.", "/msg %s SAY <target> <message>\n", NORMAL},
  {"STAFFMSG", m_staffmsg, "Opens a query with the message to every staff member that hits the mask.", "/msg %s STAFFMSG <mask> <message>\nMask is i.e <7 (all staff members with access lower than level 7), >8 (all staff members with access higher than level 8)", HELPER},
  {"STAFFNOTICE", m_staffnotice, "Sends a notice with the message to every staff member that hits the mask.", "/msg %s STAFFNOTICE <mask> <message>\nMask is i.e <7 (all staff members with access lower than level 7), =8 (all staff members with level 8)", HELPER},
  {"ALLSAY", m_allsay, "Makes all the arms in the service to msg the target.", "/msg %s ALLSAY <target> <message>\n", MASTER_TECHNICIAN},
  {"BROADCAST", m_broadcast, "Broadcast a message to all channels the bot is on.", "/msg %s BROADCAST <message>\n", TECHNICIAN},
  {"FLUSHLOG", m_flushlog, "Flushes the logs in memory to database.", "/msg %s FLUSHLOG\n", TECHNICIAN},  
  {"BAN", m_ban, "Bans someone on a channel.", "/msg %s BAN <channel> <nick>/<host> [duration] [reason]\nThis will ban someone on a channel, i.e: \"BAN #channel nick 10m U suck\" or \"BAN #channel user@host\" Default ban time is 1 hour. - You must have chanop or higher on that channel.\n", NORMAL},
  {"GLOBALBAN", m_gban, "Places a ban over the entire service/servicenet.", "/msg %s GLOBALBAN <nick>/<host> <duration> <reason>\nThis will ban someone globally, i.e: \"BAN nick 10m Flooding massively\"\n", MASTER_TECHNICIAN},
  {"UNBAN", m_unban, "Unbans someone on a channel.", "/msg %s UNBAN <channel> <nick>/<host>\nThis will unban someone on a channel, i.e: \"UNBAN #channel nick\" or \"UNBAN #channel user@host\" - You must have chanop or higher on that channel.\n", NORMAL},
#ifndef Q_AUTOAUTH
   {"HELLO", m_hello, "Creates a new user on the bot.", "/msg %s HELLO\nCreates a new user for you on the bot. Note that there are *NO HOSTMASKS* on this bot. Other bots allow you to ident if you just know the password, so this one just uses the password and scraps the hostmask as pointless.\n", UNAUTHED},
  {"AUTH", m_auth, "Identifies you as a particular user on the bot.", "/msg %s AUTH <nick> <password>\nThis will identify you on the bot as <nick> until you next quit from IRC or time out.\n", UNAUTHED},
#else
  {"IDENT", m_ident, "Identifies you as a particular user on the bot (useful i.e if you have authed with Q after joining).", "/msg %s IDENT\n Checks your auth status again.\n", UNAUTHED},
  {"SYNC", m_sync, "Syncs the AUTH status of every un-AUTH'd user on a chan.", "/msg %s SYNC <channel>\nSyncs the AUTH status of every un-AUTH'd user on a chan. Not recommended on large channels.\n", HELPER},
#endif
  {"SHOWCOMMANDS", m_showcommands, "Lists all the commands on the bot.", "/msg %s SHOWCOMMANDS\nLists the commands available on the bot and the level of access required for each. This won't list commands above your level.\n", UNAUTHED},
  {"HELP", m_help, "Gives full help on a particular bot command.", "/msg %s HELP <command>\nGives the full help (like this!) instead of the short help for a particular bot command.\n", UNAUTHED},
  {"JOIN", m_join, "Makes the bot join a channel.", "/msg %s JOIN <channel>\n", TECHNICIAN},
  {"PART", m_part, "Makes the bot leave a channel.", "/msg %s PART <channel>\n", TECHNICIAN},
  {"CYCLE", m_cycle, "Makes the bot part and then instantly join the channel.", "/msg %s CYCLE <channel>\nYou need to be a helper or owner on the channel.\nThis function is good on desyncs caused by netsplits and such.", NORMAL},
  {"LISTCHANUSERS", m_listachanusers, "Lists all active channel users on a channel.", "/msg %s LISTCHANUSERS <channel>\n", HELPER},
#ifdef Q
  {"REQUESTOP", m_requestop, "This will search the service for opless channels and request op from O when one is found.", "/msg %s REQUESTOP\nYou must be a helper.", HELPER},
#endif
  {"MOVE", m_move, "Move the bot from a channel to another.", "/msg %s MOVE <from-channel> <to-channel>\nYou must be a helper.", HELPER},
  {"REHASH", m_rehash, "Reloads the bot's config.", "/msg %s rehash\n", MASTER_TECHNICIAN},
  {"LISTAUTH", m_listauth, "List all AUTH'd users with level 10+.", "/msg %s LISTAUTH\n", HELPER},
  {"BADCHAN", m_badchan, "Ban a channel, so it is not requestable.", "/msg %s BADCHAN <channel> <duration> <reason>\n", TECHNICIAN},
  {"REGEXBADCHAN", m_regexbadchan, "Ban a channel, so it is not requestable. Using regular expressions.", "/msg %s REGEXBADCHAN <regex-channel> <duration> <reason>\n", TECHNICIAN},
  {"UNBADCHAN", m_unbadchan, "Remove badchan for a channel, so it is requestable.", "/msg %s UNBADCHAN <channel>\n", TECHNICIAN},
  {"RELOADMOD", m_reloadmod, "Reloads a module.", "/msg %s RELOADMOD <name>\nReload a module\n", MASTER_TECHNICIAN},
  {"LOADMOD", m_loadmod, "Loads a module.", "/msg %s LOADMOD <path>\n", MASTER_TECHNICIAN},
  {"UNLOADMOD", m_unloadmod, "Unloads a module.", "/msg %s UNLOADMOD <name>\n", MASTER_TECHNICIAN},
  {"MODSTATS", m_modstats, "Shows module status.", "/msg %s MODSTATS\n", HELPER},
#ifndef Q_AUTOAUTH
  {"OPER", m_oper, "Identify you as an IRC Operator.", "/msg %s OPER\n", UNAUTHED},
#endif
  {"ACCEPT", m_accept, "Accepts request from your nick.", "/msg %s ACCEPT will make you able to request a bot for a channel.\n", NORMAL},
  {"STATUS", m_status, "Shows some status for the service.", "/msg %s STATUS\n", HELPER},
  {"ARMSTATUS", m_armstatus, "Shows some status for the ARM that is messaged.", "/msg %s ARMSTATUS\n", HELPER},
  {"QUIT", m_quit, "Makes the service quit", "/msg %s QUIT <reason>\n", MASTER_TECHNICIAN},
  {"WHOAMI", m_whoami, "Gives the bot's opinion on who you are.", "/msg %s WHOAMI\nThe bot should tell you your current global auth level and may give other info too.\n", UNAUTHED},
  {"ACCESS", m_access, "Tells anyones level on a channel", "/msg %s ACCESS <channel> <nick>\n", NORMAL},
  {"GREET", m_greet, "Set someones greet on a channel.", "/msg %s GREET <channel> <nick> <message>\nYou need to be channel master or higher to be able to use this comand.\n", NORMAL},
  {"CHANSET", m_chanset, "Changes channel settings", "/msg %s CHANSET <channel> <+/-><mode> [value]\n+ activates a mode and if necessary sets a value. - disables the mode.
   Modes available are:
    modes = IRC channel modes in <value>.
    key = IRC channel key in <value>.
    autoop/autovoice = sets automatic op/voice.
    bitch = bitch mode.
    onjoin = set channel welcome message to <value>. %%n is replaced with the joiners nickname. %%p is replaced with the channel peak.
    topic = Keeps topic until master/owner changes it.
    massvoice = if someones name matches REGEX <value> he/she will be given voice (if you set * everyone will get voice).
    advertise = enable/disable anti-advertising.
    flood = anti-spam, syntax: repeats:time i.e 4:6 means that over 4 repeats in 6 seconds the user will be kickbanned for 5 minutes.
    peak = sets peak notification and the !peak public command.
    greet = If + all users with a greeting message set for your channel will be greeted.
    tv = sets the !tv public command. Shows what is currently on Swedish TV.
    vote = sets the public command !vote. To be able to vote in a channel
    infobot = sets infobot mode. Public commands like: ++ -- ?? (Not Yet Done).
    stats = enable/disable stats and logging om this channel (most people want this). The stats and log addresses will be showed if someone types stats? or logs? in the channel.\n", NORMAL},
  {"USERLEV", m_userlev, "Sets someones level on a channel.", "/msg %s USERLEV <channel> <nick> <level>\nOnly ops or higher can set voice, only master or higher can set op only owner can set master.
 Levels are:
  No = No access
  Friend = Protection from autokicks/bans
  Voice = Automatic voice
  Op = Automatic op
  Master = Master
  Owner = Owner, highest level", NORMAL},
  {"CHANLEV", m_userlev, "Sets someones level on a channel (alias to USERLEV).", "See HELP USERLEV.\n", NORMAL},
#ifndef Q_AUTOAUTH
  {"NEWPASS", m_newpass, "Changes your password", "/msg %s NEWPASS <new password\nChanges your password.\n", NORMAL},
  {"EMAIL", m_email, "Set your E-Mail", "/msg %s EMAIL <E-Mail address> <new password>\nYour E-Mail will only be used for password retrieva and channel accept/decline issues.", NORMAL},
#endif
  {"WHOIS", m_whois, "Tells you who someone really is.", "/msg %s WHOIS <nick>\nTells you what name a user has AUTHed under, if it's not the same as their nick.\n", NORMAL},
  {"ADDARM", m_addarm, "Launch a new ARM", "/msg %s ADDARM <nick>\n", MASTER_TECHNICIAN},
  {"DELARM", m_delarm, "Disconnects and deletes an ARM", "/msg %s DELARM <nick>\n", MASTER_TECHNICIAN},
  {"ARMMODE", m_armmode, "Changes the suspend status of an ARM.", "/msg %s ARMMODE <nick>\n", MASTER_TECHNICIAN},
#ifdef OUTGOING_VHOST
  {"VHOST", m_vhost, "Change the host of an arm.", "/msg %s VHOST <nick> <host>\n", MASTER_TECHNICIAN},
#endif
  {"CONNECTARMS", m_connectarms, "Changes ARM connection mode", "/msg %s CONNECTARMS\n", MASTER_TECHNICIAN},
  {"SYNCARM", m_syncarm, "Makes you able to fix an arm that has faulty info.", "/msg %s SYNCARM <nick> <type>\nTypes are: 0: Rejoin homechan 1: Reconnect to server. 2: Database sync 3: Hard reconnect\n", MASTER_TECHNICIAN},
  {"VERSION", m_version, "Show version info", "/msg %s VERSION\n", UNAUTHED},
  {"DONE", 0, "DONE", "DONE", 1000}
};
