不和谐的python库
disco-p的Python项目详细描述
#disco
disco是[discord api]的一个简单且可扩展的库(https://discordapp.com/developers/docs/intro)。加入官方频道[这里](https://discord.gg/wmzzpec)聊天。
-富有表现力的功能性界面,让人望而却步
-为高性能和高效率而构建
-可配置和模块化,采用您需要的位
-对python 2.x/3.x的完全支持
-使用gevent
安装disco和运行“pip install disco py”一样简单,但是建议超级用户使用一些额外的软件包,即:
earl etf(3.x)etf解析器使用--encoder=etf标志
gipc gevent ipc运行,用于自动硬装
示例
使用内置bot创作工具的简单bot:
``python
from disco.bot import bot,plugin
类simpleplugin(plugin):
它们还提供了一个易于使用的命令组件
@plugin.command('ping')
def on_ping_command(self,event):
event.msg.reply('pong!')
其中包括命令参数解析
@plugin.command('echo','<;content:str..>;')
--运行bot--plugin simpleplugin`
,可以通过提及bot(由botconfig.command\u require\u提及标志配置)来触发命令:
![](http://i.imgur.com/vw6t8bi.png)
disco是[discord api]的一个简单且可扩展的库(https://discordapp.com/developers/docs/intro)。加入官方频道[这里](https://discord.gg/wmzzpec)聊天。
-富有表现力的功能性界面,让人望而却步
-为高性能和高效率而构建
-可配置和模块化,采用您需要的位
-对python 2.x/3.x的完全支持
-使用gevent
安装disco和运行“pip install disco py”一样简单,但是建议超级用户使用一些额外的软件包,即:
earl etf(3.x)etf解析器使用--encoder=etf标志
gipc gevent ipc运行,用于自动硬装
示例
使用内置bot创作工具的简单bot:
``python
from disco.bot import bot,plugin
类simpleplugin(plugin):
它们还提供了一个易于使用的命令组件
@plugin.command('ping')
def on_ping_command(self,event):
event.msg.reply('pong!')
其中包括命令参数解析
@plugin.command('echo','<;content:str..>;')
--运行bot--plugin simpleplugin`
,可以通过提及bot(由botconfig.command\u require\u提及标志配置)来触发命令:
![](http://i.imgur.com/vw6t8bi.png)