Commit Graph

28 Commits

Author SHA1 Message Date
洛水.山岭居室
693cd774d3
重构插件传入 service 方式
* 重构插件传入 `service` 方式

重构插件传入 `service` 方式
将 `create_handlers`函数的修饰符改为 `classmethod`
2022-07-07 09:36:34 +08:00
洛水.山岭居室
cb2ac781a4
使用修饰器加载插件 2022-06-26 14:17:43 +08:00
洛水居室
0d10707812
修改 restricts 部分逻辑 2022-06-26 13:47:50 +08:00
洛水.山岭居室
da545629a1
重写相关洪水防御代码 2022-06-22 21:33:07 +08:00
洛水居室
7ff5dd3233
移动文件 model/random.pyutils 目录 2022-06-19 17:54:30 +08:00
洛水居室
f41a547fa4
添加基于 MT19937 的随机数生成器 2022-06-18 19:56:44 +08:00
洛水居室
6bb09bcb25
删除部分日记换行符 添加日记记录 2022-06-10 16:47:32 +08:00
luoshuijs
8eb7db73ea
修改部分函数细节 添加注释 2022-06-09 23:35:32 +08:00
luoshuijs
bb77a52918
Modify function to contain unused parameters 2022-06-09 23:35:32 +08:00
luoshuijs
56c8ee3591
格式化代码并优化导入 2022-06-09 23:25:19 +08:00
kotoriのねこ
6b9e06a2e3 Fix imports; refactor add_handlers into handler.py 2022-06-09 15:08:04 +08:00
kotoriのねこ
1818d93388 Refactor conversation handler creations into plugins 2022-06-09 15:08:04 +08:00
洛水.山岭居室
1e94d3197e 修改大部分的 reply_chat_action 2022-05-30 16:08:56 +08:00
deepsource-autofix[bot]
34688cd914 Remove unnecessary f-string 2022-05-28 15:28:44 +08:00
洛水.山岭居室
02fa66f7b6 添加 service.quizcorrect_option 异常时的日记 2022-05-25 17:04:14 +08:00
洛水.山岭居室
11153b582c 尝试修复奇怪的错误
很奇怪,先会这样

`Traceback (most recent call last):
  File "/home/luoshuijs/anaconda3/envs/TGPaimonBot/lib/python3.9/site-packages/python_telegram_bot-20.0a0-py3.9.egg/telegram/ext/_application.py", line 874, in __create_task_callback
    raise exception
  File "/home/luoshuijs/anaconda3/envs/TGPaimonBot/lib/python3.9/site-packages/python_telegram_bot-20.0a0-py3.9.egg/telegram/ext/_application.py", line 846, in __create_task_callback
    return await coroutine
  File "/home/luoshuijs/anaconda3/envs/TGPaimonBot/lib/python3.9/site-packages/python_telegram_bot-20.0a0-py3.9.egg/telegram/ext/_handler.py", line 137, in handle_update
    return await self.callback(update, context)
  File "/root/Projects/TGPaimonBot/plugins/base.py", line 66, in decorator
    return await func(*args, **kwargs)
  File "/root/Projects/TGPaimonBot/plugins/quiz.py", line 95, in command_start
    poll_message = await self.send_poll(update)
  File "/root/Projects/TGPaimonBot/plugins/quiz.py", line 66, in send_poll
    index = options.index(correct_option)
ValueError: '' is not in list`

然后就会一直这样

`Traceback (most recent call last):
  File "/home/luoshuijs/anaconda3/envs/TGPaimonBot/lib/python3.9/site-packages/python_telegram_bot-20.0a0-py3.9.egg/telegram/ext/_application.py", line 929, in process_update
    check = handler.check_update(update)  # Should the handler handle this update?
  File "/home/luoshuijs/anaconda3/envs/TGPaimonBot/lib/python3.9/site-packages/python_telegram_bot-20.0a0-py3.9.egg/telegram/ext/_conversationhandler.py", line 741, in check_update
    for candidate in self.states.get(state, []):
TypeError: unhashable type: 'PendingState'`

但是对于上个错误一直触发我也没办法
2022-05-25 14:24:13 +08:00
洛水.山岭居室
4ae2cccfec 添加用于装饰在指定函数防止过度调用的类装饰器 2022-05-20 18:23:15 +08:00
洛水.山岭居室
5bc96d7598 quizgacha 添加命令请求限制 2022-05-20 14:33:35 +08:00
洛水.山岭居室
ed7618f961 私聊也可以触发答题挑战 2022-05-19 17:33:35 +08:00
洛水.山岭居室
c0a8399442 quiz添加日记 2022-05-17 20:58:44 +08:00
洛水.山岭居室
3b419bc775 quiz添加自动删除 2022-05-17 20:55:40 +08:00
洛水.山岭居室
60bb6bca05 quiz添加自动删除 2022-05-17 20:54:45 +08:00
洛水.山岭居室
4e37d41742 打乱quizauth的选项 2022-05-17 20:46:53 +08:00
洛水.山岭居室
9d5eba02ff 修复绑定国际服写入的错误数据 修改国服名称 2022-04-30 14:51:24 +08:00
洛水.山岭居室
abca8153cd 修复奇怪的BUG 2022-04-20 20:38:34 +08:00
洛水.山岭居室
7424debdad 修复部分BUG 处理重载问题失败抛出的异常处理 2022-04-20 20:31:15 +08:00
洛水.山岭居室
d68ff4d514 Fix some commands cannot use "/cancel" 2022-04-20 15:52:15 +08:00
洛水.山岭居室
760ea19c76 Initial commit 2022-04-14 15:18:45 +08:00