TelegramBot module for MagicMirror
- You can remote-control your
MagicMirror
and modules withinTelegram
. - The Bot is implemented in this module thus you don't need to manage antoher daemon.
- Other module developers can add their commands easily. (See the Wiki : https://github.com/eouia/MMM-TelegramBot/wiki )
Ref : https://core.telegram.org/bots#6-botfather
- Open your browser in Desktop PC(or your mirror or your phone, anywhere) and Navigate to https://telegram.me/botfather
- Click
Send Message
button, then your telegram will be opened in your phone or your PC whichTelegram
is already installed on. MeetBotFather
. - Command
/newbot
, give aname
to the bot created, give anusername
.username
should end withbot
. (e.g.MyMagicMirrorBot
ormystupidslave-bot
... ) - After created, you can get API Token. It looks like
110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw
. Remember that. - Read messages from
BotFather
. You can find your bot and change chat room of your Bot. Type anything, but your bot will not react yet.
- In your mirror, open terminal and execute below;
cd ~/MagicMirror/modules
git clone https://github.com/eouia/MMM-TelegramBot.git
cd MMM-TelegramBot
npm install
- Open
config.js
ofMagicMirror
, add these;
{
module: 'MMM-TelegramBot',
config: {
telegramAPIKey : '<your Telegram API Token>',
allowedUser : ['<your Telegram username without @>'], // This is NOT the username of bot.
}
},
- restart your
MagicMirror
.
- Back to the chat room with your Bot in Telegram, try
/help
or/commands
. Your bot will react! - Now,try
/mychatid
. This command will show the id of this chat room. Thechat id
looks like12345678
. Remember that. We will use this id for admin.
- Open
config.js
again.
{
module: 'MMM-TelegramBot',
config: {
telegramAPIKey : '<your Telegram API Token>',
allowedUser : ['<your Telegram username without @>'],
adminChatId : <your admin chat id>,
}
},
- Restart your
MagicMirror
. - You can get welcome message in your admin chat room. Now you can use Bot!
See the Wiki