summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlee14 <alee14498@gmail.com>2017-11-19 13:01:10 -0500
committerAlee14 <alee14498@gmail.com>2017-11-19 13:01:10 -0500
commit34d5670837d8d72354c42fd4e74978767bea0416 (patch)
treea1523cf4b2a58a97d0c5c165aae3232acbbfe58d /src
parent301cb6a9af6acca41b5f7b9991498da30bc19dd9 (diff)
downloadAleeBot-34d5670837d8d72354c42fd4e74978767bea0416.tar.gz
AleeBot-34d5670837d8d72354c42fd4e74978767bea0416.tar.bz2
AleeBot-34d5670837d8d72354c42fd4e74978767bea0416.zip
Rename bot.js to bot_discord.js and added bot_telegram.js
Diffstat (limited to 'src')
-rw-r--r--src/bot_discord.js (renamed from src/bot.js)1
-rw-r--r--src/bot_telegram.js20
2 files changed, 21 insertions, 0 deletions
diff --git a/src/bot.js b/src/bot_discord.js
index c9a2fd0..5fa6fd6 100644
--- a/src/bot.js
+++ b/src/bot_discord.js
@@ -50,6 +50,7 @@ client.on("message", function(message) {
if (message.author.bot) return;
if (message.channel.type === "dm") return;
if (message.content.indexOf(config.prefix) !== 0) return;
+ var msg = message.content;
const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
diff --git a/src/bot_telegram.js b/src/bot_telegram.js
new file mode 100644
index 0000000..3ca14c3
--- /dev/null
+++ b/src/bot_telegram.js
@@ -0,0 +1,20 @@
+/*********************************************
+ *
+ * AleeBot for Alee's Lounge telegram chat
+ * Copyright (C) 2017 AleeCorp
+ * License: MIT
+ *
+ **********************************************/
+ const TelegramBot = require('node-telegram-bot-api');
+ const abVersion = ('1.0 Beta');
+ var token = "506287133:AAFUxedYBjhvjNSO6HFitJqk-tLjZ1gY864";
+ var opt = {polling: true};
+ var bot = new TelegramBot(token, opt);
+
+ bot.on('message', function (msg) {
+ console.log(msg);
+ var id = msg.chat.id;
+ var echo = msg.text;
+
+ bot.sendMessage(id, echo);
+ }); \ No newline at end of file