Giter Club home page Giter Club logo

madelineprotopluginsystem's Introduction

MadelineProto Plugin System V1.5

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!

Instructions


Table Of Contents
1-Installation
1.1-Using Terminal
1.1.1-Download Repository
1.1.2-Config And Run
1.2-Using Browser
1.2.1-Download Repository
1.2.2-Config And Run
2-Any time configuration
2.1-Using terminal
2.2-Using Browser
3-How To Use
3.1-Plugins
3.1.1-Syntax
3.1.2-Loading Plugins On Bot
3.1.3-Available Plugins
3.1.4-Available Commands

1-Installation

1.1-Using Terminal

1.1.1-Download Repository

First clone this repository using git:

$ git clone https://github.com/realGuys/MadelineProtoPluginSystem.git

Go to it's directory:

$ cd MadelineProtoPluginSystem
1.1.2-Config And Run

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!

1.2-Using Browser

1.2.1-Download Repository

Download repository as zip from here, then upload it on your host and extract it.

1.2.2-Config And Run

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!

2-Any time configuration

2.1-Using terminal

Run index.php file with --config flag:

$ php index.php --config

2.2-Using Browser

Run index.php file in browser with config query:

http://yourdomain.ext/path/to/index.php?config

3-How To Use

3.1-Plugins

3.1.1-Syntax

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;
3.1.2-Loading Plugins On Bot

No need to do that! The plugins will automatically load on starting bot.

3.1.3-Available Plugins

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!

3.1.4-Available Commands
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

madelineprotopluginsystem's People

Contributors

realsamy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.