forked from henriquemaio/CaronasBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
28 lines (26 loc) · 689 Bytes
/
example.php
File metadata and controls
28 lines (26 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
require __DIR__."/vendor/autoload.php";
require_once "src/TeleMatic.php";
use TeleMatic\TeleMatic;
$token = "141695972:AAGy7QJbShMFUK-xRJmKHKE0PdHvZ1MymPQ";
$tele = new TeleMatic("botName", $token, true);
$cmd = $tele->command;
$args = $tele->args;
switch($cmd){
case "help":
$tele->sendMessage("I don't need any help, but thanks!");
break;
case "echo":
if(count($args)){
$msg = 'You said "';
foreach($args as $word) $msg.="$word ";
$msg = rtrim($msg);
$msg .= '".';
$tele->sendMessage($msg);
}else $tele->sendMessage("How does silence sound in an echoey room?");
break;
default:
$tele->sendMessage("My man!");
}
?>
END