diff options
author | Adam <Adam@anope.org> | 2010-11-24 21:40:56 -0600 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-12-12 19:36:19 -0500 |
commit | cb6ef574e3df5cc846247450b74ca37d265f319e (patch) | |
tree | 8ce3374a537c312af63c78125bfea4622bb188f0 /include/commands.h | |
parent | 37e02a3594fdddc3d5a3df0501c528f42db6c4da (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.h | 24 |
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> ¶ms) = 0; /** Called when HELP is requsted for the client this command is on. * @param u The user requesting help |