AltervistaUserBot/_comandi.php

47 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2018-03-27 17:08:11 +02:00
<?php
2018-03-27 22:14:22 +02:00
include '_config.php';
2018-03-27 17:08:11 +02:00
/*
QUESTO FILE SERVE PER AVERE SEPARATI I COMANDI DELL'USERBOT
DAI FILE BASE DI FUNZIONAMENTO DELLO STESSO
*/
if (isset($userID) && in_array($userID, $lista_admin)) {
$isadmin = true;
} else {
$isadmin = false;
}
if (isset($msg) && isset($chatID)) {
if ($isadmin) {
if ($msg == '!on') {
sm($chatID, "Hello world, I'm alive.");
}
2018-03-27 20:23:15 +02:00
if ($msg == '!pony') {
sm($chatID, "This bot is powered by altervistabot & MadelineProto.\n\nCreated by a pony and a bruno.");
}
2018-03-27 17:08:11 +02:00
if (stripos($msg, '!say ') === 0) {
sm($chatID, explode(' ', $msg, 2)[1]);
}
2018-03-27 22:09:10 +02:00
if ($msg == '!off' and (time() - $started) > 5) {
2018-03-27 17:08:11 +02:00
sm($chatID, 'Mi spengo.');
exit;
}
if (stripos($msg, '!join ') === 0) {
joinChat(explode(' ', $msg, 2)[1], $chatID);
}
if ($msg == '!leave' && stripos($chatID, '-100') === 0) {
abbandonaChat($chatID);
}
//ALTRI COMANDI RISERVATI AGLI ADMIN
}
//COMANDI DESTINATI AL PUBBLICO
}