fengnz / fengdoorbot

这是一个Telegram 电报群的聊天管理机器人, 主要用来防止垃圾消息
GNU General Public License v3.0
123 stars 52 forks source link

TypeError: Cannot read property "_embedded" from null #3

Open fengnz opened 4 years ago

fengnz commented 4 years ago

用 /initdb 命令初始化数据库成功 但运行代码出现: TypeError: Cannot read property "_embedded" from null.(第 130 行,“Mongo”文件) 日志里全是下面这个样: message": "Request failed for https://api.telegram.org returned code 400. Truncated server response: {\"ok\":false,\"error_code\":400,\"description\":\"Bad Request: message text is empty\"} (use muteHttpExceptions option to examine full response)"

Originally posted by @buttt5460 in https://github.com/fengnz/fengdoorbot/issues/1#issuecomment-567264788

fengnz commented 4 years ago

这要看你是怎么运行的了, 机器人代码不能直接在GAS里面运行, 你需要发布它, 然后在使用. /initdb 成功的话, 说明你发布和绑定都有成功. 这个时候你不应该去运行代码. 而是直接在机器人里输入 /admin 看看有没有响应.

buttt5460 commented 4 years ago

机器人在群里输入/ admin有响应,能打开"欢迎词设置""进群验证"并设置. 现在的问题是,群里聊天的内容记录不到logs里面!

buttt5460 commented 4 years ago

但我参照您视屏"连接 RestHeart MongoDB 数据库",自建了数据库并绑定另一个机器人,所有聊天记录都能在logs里找到,说明数据库没问题

fengnz commented 4 years ago

厉害哦,居然成功建了数据库. 那问题就不大了, 只是没有记录到LOGS里面的话, 应该是机器人里没有把聊天记录到LOGS里面. 也许就没有这样的代码, 或者这行代码被注释掉了. 应该是没有启用的, 不然我的数据库早就炸了.

buttt5460 commented 4 years ago

我是在这下载的啊!除了改CONST里面机器人ID,数据库地址,其它没动过. 还是日志什么都记录不了,头痛啊

buttt5460 commented 4 years ago

刚弄好了,是缺少了代码. 少了代码你们还能用啊,晕

fengnz commented 4 years ago

因为日志记不记录不会影响功能呀!

buttt5460 notifications@github.com 于2019年12月23日周一 上午12:54写道:

刚弄好了,是缺少了代码. 少了代码你们还能用啊,晕

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fengnz/fengdoorbot/issues/3?email_source=notifications&email_token=ALRBS6BVOIP4RDHEKKN7OL3QZ5IOXA5CNFSM4J4V6EE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHPOHDI#issuecomment-568255373, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALRBS6GFNJXLAFKZZ4RLKGLQZ5IOXANCNFSM4J4V6EEQ .

-- Feng