1: <?php
2:
3: namespace Budabot\User\Modules;
4:
5: use Budabot\Core\AutoInject;
6:
7: /**
8: * Authors:
9: * - Tyrence (RK2)
10: *
11: * @Instance
12: *
13: * Commands this controller contains:
14: * @DefineCommand(
15: * command = 'sendtell',
16: * accessLevel = 'superadmin',
17: * description = 'Send a tell to another character from the bot',
18: * help = 'sendtell.txt'
19: * )
20: */
21: class SendTellController extends AutoInject {
22:
23: /**
24: * Name of the module.
25: * Set automatically by module loader.
26: */
27: public $moduleName;
28:
29: /**
30: * @Setup
31: */
32: public function setup() {
33:
34: }
35:
36: /**
37: * @HandlesCommand("sendtell")
38: * @Matches("/^sendtell ([a-z0-9-]+) (.+)$/i")
39: */
40: public function sendtellCommand($message, $channel, $sender, $sendto, $args) {
41: $name = ucfirst(strtolower($args[1]));
42: $message = $args[2];
43:
44: $this->logger->logChat("Out. Msg.", $name, $message);
45: $this->chatBot->send_tell($name, $message, "\0", AOC_PRIORITY_MED);
46: $sendto->reply("Message has been sent to <highlight>$name<end>.");
47: }
48: }
49: