This commit is contained in:
hibiki 2021-05-20 19:06:01 +08:00
commit 5385a24c1e
208 changed files with 221 additions and 0 deletions

View File

@ -1,10 +1,18 @@
<<<<<<< HEAD
SUPERUSERS=[""]
=======
SUPERUSERS=["775757368"]
>>>>>>> master
COMMAND_START=[""]
SESSION_RUNNING_EXPRESSION="别急呀,小真寻要宕机了!QAQ"
<<<<<<< HEAD
NICKNAME=["真寻", "小真寻", "绪山真寻", "小寻子"]
=======
NICKNAME=["A"]
>>>>>>> master
SESSION_EXPIRE_TIMEOUT=30

2
.gitgignore Normal file
View File

@ -0,0 +1,2 @@
*/__pycache__/
/.idea/

107
bot.py
View File

@ -1,3 +1,7 @@
<<<<<<< HEAD
=======
<<<<<<< HEAD
>>>>>>> master
import nonebot
from nonebot.adapters.cqhttp import Bot as CQHTTPBot
from services.db_context import init, disconnect
@ -70,7 +74,11 @@ if __name__ == "__main__":
# "role": "member/admin/owner", "title": ""}, "to_me": true, "reply": null, "group_id": 863633108, "anonymous": null}
# bilibili转发
<<<<<<< HEAD
# {"app":"com.tencent.miniapp_01","configs":{"autoSize":0,"ctime":1613992391,"forward":1,"height":0,"
=======
# {"app":"com.tencent.miniapp_01","config":{"autoSize":0,"ctime":1613992391,"forward":1,"height":0,"
>>>>>>> master
# token":"f7f529900be6af62f4d864f8a92c94c9","type":"normal","width":0},"desc":"哔哩哔哩",
# "extra":{"app_type":1,"appid":100951776,"uin":775757368},"meta":{"detail_1":{"appid":"1109937557",
# "desc":"B 站 用 户 三 连 现 状","gamePoints":"","gamePointsUrl":"","host":{"nick":"这里是","uin":775757368},
@ -92,3 +100,102 @@ if __name__ == "__main__":
<<<<<<< HEAD
=======
=======
import nonebot
from nonebot.adapters.cqhttp import Bot as CQHTTPBot
from services.db_context import init, disconnect
nonebot.init()
driver = nonebot.get_driver()
driver.register_adapter("cqhttp", CQHTTPBot)
config = driver.config
driver.on_startup(init)
driver.on_shutdown(disconnect)
nonebot.load_builtin_plugins()
nonebot.load_plugins("plugins")
nonebot.load_plugins("plugins/shop")
nonebot.load_plugins("plugins/genshin")
if __name__ == "__main__":
nonebot.run()
# None
# ---------------------
# 775757368 print(event.get_user_id())
# 775757368 print(event.get_session_id())
# 天气 print(event.get_message())
# message.group.normal print(event.get_event_name())
# 天气 print(event.get_plaintext())
# -------
# 863633108 print(event.group_id)
# 775757368 print(event.user_id)
# 1851212230 print(event.message_id)
# event
# [request.group.invite]: {
# 'time': 1612430661, 'self_id': 3054557284, 'post_type': 'request', 'request_type': 'group', 'sub_type': 'invite',
# 'group_id': 863633108, 'user_id': 775757368, 'comment': '', 'flag': '1612430661235986'}
# [request.friend]: {'time': 1612431762, 'self_id': 3054557284, 'post_type': 'request',
# 'request_type': 'friend', 'user_id': 3238573864, 'comment': '', 'flag': '1612431762000000'}
# [notice.group_decrease.leave]: {'time': 1612620312,
# 'self_id': 3054557284, 'post_type': 'notice', 'notice_type': 'group_decrease',
# 'sub_type': 'leave', 'user_id': 3238573864, 'group_id': 863633108, 'operator_id': 3238573864}
# [notice.group_increase.approve]: {'time': 1612620506,
# 'self_id': 3054557284, 'post_type': 'notice', 'notice_type': 'group_increase',
# 'sub_type': 'approve', 'user_id': 3238573864, 'group_id': 863633108, 'operator_id': 0}
# get_group_list
# [{'group_id': 210287674, 'group_name': '豪爹头号粉丝⑧群', 'max_member_count': 200, 'member_count': 14},
# {'group_id': 863633108, 'group_name': 'Amireux、这里是、可…', 'max_member_count': 200, 'member_count': 4}]
# 消息event
# {"time": 1613886297, "self_id": 3054557284, "post_type": "message", "sub_type": "normal", "user_id": 3238573864,
# "message_type": "group", "message_id": 1933353523, "message": [{"type": "text", "data": {"text": "666"}}],
# "raw_message": "A666", "font": 0, "sender": {"user_id": 3238573864, "nickname":
# "\u53ef\u7231\u7684\u5c0f\u771f\u5bfb", "sex": "unknown", "age": 0, "card": "", "area": "", "level": "",
# "role": "member/admin/owner", "title": ""}, "to_me": true, "reply": null, "group_id": 863633108, "anonymous": null}
# bilibili转发
# {"app":"com.tencent.miniapp_01","config":{"autoSize":0,"ctime":1613992391,"forward":1,"height":0,"
# token":"f7f529900be6af62f4d864f8a92c94c9","type":"normal","width":0},"desc":"哔哩哔哩",
# "extra":{"app_type":1,"appid":100951776,"uin":775757368},"meta":{"detail_1":{"appid":"1109937557",
# "desc":"B 站 用 户 三 连 现 状","gamePoints":"","gamePointsUrl":"","host":{"nick":"这里是","uin":775757368},
# "icon":"http://miniapp.gtimg.cn/public/appicon/432b76be3a548fc128acaa6c1ec90131_200.jpg",
# "preview":"pubminishare-30161.picsz.qpic.cn/4f5a19fb-42d5-4bb5-bc0a-b92fa5a06519",
# "qqdocurl":"https://b23.tv/qDvchc?share_medium=android&share_source=qq&bbid=XYDEA6CD35717661AE594D9DD99A5E852E414&ts=1613992387314",
# "scene":1036,"shareTemplateData":{},"shareTemplateId":"8C8E89B49BE609866298ADDFF2DBABA4","showLittleTail":"","title":"哔哩哔哩",
# "url":"m.q.qq.com/a/s/130c1f9c2af58430805ebfda192caa9a"}},"needShareCallBack":false,"prompt":"[QQ小程序]哔哩哔哩","ver":"1.0.0.19",
# "view":"view_8C8E89B49BE609866298ADDFF2DBABA4"}
#event
# [notice.group_decrease.kick_me]: {'time': 1614143313, 'self_id': 3054557284, 'post_type': 'notice',
# 'notice_type': 'group_decrease', 'sub_type': 'kick_me', 'user_id': 3054557284, 'group_id': 863633108,
# 'operator_id': 775757368}
# [request.group.add]: {'time': 1614851972, 'self_id': 3238573864, 'post_type': 'request', 'request_type': 'group',
# 'sub_type': 'add', 'group_id': 774261838, 'user_id': 3054557284, 'comment': '问题:为啥加群鸭?\n答案哈哈哈',
# 'flag': '1614851972274444'}
>>>>>>> master
>>>>>>> master

View File

@ -6,6 +6,7 @@ except ModuleNotFoundError:
# 是否使用配置文件
<<<<<<< HEAD
USE_CONFIG_FILE = True
@ -24,6 +25,9 @@ password = ''
address = ''
port = ''
database = ''
=======
USE_CONFIG_FILE = False
>>>>>>> master
# 公开图库列表
@ -32,6 +36,7 @@ IMAGE_DIR_LIST = ["色图", "美图", "萝莉", "壁纸"]
# 对被ban用户发送的消息
BAN_RESULT = "才不会给你发消息."
<<<<<<< HEAD
# 插件配置
MAXINFO_REIMU: int = 7 # 上车(reimu)功能查找目的地的最大数
@ -39,11 +44,22 @@ COUNT_PER_DAY_REIMU: int = 5 # 每日上车(reimu)次数限制
MAXINFO_BT: int = 10 # bt功能单次查找最大数
MAXINFO_PRIVATE_ANIME: int = 20 # 私聊搜索动漫返回的最大数量
MAXINFO_GROUP_ANIME: int = 5 # 群搜索动漫返回的最大数量
=======
MAXINFO_REIMU: int = 7 # 上车功能查找目的地的最大数
COUNT_PER_DAY_REIMU: int = 5 # 每日上车次数限制
MAXINFO_BT: int = 10 # bt功能单次查找最大数
MAXINFO_PRIVATE_ANIME: int = 20 # 私聊单词搜索动漫最大数
MAXINFO_GROUP_ANIME: int = 5 # 群单词搜索动漫最大数
>>>>>>> master
MAX_FIND_IMG_COUNT = 3 # 识图最大返回数
ADMIN_DEFAULT_AUTH = 5 # 默认群管理员权限
<<<<<<< HEAD
MAX_SIGN_GOLD = 200 # 签到好感度加成额外获得的最大金币数
=======
MAX_SIGN_GOLD = 200 # 好感度加成额外获得的最大金币数
>>>>>>> master
INITIAL_SETU_PROBABILITY = 0.7 # 色图概率
FUDU_PROBABILITY = 0.7 # 复读概率
@ -54,6 +70,7 @@ MUTE_DEFAULT_TIME = 7 # 刷屏检测默认规定时间
MUTE_DEFAULT_DURATION = 10 # 刷屏检测默禁言时长(分钟)
<<<<<<< HEAD
# 注:即在 MALICIOUS_CHECK_TIME 时间内触发相同命令 MALICIOUS_BAN_COUNT 将被ban MALICIOUS_BAN_TIME 分钟
MALICIOUS_BAN_TIME = 30 # 恶意命令触发检测触发后ban的时长分钟
MALICIOUS_BAN_COUNT = 4 # 恶意命令触发检测最大触发次数
@ -71,6 +88,25 @@ MUTE_LEVEL: int = 5 # 更改禁言设置权限
# 示例:[434995955, 239483248]
UPDATE_GOCQ_GROUP = []
=======
# 注:即在 MALICIOUS_BAN_COUNT 时间内触发相同命令 MALICIOUS_CHECK_TIME 将被ban MALICIOUS_BAN_TIME 分钟
MALICIOUS_BAN_TIME = 30 # 恶意命令触发检测触发后ban的时长分钟
MALICIOUS_BAN_COUNT = 4 # 恶意命令触发检测规定时间内(秒)
MALICIOUS_CHECK_TIME = 5 # 恶意命令触发检测最大触发次数
# LEVEL
DELETE_IMG_LEVEL: int = 7
MOVE_IMG_LEVEL: int = 7
UPLOAD_LEVEL: int = 6
BAN_LEVEL: int = 5
OC_LEVEL: int = 2
MUTE_LEVEL: int = 5
# 需要更新gocq吗
UPDATE_GOCQ_GROUP = []
>>>>>>> master
# 代理
system_proxy = 'http://127.0.0.1:7890'
buff_proxy = ''
@ -83,8 +119,28 @@ LOCAL_SETU = True
AUTO_ADD_FRIEND = True
<<<<<<< HEAD
# 模块与对应命令
# 用于生成帮助图片 和 开关功能
=======
# API KEY
LOLICON_KEY: str = "336595836015174952daa2" # lolicon
RSSHUBAPP: str = "https://docs.rsshub.app/" # rsshub
# 图灵
TL_KEY = ["4474710fabbf4540bfaa569c192bb457", "6f4c0920d2ff4962b5cbd8148aef771b",
"f5595738894042fb9fad88ecdc4acf41", "c24400595fed48f9a5c5bc3ff03a3267", "efab135b75d84b02a59115f5b571f277"]
# 数据库
bind = 'postgresql://hibiki:KEWang130123@hibiki0v0.cn:5432/hibikibot'
sql_name = ''
user = ''
password = ''
address = ''
port = ''
database = ''
>>>>>>> master
plugins2name_dict = {
'sign_in': ['签到'],
'send_img': ['发送图片', '萝莉', '美图', '壁纸'],
@ -123,7 +179,11 @@ plugins2name_dict = {
'query_resource_points': ['原神资源查询', '原神资源列表'],
}
<<<<<<< HEAD
# 群管理员功能 与 对应权限
=======
>>>>>>> master
admin_plugins_auth = {
'admin_bot_manage': OC_LEVEL,
'ban': BAN_LEVEL,
@ -134,16 +194,23 @@ admin_plugins_auth = {
'mute': MUTE_LEVEL,
}
<<<<<<< HEAD
# 配置文件应用
=======
>>>>>>> master
if USE_CONFIG_FILE:
config = get_config_data()
if config:
for key in config.keys():
if isinstance(config[key], str):
config[key] = config[key].strip()
<<<<<<< HEAD
if key.find('proxy') != -1:
if not config[key]:
config[key] = None
=======
>>>>>>> master
# if not configs[key] and key.find("PATH") == -1:
# configs[key] = None
globals().update(config)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More