Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: OnPreCommand: Know which command is executed  (Read 2503 times)

0 Members and 1 Guest are viewing this topic.

Zoddo

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 8
OnPreCommand: Know which command is executed
« on: June 05, 2014, 08:22:06 PM »

Hi !

Firstly, sorry for my bad English.

I develop a module for myself and I would know which command is executed in the event OnPreCommand.
I don't find function to make it in the class Command
Logged

Adam

  • Team
  • *
  • Offline Offline
  • Posts: 462
Re: OnPreCommand: Know which command is executed
« Reply #1 on: June 05, 2014, 08:24:08 PM »

Code: [Select]
EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> &params);

'command' is the command executed.
Logged

Zoddo

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 8
Re: OnPreCommand: Know which command is executed
« Reply #2 on: June 05, 2014, 08:26:50 PM »

Yes, but how to know the command ? I don't find a method in the class Command to do so.
Logged

Adam

  • Team
  • *
  • Offline Offline
  • Posts: 462
Re: OnPreCommand: Know which command is executed
« Reply #3 on: June 05, 2014, 08:30:08 PM »

You mean source.command?
Logged

Zoddo

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 8
Re: OnPreCommand: Know which command is executed
« Reply #4 on: June 05, 2014, 08:32:35 PM »

Oh, Thanks you! I didn't really pay attention to CommandSource class.
Logged
Pages: [1]   Go Up