A fully async plugin-friendly MadelineProto source base
Use this source code to make your ideas in a nice async way! Just follow the way that source code itself is written in!
First clone this repository using git:
$ git clone https://github.com/realGuys/MadelineProtoPluginSystem.git
Go to it's directory:
$ cd MadelineProtoPluginSystem
Just run it and config it through your terminal and answer prompts to config your bot settings:
$ php index.php
Enjoy your first (user) bot using this Plugin System!
Download repository as zip from here, then upload it on your host and extract it.
Run index.php file through your browser and fill asked forms to config your bot settings.
Enjoy your first (user) bot using this Plugin System!
Run index.php
file with --config
flag:
$ php index.php --config
Run index.php
file in browser with config
query:
http://yourdomain.ext/path/to/index.php?config
Plugin files must return an array with two column of values, the first one describes role
of user using the command, the second one is command
itself!
You can make a plugin with two commands for two different roles just like this:
<?php
/**
* Just another simple plugin
**/
$commands['role1']['ping'] = function (array $update): \Generator
{
yield $this->messages->sendMessage([
'peer' => $update,
'message' => 'Pong!'
]);
};
$commands['role2']['hello'] = function (array $update): \Generator
{
yield $this->messages->sendMessage([
'peer' => $update,
'message' => 'Pong!'
]);
};
return $commands;
No need to do that! The plugins will automatically load on starting bot.
There is some plugins for add admin access to other users, reloading plugins e.g. to apply new changes and so on in the plugins
directory, use tham to make your own awesome plugins!
Maybe I make some new plugins and add them to repository too, you may commit yours too!
Command | Information |
---|---|
ping | Just a simple ping command! |
getReports (on |off ) |
Enable/Disable error reporting |
addAdmin (@username |reply ) |
Adds new admins to bot using addAdmin @username or simply reply this command on a message |
addOwner (@username |reply ) |
Adds new owners to bot, use just like addAdmin ! |
delAdmin (@username |reply ) |
Removes admins from bot, use just like addAdmin ! |
listAdmin | Sends a list of current admins |
reload | Reloads Plugin System e.g. to apply new changes |
restart | Restarts the bot |
shutdown | Shuts the bot down |