diff --git a/bot/seedbot.lua b/bot/seedbot.lua index 4fd00572..e0eef64d 100644 --- a/bot/seedbot.lua +++ b/bot/seedbot.lua @@ -217,7 +217,6 @@ function create_config( ) "inrealm", "ingroup", "inpm", - "banhammer", "stats", "anti_spam", "owners", @@ -230,73 +229,30 @@ function create_config( ) "leave_ban", "supergroup", "whitelist", - "msg_checks", -"antiporn", -"badword", -"lang", -"infome", -"show", -"Spam-check", -"abjad", -"anti_spam", -"anti_spam", -"aparat", "arabic_lock", "azan", "get", "joke", "lock_emoji", "lock_english", -"lockfwd", -"lock_fwd", -"me", -"owners", -"rmsg", -"stickerset", -"sudo", +"lockfwd", +"me", +"rmsg", "times", -"voice", -"lock_badword", "lock_chat", "lock_eng", -"lock_fwd", -"lock_join", -"lock_media", -"lock_tag", +"lock_fwd", "remmsg", -"rmsg", -"setwlc", -"add_bot", -"addsudo", -"admin", -"anti_spam", -"set", -"setbye", -"SMS", -"tagall", +"rmsg", +"anti_spam", "time", "welcome", "bing", "map", "maps", -"Add_Bot", "Anti_Bot", "filter", -"fosh", "linkpv", -"logo", -"plugin_asl", -"rem_admins", -"unshort", -"InPm", -"plugins", -"infome", -"inpm", -"lock_eng", -"plugins", -"Anti_Bot", -"Spammer_U", -"add_bot", "lock_Edit", "lock_Fosh", "lock_Join", @@ -310,9 +266,8 @@ function create_config( ) "lockshare", "lockfwd", "lock_tag", -"News", }, - sudo_users = {(275579349)},(275579349) + sudo_users = {(293835020)},(293835020) moderation = {data = 'data/moderation.json'}, about_text = [[Teleseed v4 An advanced administration bot based on TG-CLI written in Lua @@ -333,7 +288,7 @@ topkecleon Vamptacus Our channels -@Bat_Strike +@iD_SHOMARE_MAJaZE_iD Our website http://teleseed.seedteam.org/ ]], @@ -524,11 +479,7 @@ _________________________________________ سودووطراح ربات ضداسپم:» نکته »»قبل از نوشتن کلمه های بالا گذاشتن ! !دراول دستور فراموش نشود -#ID SUDO: @oOo_SUDO_Link_Doni_oOo -#ID Channel: @LINK_DONI_TM -#ID Bot messenger: @sudo_Link_Doni_TMBoT - - +#ID SUDO: @TANHAIE_A_F_Z_L_MAJAZEE منتظر شمادوستان گل هستیم ❤️🌹💋 _________________________________________ @@ -657,9 +608,7 @@ _________________________________________ سودووطراح ربات ضداسپم:» نکته »»قبل از نوشتن کلمه های بالا گذاشتن ! !دراول دستور فراموش نشود -#ID SUDO: @oOo_SUDO_Link_Doni_oOo -#ID Channel: @LINK_DONI_TM -#ID Bot messenger: @sudo_Link_Doni_TMBoT +#ID SUDO: @TANHAIE_A_F_Z_L_MAJAZEE منتظر شمادوستان گل هستیم ❤️🌹💋 _________________________________________ _________________________________________ diff --git a/plugins/BanHammer.lua b/plugins/BanHammer.lua deleted file mode 100644 index b48ac2b3..00000000 --- a/plugins/BanHammer.lua +++ /dev/null @@ -1,363 +0,0 @@ - -local function pre_process(msg) - local data = load_data(_config.moderation.data) - -- SERVICE MESSAGE - if msg.action and msg.action.type then - local action = msg.action.type - -- Check if banned user joins chat by link - if action == 'chat_add_user_link' then - local user_id = msg.from.id - print('Checking invited user '..user_id) - local banned = is_banned(user_id, msg.to.id) - if banned or is_gbanned(user_id) then -- Check it with redis - print('User is banned!') - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] is banned and kicked ! ")-- Save to logs - kick_user(user_id, msg.to.id) - end - end - -- Check if banned user joins chat - if action == 'chat_add_user' then - local user_id = msg.action.user.id - print('Checking invited user '..user_id) - local banned = is_banned(user_id, msg.to.id) - if banned and not is_momod2(msg.from.id, msg.to.id) or is_gbanned(user_id) and not is_admin2(msg.from.id) then -- Check it with redis - print('User is banned!') - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] added a banned user >"..msg.action.user.id)-- Save to logs - kick_user(user_id, msg.to.id) - local banhash = 'addedbanuser:'..msg.to.id..':'..msg.from.id - redis:incr(banhash) - local banhash = 'addedbanuser:'..msg.to.id..':'..msg.from.id - local banaddredis = redis:get(banhash) - if banaddredis then - if tonumber(banaddredis) >= 4 and not is_owner(msg) then - kick_user(msg.from.id, msg.to.id)-- Kick user who adds ban ppl more than 3 times - end - if tonumber(banaddredis) >= 8 and not is_owner(msg) then - ban_user(msg.from.id, msg.to.id)-- Kick user who adds ban ppl more than 7 times - local banhash = 'addedbanuser:'..msg.to.id..':'..msg.from.id - redis:set(banhash, 0)-- Reset the Counter - end - end - end - if data[tostring(msg.to.id)] then - if data[tostring(msg.to.id)]['settings'] then - if data[tostring(msg.to.id)]['settings']['lock_bots'] then - bots_protection = data[tostring(msg.to.id)]['settings']['lock_bots'] - end - end - end - if msg.action.user.username ~= nil then - if string.sub(msg.action.user.username:lower(), -3) == 'bot' and not is_momod(msg) and bots_protection == "yes" then --- Will kick bots added by normal users - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] added a bot > @".. msg.action.user.username)-- Save to logs - kick_user(msg.action.user.id, msg.to.id) - end - end - end - -- No further checks - return msg - end - -- banned user is talking ! - if msg.to.type == 'chat' or msg.to.type == 'channel' then - local group = msg.to.id - local texttext = 'groups' - --if not data[tostring(texttext)][tostring(msg.to.id)] and not is_realm(msg) then -- Check if this group is one of my groups or not - --chat_del_user('chat#id'..msg.to.id,'user#id'..our_id,ok_cb,false) - --return - --end - local user_id = msg.from.id - local chat_id = msg.to.id - local banned = is_banned(user_id, chat_id) - if banned or is_gbanned(user_id) then -- Check it with redis - print('Banned user talking!') - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] banned user is talking !")-- Save to logs - kick_user(user_id, chat_id) - msg.text = '' - end - end - return msg -end - -local function kick_ban_res(extra, success, result) - local chat_id = extra.chat_id - local chat_type = extra.chat_type - if chat_type == "chat" then - receiver = 'chat#id'..chat_id - else - receiver = 'channel#id'..chat_id - end - if success == 0 then - return send_large_msg(receiver, "Cannot find user by that username!") - end - local member_id = result.peer_id - local user_id = member_id - local member = result.username - local from_id = extra.from_id - local get_cmd = extra.get_cmd - if get_cmd == "kick" then - if member_id == from_id then - send_large_msg(receiver, "You can't kick yourself") - return - end - if is_momod2(member_id, chat_id) and not is_admin2(sender) then - send_large_msg(receiver, "You can't Kick mods/owner/admins") - return - end - kick_user(member_id, chat_id) - elseif get_cmd == 'ban' then - if is_momod2(member_id, chat_id) and not is_admin2(sender) then - send_large_msg(receiver, "You can't Ban mods/owner/admins") - return - end - send_large_msg(receiver, 'User @'..member..' ['..member_id..'] banned') - ban_user(member_id, chat_id) - elseif get_cmd == 'unban' then - send_large_msg(receiver, 'User @'..member..' ['..member_id..'] unbanned') - local hash = 'banned:'..chat_id - redis:srem(hash, member_id) - return 'User '..user_id..' unbanned' - elseif get_cmd == 'banall' then - send_large_msg(receiver, 'Done!\nUser @'..member..' ['..member_id..'] globally banned') - banall_user(member_id) - elseif get_cmd == 'unbanall' then - send_large_msg(receiver, 'Done!\nUser @'..member..' ['..member_id..'] globally unbanned') - unbanall_user(member_id) - end -end - -local function run(msg, matches) -local support_id = msg.from.id - if matches[1]:lower() == 'id' and msg.to.type == "chat" or msg.to.type == "user" then - if msg.to.type == "user" then - return "Bot ID : "..msg.to.id.."\n\nYour ID : "..msg.from.id.."" - end - if type(msg.reply_id) ~= "nil" then - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] used /id ") - id = get_message(msg.reply_id,get_message_callback_id, false) - elseif matches[1]:lower() == 'id' then - local name = user_print_name(msg.from) - savelog(msg.to.id, name.." ["..msg.from.id.."] used /id ") - return "Group ID for " ..string.gsub(msg.to.print_name, "_", " ").. ":\n\n"..msg.to.id - end - end - if matches[1]:lower() == 'kickme' and msg.to.type == "chat" then-- /kickme - local receiver = get_receiver(msg) - if msg.to.type == 'chat' then - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] left using kickme ")-- Save to logs - chat_del_user("chat#id"..msg.to.id, "user#id"..msg.from.id, ok_cb, false) - end - end - - if not is_momod(msg) then -- Ignore normal users - return - end - - if matches[1]:lower() == "banlist"or matches[1] =="لیست بن" then -- Ban list ! - local chat_id = msg.to.id - if matches[2] and is_admin1(msg) then - chat_id = matches[2] - end - return ban_list(chat_id) - end - if matches[1]:lower() == 'ban' or matches[1] =='بن' then-- /ban - if type(msg.reply_id)~="nil" and is_momod(msg) then - if is_admin1(msg) then - msgr = get_message(msg.reply_id,ban_by_reply_admins, false) - else - msgr = get_message(msg.reply_id,ban_by_reply, false) - end - local user_id = matches[2] - local chat_id = msg.to.id - elseif string.match(matches[2], '^%d+$') then - if tonumber(matches[2]) == tonumber(our_id) then - return - end - if not is_admin1(msg) and is_momod2(matches[2], msg.to.id) then - return "you can't ban mods/owner/admins" - end - if tonumber(matches[2]) == tonumber(msg.from.id) then - return "You can't ban your self !" - end - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - local receiver = get_receiver(msg) - savelog(msg.to.id, name.." ["..msg.from.id.."] baned user ".. matches[2]) - ban_user(matches[2], msg.to.id) - send_large_msg(receiver, 'Done!\nUser ['..matches[2]..'] Banned :D') - else - local cbres_extra = { - chat_id = msg.to.id, - get_cmd = 'ban', - from_id = msg.from.id, - chat_type = msg.to.type - } - local username = string.gsub(matches[2], '@', '') - resolve_username(username, kick_ban_res, cbres_extra) - end - end - - - if matches[1]:lower() == 'unban' or matches[1] =='خ بن' then -- /unban - if type(msg.reply_id)~="nil" and is_momod(msg) then - local msgr = get_message(msg.reply_id,unban_by_reply, false) - end - local user_id = matches[2] - local chat_id = msg.to.id - local targetuser = matches[2] - if string.match(targetuser, '^%d+$') then - local user_id = targetuser - local hash = 'banned:'..chat_id - redis:srem(hash, user_id) - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] unbaned user ".. matches[2]) - return 'Done!\nUser ['..user_id..'] Unbanned :D' - else - local cbres_extra = { - chat_id = msg.to.id, - get_cmd = 'unban', - from_id = msg.from.id, - chat_type = msg.to.type - } - local username = string.gsub(matches[2], '@', '') - resolve_username(username, kick_ban_res, cbres_extra) - end - end - -if matches[1]:lower() == 'kick' or matches[1] =='اخراج' then - if type(msg.reply_id)~="nil" and is_momod(msg) then - if is_admin1(msg) then - msgr = get_message(msg.reply_id,Kick_by_reply_admins, false) - else - msgr = get_message(msg.reply_id,Kick_by_reply, false) - end - elseif string.match(matches[2], '^%d+$') then - if tonumber(matches[2]) == tonumber(our_id) then - return - end - if not is_admin1(msg) and is_momod2(matches[2], msg.to.id) then - return "You can't kick mods/owner/admins" - end - if tonumber(matches[2]) == tonumber(msg.from.id) then - return "You can't kick your self !" - end - local user_id = matches[2] - local chat_id = msg.to.id - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] kicked user ".. matches[2]) - kick_user(user_id, chat_id) - else - local cbres_extra = { - chat_id = msg.to.id, - get_cmd = 'kick', - from_id = msg.from.id, - chat_type = msg.to.type - } - local username = string.gsub(matches[2], '@', '') - resolve_username(username, kick_ban_res, cbres_extra) - end -end - - - if not is_admin1(msg) and not is_support(support_id) then - return - end - - if matches[1]:lower() == 'banall' and is_admin1(msg) or matches[1] =='gb' and is_admin1(msg) then -- Global ban - if type(msg.reply_id) ~="nil" and is_admin1(msg) then - banall = get_message(msg.reply_id,banall_by_reply, false) - end - local user_id = matches[2] - local chat_id = msg.to.id - local targetuser = matches[2] - if string.match(targetuser, '^%d+$') then - if tonumber(matches[2]) == tonumber(our_id) then - return false - end - banall_user(targetuser) - return 'Done!\nUser ['..user_id..'] Globally Banned' - else - local cbres_extra = { - chat_id = msg.to.id, - get_cmd = 'banall', - from_id = msg.from.id, - chat_type = msg.to.type - } - local username = string.gsub(matches[2], '@', '') - resolve_username(username, kick_ban_res, cbres_extra) - end - end - if matches[1]:lower() == 'unbanall' or matches[1] =='ungb' then -- Global unban - local user_id = matches[2] - local chat_id = msg.to.id - if string.match(matches[2], '^%d+$') then - if tonumber(matches[2]) == tonumber(our_id) then - return false - end - unbanall_user(user_id) - return 'Done!\nUser ['..user_id..'] Globally unbanned' - else - local cbres_extra = { - chat_id = msg.to.id, - get_cmd = 'unbanall', - from_id = msg.from.id, - chat_type = msg.to.type - } - local username = string.gsub(matches[2], '@', '') - resolve_username(username, kick_ban_res, cbres_extra) - end - end - if matches[1]:lower() == "gbanlist" or matches[1] =="لیست گلوبال بن" then -- Global ban list - return banall_list() - end -end - -return { - patterns = { - "^[#!/]([Bb]anall) (.*)$", - "^[#!/]([Bb]anall)$", - "^[#!/]([Bb]anlist) (.*)$", - "^[#!/]([Bb]anlist)$", - "^[#!/]([Gg]banlist)$", - "^[#!/]([Kk]ickme)", - "^[#!/]([Kk]ick)$", - "^[#!/]([Bb]an)$", - "^(gb) (.*)$", - "^(gb)$", - "^(لیست بن) (.*)$", - "^(لیست بن)$", - "^(لیست گلوبال بن)$", - "^(اخراج)$", - "^(بن)$", - "^(بن) (.*)$", - "^(خ بن) (.*)$", - "^(ungb) (.*)$", - "^(ungb)$", - "^(اخراج) (.*)$", - "^(خ بن)$", - "^[#!/]([Bb]an) (.*)$", - "^[#!/]([Uu]nban) (.*)$", - "^[#!/]([Uu]nbanall) (.*)$", - "^[#!/]([Uu]nbanall)$", - "^[#!/]([Kk]ick) (.*)$", - "^[#!/]([Uu]nban)$", - "^[#!/]([Ii]d)$", - "^!!tgservice (.+)$" - }, - run = run, - pre_process = pre_process -} - --- By @MobinDev diff --git a/plugins/Broadcast.lua b/plugins/Broadcast.lua deleted file mode 100644 index 51a54be0..00000000 --- a/plugins/Broadcast.lua +++ /dev/null @@ -1,30 +0,0 @@ -local function run(msg, matches) - if matches[1] == 'bc' and is_admin1(msg) then - local response = matches[3] - --send_large_msg("chat#id"..matches[2], response) - send_large_msg("channel#id"..matches[2], response) - end - if matches[1] == 'broadcast' then - if is_sudo(msg) then -- Only sudo ! - local data = load_data(_config.moderation.data) - local groups = 'groups' - local response = matches[2] - for k,v in pairs(data[tostring(groups)]) do - chat_id = v - local chat = 'chat#id'..chat_id - local channel = 'channel#id'..chat_id - send_large_msg(chat, response) - send_large_msg(channel, response) - end - end - end -end -return { - patterns = { - "^[#!/](broadcast) (.*)$", - "^[#!/](bc) (%d+) (.*)$", - "^(broadcast) (.*)$", - "^(bc) (%d+) (.*)$" - }, - run = run -} diff --git a/plugins/Expire.lua b/plugins/Expire.lua deleted file mode 100644 index c07723b5..00000000 --- a/plugins/Expire.lua +++ /dev/null @@ -1,210 +0,0 @@ -local function check_member_superrem2(cb_extra, success, result) - local receiver = cb_extra.receiver - local data = cb_extra.data - local msg = cb_extra.msg - for k,v in pairs(result) do - local member_id = v.id - if member_id ~= our_id then - -- Group configuration removal - data[tostring(msg.to.id)] = nil - save_data(_config.moderation.data, data) - local groups = 'groups' - if not data[tostring(groups)] then - data[tostring(groups)] = nil - save_data(_config.moderation.data, data) - end - data[tostring(groups)][tostring(msg.to.id)] = nil - save_data(_config.moderation.data, data) - chat_del_user(get_receiver(msg), 'user#id'..160149610, ok_cb, false) -- Your ID - leave_channel(get_receiver(msg), ok_cb, false) - end - end -end - -local function superrem2(msg) - local data = load_data(_config.moderation.data) - local receiver = get_receiver(msg) - channel_get_users(receiver, check_member_superrem2,{receiver = receiver, data = data, msg = msg}) -end -local function pre_process(msg) - local timetoexpire = 'unknown' - local expiretime = redis:hget ('expiretime', get_receiver(msg)) - local now = tonumber(os.time()) - if expiretime then - timetoexpire = math.floor((tonumber(expiretime) - tonumber(now)) / 86400) + 1 - if tonumber("0") > tonumber(timetoexpire) then - if get_receiver(msg) then - redis:del('expiretime', get_receiver(msg)) - rem_mutes(msg.to.id) - superrem2(msg) - return send_large_msg(get_receiver(msg), '⏰ تاریخ انقضای گروه پایان یافت\n\n> برای تمدید تاریخ انقضای گروه میتوانید به گروه پشتیبانی روبات مراجعه نمایید و تقاضای تمدید دوباره نمایید\n\n👥 لینک گروه پشتیبانی :\nhttps://telegram.me/joinchat/CYuwakBXO9sosgQ_8xuYTw') - else - return - end - end - if tonumber(timetoexpire) == 0 then - if redis:hget('expires0',msg.to.id) then return msg end - local user = "user#id"..160149610 -- Your ID - local text = "⏰ تاریخ انقضای گروه ارسال شده به پایان رسیده است" - local text12 = 0 - local data = load_data(_config.moderation.data) - local group_owner = data[tostring(msg.to.id)]['set_owner'] - if not group_owner then -group_owner = "--" -end - local group_link = data[tostring(msg.to.id)]['settings']['set_link'] - if not group_link then -group_link = "Unset" -end -local exppm = 'Charge finish\n' -..'_______________\n' -..'Group Name : '..msg.to.title..' \n' -..'Group ID : '..msg.to.id..' \n' -..'Group Owner : '..group_owner..' \n' -..'Group Link : '..group_link..'\n' -..'Info Time:\n'..text12..'\n' -..'_______________\n' -..'Charge For 1 Month :\n' -..'/setexp_'..msg.to.id..'_30\n' -..'_______________\n' -..'Our Channel : @PrivateTeam' - - local sends = send_msg(user, exppm, ok_cb, false) - send_large_msg(get_receiver(msg), '⏰ کمتر از یکروز تا انقضای گروه باقی مانده است\n\n> برای تمدید تاریخ انقضای گروه میتوانید به گروه پشتیبانی روبات مراجعه نمایید و تقاضای تمدید دوباره نمایید\n\n👥 لینک گروه پشتیبانی :\nhttps://telegram.me/joinchat/CYuwakBXO9sosgQ_8xuYTw') - redis:hset('expires0',msg.to.id,'0') - end - if tonumber(timetoexpire) == 1 then - if redis:hget('expires1',msg.to.id) then return msg end - local user = "user#id"..160149610 -- Your ID - local text2 = "⏰ یکروز تا پایان انقضای گروه ارسال شده" - local text13 = 1 - local data = load_data(_config.moderation.data) - local group_owner = data[tostring(msg.to.id)]['set_owner'] - if not group_owner then -group_owner = "--" -end - local group_link = data[tostring(msg.to.id)]['settings']['set_link'] - if not group_link then -group_link = "Unset" -end -local exppm = 'Charge finish\n' -..'_______________\n' -..'Group Name : '..msg.to.title..' \n' -..'Group ID : '..msg.to.id..' \n' -..'Group Owner : '..group_owner..' \n' -..'Group Link : '..group_link..'\n' -..'Info Time:\n'..text13..'\n' -..'_______________\n' -..'Charge For 1 Month :\n' -..'/setexp_'..msg.to.id..'_30\n' -..'Charge For 3 Month :\n' -..'/setexp_'..msg.to.id..'_90\n' -..'Unlimited Charge :\n' -..'/setexp_'..msg.to.id..'_999\n' -..'_______________\n' -..'Our Channel : @PrivateTeam' - local sends = send_msg(user, exppm, ok_cb, false) - send_large_msg(get_receiver(msg), '⏰ 1 روز تا انقضای گروه باقی مانده است\n\n> برای تمدید تاریخ انقضای گروه میتوانید به گروه پشتیبانی روبات مراجعه نمایید و تقاضای تمدید دوباره نمایید\n\n👥 لینک گروه پشتیبانی :\nhttps://telegram.me/joinchat/CYuwakBXO9sosgQ_8xuYTw') - redis:hset('expires1',msg.to.id,'1') - end - if tonumber(timetoexpire) == 2 then - if redis:hget('expires2',msg.to.id) then return msg end - send_large_msg(get_receiver(msg), '⏰ 2 روز تا انقضای گروه باقی مانده است\n\n> برای تمدید تاریخ انقضای گروه میتوانید به گروه پشتیبانی روبات مراجعه نمایید و تقاضای تمدید دوباره نمایید\n\n👥 لینک گروه پشتیبانی :\nhttps://telegram.me/joinchat/CYuwakBXO9sosgQ_8xuYTw') - redis:hset('expires2',msg.to.id,'2') - end - if tonumber(timetoexpire) == 3 then - if redis:hget('expires3',msg.to.id) then return msg end - send_large_msg(get_receiver(msg), '⏰ 3 روز تا انقضای گروه باقی مانده است\n\n> برای تمدید تاریخ انقضای گروه میتوانید به گروه پشتیبانی روبات مراجعه نمایید و تقاضای تمدید دوباره نمایید\n\n👥 لینک گروه پشتیبانی :\nhttps://telegram.me/joinchat/CYuwakBXO9sosgQ_8xuYTw') - redis:hset('expires3',msg.to.id,'3') - end - if tonumber(timetoexpire) == 4 then - if redis:hget('expires4',msg.to.id) then return msg end - send_large_msg(get_receiver(msg), '⏰ 4 روز تا انقضای گروه باقی مانده است\n\n> برای تمدید تاریخ انقضای گروه میتوانید به گروه پشتیبانی روبات مراجعه نمایید و تقاضای تمدید دوباره نمایید\n\n👥 لینک گروه پشتیبانی :\nhttps://telegram.me/joinchat/CYuwakBXO9sosgQ_8xuYTw') - redis:hset('expires4',msg.to.id,'4') - end - if tonumber(timetoexpire) == 5 then - if redis:hget('expires5',msg.to.id) then return msg end - send_large_msg(get_receiver(msg), '⏰ 5 روز تا انقضای گروه باقی مانده است\n\n> برای تمدید تاریخ انقضای گروه میتوانید به گروه پشتیبانی روبات مراجعه نمایید و تقاضای تمدید دوباره نمایید\n\n👥 لینک گروه پشتیبانی :\nhttps://telegram.me/joinchat/CYuwakBXO9sosgQ_8xuYTw') - redis:hset('expires5',msg.to.id,'5') - end -end -return msg -end -function run(msg, matches) - if matches[1]:lower() == 'setexpire' then - if not is_sudo(msg) then return end - local time = os.time() - local buytime = tonumber(os.time()) - local timeexpire = tonumber(buytime) + (tonumber(matches[2]) * 86400) - redis:hset('expiretime',get_receiver(msg),timeexpire) - return "⏰ Group Expire Has been seted to "..matches[2].. " Days later :D" - end - - if matches[1]:lower() == 'setexp' then - if not is_sudo(msg) then return end - local expgp = "channel#id"..matches[2] - local time = os.time() - local buytime = tonumber(os.time()) - local timeexpire = tonumber(buytime) + (tonumber(matches[3]) * 86400) - redis:hset('expiretime',expgp,timeexpire) - return "⏰ Group Expire Has been seted to "..matches[3].. " Days later :D\n\n🗣 Thanks to @MobinDev" - end - if matches[1]:lower() == 'expire' then - local expiretime = redis:hget ('expiretime', get_receiver(msg)) - if not expiretime then return 'Group Expire is Unlimite !' else - local now = tonumber(os.time()) - local text = (math.floor((tonumber(expiretime) - tonumber(now)) / 86400) + 1) - return (math.floor((tonumber(expiretime) - tonumber(now)) / 86400) + 1) .. " روز دیگر\n\n> در صورتی تمایل به شارژ تاریخ گروه دارید میتوانید از دستور زیر استفاده نمایید\n\n!charge" - - end - end - if matches[1]:lower() == 'charge' then - if not is_owner(msg) then return end - local expiretime = redis:hget ('expiretime', get_receiver(msg)) - local now = tonumber(os.time()) - local text4 = (math.floor((tonumber(expiretime) - tonumber(now)) / 86400) + 1) - if not expiretime then - expiretime = "-" - end -local text3 = "Owner Need To Charge Group!" -local user = "user#id"..160149610 -- Your ID -local data = load_data(_config.moderation.data) -local group_owner = data[tostring(msg.to.id)]['set_owner'] -if not group_owner then -group_owner = "--" -end -local group_link = data[tostring(msg.to.id)]['settings']['set_link'] -if not group_link then -group_link = "Unset" -end -local exppm = 'Charge Request\n' -..'_______________\n' -..'Group Name : '..msg.to.title..' \n' -..'Group ID : '..msg.to.id..' \n' -..'Group Owner : '..group_owner..' \n' -..'Group Link : '..group_link..' \n' -..'Info Time: '..text4..' \n' -..'Info msg:\n'..text3..' \n' -..'----------------\n' -..'Charge For 1 Month :\n' -..'/setexp_'..msg.to.id..'_30\n' -..'----------------------------------\n' -..'Our Channel : @PrivateTeam' - local sends = send_msg(user, exppm, ok_cb, false) - return "Your Request Was Sent!" -end -end -return { - patterns = { - "^(setexpire) (.*)$", - "^(setexp)_(.*)_(.*)$", - "^(expire)$", - "^(charge)$", - "^[!#/](charge)$", - "^[!#/](setexpire) (.*)$", - "^[!#/](setexp)_(.*)_(.*)$", - "^[!#/](expire)$", - }, - run = run, - pre_process = pre_process -} diff --git a/plugins/aparat.lua b/plugins/aparat.lua index 683da563..480d67bf 100644 --- a/plugins/aparat.lua +++ b/plugins/aparat.lua @@ -1,8 +1,8 @@ --[[ # -# @LINK_DONI_TM -# @LINK_DONI_TM +# @iD_SHOMARE_MAJaZE_iD +# @iD_SHOMARE_MAJaZE_iD # ]] @@ -17,7 +17,7 @@ local function run(msg, matches) for i = 1, #items do text = text..'\n'..i..'- '..items[i].title..' - تعداد بازدید: '..items[i].visit_cnt..'\n لینک: aparat.com/v/'..items[i].uid end - text = text..'\n\nStrike Team' + text = text..'\n\niD_SHOMARE_MAJaZE_iD' return text end end diff --git a/plugins/azan.lua b/plugins/azan.lua index b6dbea35..003f59b9 100644 --- a/plugins/azan.lua +++ b/plugins/azan.lua @@ -78,7 +78,7 @@ function run(msg, matches) text = text..'\nغروب آفتاب: '..data.Sunset text = text..'\nاذان مغرب: '..data.Maghrib text = text..'\nعشاء : '..data.Isha - text = text..'\n\nLINK_DONI_TM' + text = text..'\n\niD_SHOMARE_MAJaZE_iD' if string.match(text, '0') then text = string.gsub(text, '0', '۰') end if string.match(text, '1') then text = string.gsub(text, '1', '۱') end if string.match(text, '2') then text = string.gsub(text, '2', '۲') end diff --git a/plugins/banhammer.lua b/plugins/banhammer.lua deleted file mode 100644 index 9cce9240..00000000 --- a/plugins/banhammer.lua +++ /dev/null @@ -1,348 +0,0 @@ - -local function pre_process(msg) - local data = load_data(_config.moderation.data) - -- SERVICE MESSAGE - if msg.action and msg.action.type then - local action = msg.action.type - -- Check if banned user joins chat by link - if action == 'chat_add_user_link' then - local user_id = msg.from.id - print('Checking invited user '..user_id) - local banned = is_banned(user_id, msg.to.id) - if banned or is_gbanned(user_id) then -- Check it with redis - print('User is banned!') - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] is banned and kicked ! ")-- Save to logs - kick_user(user_id, msg.to.id) - end - end - -- Check if banned user joins chat - if action == 'chat_add_user' then - local user_id = msg.action.user.id - print('Checking invited user '..user_id) - local banned = is_banned(user_id, msg.to.id) - if banned and not is_momod2(msg.from.id, msg.to.id) or is_gbanned(user_id) and not is_admin2(msg.from.id) then -- Check it with redis - print('User is banned!') - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] added a banned user >"..msg.action.user.id)-- Save to logs - kick_user(user_id, msg.to.id) - local banhash = 'addedbanuser:'..msg.to.id..':'..msg.from.id - redis:incr(banhash) - local banhash = 'addedbanuser:'..msg.to.id..':'..msg.from.id - local banaddredis = redis:get(banhash) - if banaddredis then - if tonumber(banaddredis) >= 4 and not is_owner(msg) then - kick_user(msg.from.id, msg.to.id)-- Kick user who adds ban ppl more than 3 times - end - if tonumber(banaddredis) >= 8 and not is_owner(msg) then - ban_user(msg.from.id, msg.to.id)-- Kick user who adds ban ppl more than 7 times - local banhash = 'addedbanuser:'..msg.to.id..':'..msg.from.id - redis:set(banhash, 0)-- Reset the Counter - end - end - end - if data[tostring(msg.to.id)] then - if data[tostring(msg.to.id)]['settings'] then - if data[tostring(msg.to.id)]['settings']['lock_bots'] then - bots_protection = data[tostring(msg.to.id)]['settings']['lock_bots'] - end - end - end - if msg.action.user.username ~= nil then - if string.sub(msg.action.user.username:lower(), -3) == 'bot' and not is_momod(msg) and bots_protection == "yes" then --- Will kick bots added by normal users - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] added a bot > @".. msg.action.user.username)-- Save to logs - kick_user(msg.action.user.id, msg.to.id) - end - end - end - -- No further checks - return msg - end - -- banned user is talking ! - if msg.to.type == 'chat' or msg.to.type == 'channel' then - local group = msg.to.id - local texttext = 'groups' - --if not data[tostring(texttext)][tostring(msg.to.id)] and not is_realm(msg) then -- Check if this group is one of my groups or not - --chat_del_user('chat#id'..msg.to.id,'user#id'..our_id,ok_cb,false) - --return - --end - local user_id = msg.from.id - local chat_id = msg.to.id - local banned = is_banned(user_id, chat_id) - if banned or is_gbanned(user_id) then -- Check it with redis - print('Banned user talking!') - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] banned user is talking !")-- Save to logs - kick_user(user_id, chat_id) - msg.text = '' - end - end - return msg -end - -local function kick_ban_res(extra, success, result) - local chat_id = extra.chat_id - local chat_type = extra.chat_type - if chat_type == "chat" then - receiver = 'chat#id'..chat_id - else - receiver = 'channel#id'..chat_id - end - if success == 0 then - return send_large_msg(receiver, "Cannot find user by that username!") - end - local member_id = result.peer_id - local user_id = member_id - local member = result.username - local from_id = extra.from_id - local get_cmd = extra.get_cmd - if get_cmd == "kick" then - if member_id == from_id then - send_large_msg(receiver, "You can't kick yourself") - return - end - if is_momod2(member_id, chat_id) and not is_admin2(sender) then - send_large_msg(receiver, "You can't kick mods/owner/admins") - return - end - kick_user(member_id, chat_id) - elseif get_cmd == 'ban' then - if is_momod2(member_id, chat_id) and not is_admin2(sender) then - send_large_msg(receiver, "You can't ban mods/owner/admins") - return - end - send_large_msg(receiver, 'User @'..member..' ['..member_id..'] banned') - ban_user(member_id, chat_id) - elseif get_cmd == 'unban' then - send_large_msg(receiver, 'User @'..member..' ['..member_id..'] unbanned') - local hash = 'banned:'..chat_id - redis:srem(hash, member_id) - return 'User '..user_id..' unbanned' - elseif get_cmd == 'banall' then - send_large_msg(receiver, 'User @'..member..' ['..member_id..'] globally banned') - banall_user(member_id) - elseif get_cmd == 'unbanall' then - send_large_msg(receiver, 'User @'..member..' ['..member_id..'] globally unbanned') - unbanall_user(member_id) - end -end - -local function run(msg, matches) -local support_id = msg.from.id - if matches[1]:lower() == 'id' and msg.to.type == "chat" or msg.to.type == "user" then - if msg.to.type == "user" then - return "Bot ID: "..msg.to.id.. "\n\nYour ID: "..msg.from.id - end - if type(msg.reply_id) ~= "nil" then - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] used /id ") - id = get_message(msg.reply_id,get_message_callback_id, false) - elseif matches[1]:lower() == 'id' then - local name = user_print_name(msg.from) - savelog(msg.to.id, name.." ["..msg.from.id.."] used /id ") - return "Group ID for " ..string.gsub(msg.to.print_name, "_", " ").. ":\n\n"..msg.to.id - end - end - if matches[1]:lower() == 'kickme' and msg.to.type == "chat" then-- /kickme - local receiver = get_receiver(msg) - if msg.to.type == 'chat' then - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] left using kickme ")-- Save to logs - chat_del_user("chat#id"..msg.to.id, "user#id"..msg.from.id, ok_cb, false) - end - end - - if not is_momod(msg) then -- Ignore normal users - return - end - - if matches[1]:lower() == "banlist" then -- Ban list ! - local chat_id = msg.to.id - if matches[2] and is_admin1(msg) then - chat_id = matches[2] - end - return ban_list(chat_id) - end - if matches[1]:lower() == 'ban' then-- /ban - if type(msg.reply_id)~="nil" and is_momod(msg) then - if is_admin1(msg) then - msgr = get_message(msg.reply_id,ban_by_reply_admins, false) - else - msgr = get_message(msg.reply_id,ban_by_reply, false) - end - local user_id = matches[2] - local chat_id = msg.to.id - elseif string.match(matches[2], '^%d+$') then - if tonumber(matches[2]) == tonumber(our_id) then - return - end - if not is_admin1(msg) and is_momod2(matches[2], msg.to.id) then - return "you can't ban mods/owner/admins" - end - if tonumber(matches[2]) == tonumber(msg.from.id) then - return "You can't ban your self !" - end - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - local receiver = get_receiver(msg) - savelog(msg.to.id, name.." ["..msg.from.id.."] baned user ".. matches[2]) - ban_user(matches[2], msg.to.id) - send_large_msg(receiver, 'User ['..matches[2]..'] banned') - else - local cbres_extra = { - chat_id = msg.to.id, - get_cmd = 'ban', - from_id = msg.from.id, - chat_type = msg.to.type - } - local username = string.gsub(matches[2], '@', '') - resolve_username(username, kick_ban_res, cbres_extra) - end - end - - - if matches[1]:lower() == 'unban' then -- /unban - if type(msg.reply_id)~="nil" and is_momod(msg) then - local msgr = get_message(msg.reply_id,unban_by_reply, false) - end - local user_id = matches[2] - local chat_id = msg.to.id - local targetuser = matches[2] - if string.match(targetuser, '^%d+$') then - local user_id = targetuser - local hash = 'banned:'..chat_id - redis:srem(hash, user_id) - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] unbaned user ".. matches[2]) - return 'User '..user_id..' unbanned' - else - local cbres_extra = { - chat_id = msg.to.id, - get_cmd = 'unban', - from_id = msg.from.id, - chat_type = msg.to.type - } - local username = string.gsub(matches[2], '@', '') - resolve_username(username, kick_ban_res, cbres_extra) - end - end - -if matches[1]:lower() == 'kick' then - if type(msg.reply_id)~="nil" and is_momod(msg) then - if is_admin1(msg) then - msgr = get_message(msg.reply_id,Kick_by_reply_admins, false) - else - msgr = get_message(msg.reply_id,Kick_by_reply, false) - end - elseif string.match(matches[2], '^%d+$') then - if tonumber(matches[2]) == tonumber(our_id) then - return - end - if not is_admin1(msg) and is_momod2(matches[2], msg.to.id) then - return "you can't kick mods/owner/admins" - end - if tonumber(matches[2]) == tonumber(msg.from.id) then - return "You can't kick your self !" - end - local user_id = matches[2] - local chat_id = msg.to.id - local print_name = user_print_name(msg.from):gsub("‮", "") - local name = print_name:gsub("_", "") - savelog(msg.to.id, name.." ["..msg.from.id.."] kicked user ".. matches[2]) - kick_user(user_id, chat_id) - else - local cbres_extra = { - chat_id = msg.to.id, - get_cmd = 'kick', - from_id = msg.from.id, - chat_type = msg.to.type - } - local username = string.gsub(matches[2], '@', '') - resolve_username(username, kick_ban_res, cbres_extra) - end -end - - - if not is_admin1(msg) and not is_support(support_id) then - return - end - - if matches[1]:lower() == 'banall' and is_admin1(msg) then -- Global ban - if type(msg.reply_id) ~="nil" and is_admin1(msg) then - banall = get_message(msg.reply_id,banall_by_reply, false) - end - local user_id = matches[2] - local chat_id = msg.to.id - local targetuser = matches[2] - if string.match(targetuser, '^%d+$') then - if tonumber(matches[2]) == tonumber(our_id) then - return false - end - banall_user(targetuser) - return 'User ['..user_id..' ] globally banned' - else - local cbres_extra = { - chat_id = msg.to.id, - get_cmd = 'banall', - from_id = msg.from.id, - chat_type = msg.to.type - } - local username = string.gsub(matches[2], '@', '') - resolve_username(username, kick_ban_res, cbres_extra) - end - end - if matches[1]:lower() == 'unbanall' then -- Global unban - local user_id = matches[2] - local chat_id = msg.to.id - if string.match(matches[2], '^%d+$') then - if tonumber(matches[2]) == tonumber(our_id) then - return false - end - unbanall_user(user_id) - return 'User ['..user_id..' ] globally unbanned' - else - local cbres_extra = { - chat_id = msg.to.id, - get_cmd = 'unbanall', - from_id = msg.from.id, - chat_type = msg.to.type - } - local username = string.gsub(matches[2], '@', '') - resolve_username(username, kick_ban_res, cbres_extra) - end - end - if matches[1]:lower() == "gbanlist" then -- Global ban list - return banall_list() - end -end - -return { - patterns = { - "^[#!/]([Bb]anall) (.*)$", - "^[#!/]([Bb]anall)$", - "^[#!/]([Bb]anlist) (.*)$", - "^[#!/]([Bb]anlist)$", - "^[#!/]([Gg]banlist)$", - "^[#!/]([Kk]ickme)", - "^[#!/]([Kk]ick)$", - "^[#!/]([Bb]an)$", - "^[#!/]([Bb]an) (.*)$", - "^[#!/]([Uu]nban) (.*)$", - "^[#!/]([Uu]nbanall) (.*)$", - "^[#!/]([Uu]nbanall)$", - "^[#!/]([Kk]ick) (.*)$", - "^[#!/]([Uu]nban)$", - "^[#!/]([Ii]d)$", - "^!!tgservice (.+)$" - }, - run = run, - pre_process = pre_process -} diff --git a/plugins/broadcast.lua b/plugins/broadcast.lua deleted file mode 100644 index 23d8560b..00000000 --- a/plugins/broadcast.lua +++ /dev/null @@ -1,28 +0,0 @@ -local function run(msg, matches) - if matches[1] == 'bc' and is_admin1(msg) then - local response = matches[3] - --send_large_msg("chat#id"..matches[2], response) - send_large_msg("channel#id"..matches[2], response) - end - if matches[1] == 'broadcast' then - if is_sudo(msg) then -- Only sudo ! - local data = load_data(_config.moderation.data) - local groups = 'groups' - local response = matches[2] - for k,v in pairs(data[tostring(groups)]) do - chat_id = v - local chat = 'chat#id'..chat_id - local channel = 'channel#id'..chat_id - send_large_msg(chat, response) - send_large_msg(channel, response) - end - end - end -end -return { - patterns = { - "^[#!/](broadcast) (.*)$", - "^[#!/](bc) (%d+) (.*)$" - }, - run = run -} diff --git a/plugins/plugin_asl.lua b/plugins/plugin_asl.lua index ebaf706f..7caafa32 100644 --- a/plugins/plugin_asl.lua +++ b/plugins/plugin_asl.lua @@ -5,7 +5,7 @@ 📋اسم•سن•ادرس•سایت•کانال•اینساگرام•جنسیت•تحصیلات•شماره ▂▂▂▂▂▂▂▂▂▂▂▂ -Channel: LINK_DONI_TM +Channel: iD_SHOMARE_MAJaZE_iD ]] do @@ -125,7 +125,7 @@ return "Hi "..msg.from.first_name.."\n" .."Your Channel∶"..(redis:get(hash7) or 'NO Channel').."\n" .."Your insta∶"..(redis:get(hash8) or 'NO insta').."\n" .."Your Site∶"..(redis:get(hash10) or 'NO Site').."\n\n" -.."CHANNEL @LINK_DONI_TM".."\n" +.."CHANNEL @iD_SHOMARE_MAJaZE_iD".."\n" end if matches[1]:lower()== 'delinfo' then diff --git a/plugins/time.lua b/plugins/time.lua index 07ea41f4..943e0418 100644 --- a/plugins/time.lua +++ b/plugins/time.lua @@ -2,7 +2,7 @@ function run(msg, matches) local url , res = http.request('http://api.gpmod.ir/time/') if res ~= 200 then return "No connection" end local jdat = json:decode(url) -local text = '🕒 ساعت '..jdat.FAtime..' \n📆 امروز '..jdat.FAdate..' میباشد.\n ----\n🕒 '..jdat.ENtime..'\n📆 '..jdat.ENdate.. '\n#ID Channel: @LINK_DONI_TM' +local text = '🕒 ساعت '..jdat.FAtime..' \n📆 امروز '..jdat.FAdate..' میباشد.\n ----\n🕒 '..jdat.ENtime..'\n📆 '..jdat.ENdate.. '\n#ID Channel: @iD_SHOMARE_MAJaZE_iD' return text end