mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-10 21:10:59 +00:00
perf(nakuru.py): access-token被拒时报警
This commit is contained in:
@@ -157,7 +157,6 @@ class NakuruProjectEventConverter(EventConverter):
|
|||||||
raise Exception("未支持转换的事件类型: " + str(event))
|
raise Exception("未支持转换的事件类型: " + str(event))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class NakuruProjectAdapter(MessageSourceAdapter):
|
class NakuruProjectAdapter(MessageSourceAdapter):
|
||||||
"""nakuru-project适配器"""
|
"""nakuru-project适配器"""
|
||||||
bot: nakuru.CQHTTP
|
bot: nakuru.CQHTTP
|
||||||
@@ -183,6 +182,9 @@ class NakuruProjectAdapter(MessageSourceAdapter):
|
|||||||
},
|
},
|
||||||
timeout=5
|
timeout=5
|
||||||
)
|
)
|
||||||
|
if resp.status_code == 403:
|
||||||
|
logging.error("go-cqhttp拒绝访问,请检查config.py中nakuru_config的token是否与go-cqhttp设置的access-token匹配")
|
||||||
|
raise Exception("go-cqhttp拒绝访问,请检查config.py中nakuru_config的token是否与go-cqhttp设置的access-token匹配")
|
||||||
self.bot_account_id = int(resp.json()['data']['user_id'])
|
self.bot_account_id = int(resp.json()['data']['user_id'])
|
||||||
|
|
||||||
def send_message(
|
def send_message(
|
||||||
|
|||||||
Reference in New Issue
Block a user