Closed Kevsw99 closed 5 years ago
I think you'd missed allowedUser
in configuration. For security reason, only allowed user can command to TelegramBot in your chat room.
If you want to give a permission to multi users, set like this;
allowedUser: ["tom1234", "jake_work", ...],
i did add my tele username before though
{
module: 'MMM-TelegramBot',
config: {
telegramAPIKey : '
allowedUser is Array of string
, so, it should be in array [ ]
allowedUser: ["KevinW99"],
Ah alright, ill try it our tomorrow and get back to you if it does work
{
module: 'MMM-TelegramBot',
config: {
telegramAPIKey : 'gytdyuccyuibcxtfyguhjcd', // this is just a sample api key
allowedUser : ['KevinW99'],
}
},
Currently this is my code, is there anything wrong with this?
I tried making new bot and still does not work though
First, Check your telegram API Key. It would look like "556021590:XAGPwvet2CdybsmXyJnQN_eflnRsnDVz-ZX".
Second,
Check your serverside log (show pm2 log
or result of npm start dev
), Is there any error?
If you ask something (e.g: /something
) on Telegram,
The serverlogs will be something like this;[TELBOT][2018-11-02 08:19:59]Message is coming from CHAT:41286649
If there is no error log but still doesn't work, tell me. I'll send a file of modified version to check points.
alrite, ill check it on tuesday whhen i get back to my intern desk, and yeah the api key is just hidden for security reasons.
I am so sorry for the late reply but i can only resume this project on 12 November so only then i can test and let you know whether it does work or not.
Hi, i have checked it again and there is no error log whatsoever, so i am not to sure what to do now.
Can I test your telegram API Key and username? (just for a check. you can re-get those) My email is eouia0819@gmail.com
@Kevsw99 Aren't you missing the adminChatId
from your config?
You need all three settings:
config: {
telegramAPIKey: '<your-api-key>',
allowedUser: ['<your-allowed-user>'],
adminChatId: '<your-admin-chat-id>'
}
@michael5r Good point, but I think he had some problem to get adminChatId
even in first execution. /mychatid
or help
should work even without adminChatId
.
Anyway, I'll close this issue because it's too old. If @Kevsw99 has still a problem, reopen it. Thanks.
Hi, i always do get this message from my bot, can you help me out with this?
magicMirrorBot, [01.11.18 11:37] [In reply to Kevin W] You are not allowed to command me. Ask admin.