MadelineProtoPluginSystem开源项目

我要开发同款
匿名用户2021年11月08日
45阅读
开发技术Python
所属分类应用工具、IM/聊天/语音工具
授权协议MIT License

作品详情

MadelineProtoPluginSystemV1.5

Afullyasyncplugin-friendlyMadelineProtosourcebase

Usethissourcecodetomakeyourideasinaniceasyncway!Justfollowthewaythatsourcecodeitselfiswrittenin!

InstructionsTableOfContents1-Installation1.1-UsingTerminal1.1.1-DownloadRepository1.1.2-ConfigAndRun1.2-UsingBrowser1.2.1-DownloadRepository1.2.2-ConfigAndRun2-Anytimeconfiguration2.1-Usingterminal2.2-UsingBrowser3-HowToUse3.1-Plugins3.1.1-Syntax3.1.2-LoadingPluginsOnBot3.1.3-AvailablePlugins3.1.4-AvailableCommands1-Installation1.1-UsingTerminal1.1.1-DownloadRepository

Firstclonethisrepositoryusinggit:

$gitclonehttps://github.com/realGuys/MadelineProtoPluginSystem.git

Gotoit'sdirectory:

$cdMadelineProtoPluginSystem1.1.2-ConfigAndRun

Justrunitandconfigitthroughyourterminalandanswerpromptstoconfigyourbotsettings:

$phpindex.php

Enjoyyourfirst(user)botusingthisPluginSystem!

1.2-UsingBrowser1.2.1-DownloadRepository

Downloadrepositoryaszipfromhere,thenuploaditonyourhostandextractit.

1.2.2-ConfigAndRun

Runindex.phpfilethroughyourbrowserandfillaskedformstoconfigyourbotsettings.

Enjoyyourfirst(user)botusingthisPluginSystem!

2-Anytimeconfiguration2.1-Usingterminal

Runindex.phpfilewith--configflag:

$phpindex.php--config2.2-UsingBrowser

Runindex.phpfileinbrowserwithconfigquery:

https://yourdomain.ext/path/to/index.php?config3-HowToUse3.1-Plugins3.1.1-Syntax

Pluginfilesmustreturnanarraywithtwocolumnofvalues,thefirstonedescribesroleofuserusingthecommand,thesecondoneiscommanditself!Youcanmakeapluginwithtwocommandsfortwodifferentrolesjustlikethis:

<?php/***Justanothersimpleplugin**/$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-LoadingPluginsOnBot

Noneedtodothat!Thepluginswillautomaticallyloadonstartingbot.

3.1.3-AvailablePlugins

Thereissomepluginsforaddadminaccesstootherusers,reloadingpluginse.g.toapplynewchangesandsooninthepluginsdirectory,usethamtomakeyourownawesomeplugins!

MaybeImakesomenewpluginsandaddthemtorepositorytoo,youmaycommityourstoo!

3.1.4-AvailableCommandsCommandInformationpingJustasimplepingcommand!getReports(on|off)Enable/DisableerrorreportingaddAdmin(@username|reply)AddsnewadminstobotusingaddAdmin@usernameorsimplyreplythiscommandonamessageaddOwner(@username|reply)Addsnewownerstobot,usejustlikeaddAdmin!delAdmin(@username|reply)Removesadminsfrombot,usejustlikeaddAdmin!listAdminSendsalistofcurrentadminsreloadReloadsPluginSysteme.g.toapplynewchangesrestartRestartsthebotshutdownShutsthebotdown
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论