summaryrefslogtreecommitdiff
path: root/include/commands.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-11-24 21:40:56 -0600
committerAdam <Adam@anope.org>2010-12-12 19:36:19 -0500
commitcb6ef574e3df5cc846247450b74ca37d265f319e (patch)
tree8ce3374a537c312af63c78125bfea4622bb188f0 /include/commands.h
parent37e02a3594fdddc3d5a3df0501c528f42db6c4da (diff)
Send replies from fantasy commands back to the channel, this will be expanded on later
Diffstat (limited to 'include/commands.h')
-rw-r--r--include/commands.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/include/commands.h b/include/commands.h
index 5c0b5315c..e247fc388 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -43,6 +43,25 @@ enum CommandFlag
CFLAG_DISABLE_FANTASY
};
+/* The source for a command */
+struct CommandSource
+{
+ /* User executing the command */
+ User *u;
+ /* Channel (if applicable) */
+ ChannelInfo *ci;
+ /* The service this command is on */
+ BotInfo *owner;
+ /* The service the reply should come from, *not* necessarily the service the command is on */
+ BotInfo *service;
+ /* Whether or not this was a fantasy command */
+ bool fantasy;
+
+ void Reply(LanguageString message, ...);
+ void Reply(const char *message, ...);
+ void Reply(const Anope::string &message);
+};
+
/** Every services command is a class, inheriting from Command.
*/
class CoreExport Command : public Flags<CommandFlag>
@@ -73,9 +92,10 @@ class CoreExport Command : public Flags<CommandFlag>
virtual ~Command();
/** Execute this command.
- * @param u The user executing the command.
+ * @param source The source
+ * @param params Command parameters
*/
- virtual CommandReturn Execute(User *u, const std::vector<Anope::string> &);
+ virtual CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params) = 0;
/** Called when HELP is requsted for the client this command is on.
* @param u The user requesting help