MMRIZE / MMM-TelegramBot

TelegramBot module for remote-controlling MagicMirror
MIT License
26 stars 8 forks source link

Not allowed to command bot, ask Admin #20

Closed Kevsw99 closed 5 years ago

Kevsw99 commented 5 years ago

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.

eouia commented 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", ...],
Kevsw99 commented 5 years ago

i did add my tele username before though { module: 'MMM-TelegramBot', config: { telegramAPIKey : '', allowedUser : 'KevinW99', // This is NOT the username of bot. } },

eouia commented 5 years ago

allowedUser is Array of string, so, it should be in array [ ]

allowedUser: ["KevinW99"],
Kevsw99 commented 5 years ago

Ah alright, ill try it our tomorrow and get back to you if it does work

Kevsw99 commented 5 years ago

{ module: 'MMM-TelegramBot', config: { telegramAPIKey : 'gytdyuccyuibcxtfyguhjcd', // this is just a sample api key allowedUser : ['KevinW99'], } }, unnamed

Currently this is my code, is there anything wrong with this?

Kevsw99 commented 5 years ago

I tried making new bot and still does not work though

eouia commented 5 years ago

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.

Kevsw99 commented 5 years ago

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.

Kevsw99 commented 5 years ago

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.

Kevsw99 commented 5 years ago

Hi, i have checked it again and there is no error log whatsoever, so i am not to sure what to do now.

eouia commented 5 years ago

Can I test your telegram API Key and username? (just for a check. you can re-get those) My email is eouia0819@gmail.com

michael5r commented 5 years ago

@Kevsw99 Aren't you missing the adminChatId from your config?

michael5r commented 5 years ago

You need all three settings:

config: {
    telegramAPIKey: '<your-api-key>',
    allowedUser: ['<your-allowed-user>'],
    adminChatId: '<your-admin-chat-id>'
}
eouia commented 5 years ago

@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.