Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/modules
2021-04-08 23:22:55 +08:00
..
bugtracker Fixed a bug that may cause reading to confuse 2021-04-08 23:17:13 +08:00
core Fixed several bugs that may cause oa too lazy 2021-04-08 23:21:40 +08:00
cytoid Update __init__.py 2021-04-08 20:51:46 +08:00
github Fixed several bugs that may cause oa quality 2021-04-08 23:20:14 +08:00
mcv Revert "🤡" 2021-04-01 23:58:02 +08:00
mcv_rss Fixed several bugs that may cause oa too lazy 2021-04-08 23:21:40 +08:00
nintendo_err Fixed several bugs that may cause oa quality 2021-04-08 23:20:14 +08:00
server update 2021-02-19 20:20:00 +08:00
user Fixed several bugs that may cause oa too lazy 2021-04-08 23:21:40 +08:00
utils Fixed several bugs that may cause oa too lazy 2021-04-08 23:21:40 +08:00
weekly Well it just reformat code but lol 2021-04-08 23:22:55 +08:00
wiki Fixed several bugs that may cause oa too lazy 2021-04-08 23:21:40 +08:00
README.MD remove unused module help and refactor user 2021-02-09 21:05:19 +08:00

没人看的信息

如何添加模块

  1. 新建一个文件夹。
  2. 在新建的文件夹内新建一个名为 __init__.py的文件。
  3. 编写一个异步函数,异步函数接收一个 dict 类型的参数,这个 dict 包含从 parser.pybot.py 传入的信息。
  4. 在函数外编写一些能够被加载器识别的变量,变量值需为 dict,以下是能够被加载器识别的变量(不需要的变量可不编写,示例可以看已经写好的模块):
#函数名后面不要带括号
admin = {'绑定指令名': 函数名} #将函数标记为仅超级管理员可用的指令,此变量内的函数会在机器人启动时被强制启用,不可关闭
essential = {'绑定指令名': 函数名} #将函数标记为基础命令,此变量内的函数会在机器人启动时被强制启用,不可关闭
command = {'绑定指令名': 函数名} #将函数标记为模块命令,此变量内的函数需要在机器人启动后进行手动启用
help = {'绑定指令名':{'help': '模块详细帮助'}} #此变量用于编写帮助
regex = {'绑定指令名': 函数名} #将函数标记为正则命令,此变量内的函数在机器人启动后手动启用。标记为正则命令的函数会处理机器人收到的每一条消息。
self_options = ['自定义参数'] #用于检查用户是否要求开启某一项功能,可帮助判断。
options = ['自定义参数'] #用于检查群组是否要求开启某一项功能,可帮助判断。

灵活运用这些东西。