From 905780f7bf0a3041e865952889839cd683e6fa57 Mon Sep 17 00:00:00 2001 From: Wathiq Al-Qajar Date: Tue, 29 Mar 2016 15:35:53 +0300 Subject: [PATCH 1/2] Update bot.lua --- bot.lua | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/bot.lua b/bot.lua index fb10453..7cf38a1 100644 --- a/bot.lua +++ b/bot.lua @@ -6,11 +6,30 @@ JSON = require('dkjson') HTTPS = require('ssl.https') dofile('utilities.lua') ----config---- -local bot_api_key = "" -local You = --خلي ايدي حسابك +local bot_api_key = "194907926:AAEEfuGhjqmMdN91RocmAGFs_dBESDPRJ8o" +local You = 214096109,163578079 --خلي ايدي حسابك local BASE_URL = "https://api.telegram.org/bot"..bot_api_key local BASE_FOLDER = "" local start = [[]] -- خلي بنص [[]] رساله ترحيب +local help = [[ +➖➖➖➖➖➖➖➖➖➖➖ +*commands:*`for admin` +`/ban` ✴️ +*حظر عضو من ارسال رساله بالرد على رسالته* +`/unban` ✴️ +*فتح الحظر عن عضو عن طريق الرد على رسالته* +`/users` ✴️ +*معرفه عدد الاعضاء المشتركين* +`/broadcast` ✴️ +*ارسل هذا الامر وكل رساله كانت بعده سترسل لجميع المشتركين* +`/unbroadcast` ✴️ +*لكي تتوقف ارسال الرسائل وتفعيل الاوامر البقيه* +`/start` ✴️ +*لأظهار رساله ترحيب للاعضاٱء* +`/id` ✴️ +*بالرد على رساله موجهه يضهر لك المعلومات* +➖➖➖➖➖➖➖➖➖➖➖ +]]--اوامر المساعدة ------- ----utilites---- @@ -259,8 +278,12 @@ function bot_run() is_started = true -- and whether or not the bot should be running. add.id = add.id or {} --TABLE FUCKERRRRRRRRRRRRRRRRRRRRRRRRRRR ban.id = ban.id or {} + add.broadcast = add.broadcast or {} -- end function msg_processor(msg) + if msg.text == '/help' then +sendMessage(msg.chat.id,help,true,false,true) +end if is_ban(msg) then return end if msg.date < os.time() - 5 then -- Ignore old msgs return @@ -284,7 +307,14 @@ end else if msg.text == "/start" and is_add(msg) then print(#add.id) -sendMessage(msg.chat.id,start,true,false,true) + local user = "" +if msg.from.username == nil then +user = bot.username +else +user = msg.from.username +end +local text = "مرحبا بك يا ["..msg.from.first_name.."](www.telegram.me/"..user..")" +sendMessage(msg.chat.id,text.."\n"..start,true,false,true) elseif is_admin(msg) and msg.text == "/users" then local r = tostring(#add.id) @@ -325,6 +355,15 @@ end elseif msg.text == "/start" and not is_add(msg) then table.insert(add.id,msg.from.id) print("adding.....") + local user = "" +if msg.from.username == nil then +user = bot.username +else +user = msg.from.username +end +local text = "مرحبا بك يا ["..msg.from.first_name.."](www.telegram.me/"..user..")" +sendMessage(msg.chat.id,text.."\n"..start,true,false,true) + elseif not is_ban(msg) and msg.text ~= "/start" and msg.text ~= "/id" and msg.text ~= "/unban" and msg.text ~= "/ban" then if is_admin(msg) and msg.reply_to_message then forwardMessage(msg.reply_to_message.forward_from.id,msg.from.id,msg.message_id) From bc0a91dcfa77cd81d4c192b29daf695e329f8fa1 Mon Sep 17 00:00:00 2001 From: Wathiq Al-Qajar Date: Tue, 29 Mar 2016 15:37:20 +0300 Subject: [PATCH 2/2] Update bot.lua --- bot.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.lua b/bot.lua index 7cf38a1..0e1e41f 100644 --- a/bot.lua +++ b/bot.lua @@ -6,8 +6,8 @@ JSON = require('dkjson') HTTPS = require('ssl.https') dofile('utilities.lua') ----config---- -local bot_api_key = "194907926:AAEEfuGhjqmMdN91RocmAGFs_dBESDPRJ8o" -local You = 214096109,163578079 --خلي ايدي حسابك +local bot_api_key = "" --التوكم هنا +local You = --خلي ايدي حسابك local BASE_URL = "https://api.telegram.org/bot"..bot_api_key local BASE_FOLDER = "" local start = [[]] -- خلي بنص [[]] رساله ترحيب