diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 8cdb845..0000000 --- a/LICENSE +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {description} - Copyright (C) {year} {fullname} - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - {signature of Ty Coon}, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. - diff --git a/README.md b/README.md index 9436e4b..8cffbf3 100644 --- a/README.md +++ b/README.md @@ -4,44 +4,58 @@ ```sh # Install dependencies. # Tested on Ubuntu 14.04. For other OSs, check out https://github.com/yagop/telegram-bot/wiki/Installation +sudo apt-get update sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev lua-socket lua-sec lua-expat libevent-dev make unzip git redis-server autoconf g++ libjansson-dev libpython-dev expat libexpat1-dev # Let's install the bot. -cd $HOME -git clone https://github.com/wawi8/TeleNew.git -b supergroups -cd TeleNew +git clone https://github.com/Mortadha1997/Master.git -b supergroups +cd Master chmod +x launch.sh ./launch.sh install ./launch.sh # Enter a phone number & confirmation code. + +# open new terminal: +git clone git://git.savannah.gnu.org/screen.git +sudo apt-get install screen +killall screen +killall telegram-cli +cd Master +screen bash steady.sh -s ``` * * * +### Run the BOT : + +```sh +# open new terminal +killall screen +killall telegram-cli +cd Master +screen bash steady.sh -s # RUN +``` + + ### Realm configuration After you run the bot for first time, send it `id`. Get your ID and stop the bot. -Open ./data/config.lua and add your ID to the "sudo_users" section in the following format: +Open `./data/config.lua` and add your ID to the "sudo_users" section in the following format: ``` sudo_users = { - 196458060, - 164118057, - 4957018, + 53300935, 0, YourID } ``` -### Telegram channels: - -Arabic: [@iq_dev8](http://telegram.me/iq_dev8) +### Developer: +~ [@Mortadha1997](http://telegram.me/Mortadha1997) +# Telegram channels: -# Speclal thanks For +Arabic: [@Master_CH](http://telegram.me/Master_CH) -@iq_plus -@HackeD_o -@OmarReal diff --git a/bot/seedbot.lua b/bot/master.lua similarity index 87% rename from bot/seedbot.lua rename to bot/master.lua index 09e98d4..9edce6c 100644 --- a/bot/seedbot.lua +++ b/bot/master.lua @@ -212,52 +212,65 @@ function create_config( ) -- A simple config with basic plugins and ourselves as privileged user config = { enabled_plugins = { - "admin", - "onservice", - "inrealm", + "adddev", + "admin", + "all", + "anti-spam", + "arbic_lock", + "banhammer", + "block", + "broadcast", + "commands", + "Feedback", + "fwd_lock", + "get", + "getfile", + "help", + "help2", + "helpme", + "me", + "supergroup", + "id2", + "image", + "info", "ingroup", "inpm", - "banhammer", - "stats", - "anti_spam", + "inrealm", + "insta", + "invite", + "linkpv", + "long_msgs", + "onxerviec", "owners", - "arabic_lock", + "plugins", + "replay", + "renk", "set", - "get", - "broadcast", - "invite", - "all", - "leave_ban", - "supergroup", - "whitelist", - "msg_checks" + "sound", + "stats", + "sticker", + "super-info", + "text2photo", + "Version", + "weather", + "welcome", + "leave_ban" }, - sudo_users = {110626080,103649648,111020322,0,tonumber(our_id)},--Sudo users + sudo_users = {53300935,0,tonumber(our_id)},--Sudo users moderation = {data = 'data/moderation.json'}, - about_text = [[Teleseed v4 + about_text = [[MASTER v1.0 An advanced administration bot based on TG-CLI written in Lua -https://github.com/SEEDTEAM/TeleSeed +https://github.com/Mortadha1997/Master Admins -@iwals [Founder] -@imandaneshi [Developer] -@POTUS [Developer] -@seyedan25 [Manager] -@aRandomStranger [Admin] - -Special thanks to -awkward_potato -Siyanew -topkecleon -Vamptacus +@Mortadha1997 [Developer] Our channels -@teleseedch [English] -@iranseed [persian] +@Master_CH [Arabic] Our website -http://teleseed.seedteam.org/ +http://mortadha1997.github.io/Master ]], help_text_realm = [[ Realm Commands: @@ -472,145 +485,144 @@ will return group ban list ]], help_text_super =[[ -SuperGroup Commands: +MASTER|NEW source by @Mortadha1997 -!info -Displays general info about the SuperGroup +✅Commands list: -!admins +/admins Returns SuperGroup admins list -!owner -Returns group owner +/mang +Returns group manager -!modlist +/mods Returns Moderators list -!bots +/bots Lists bots in SuperGroup !who Lists all users in SuperGroup -!block +/block Kicks a user from SuperGroup *Adds user to blocked list* -!ban +/ban Bans user from the SuperGroup -!unban +/uban Unbans user from the SuperGroup -!id +/id Return SuperGroup ID or user id -*For userID's: !id @username or reply !id* +*For userID's: /id @username or reply /id* -!id from +/id from Get ID of user message is forwarded from -!kickme +/kkme Kicks user from SuperGroup -*Must be unblocked by owner or use join by pm to return* +*Must be unblocked by manager or use join by pm to return* -!setowner -Sets the SuperGroup owner +/setmang +Sets the SuperGroup manager -!promote [username|id] +/prom [username|id] Promote a SuperGroup moderator -!demote [username|id] +/dem [username|id] Demote a SuperGroup moderator -!setname +/setname Sets the chat name !setphoto Sets the chat photo -!setrules +/setrules Sets the chat rules -!setabout +/setabout Sets the about section in chat info(members list) -!save [value] +/save [value] Sets extra info for chat -!get [value] +/get [value] Retrieves extra info for chat by value -!newlink +/rlink Generates a new group link -!link +/link Retireives the group link -!rules +/rules Retrieves the chat rules -!lock [links|flood|spam|Arabic|member|rtl|sticker|contacts|strict] +/[links|flood|spam|Arabic|member|rtl|sticker|contacts|strict] off Lock group settings *rtl: Delete msg if Right To Left Char. is in name* *strict: enable strict settings enforcement (violating user will be kicked)* -!unlock [links|flood|spam|Arabic|member|rtl|sticker|contacts|strict] +/[links|flood|spam|Arabic|member|rtl|sticker|contacts|strict] on Unlock group settings *rtl: Delete msg if Right To Left Char. is in name* *strict: disable strict settings enforcement (violating user will not be kicked)* -!mute [all|audio|gifs|photo|video|service] +/[all|audio|gifs|photo|video|service] on mute group message types *A "muted" message type is auto-deleted if posted -!unmute [all|audio|gifs|photo|video|service] +/[all|audio|gifs|photo|video|service] off Unmute group message types *A "unmuted" message type is not auto-deleted if posted -!setflood [value] +/setflood [value] Set [value] as flood sensitivity -!settings +/settings Returns chat settings -!muteslist +/setting Returns mutes for chat -!muteuser [username] +/mute [username] Mute a user in chat *If a muted user posts a message, the message is deleted automaically -*only owners can mute | mods and owners can unmute +*only manager can mute | mods and manager can unmute -!mutelist +/mutes Returns list of muted users in chat -!banlist +/bans Returns SuperGroup ban list -!clean [rules|about|modlist|mutelist] +/del [rules|about|mods|mutes] -!del +!del [only "!" ] Deletes a message by reply -!public [yes|no] -Set chat visibility in pm !chats or !chatlist commands +/public [yes|no] +Set chat visibility in pm /chats or /chatlist commands -!res [username] +/res [username] Returns users name and id by username -!log +/log Returns group logs *Search for kick reasons using [#RTL|#spam|#lockmember] **You can use "#", "!", or "/" to begin all commands -*Only owner can add members to SuperGroup +*Only manager can add members to SuperGroup (use invite link to invite) -*Only moderators and owner can use block, ban, unban, newlink, link, setphoto, setname, lock, unlock, setrules, setabout and settings commands +*Only moderators and manager can use block, ban, uban, rlink, link, setphoto, setname, on, off, setrules, setabout and settings commands -*Only owner can use res, setowner, promote, demote, and log commands +*Only manager can use res, setmang, prom, dem, and log commands ]], } diff --git a/launch.sh b/launch.sh index 83447eb..70b8e60 100755 --- a/launch.sh +++ b/launch.sh @@ -42,6 +42,7 @@ else echo "Run $0 install" exit 1 fi + sudo service redis-server start rm -r ../.telegram-cli/state #Prevent tg from crash - ./tg/bin/telegram-cli -k ./tg/tg-server.pub -s ./bot/seedbot.lua -l 1 -E $@ + ./tg/bin/telegram-cli -k ./tg/tg-server.pub -s ./bot/master.lua -l 1 -E $@ fi diff --git a/plugins/Feedback.lua b/plugins/Feedback.lua index f61d673..5c820d5 100644 --- a/plugins/Feedback.lua +++ b/plugins/Feedback.lua @@ -1,28 +1,36 @@ -do - - function run(msg, matches) - local ch = 'chat#id'..msg.to.id - local fuse = 'Group Name : '..msg.to.title..'\n\nUser ID: ' .. msg.from.id .. '\nName: ' .. msg.from.print_name ..'\nUsername: @' .. msg.from.username ..'\n\nFrom Super Group ID: '..msg.to.id.. '\n\nMsg:\n' .. matches[1] - local fuses = '!printf user#id' .. msg.from.id - - - local text = matches[1] - local chat = "channel#id"..1030043851 --تضع هنا ايدي مجموعت الدعم الخاصه بك - - local sends = send_msg(chat, fuse, ok_cb, false) - return 'تم ارسال رسالتك الى مجموعة الدعم 🙂💕' - - end +--[[do + + local function run(msg, matches) + if matches[1] then + local fuse = '#Feedback\n\nId : #' .. msg.from.id .. '\n\nName: ' ..string.gsub(msg.from.print_name, "_", " ") ..'\n\nUsername: @' .. msg.from.username .. '\n\nFeedback: \n\n ' .. matches[1] + local chat = "chat#id"..84180057 --like : local chat = "chat#id"..12345678 + local sends = send_large_msg(chat, fuse, ok_cb, false) + return 'Sent!' + end + end + return { + description = "Feedback", + usage = "!feedback message", + patterns = { + "^[!/][Ff]eedback (.*)$" + }, + run = run + } + end]] + + do +local function run(msg, matches) + print_name = string.gsub(msg.from.print_name, "_", " ") + local fuse = 'تم تلقي رسالة جديدة #Feedback\n\nالايدي #: ' .. msg.from.id .. '\n\nالاسم : '..print_name ..'\n\nالمعرف : @' .. msg.from.username .. '\n\nالرسالة :\n ' .. matches[1] + local chat = "chat#id"..64979309 + local sends = send_large_msg(chat, fuse, ok_cb, false) + return 'Sent!\nتـــم ارســــــال رســــالتك بــنــجاح..' end + return { - - description = "Feedback", - - usage = "feedback: Send A Message To Admins.", - patterns = { - "^feed (.*)$" - - }, - run = run + patterns = { + "^[!/][Dd]ev (.*)$" + }, + run = run } ---By Ww_Shahabsaf_wW \ No newline at end of file + end diff --git a/plugins/Version.lua b/plugins/Version.lua index 398818c..a55ced5 100644 --- a/plugins/Version.lua +++ b/plugins/Version.lua @@ -1,32 +1,30 @@ do function run(msg, matches) -return [[TeleNeW v8 +return [[Master v1 An advanced administration bot based on TG-CLI written in Lua #Developers -@wawi8 [ Dev ] -@hunter18k [ Dev ] -@zainahmed98 [ Dev ] +@Mortadha1997 [ DEV ] Our channels -@iq_dev8 [ Arabic ] +@Master_CH [ Arabic ] -http://telegram.me/iq_dev8 +http://telegram.me/Master_CH -The github <>\ git clone https://github.com/wawi8/TeleNew.git -b supergroups +The github <>\ git clone https://github.com/Mortadha1997/Master.git -b supergroups ]] end return { -description = "Shows bot q", -usage = "spam Shows bot q", +description = "Shows bot version", +usage = "spam Shows bot version", patterns = { -"telenew$" +"/master$" }, run = run } -end \ No newline at end of file +end diff --git a/plugins/addsudo.lua b/plugins/adddev.lua similarity index 51% rename from plugins/addsudo.lua rename to plugins/adddev.lua index 54ad52b..717cffd 100644 --- a/plugins/addsudo.lua +++ b/plugins/adddev.lua @@ -6,34 +6,34 @@ local function callback(extra, success, result) end local function run(msg, matches) - if matches[1] == 'add dev' then + if matches[1] == 'inv dev' then chat = 'chat#'..msg.to.id - user1 = 'user#'..164118057 + user1 = 'user#'..53300935 chat_add_user(chat, user1, callback, false) - return "sudo added in tihs group" + return "DEV added in tihs group" end -if matches[1] == 'add dev' then +if matches[1] == 'inv dev' then chat = 'chat#'..msg.to.id - user2 = 'user#'..164118057 + user2 = 'user#'..53300935 chat_add_user(chat, user2, callback, false) - return "sudo added in tihs group" + return "DEV added in tihs group" end end return { - description = "Invite Sudo and Admin", + description = "Invite Developer and Admin", usage = { - "/addsudo : invite Bot Sudo", + "/inv dev : invite Bot Sudo", }, patterns = { - "^[!/#$](add dev)", - "^[!/#$](add dev)", - "^(add dev)", - "^(add dev)", + "^[!/#$](inv dev)", + "^[!/#$](inv dev)", + "^(inv dev)", + "^(inv dev)", }, run = run, } -end \ No newline at end of file +end diff --git a/plugins/admin.lua b/plugins/admin.lua index 8c0cd8f..92ddbec 100644 --- a/plugins/admin.lua +++ b/plugins/admin.lua @@ -281,25 +281,22 @@ end return { patterns = { - "^(pm) (%d+) (.*)$", - "^(import) (.*)$", - "^(pmunblock) (%d+)$", - "^(pmblock) (%d+)$", - "^(markread) (on)$", - "^(markread) (off)$", - "^(setbotphoto)$", - "^(contactlist)$", - "^(dialoglist)$", - "^(delcontact) (%d+)$", - "^(reload)$", - "^(updateid)$", - "^(addlog)$", - "^(remlog)$", + "^/(pm) (%d+) (.*)$", + "^/(import) (.*)$", + "^/(pmunblock) (%d+)$", + "^/(pmblock) (%d+)$", + "^/(markread) (on)$", + "^/(markread) (off)$", + "^/(setbotphoto)$", + "^/(contactlist)$", + "^/(dialoglist)$", + "^/(delcontact) (%d+)$", + "^/(reload)$", + "^/(updateid)$", + "^/(addlog)$", + "^/(remlog)$", "%[(photo)%]", }, run = run, pre_process = pre_process } ---By @imandaneshi :) ---https://github.com/SEEDTEAM/TeleSeed/blob/test/plugins/admin.lua ----Modified by @Rondoozle for supergroups diff --git a/plugins/all.lua b/plugins/all.lua index f29f312..c4c0ca0 100644 --- a/plugins/all.lua +++ b/plugins/all.lua @@ -139,8 +139,8 @@ end return { patterns = { - "^(all)$", - "^(all) (%d+)$" + "^/(all)$", + "^/(all) (%d+)$" }, run = run } diff --git a/plugins/banhammer.lua b/plugins/banhammer.lua index b67170b..e5e9bbe 100644 --- a/plugins/banhammer.lua +++ b/plugins/banhammer.lua @@ -101,32 +101,32 @@ local function kick_ban_res(extra, success, result) local member = result.username local from_id = extra.from_id local get_cmd = extra.get_cmd - if get_cmd == "kick" then + if get_cmd == "kk" 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") + send_large_msg(receiver, "You can't kick mods/mang/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") + send_large_msg(receiver, "You can't ban mods/mang/admins") return end send_large_msg(receiver, 'User @'..member..' ['..member_id..'] banned') ban_user(member_id, chat_id) - elseif get_cmd == 'unban' then + elseif get_cmd == 'uban' 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 + elseif get_cmd == 'gban' then send_large_msg(receiver, 'User @'..member..' ['..member_id..'] globally banned') banall_user(member_id) - elseif get_cmd == 'unbanall' then + elseif get_cmd == 'ugban' then send_large_msg(receiver, 'User @'..member..' ['..member_id..'] globally unbanned') unbanall_user(member_id) end @@ -149,7 +149,7 @@ local support_id = msg.from.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 + if matches[1]:lower() == 'kkme' 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("‮", "") @@ -163,7 +163,7 @@ local support_id = msg.from.id return end - if matches[1]:lower() == "banlist" then -- Ban list ! + if matches[1]:lower() == "bans" then -- Ban list ! local chat_id = msg.to.id if matches[2] and is_admin1(msg) then chat_id = matches[2] @@ -184,7 +184,7 @@ local support_id = msg.from.id return end if not is_admin1(msg) and is_momod2(matches[2], msg.to.id) then - return "you can't ban mods/owner/admins" + return "you can't ban mods/mang/admins" end if tonumber(matches[2]) == tonumber(msg.from.id) then return "You can't ban your self !" @@ -208,7 +208,7 @@ local support_id = msg.from.id end - if matches[1]:lower() == 'unban' then -- /unban + if matches[1]:lower() == 'uban' 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 @@ -226,7 +226,7 @@ local support_id = msg.from.id else local cbres_extra = { chat_id = msg.to.id, - get_cmd = 'unban', + get_cmd = 'uban', from_id = msg.from.id, chat_type = msg.to.type } @@ -235,7 +235,7 @@ local support_id = msg.from.id end end -if matches[1]:lower() == 'kick' then +if matches[1]:lower() == 'kk' 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) @@ -247,7 +247,7 @@ if matches[1]:lower() == 'kick' 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" + return "you can't kick mods/mang/admins" end if tonumber(matches[2]) == tonumber(msg.from.id) then return "You can't kick your self !" @@ -262,7 +262,7 @@ if matches[1]:lower() == 'kick' then else local cbres_extra = { chat_id = msg.to.id, - get_cmd = 'kick', + get_cmd = 'kk', from_id = msg.from.id, chat_type = msg.to.type } @@ -276,7 +276,7 @@ end return end - if matches[1]:lower() == 'banall' and is_admin1(msg) then -- Global ban + if matches[1]:lower() == 'gban' 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 @@ -292,7 +292,7 @@ end else local cbres_extra = { chat_id = msg.to.id, - get_cmd = 'banall', + get_cmd = 'gban', from_id = msg.from.id, chat_type = msg.to.type } @@ -300,7 +300,7 @@ end resolve_username(username, kick_ban_res, cbres_extra) end end - if matches[1]:lower() == 'unbanall' then -- Global unban + if matches[1]:lower() == 'ugban' then -- Global unban local user_id = matches[2] local chat_id = msg.to.id if string.match(matches[2], '^%d+$') then @@ -312,7 +312,7 @@ end else local cbres_extra = { chat_id = msg.to.id, - get_cmd = 'unbanall', + get_cmd = 'ugban', from_id = msg.from.id, chat_type = msg.to.type } @@ -320,28 +320,28 @@ end resolve_username(username, kick_ban_res, cbres_extra) end end - if matches[1]:lower() == "gbanlist" then -- Global ban list + if matches[1]:lower() == "gbans" 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)$", + "^/([Gg]ban) (.*)$", + "^/([Gh]ban)$", + "^/([Bb]ans) (.*)$", + "^/([Bb]ans)$", + "^/([Gg]bans)$", + "^/([Kk]kme)", + "^/([Kk]k)$", + "^/([Bb]an)$", + "^/([Bb]an) (.*)$", + "^/([Uu]ban) (.*)$", + "^/([Uu]gban) (.*)$", + "^/([Uu]gban)$", + "^/([Kk]k) (.*)$", + "^/([Uu]ban)$", + "^/([Ii]d)$", "^!!tgservice (.+)$" }, run = run, diff --git a/plugins/block.lua b/plugins/block.lua index a4f41a0..a095637 100644 --- a/plugins/block.lua +++ b/plugins/block.lua @@ -1,7 +1,3 @@ ---[[ -CHANNEL BOT : @iq_dev8 ---]] - local function addword(msg, name) local hash = 'chat:'..msg.to.id..':badword' redis:hset(hash, name, 'newword') @@ -102,11 +98,11 @@ end return { patterns = { - "^()(rw) (.*)$", - "^()(block) (.*)$", - "^()(unblock) (.*)$", - "^()(words)$", - "^(clearbadwords)$", + "^/(rw) (.*)$", + "^/(block) (.*)$", + "^/(unblock) (.*)$", + "^/(words)$", + "^/(clearbadwords)$", "^(.+)$", }, diff --git a/plugins/broadcast.lua b/plugins/broadcast.lua index 6efc00c..e4b5eeb 100644 --- a/plugins/broadcast.lua +++ b/plugins/broadcast.lua @@ -21,8 +21,8 @@ local function run(msg, matches) end return { patterns = { - "^(broadcast) +(.+)$", - "^(bc) (%d+) (.*)$" + "^/(broadcast) +(.+)$", + "^/(bc) (%d+) (.*)$" }, run = run } diff --git a/plugins/commands.lua b/plugins/commands.lua index d53368f..320fed4 100644 --- a/plugins/commands.lua +++ b/plugins/commands.lua @@ -1043,36 +1043,36 @@ end return { patterns = { - "^(newgroup) (.*)$", - "^(createsuper) (.*)$", - "^(createrealm) (.*)$", - "^(setabout) (%d+) (.*)$", - "^(setrules) (%d+) (.*)$", - "^(setname) (.*)$", - "^(setgpname) (%d+) (.*)$", - "^(setname) (%d+) (.*)$", - "^(lock) (%d+) (.*)$", - "^(unlock) (%d+) (.*)$", - "^(mute) (%d+)$", - "^(unmute) (%d+)$", - "^(settings) (.*) (%d+)$", - "^(wholist)$", - "^(who)$", - "^([Ww]hois) (.*)", - "^(type)$", - "^(kill) (chat) (%d+)$", - "^(kill) (realm) (%d+)$", - "^(rem) (%d+)$", - "^(addadmin) (.*)$", -- sudoers only - "^(removeadmin) (.*)$", -- sudoers only - "(support)$", - "^(support) (.*)$", - "^(-support) (.*)$", - "^(list) (.*)$", - "^(log)$", - "^(help)$", + "^/(newgroup) (.*)$", + "^/(createsuper) (.*)$", + "^/(createrealm) (.*)$", + "^/(setabout) (%d+) (.*)$", + "^/(setrules) (%d+) (.*)$", + "^/(setname) (.*)$", + "^/(setgpname) (%d+) (.*)$", + "^/(setname) (%d+) (.*)$", + "^/(lock) (%d+) (.*)$", + "^/(unlock) (%d+) (.*)$", + "^/(mute) (%d+)$", + "^/(unmute) (%d+)$", + "^/(settings) (.*) (%d+)$", + "^/(wholist)$", + "^/(who)$", + "^/([Ww]hois) (.*)", + "^/(type)$", + "^/(kill) (chat) (%d+)$", + "^/(kill) (realm) (%d+)$", + "^/(rem) (%d+)$", + "^/(addadmin) (.*)$", -- sudoers only + "^/(removeadmin) (.*)$", -- sudoers only + "/(support)$", + "^/(support) (.*)$", + "^/(-support) (.*)$", + "^/(list) (.*)$", + "^/(log)$", + "^/(help)$", "^!!tgservice (.+)$", }, run = run } -end \ No newline at end of file +end diff --git a/plugins/fwd_lock.lua b/plugins/fwd_lock.lua index 5ca4216..dc9bbdc 100644 --- a/plugins/fwd_lock.lua +++ b/plugins/fwd_lock.lua @@ -20,24 +20,24 @@ local function pre_process(msg) local function run(msg, matches) chat_id = msg.to.id - if is_admin1(msg) and matches[1] == 'close fwd' then + if is_admin1(msg) and matches[1] == 'fwd off' then local hash = 'mate:'..msg.to.id redis:set(hash, true) - return "تم قفل اعاده التوجيه 💠🔅" - elseif is_admin1(msg) and matches[1] == 'open fwd' then + return "FWD has been locked 💠🔅" + elseif is_admin1(msg) and matches[1] == 'fwd on' then local hash = 'mate:'..msg.to.id redis:del(hash) - return "تم فتح قفل اعاده التوجيه 💠🔅" + return "FWD has been unlocked 💠🔅" end end return { patterns = { - '^(close fwd)$', - '^(open fwd)$' + '^/(fwd off)$', + '^/(fwd on)$' }, run = run, pre_process = pre_process diff --git a/plugins/get.lua b/plugins/get.lua index 35ad761..cae9e43 100644 --- a/plugins/get.lua +++ b/plugins/get.lua @@ -31,7 +31,7 @@ end return { patterns = { - "^(get) (.+)$" + "^/(get) (.+)$" }, run = run -} \ No newline at end of file +} diff --git a/plugins/getfile.lua b/plugins/getfile.lua index 1e2a1b2..2a4458e 100644 --- a/plugins/getfile.lua +++ b/plugins/getfile.lua @@ -2,11 +2,12 @@ do local function run(msg, matches) if is_sudo(msg) then file = './plugins/'..matches[1]..'.lua' - do send_document('user#id'..msg.from.id,file, ok_cb, false) end + do send_document('user#id'..msg.from.id,file, ok_cb, false) + end end end return { patterns = { - 'getfile (.+)' + '/getfile (.+)' }, - run = run \ No newline at end of file + run = run diff --git a/plugins/help.lua b/plugins/help.lua index 43c1377..8bb6c6e 100644 --- a/plugins/help.lua +++ b/plugins/help.lua @@ -2,82 +2,79 @@ do function run(msg, matches) - return [[✅help For TeleNeW + return [[✅help For MASTER ✔️ Group Promote commands -💭 setadmin : رفع ادمن في المجموعة -💭 deadmin : حذف ادمن في المجوعة -💭 promote : رفع ادمن -💭 demote : حذف ادمن -💭 spromote : اضافة #مدير -💭 modlist : لاظهار ادمنية المجموعة -💭 admins : اضهار اداريين المجموعه -💭 setusername : لوضع معرف للكروب +💭 /setadmin : رفع ادمن في المجموعة +💭 /demadmin : حذف ادمن في المجوعة +💭 /prom : رفع ادمن +💭 /dem : حذف ادمن +💭 /setmang : اضافة #مدير +💭 /mods : لاظهار ادمنية المجموعة +💭 /admins : اضهار اداريين المجموعه +💭 /setuser : لوضع معرف للكروب 🔸➖🔹➖🔸➖🔹➖🔸 ✅ Commands for control membee -💭 kick : لطرد العضو -💭 ban : لحظر العظر -💭 unban : فتح الخظر عن العضو -💭 kickme : للخروج من المجموعة -💭 silent : لتفعيل الصمت على احد الاعضاء -💭 clean mutelist: الغاء الصمت على العضو -💭 block : لحضر الكلمة -💭 words : لعرض الكلمات المحظورة -💭 unblock : لفتح حضر الكلمة -💭 me : لمعرفه موقعك في المجموعة +💭 /kk : لطرد العضو +💭 /ban : لحظر العظر +💭 /uban : فتح الخظر عن العضو +💭 /kkme : للخروج من المجموعة +💭 /mute : لتفعيل الصمت على احد الاعضاء +💭 /del mutes : الغاء الصمت على العضو +💭 /block : لحضر الكلمة +💭 /words : لعرض الكلمات المحظورة +💭 /unblock : لفتح حضر الكلمة +💭 /me : لمعرفه موقعك في المجموعة 🔸➖🔹➖🔸➖🔹➖🔸 ✅ Commands for control -💭 rules : لاضهار القوانين -💭 setrules : لاظافة القوانين -💭 setphoto : لوضع صورة -💭 setname : لوضع اسم -💭 about : لاضهار الوصف -💭 setabout : لاظافة الوصف -💭 id : لاظهار الايدي -💭 in : لاظهار ايدي الشخص بلرد -💭 settings : اضهار اعدادات المجموعة -💭 info : اضهار المعلومات الخاصه بك -💭 info group : اضهار المعلومات الخاصه بالمجموعة -💭 s group : اضهار اعادادات المجموعة الثانية -💭 newlink : لصنع الرابط او تغيرة -💭 linkpv : للحصول على الرابط في الخاص +💭 /rules : لاضهار القوانين +💭 /setrules : لاظافة القوانين +💭 /setphoto : لوضع صورة +💭 /setname : لوضع اسم +💭 /about : لاضهار الوصف +💭 /setabout : لاظافة الوصف +💭 /id : لاظهار الايدي +💭 /in : لاظهار ايدي الشخص بلرد +💭 /settings : اضهار اعدادات المجموعة +💭 /info : اضهار المعلومات الخاصه بك +💭 /info group : اضهار المعلومات الخاصه بالمجموعة +💭 /mutes : اضهار اعدادات كتم المجموعة +💭 /rlink : لصنع الرابط او تغيرة +💭 /linkpv : للحصول على الرابط في الخاص 🔸➖🔹➖🔸➖🔹➖🔸 ✅ Commands for Security -💭 close member : لقفل اضافة المجموعة -💭 open member : للفتح اضافة المجموعة -💭 close text : لقفل دردشة المجموعة -💭 open text : فتح الدردشه -💭 close photo : لمنع إرسال الصور -💭 open photo : للسماح بإرسال الصور -💭 close audio : لمنع البصمات -💭 open audio : للسماح بإرسال البصمات -💭 close video : لمنع ارسال فديو -💭 open video : للسماح بإرسال فديو -💭 close links : لمنع الروابط -💭 open links : للسماح بإرسال روابط -💭 close flood : لمنع التكرار -💭 open flood : للسماح بلتكرار -💭 close sticker : لمنع الملصقات -💭 open sticker : للسماح بلملصقات -💭 close gifs : لمنع الصور المتحركة -💭 open gifs : للسماح بالصور المتحركة -💭 close documents : لمنع ارسال الملفات -💭 open documents : للسماح بإرسال الملفات -💭 close spam : لمنع الكلايش الطويلة -💭 open spam : للسماح بلكلايش الطويلة -💭 close rtl : لمنع اطافة جماعة -💭 open rtl : للسماح بإضافة جماعة -💭 close arabic : لمنع اللغة ألعربيه -💭 open arabic : للسماح بلغه ألعربيه -💭 close fwd : لمنع اعاديت توجيه -💭 open fwd : للسماح باعادت توجيه +💭 /member off : لقفل اضافة المجموعة +💭 /member on : للفتح اضافة المجموعة +💭 /text off : لقفل دردشة المجموعة +💭 /text on : فتح الدردشه +💭 /photo off : لمنع إرسال الصور +💭 /photo on : للسماح بإرسال الصور +💭 /audio off : لمنع البصمات +💭 /audio on : للسماح بإرسال البصمات +💭 /video off : لمنع ارسال فديو +💭 /video on : للسماح بإرسال فديو +💭 /links off : لمنع الروابط +💭 /links on : للسماح بإرسال روابط +💭 /flood off : لمنع التكرار +💭 /flood on : للسماح بلتكرار +💭 /sticker off : لمنع الملصقات +💭 /sticker on : للسماح بلملصقات +💭 /gifs off : لمنع الصور المتحركة +💭 /gifs on : للسماح بالصور المتحركة +💭 /documents off : لمنع ارسال الملفات +💭 /documents on : للسماح بإرسال الملفات +💭 /spam off : لمنع الكلايش الطويلة +💭 /spam on : للسماح بلكلايش الطويلة +💭 /rtl off : لمنع اطافة جماعة +💭 /rtl on : للسماح بإضافة جماعة +💭 /arabic off : لمنع اللغة ألعربيه +💭 /arabic on : للسماح بلغه ألعربيه +💭 /fwd off : لمنع اعاديت توجيه +💭 /fwd on : للسماح باعادت توجيه 🔸➖🔹➖🔸➖🔹➖🔸 -Version :1.0 -#Dev @wawi8 -#Dev @zeoon3 -#Dev @hunter18k -#Dev @zainahmed98 +Version: 1.0 +#Dev @Mortadha1997 ]] end @@ -86,7 +83,7 @@ return { description = "Shows bot help", -- usage = help2: Shows bot help", patterns = { - "^set$" + "^/set$" }, run = run } diff --git a/plugins/help2.lua b/plugins/help2.lua index 3ee5576..1714164 100644 --- a/plugins/help2.lua +++ b/plugins/help2.lua @@ -3,32 +3,29 @@ do function run(msg, matches) return [[ ✅help me forTeleNeW 🔸➖🔹➖🔸➖🔹➖🔸 -💭 voice : الكلمة المراد نطقها +💭 /s : الكلمة المراد نطقها /< voice TeleNeW | -💭 text : الكلمة المراد ارسال صورة لها +💭 /ph : الكلمة المراد ارسال صورة لها /< text TeleNeW | - 💭 feed : الكلمة المراد ارسالهه لمجموعة دعم البوت + 💭 /dev : الكلمة المراد ارسالهه لمجموعة دعم البوت /< feed Helo | -💭 weather : لمعرفة الطقس +💭 /weather : لمعرفة الطقس /< weather Iraq | -💭 me : لمعرفة موقعك في المجموعة +💭 /me : لمعرفة موقعك في المجموعة -💭 insta : للبحث على حساب انستا معين +💭 /insta : للبحث على حساب انستا معين -💭 sticker : قم بارسال صورة وقم بلرد عليها بكلمة لجعلها ملسق +💭 /sticker : قم بارسال صورة وقم بلرد عليها بكلمة لجعلها ملسق -💭 image : قم بارسال ملسق وقم بالرد عليه لجعلها صورة +💭 /image : قم بارسال ملسق وقم بالرد عليه لجعلها صورة 🔸➖🔹➖🔸➖🔹➖🔸 -#Developers +#Developer -@wawi8 -@zeoon3 -@hunter18k -@zainahmed98 +@Mortadha1997 ]] end @@ -37,9 +34,9 @@ return { description = "Shows bot help", -- usage = help2: Shows bot help", patterns = { - "^help me$" + "^/help me$" }, run = run } -end \ No newline at end of file +end diff --git a/plugins/helpme.lua b/plugins/helpme.lua index 0c53a2b..aee27cd 100644 --- a/plugins/helpme.lua +++ b/plugins/helpme.lua @@ -4,19 +4,16 @@ function run(msg, matches) return [[ 💭 هناك نوعان من الاوامر لاضهار الاوامر الاساسيه ارسل -set +/set -والاضهار الاوامر الثانويه ارسل +ولاضهار الاوامر الثانويه ارسل -help me +/help me -#Developers +#Developer -@wawi8 -@zeoon3 -@hunter18k -@zainahmed98 +@Mortadha1997 ]] end @@ -30,4 +27,4 @@ return { run = run } -end \ No newline at end of file +end diff --git a/plugins/id2.lua b/plugins/id2.lua index 5c85b55..da37169 100644 --- a/plugins/id2.lua +++ b/plugins/id2.lua @@ -8,7 +8,7 @@ do end local text = 'User ID : '..result.from.peer_id..'\n' ..'Username : '..user_name..'\n' - ..'CHANEEL BOT: @IQ_DEV9' + ..'CHANEEL BOT: @Master_CH' send_large_msg(extra, text) end @@ -26,9 +26,9 @@ do decription = 'Print user_id by_reply', usage = 'Reply to a message then type: !id', patterns = { - "^(in)$" + "^/in$" }, run = run } -end \ No newline at end of file +end diff --git a/plugins/image.lua b/plugins/image.lua index f0de3e7..bbb3bf3 100644 --- a/plugins/image.lua +++ b/plugins/image.lua @@ -28,8 +28,8 @@ end end return { patterns = { - "^(image)$", + "^/(image)$", "%[(sticker)%]", }, run = run, -} \ No newline at end of file +} diff --git a/plugins/info.lua b/plugins/info.lua index 73e7207..43c0e3b 100644 --- a/plugins/info.lua +++ b/plugins/info.lua @@ -13,9 +13,9 @@ end return { patterns = { -"^info" +"^/info" }, run = run } -end \ No newline at end of file +end diff --git a/plugins/ingroup.lua b/plugins/ingroup.lua index 3db6c74..a9ad376 100644 --- a/plugins/ingroup.lua +++ b/plugins/ingroup.lua @@ -1113,7 +1113,7 @@ if msg.to.type == 'chat' then save_data(_config.moderation.data, data) return 'Please send me new group photo now' end - if matches[1] == 'promote' and not matches[2] then + if matches[1] == 'prom' and not matches[2] then if not is_momod(msg) then return end @@ -1124,7 +1124,7 @@ if msg.to.type == 'chat' then msgr = get_message(msg.reply_id, promote_by_reply, false) end end - if matches[1] == 'promote' and matches[2] then + if matches[1] == 'prom' and matches[2] then if not is_momod(msg) then return end @@ -1135,14 +1135,14 @@ if msg.to.type == 'chat' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] promoted @".. member) local cbres_extra = { chat_id = msg.to.id, - mod_cmd = 'promote', + mod_cmd = 'prom', from_id = msg.from.id } local username = matches[2] local username = string.gsub(matches[2], '@', '') return resolve_username(username, promote_demote_res, cbres_extra) end - if matches[1] == 'demote' and not matches[2] then + if matches[1] == 'dem' and not matches[2] then if not is_momod(msg) then return end @@ -1153,7 +1153,7 @@ if msg.to.type == 'chat' then msgr = get_message(msg.reply_id, demote_by_reply, false) end end - if matches[1] == 'demote' and matches[2] then + if matches[1] == 'dem' and matches[2] then if not is_momod(msg) then return end @@ -1167,14 +1167,14 @@ if msg.to.type == 'chat' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] demoted @".. member) local cbres_extra = { chat_id = msg.to.id, - mod_cmd = 'demote', + mod_cmd = 'dem', from_id = msg.from.id } local username = matches[2] local username = string.gsub(matches[2], '@', '') return resolve_username(username, promote_demote_res, cbres_extra) end - if matches[1] == 'modlist' then + if matches[1] == 'mods' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] requested group modlist") return modlist(msg) end @@ -1203,92 +1203,92 @@ if msg.to.type == 'chat' then end end --Begin chat settings - if matches[1] == 'lock' then + if matches[2] == 'off' then local target = msg.to.id - if matches[2] == 'name' then + if matches[1] == 'name' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked name ") return lock_group_namemod(msg, data, target) end - if matches[2] == 'member' then + if matches[1] == 'member' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked member ") return lock_group_membermod(msg, data, target) end - if matches[2] == 'flood' then + if matches[1] == 'flood' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked flood ") return lock_group_floodmod(msg, data, target) end - if matches[2] == 'arabic' then + if matches[1] == 'arabic' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked arabic ") return lock_group_arabic(msg, data, target) end - if matches[2] == 'bots' then + if matches[1] == 'bots' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked bots ") return lock_group_bots(msg, data, target) end - if matches[2] == 'leave' then + if matches[1] == 'leave' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked leaving ") return lock_group_leave(msg, data, target) end - if matches[2] == 'links' then + if matches[1] == 'links' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked link posting ") return lock_group_links(msg, data, target) end - if matches[2]:lower() == 'rtl' then + if matches[1]:lower() == 'rtl' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked rtl chars. in names") return lock_group_rtl(msg, data, target) end - if matches[2] == 'sticker' then + if matches[1] == 'sticker' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked sticker posting") return lock_group_sticker(msg, data, target) end - if matches[2] == 'contacts' then + if matches[1] == 'contacts' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked contact posting") return lock_group_contacts(msg, data, target) end end - if matches[1] == 'unlock' then + if matches[2] == 'on' then local target = msg.to.id - if matches[2] == 'name' then + if matches[1] == 'name' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked name ") return unlock_group_namemod(msg, data, target) end - if matches[2] == 'member' then + if matches[1] == 'member' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked member ") return unlock_group_membermod(msg, data, target) end - if matches[2] == 'photo' then + if matches[1] == 'photo' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked photo ") return unlock_group_photomod(msg, data, target) end - if matches[2] == 'flood' then + if matches[1] == 'flood' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked flood ") return unlock_group_floodmod(msg, data, target) end - if matches[2] == 'arabic' then + if matches[1] == 'arabic' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked arabic ") return unlock_group_arabic(msg, data, target) end - if matches[2] == 'bots' then + if matches[1] == 'bots' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked bots ") return unlock_group_bots(msg, data, target) end - if matches[2] == 'leave' then + if matches[1] == 'leave' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked leaving ") return unlock_group_leave(msg, data, target) end - if matches[2] == 'links' then + if matches[1] == 'links' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked link posting") return unlock_group_links(msg, data, target) end - if matches[2]:lower() == 'rtl' then + if matches[1]:lower() == 'rtl' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked RTL chars. in names") return unlock_group_rtl(msg, data, target) end - if matches[2] == 'sticker' then + if matches[1] == 'sticker' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked sticker posting") return unlock_group_sticker(msg, data, target) end - if matches[2] == 'contacts' then + if matches[1] == 'contacts' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked contact posting") return unlock_group_contacts(msg, data, target) end @@ -1297,9 +1297,9 @@ end --Begin Chat mutes - if matches[1] == 'mute' and is_owner(msg) then + if matches[2] == 'off' and is_owner(msg) then local chat_id = msg.to.id - if matches[2] == 'audio' then + if matches[1] == 'audio' then local msg_type = 'Audio' if not is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: mute "..msg_type) @@ -1309,7 +1309,7 @@ end return "Group mute "..matches[2].." is already on" end end - if matches[2] == 'photo' then + if matches[1] == 'photo' then local msg_type = 'Photo' if not is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: mute "..msg_type) @@ -1319,7 +1319,7 @@ end return "Group mute "..matches[2].." is already on" end end - if matches[2] == 'video' then + if matches[1] == 'video' then local msg_type = 'Video' if not is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: mute "..msg_type) @@ -1329,7 +1329,7 @@ end return "Group mute "..matches[2].." is already on" end end - if matches[2] == 'gifs' then + if matches[1] == 'gifs' then local msg_type = 'Gifs' if not is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: mute "..msg_type) @@ -1339,7 +1339,7 @@ end return "Group mute "..msg_type.." is already on" end end - if matches[2] == 'documents' then + if matches[1] == 'documents' then local msg_type = 'Documents' if not is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: mute "..msg_type) @@ -1349,7 +1349,7 @@ end return "Group mute "..msg_type.." is already on" end end - if matches[2] == 'text' then + if matches[1] == 'text' then local msg_type = 'Text' if not is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: mute "..msg_type) @@ -1359,7 +1359,7 @@ end return "Group mute text is already on" end end - if matches[2] == 'all' then + if matches[1] == 'all' then local msg_type = 'All' if not is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: mute "..msg_type) @@ -1370,9 +1370,9 @@ end end end end - if matches[1] == 'unmute' and is_owner(msg) then + if matches[2] == 'on' and is_owner(msg) then local chat_id = msg.to.id - if matches[2] == 'audio' then + if matches[1] == 'audio' then local msg_type = 'Audio' if is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: unmute "..msg_type) @@ -1382,7 +1382,7 @@ end return "Group mute "..msg_type.." is already off" end end - if matches[2] == 'photo' then + if matches[1] == 'photo' then local msg_type = 'Photo' if is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: unmute "..msg_type) @@ -1392,7 +1392,7 @@ end return "Group mute "..msg_type.." is already off" end end - if matches[2] == 'Video' then + if matches[1] == 'Video' then local msg_type = 'Video' if is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: unmute "..msg_type) @@ -1402,7 +1402,7 @@ end return "Group mute "..msg_type.." is already off" end end - if matches[2] == 'gifs' then + if matches[1] == 'gifs' then local msg_type = 'Gifs' if is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: unmute "..msg_type) @@ -1412,7 +1412,7 @@ end return "Mute "..msg_type.." is already off" end end - if matches[2] == 'documents' then + if matches[1] == 'documents' then local msg_type = 'Documents' if is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: unmute "..msg_type) @@ -1422,7 +1422,7 @@ end return "Mute "..msg_type.." is already off" end end - if matches[2] == 'text' then + if matches[1] == 'text' then local msg_type = 'Text' if is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: unmute message") @@ -1432,7 +1432,7 @@ end return "Group mute text is already off" end end - if matches[2] == 'all' then + if matches[1] == 'all' then local msg_type = 'All' if is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set group to: unmute "..msg_type) @@ -1445,7 +1445,7 @@ end end --Begin chat muteuser - if matches[1] == "muteuser" and is_momod(msg) then + if matches[1] == "mute" and is_momod(msg) then local chat_id = msg.to.id local hash = "mute_user"..chat_id local user_id = "" @@ -1453,7 +1453,7 @@ end local receiver = get_receiver(msg) local get_cmd = "mute_user" get_message(msg.reply_id, mute_user_callback, {receiver = receiver, get_cmd = get_cmd}) - elseif matches[1] == "muteuser" and string.match(matches[2], '^%d+$') then + elseif matches[1] == "mute" and string.match(matches[2], '^%d+$') then local user_id = matches[2] if is_muted_user(chat_id, user_id) then mute_user(chat_id, user_id) @@ -1462,7 +1462,7 @@ end unmute_user(chat_id, user_id) return "["..user_id.."] added to the muted user list" end - elseif matches[1] == "muteuser" and not string.match(matches[2], '^%d+$') then + elseif matches[1] == "mute" and not string.match(matches[2], '^%d+$') then local receiver = get_receiver(msg) local get_cmd = "mute_user" local username = matches[2] @@ -1472,7 +1472,7 @@ end end --End Chat muteuser - if matches[1] == "muteslist" and is_momod(msg) then + if matches[1] == "mutes" and is_momod(msg) then local chat_id = msg.to.id if not has_mutes(chat_id) then set_mutes(chat_id) @@ -1529,12 +1529,12 @@ if msg.to.type == 'chat' then end local group_link = data[tostring(msg.to.id)]['settings']['set_link'] if not group_link then - return "Create a link using /newlink first !" + return "Create a link using /rlink first !" end savelog(msg.to.id, name_log.." ["..msg.from.id.."] requested group link ["..group_link.."]") return "Group link ["..msg.to.title.."]:\n"..group_link end - if matches[1] == 'setowner' and matches[2] then + if matches[1] == 'setmang' and matches[2] then if not is_owner(msg) then return "For owner only!" end @@ -1544,7 +1544,7 @@ if msg.to.type == 'chat' then local text = matches[2].." added as owner" return text end - if matches[1] == 'setowner' and not matches[2] then + if matches[1] == 'setmang' and not matches[2] then if not is_owner(msg) then return "only for the owner!" end @@ -1553,22 +1553,22 @@ if msg.to.type == 'chat' then end end end - if matches[1] == 'owner' then + if matches[1] == 'mang' then local group_owner = data[tostring(msg.to.id)]['set_owner'] if not group_owner then return "no owner,ask admins in support groups to set owner for your group" end savelog(msg.to.id, name_log.." ["..msg.from.id.."] used /owner") - return "Group owner is ["..group_owner..']' + return "Group manager is ["..group_owner..']' end - if matches[1] == 'setgpowner' then + if matches[1] == 'setgpmang' then local receiver = "chat#id"..matches[2] if not is_admin1(msg) then return "For admins only!" end data[tostring(matches[2])]['set_owner'] = matches[3] save_data(_config.moderation.data, data) - local text = matches[3].." added as owner" + local text = matches[3].." added as manager" send_large_msg(receiver, text) return end @@ -1576,8 +1576,8 @@ end if not is_momod(msg) then return "For moderators only!" end - if tonumber(matches[2]) < 5 or tonumber(matches[2]) > 20 then - return "Wrong number,range is [5-20]" + if tonumber(matches[2]) < 1 or tonumber(matches[2]) > 20 then + return "Wrong number,range is [1-20]" end local flood_max = matches[2] data[tostring(msg.to.id)]['settings']['flood_msg_max'] = flood_max @@ -1587,7 +1587,7 @@ end end if msg.to.type == 'chat' then - if matches[1] == 'clean' then + if matches[1] == 'del' then if not is_owner(msg) then return "Only owner can clean" end @@ -1599,7 +1599,7 @@ if msg.to.type == 'chat' then chat_info(receiver, cleanmember, {receiver=receiver}) end end - if matches[2] == 'modlist' then + if matches[2] == 'mods' then if next(data[tostring(msg.to.id)]['moderators']) == nil then --fix way return 'No moderator in this group.' end @@ -1700,32 +1700,32 @@ return { "^[#!/](about)$", "^[#!/](setname) (.*)$", "^[#!/](setphoto)$", - "^[#!/](promote) (.*)$", - "^[#!/](promote)", + "^[#!/](prom) (.*)$", + "^[#!/](prom)", --"^[#!/](help)$", - "^[#!/](clean) (.*)$", + "^[#!/](del) (.*)$", "^[#!/](kill) (chat)$", "^[#!/](kill) (realm)$", - "^[#!/](demote) (.*)$", - "^[#!/](demote)", + "^[#!/](dem) (.*)$", + "^[#!/](dem)", "^[#!/](set) ([^%s]+) (.*)$", - "^[#!/](lock) (.*)$", - "^[#!/](setowner) (%d+)$", - "^[#!/](setowner)", - "^[#!/](owner)$", + "^[#!/](.*) (off)$", + "^[#!/](setmang) (%d+)$", + "^[#!/](setmang)", + "^[#!/](manager)$", "^[#!/](res) (.*)$", - "^[#!/](setgpowner) (%d+) (%d+)$",-- (group id) (owner id) - "^[#!/](unlock) (.*)$", + "^[#!/](setgpmang) (%d+) (%d+)$",-- (group id) (owner id) + "^[#!/](.*) (on)$", "^[#!/](setflood) (%d+)$", "^[#!/](settings)$", "^[#!/](public) (.*)$", - "^[#!/](modlist)$", - "^[#!/](newlink)$", + "^[#!/](mods)$", + "^[#!/](rlink)$", "^[#!/](link)$", - "^[#!/]([Mm]ute) ([^%s]+)$", - "^[#!/]([Uu]nmute) ([^%s]+)$", - "^[#!/]([Mm]uteuser)$", - "^[#!/]([Mm]uteuser) (.*)$", + "^[#!/]([^%s]+) ([Oo]ff)$", + "^[#!/]([^%s]+) ([Oo]n)$", + "^[#!/]([Mm]ute)$", + "^[#!/]([Mm]ute) (.*)$", "^[#!/]([Mm]uteslist)$", "^[#!/]([Mm]utelist)$", "^[#!/](kickinactive)$", diff --git a/plugins/inrealm.lua b/plugins/inrealm.lua index e7681fc..e5cc337 100644 --- a/plugins/inrealm.lua +++ b/plugins/inrealm.lua @@ -779,64 +779,63 @@ function run(msg, matches) local target = matches[2] return set_rules(msg, data, target) end - if matches[1] == 'close' then + if matches[3] == 'off' then local target = matches[2] - if matches[3] == 'name' then + if matches[1] == 'name' then return lock_group_name(msg, data, target) end - if matches[3] == 'member' then + if matches[1] == 'member' then return lock_group_member(msg, data, target) end - if matches[3] == 'photo' then + if matches[1] == 'photo' then return lock_group_photo(msg, data, target) end - if matches[3] == 'flood' then + if matches[1] == 'flood' then return lock_group_flood(msg, data, target) end - if matches[2] == 'arabic' then + if matches[1] == 'arabic' then return lock_group_arabic(msg, data, target) end - if matches[3] == 'links' then + if matches[1] == 'links' then return lock_group_links(msg, data, target) end - if matches[3] == 'spam' then - + if matches[1] == 'spam' then return lock_group_spam(msg, data, target) end - if matches[3] == 'rtl' then + if matches[1] == 'rtl' then return unlock_group_rtl(msg, data, target) end - if matches[3] == 'sticker' then + if matches[1] == 'sticker' then return lock_group_sticker(msg, data, target) end end - if matches[1] == 'open' then + if matches[3] == 'on' then local target = matches[2] - if matches[3] == 'name' then + if matches[1] == 'name' then return unlock_group_name(msg, data, target) end - if matches[3] == 'member' then + if matches[1] == 'member' then return unlock_group_member(msg, data, target) end - if matches[3] == 'photo' then + if matches[1] == 'photo' then return unlock_group_photo(msg, data, target) end - if matches[3] == 'flood' then + if matches[1] == 'flood' then return unlock_group_flood(msg, data, target) end - if matches[3] == 'arabic' then + if matches[1] == 'arabic' then return unlock_group_arabic(msg, data, target) end - if matches[3] == 'links' then + if matches[1] == 'links' then return unlock_group_links(msg, data, target) end - if matches[3] == 'spam' then + if matches[1] == 'spam' then return unlock_group_spam(msg, data, target) end - if matches[3] == 'rtl' then + if matches[1] == 'rtl' then return unlock_group_rtl(msg, data, target) end - if matches[3] == 'sticker' then + if matches[1] == 'sticker' then return unlock_group_sticker(msg, data, target) end end @@ -1049,10 +1048,10 @@ return { "^[#!/](setname) (.*)$", "^[#!/](setgpname) (%d+) (.*)$", "^[#!/](setname) (%d+) (.*)$", - "^(close) (%d+) (.*)$", - "^(open) (%d+) (.*)$", - "^(close) (%d+)$", - "^(open) (%d+)$", + "^(.*) (%d+) (off)$", + "^(.*) (%d+) (on)$", + "^(off) (%d+)$", + "^(on) (%d+)$", "^(settings) (.*) (%d+)$", "^(wholist)$", "^(who)$", diff --git a/plugins/invite.lua b/plugins/invite.lua index fd8cb6f..7e0d823 100644 --- a/plugins/invite.lua +++ b/plugins/invite.lua @@ -20,9 +20,9 @@ function run(msg, matches) if not is_momod(msg) then return end - if not is_admin1(msg) then -- For admins only ! - return 'Only admins can invite.' - end + --if not is_admin1(msg) then -- For admins only ! + --return 'Only admins can invite.' + --end if not is_realm(msg) then if data[tostring(msg.to.id)]['settings']['lock_member'] == 'yes' and not is_admin1(msg) then return 'Group is private.' @@ -37,7 +37,7 @@ function run(msg, matches) end return { patterns = { - "^invite (.*)$" + "^/inv (.*)$" }, run = run } diff --git a/plugins/getlink.lua b/plugins/linkpv.lua similarity index 99% rename from plugins/getlink.lua rename to plugins/linkpv.lua index dec620e..223069e 100644 --- a/plugins/getlink.lua +++ b/plugins/linkpv.lua @@ -735,7 +735,7 @@ return "For moderators only!" end local group_link = data[tostring(msg.to.id)]['settings']['set_link'] if not group_link then -return "Create a link using [ newlink ] first !" +return "Create a link using [ /rlink ] first !" end savelog(msg.to.id, name_log.." ["..msg.from.id.."] requested group link ["..group_link.."]") send_large_msg('user#id'..msg.from.id, "Group link:\n"..group_link) @@ -839,10 +839,10 @@ end end return { patterns = { -"^(linkpv)$", +"^/(linkpv)$", "%[(photo)%]", "^!!tgservice (.+)$", }, run = run } -end \ No newline at end of file +end diff --git a/plugins/long_msgs.lua b/plugins/long_msgs.lua index e415de1..3df3de7 100644 --- a/plugins/long_msgs.lua +++ b/plugins/long_msgs.lua @@ -2,7 +2,7 @@ do local function run(msg, matches) delete_msg(msg.id, ok_cb, true) - return "DON'T SEND LONG MSGS" + return "DON'T send long msgs" end local function run(msg, matches) if ( tonumber(string.len(matches[1])) > 360 ) then @@ -11,7 +11,7 @@ local function run(msg, matches) return nil else delete_msg(msg.id, ok_cb, true) - return "DON'T SEND LONG MSGS" + return "DON'T send long msgs" end end end @@ -22,4 +22,4 @@ return { }, run = run, } -end \ No newline at end of file +end diff --git a/plugins/me.lua b/plugins/me.lua index ab25a6f..345b598 100644 --- a/plugins/me.lua +++ b/plugins/me.lua @@ -24,9 +24,9 @@ end return { patterns = { - "^([Mm]e)$", - "^([Mm]e)$" + "^/([Mm]e)$", + "^/([Mm]e)$" }, run = run } -end \ No newline at end of file +end diff --git a/plugins/onxerviec.lua b/plugins/onxerviec.lua index 0d2b707..a39c790 100644 --- a/plugins/onxerviec.lua +++ b/plugins/onxerviec.lua @@ -15,7 +15,7 @@ end return { patterns = { - "^(leave)$", + "^/(leave)$", "^!!tgservice (.+)$", }, run = run diff --git a/plugins/renk.lua b/plugins/renk.lua index 6c49e44..c8bee2d 100644 --- a/plugins/renk.lua +++ b/plugins/renk.lua @@ -169,13 +169,13 @@ return { "id members name : Search for users with on first_name, print_name or username on current chat" }, patterns = { - "^id$", - "^ids? (chat) (%d+)$", - "^ids? (chat)$", - "^ids (channel)$", - "^ids (channel) (%d+)$", - "^id (member) (@)(.+)", - "^id (members) (name) (.+)" + "^/id$", + "^/ids? (chat) (%d+)$", + "^/ids? (chat)$", + "^/ids (channel)$", + "^/ids (channel) (%d+)$", + "^/id (member) (@)(.+)", + "^/id (members) (name) (.+)" }, run = run } diff --git a/plugins/replay.lua b/plugins/replay.lua index 2aa8b1d..31ec387 100644 --- a/plugins/replay.lua +++ b/plugins/replay.lua @@ -5,9 +5,9 @@ rs = {} -- some examples of how to use this :3 ws[1] = "هلاو" -- msg -rs[1] = "هلاوو99وووات نورت/ي ❤️🙈" -- reply +rs[1] = "هلاوووات نورت/ي ❤️🙈" -- reply -ws[2] = "@zeoon3" -- msg +ws[2] = "@Mortadha1997" -- msg rs[2] = "هذا الي صنعني فديت ربه 🙈❤️" -- reply ws[3] = "شلونكم" -- msg @@ -62,4 +62,4 @@ return { } -end \ No newline at end of file +end diff --git a/plugins/voice.lua b/plugins/sound.lua similarity index 90% rename from plugins/voice.lua rename to plugins/sound.lua index ea120d2..c63264b 100644 --- a/plugins/voice.lua +++ b/plugins/sound.lua @@ -9,10 +9,10 @@ end return { description = "text to voice", usage = { - "!voice [text]" + "s [text]" }, patterns = { - "^voice (.+)$" + "^/s (.+)$" }, run = run } diff --git a/plugins/stats.lua b/plugins/stats.lua index e422630..c04dbb0 100644 --- a/plugins/stats.lua +++ b/plugins/stats.lua @@ -120,7 +120,7 @@ local function run(msg, matches) return end end - if matches[2] == "teleseed" then -- Put everything you like :) + if matches[2] == "teleseed" then -- Put everything you like if not is_admin1(msg) then return "For admins only !" else @@ -147,4 +147,4 @@ return { }, run = run } -end \ No newline at end of file +end diff --git a/plugins/sticker.lua b/plugins/sticker.lua index c090218..39e509e 100644 --- a/plugins/sticker.lua +++ b/plugins/sticker.lua @@ -29,8 +29,8 @@ end end return { patterns = { - "^(sticker)$", + "^/(sticker)$", "%[(photo)%]", }, run = run, - } \ No newline at end of file + } diff --git a/plugins/super-info.lua b/plugins/super-info.lua index 0438f6e..fc967a9 100644 --- a/plugins/super-info.lua +++ b/plugins/super-info.lua @@ -1,7 +1,3 @@ ---[[ -CHANNEL BOT : @IQ_DEV8 -]] - do local Arian = 159280034 --تضع ايدي بوتك هنا @@ -199,7 +195,7 @@ local function run(msg, matches) text = text..'Group name : '..msg.to.title..'\n' text = text..'Group ID : '..msg.to.id end - text = text..'\n\n#CHANNEL BOT : @IQ_DEV8' + text = text..'\n\n#CHANNEL BOT : @Master_CH' return send_msg(receiver, text, ok_cb, true) end end @@ -239,4 +235,4 @@ end --CHANNEL BOT : @IQ_DEV8 ---by @zeoon3 \ No newline at end of file +--by @zeoon3 diff --git a/plugins/supergroup.lua b/plugins/supergroup.lua index 57e95cf..bb0eb75 100644 --- a/plugins/supergroup.lua +++ b/plugins/supergroup.lua @@ -205,7 +205,7 @@ local function lock_group_spam(msg, data, target) return end if not is_owner(msg) then - return "Owners only!" + return "Manager only!" end local group_spam_lock = data[tostring(target)]['settings']['lock_spam'] if group_spam_lock == 'yes' then @@ -669,7 +669,7 @@ function get_message_callback(extra, success, result) end savelog(msg.to.id, name_log.." ["..msg.from.id.."] set: ["..user_id.."] as admin by reply") send_large_msg(channel_id, text) - elseif get_cmd == "demoteadmin" then + elseif get_cmd == "demadmin" then local user_id = result.from.peer_id local channel_id = "channel#id"..result.to.peer_id if is_admin2(result.from.peer_id) then @@ -683,7 +683,7 @@ function get_message_callback(extra, success, result) end savelog(msg.to.id, name_log.." ["..msg.from.id.."] demoted: ["..user_id.."] from admin by reply") send_large_msg(channel_id, text) - elseif get_cmd == "setowner" then + elseif get_cmd == "setmang" then local group_owner = data[tostring(result.to.peer_id)]['set_owner'] if group_owner then local channel_id = 'channel#id'..result.to.peer_id @@ -699,11 +699,11 @@ function get_message_callback(extra, success, result) if result.from.username then text = "@"..result.from.username.." [ "..result.from.peer_id.." ] added as owner" else - text = "[ "..result.from.peer_id.." ] added as owner" + text = "[ "..result.from.peer_id.." ] added as manager" end send_large_msg(channel_id, text) end - elseif get_cmd == "promote" then + elseif get_cmd == "prom" then local receiver = result.to.peer_id local full_name = (result.from.first_name or '')..' '..(result.from.last_name or '') local member_name = full_name:gsub("‮", "") @@ -717,7 +717,7 @@ function get_message_callback(extra, success, result) promote2("channel#id"..result.to.peer_id, member_username, member_id) --channel_set_mod(channel_id, user, ok_cb, false) end - elseif get_cmd == "demote" then + elseif get_cmd == "dem" then local full_name = (result.from.first_name or '')..' '..(result.from.last_name or '') local member_name = full_name:gsub("‮", "") local member_username = member_name:gsub("_", " ") @@ -775,7 +775,7 @@ local function cb_user_info(extra, success, result) text = "[ "..result.peer_id.." ] has been set as an admin" end send_large_msg(receiver, text)]] - if get_cmd == "demoteadmin" then + if get_cmd == "demadmin" then if is_admin2(result.peer_id) then return send_large_msg(receiver, "You can't demote global admins!") end @@ -788,14 +788,14 @@ local function cb_user_info(extra, success, result) text = "[ "..result.peer_id.." ] has been demoted from admin" send_large_msg(receiver, text) end - elseif get_cmd == "promote" then + elseif get_cmd == "prom" then if result.username then member_username = "@"..result.username else member_username = string.gsub(result.print_name, '_', ' ') end promote2(receiver, member_username, user_id) - elseif get_cmd == "demote" then + elseif get_cmd == "dem" then if result.username then member_username = "@"..result.username else @@ -872,18 +872,18 @@ local function callbackres(extra, success, result) end send_large_msg(receiver, text) end]] - elseif get_cmd == "promote" then + elseif get_cmd == "prom" then local receiver = extra.channel local user_id = result.peer_id --local user = "user#id"..result.peer_id promote2(receiver, member_username, user_id) --channel_set_mod(receiver, user, ok_cb, false) - elseif get_cmd == "demote" then + elseif get_cmd == "dem" then local receiver = extra.channel local user_id = result.peer_id local user = "user#id"..result.peer_id demote2(receiver, member_username, user_id) - elseif get_cmd == "demoteadmin" then + elseif get_cmd == "demadmin" then local user_id = "user#id"..result.peer_id local channel_id = extra.channel if is_admin2(result.peer_id) then @@ -983,7 +983,7 @@ elseif get_cmd == "setadmin" then end send_large_msg(channel_id, text) end - elseif get_cmd == 'setowner' then + elseif get_cmd == 'setmang' then for k,v in pairs(result) do vusername = v.username vpeer_id = tostring(v.peer_id) @@ -1004,7 +1004,7 @@ elseif get_cmd == "setadmin" then if result.username then text = member_username.." ["..v.peer_id.."] added as owner" else - text = "["..v.peer_id.."] added as owner" + text = "["..v.peer_id.."] added as manager" end end elseif memberid and vusername ~= member and vpeer_id ~= memberid then @@ -1019,7 +1019,7 @@ elseif get_cmd == "setadmin" then data[tostring(channel)]['set_owner'] = tostring(memberid) save_data(_config.moderation.data, data) savelog(channel, name_log.."["..from_id.."] set ["..memberid.."] as owner by username") - text = "["..memberid.."] added as owner" + text = "["..memberid.."] added as manager" end end end @@ -1111,7 +1111,7 @@ local function run(msg, matches) admins = channel_get_admins(receiver,callback, {receiver = receiver, msg = msg, member_type = member_type}) end - if matches[1] == "owner" then + if matches[1] == "mang" then local group_owner = data[tostring(msg.to.id)]['set_owner'] if not group_owner then return "no owner,ask admins in support groups to set owner for your SuperGroup" @@ -1120,7 +1120,7 @@ local function run(msg, matches) return "SuperGroup owner is ["..group_owner..']' end - if matches[1] == "modlist" then + if matches[1] == "mods" then savelog(msg.to.id, name_log.." ["..msg.from.id.."] requested group modlist") return modlist(msg) -- channel_get_admins(receiver,callback, {receiver = receiver}) @@ -1138,7 +1138,7 @@ local function run(msg, matches) channel_get_users(receiver, callback_who, {receiver = receiver}) end - if matches[1] == "kicked" and is_momod(msg) then + if matches[1] == "kked" and is_momod(msg) then savelog(msg.to.id, name_log.." ["..msg.from.id.."] requested Kicked users list") channel_get_kicked(receiver, callback_kicked, {receiver = receiver}) end @@ -1219,14 +1219,14 @@ local function run(msg, matches) end end - if matches[1] == 'kickme' then + if matches[1] == 'kkme' then if msg.to.type == 'channel' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] left via kickme") channel_kick("channel#id"..msg.to.id, "user#id"..msg.from.id, ok_cb, false) end end - if matches[1] == 'newlink' and is_momod(msg)then + if matches[1] == 'rlink' and is_momod(msg)then local function callback_link (extra , success, result) local receiver = get_receiver(msg) if success == 0 then @@ -1333,25 +1333,25 @@ local function run(msg, matches) end end - if matches[1] == 'demoteadmin' then + if matches[1] == 'demadmin' then if not is_support(msg.from.id) and not is_owner(msg) then return end if type(msg.reply_id) ~= "nil" then local cbreply_extra = { - get_cmd = 'demoteadmin', + get_cmd = 'demadmin', msg = msg } demoteadmin = get_message(msg.reply_id, get_message_callback, cbreply_extra) - elseif matches[1] == 'demoteadmin' and string.match(matches[2], '^%d+$') then + elseif matches[1] == 'demadmin' and string.match(matches[2], '^%d+$') then local receiver = get_receiver(msg) local user_id = "user#id"..matches[2] - local get_cmd = 'demoteadmin' + local get_cmd = 'demadmin' user_info(user_id, cb_user_info, {receiver = receiver, get_cmd = get_cmd}) - elseif matches[1] == 'demoteadmin' and not string.match(matches[2], '^%d+$') then + elseif matches[1] == 'demadmin' and not string.match(matches[2], '^%d+$') then local cbres_extra = { channel = get_receiver(msg), - get_cmd = 'demoteadmin' + get_cmd = 'demadmin' } local username = matches[2] local username = string.gsub(matches[2], '@', '') @@ -1360,14 +1360,14 @@ local function run(msg, matches) end end - if matches[1] == 'setowner' and is_owner(msg) then + if matches[1] == 'setmang' and is_owner(msg) then if type(msg.reply_id) ~= "nil" then local cbreply_extra = { - get_cmd = 'setowner', + get_cmd = 'setmang', msg = msg } setowner = get_message(msg.reply_id, get_message_callback, cbreply_extra) - elseif matches[1] == 'setowner' and string.match(matches[2], '^%d+$') then + elseif matches[1] == 'setmang' and string.match(matches[2], '^%d+$') then --[[ local group_owner = data[tostring(msg.to.id)]['set_owner'] if group_owner then local receiver = get_receiver(msg) @@ -1383,12 +1383,12 @@ local function run(msg, matches) local text = "[ "..matches[2].." ] added as owner" return text end]] - local get_cmd = 'setowner' + local get_cmd = 'setmang' local msg = msg local user_id = matches[2] channel_get_users (receiver, in_channel_cb, {get_cmd=get_cmd, receiver=receiver, msg=msg, user_id=user_id}) - elseif matches[1] == 'setowner' and not string.match(matches[2], '^%d+$') then - local get_cmd = 'setowner' + elseif matches[1] == 'setmang' and not string.match(matches[2], '^%d+$') then + local get_cmd = 'setmang' local msg = msg local username = matches[2] local username = string.gsub(matches[2], '@', '') @@ -1396,29 +1396,29 @@ local function run(msg, matches) end end - if matches[1] == 'promote' then + if matches[1] == 'prom' then if not is_momod(msg) then return end if not is_owner(msg) then - return "Only owner/admin can promote" + return "Only manager/admin can promote" end if type(msg.reply_id) ~= "nil" then local cbreply_extra = { - get_cmd = 'promote', + get_cmd = 'prom', msg = msg } promote = get_message(msg.reply_id, get_message_callback, cbreply_extra) - elseif matches[1] == 'promote' and string.match(matches[2], '^%d+$') then + elseif matches[1] == 'prom' and string.match(matches[2], '^%d+$') then local receiver = get_receiver(msg) local user_id = "user#id"..matches[2] - local get_cmd = 'promote' + local get_cmd = 'prom' savelog(msg.to.id, name_log.." ["..msg.from.id.."] promoted user#id"..matches[2]) user_info(user_id, cb_user_info, {receiver = receiver, get_cmd = get_cmd}) - elseif matches[1] == 'promote' and not string.match(matches[2], '^%d+$') then + elseif matches[1] == 'prom' and not string.match(matches[2], '^%d+$') then local cbres_extra = { channel = get_receiver(msg), - get_cmd = 'promote', + get_cmd = 'prom', } local username = matches[2] local username = string.gsub(matches[2], '@', '') @@ -1440,29 +1440,29 @@ local function run(msg, matches) return "ok" end - if matches[1] == 'demote' then + if matches[1] == 'dem' then if not is_momod(msg) then return end if not is_owner(msg) then - return "Only owner/support/admin can promote" + return "Only manager/support/admin can promote" end if type(msg.reply_id) ~= "nil" then local cbreply_extra = { - get_cmd = 'demote', + get_cmd = 'dem', msg = msg } demote = get_message(msg.reply_id, get_message_callback, cbreply_extra) - elseif matches[1] == 'demote' and string.match(matches[2], '^%d+$') then + elseif matches[1] == 'dem' and string.match(matches[2], '^%d+$') then local receiver = get_receiver(msg) local user_id = "user#id"..matches[2] - local get_cmd = 'demote' + local get_cmd = 'dem' savelog(msg.to.id, name_log.." ["..msg.from.id.."] demoted user#id"..matches[2]) user_info(user_id, cb_user_info, {receiver = receiver, get_cmd = get_cmd}) elseif not string.match(matches[2], '^%d+$') then local cbres_extra = { channel = get_receiver(msg), - get_cmd = 'demote' + get_cmd = 'dem' } local username = matches[2] local username = string.gsub(matches[2], '@', '') @@ -1496,7 +1496,7 @@ local function run(msg, matches) return "Description has been set.\n\nSelect the chat again to see the changes." end - if matches[1] == "setusername" and is_admin1(msg) then + if matches[1] == "setuser" and is_admin1(msg) then local function ok_username_cb (extra, success, result) local receiver = extra.receiver if success == 1 then @@ -1530,14 +1530,14 @@ local function run(msg, matches) return 'Please send the new group photo now' end - if matches[1] == 'clean' then + if matches[1] == 'del' then if not is_momod(msg) then return end if not is_momod(msg) then return "Only owner can clean" end - if matches[2] == 'modlist' then + if matches[2] == 'mods' then if next(data[tostring(msg.to.id)]['moderators']) == nil then return 'No moderator(s) in this SuperGroup 🔅' end @@ -1571,13 +1571,13 @@ local function run(msg, matches) channel_set_about(receiver, about_text, ok_cb, false) return "About has been cleaned" end - if matches[2] == 'silent' then + if matches[2] == 'mute' then chat_id = msg.to.id local hash = 'mute_user:'..chat_id redis:del(hash) return "Mutelist Cleaned" end - if matches[2] == 'username' and is_admin1(msg) then + if matches[2] == 'user' and is_admin1(msg) then local function ok_username_cb (extra, success, result) local receiver = extra.receiver if success == 1 then @@ -1591,81 +1591,81 @@ local function run(msg, matches) end end - if matches[1] == 'close' and is_momod(msg) then + if matches[2] == 'off' and is_momod(msg) then local target = msg.to.id - if matches[2] == 'links' then + if matches[1] == 'links' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked link posting ") return lock_group_links(msg, data, target) end - if matches[2] == 'spam' then + if matches[1] == 'spam' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked spam ") return lock_group_spam(msg, data, target) end - if matches[2] == 'flood' then + if matches[1] == 'flood' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked flood ") return lock_group_flood(msg, data, target) end - if matches[2] == 'arabic' then + if matches[1] == 'arabic' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked arabic ") return lock_group_arabic(msg, data, target) end - if matches[2] == 'member' then + if matches[1] == 'member' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked member ") return lock_group_membermod(msg, data, target) end - if matches[2]:lower() == 'rtl' then + if matches[1]:lower() == 'rtl' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked rtl chars. in names") return lock_group_rtl(msg, data, target) end - if matches[2] == 'sticker' then + if matches[1] == 'sticker' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked sticker posting") return lock_group_sticker(msg, data, target) end - if matches[2] == 'contacts' then + if matches[1] == 'contacts' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked contact posting") return lock_group_contacts(msg, data, target) end - if matches[2] == 'strict' then + if matches[1] == 'strict' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked enabled strict settings") return enable_strict_rules(msg, data, target) end end - if matches[1] == 'open' and is_momod(msg) then + if matches[2] == 'on' and is_momod(msg) then local target = msg.to.id - if matches[2] == 'links' then + if matches[1] == 'links' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked link posting") return unlock_group_links(msg, data, target) end - if matches[2] == 'spam' then + if matches[1] == 'spam' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked spam") return unlock_group_spam(msg, data, target) end - if matches[2] == 'flood' then + if matches[1] == 'flood' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked flood") return unlock_group_flood(msg, data, target) end - if matches[2] == 'arabic' then + if matches[1] == 'arabic' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked Arabic") return unlock_group_arabic(msg, data, target) end - if matches[2] == 'member' then + if matches[1] == 'member' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked member ") return unlock_group_membermod(msg, data, target) end - if matches[2]:lower() == 'rtl' then + if matches[1]:lower() == 'rtl' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked RTL chars. in names") return unlock_group_rtl(msg, data, target) end - if matches[2] == 'sticker' then + if matches[1] == 'sticker' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked sticker posting") return unlock_group_sticker(msg, data, target) end - if matches[2] == 'contacts' then + if matches[1] == 'contacts' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] unlocked contact posting") return unlock_group_contacts(msg, data, target) end - if matches[2] == 'strict' then + if matches[1] == 'strict' then savelog(msg.to.id, name_log.." ["..msg.from.id.."] locked disabled strict settings") return disable_strict_rules(msg, data, target) end @@ -1675,8 +1675,8 @@ local function run(msg, matches) if not is_momod(msg) then return end - if tonumber(matches[2]) < 5 or tonumber(matches[2]) > 20 then - return "Wrong number,range is [5-20]" + if tonumber(matches[2]) < 1 or tonumber(matches[2]) > 20 then + return "Wrong number,range is [1-20]" end local flood_max = matches[2] data[tostring(msg.to.id)]['settings']['flood_msg_max'] = flood_max @@ -1696,9 +1696,9 @@ local function run(msg, matches) end end - if matches[1] == 'close' and is_owner(msg) then + if matches[2] == 'off' and is_owner(msg) then local chat_id = msg.to.id - if matches[2] == 'audio' then + if matches[1] == 'audio' then local msg_type = 'Audio' if not is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set SuperGroup to: mute "..msg_type) @@ -1708,7 +1708,7 @@ local function run(msg, matches) return "SuperGroup mute "..msg_type.." is already on" end end - if matches[2] == 'photo' then + if matches[1] == 'photo' then local msg_type = 'Photo' if not is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set SuperGroup to: mute "..msg_type) @@ -1718,7 +1718,7 @@ local function run(msg, matches) return "SuperGroup mute "..msg_type.." is already on" end end - if matches[2] == 'video' then + if matches[1] == 'video' then local msg_type = 'Video' if not is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set SuperGroup to: mute "..msg_type) @@ -1728,7 +1728,7 @@ local function run(msg, matches) return "SuperGroup mute "..msg_type.." is already on" end end - if matches[2] == 'gifs' then + if matches[1] == 'gifs' then local msg_type = 'Gifs' if not is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set SuperGroup to: mute "..msg_type) @@ -1738,7 +1738,7 @@ local function run(msg, matches) return "SuperGroup mute "..msg_type.." is already on" end end - if matches[2] == 'documents' then + if matches[1] == 'documents' then local msg_type = 'Documents' if not is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set SuperGroup to: mute "..msg_type) @@ -1748,7 +1748,7 @@ local function run(msg, matches) return "SuperGroup mute "..msg_type.." is already on" end end - if matches[2] == 'text' then + if matches[1] == 'text' then local msg_type = 'Text' if not is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set SuperGroup to: mute "..msg_type) @@ -1758,7 +1758,7 @@ local function run(msg, matches) return "Mute "..msg_type.." is already on" end end - if matches[2] == 'all' then + if matches[1] == 'all' then local msg_type = 'All' if not is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set SuperGroup to: mute "..msg_type) @@ -1769,9 +1769,9 @@ local function run(msg, matches) end end end - if matches[1] == 'open' and is_momod(msg) then + if matches[2] == 'on' and is_momod(msg) then local chat_id = msg.to.id - if matches[2] == 'audio' then + if matches[1] == 'audio' then local msg_type = 'Audio' if is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set SuperGroup to: unmute "..msg_type) @@ -1781,7 +1781,7 @@ local function run(msg, matches) return "Mute "..msg_type.." is already off" end end - if matches[2] == 'photo' then + if matches[1] == 'photo' then local msg_type = 'Photo' if is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set SuperGroup to: unmute "..msg_type) @@ -1791,7 +1791,7 @@ local function run(msg, matches) return "Mute "..msg_type.." is already off" end end - if matches[2] == 'video' then + if matches[1] == 'video' then local msg_type = 'Video' if is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set SuperGroup to: unmute "..msg_type) @@ -1801,7 +1801,7 @@ local function run(msg, matches) return "Mute "..msg_type.." is already off" end end - if matches[2] == 'gifs' then + if matches[1] == 'gifs' then local msg_type = 'Gifs' if is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set SuperGroup to: unmute "..msg_type) @@ -1811,7 +1811,7 @@ local function run(msg, matches) return "Mute "..msg_type.." is already off" end end - if matches[2] == 'documents' then + if matches[1] == 'documents' then local msg_type = 'Documents' if is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set SuperGroup to: unmute "..msg_type) @@ -1821,7 +1821,7 @@ local function run(msg, matches) return "Mute "..msg_type.." is already off" end end - if matches[2] == 'text' then + if matches[1] == 'text' then local msg_type = 'Text' if is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set SuperGroup to: unmute message") @@ -1831,7 +1831,7 @@ local function run(msg, matches) return "Mute text is already off" end end - if matches[2] == 'all' then + if matches[1] == 'all' then local msg_type = 'All' if is_muted(chat_id, msg_type..': yes') then savelog(msg.to.id, name_log.." ["..msg.from.id.."] set SuperGroup to: unmute "..msg_type) @@ -1844,7 +1844,7 @@ local function run(msg, matches) end - if matches[1] == "silent" and is_momod(msg) then + if matches[1] == "mute" and is_momod(msg) then local chat_id = msg.to.id local hash = "mute_user"..chat_id local user_id = "" @@ -1852,7 +1852,7 @@ local function run(msg, matches) local receiver = get_receiver(msg) local get_cmd = "mute_user" muteuser = get_message(msg.reply_id, get_message_callback, {receiver = receiver, get_cmd = get_cmd, msg = msg}) - elseif matches[1] == "silent" and string.match(matches[2], '^%d+$') then + elseif matches[1] == "mute" and string.match(matches[2], '^%d+$') then local user_id = matches[2] if is_muted_user(chat_id, user_id) then unmute_user(chat_id, user_id) @@ -1863,7 +1863,7 @@ local function run(msg, matches) savelog(msg.to.id, name_log.." ["..msg.from.id.."] added ["..user_id.."] to the muted users list") return "["..user_id.."] added to the muted user list" end - elseif matches[1] == "silent" and not string.match(matches[2], '^%d+$') then + elseif matches[1] == "mute" and not string.match(matches[2], '^%d+$') then local receiver = get_receiver(msg) local get_cmd = "mute_user" local username = matches[2] @@ -1872,7 +1872,7 @@ local function run(msg, matches) end end - if matches[1] == "s group" and is_momod(msg) then + if matches[1] == "mutes" and is_momod(msg) then local chat_id = msg.to.id if not has_mutes(chat_id) then set_mutes(chat_id) @@ -1881,7 +1881,7 @@ local function run(msg, matches) savelog(msg.to.id, name_log.." ["..msg.from.id.."] requested SuperGroup muteslist") return mutes_list(chat_id) end - if matches[1] == "s group" and is_momod(msg) then + if matches[1] == "mutes" and is_momod(msg) then local chat_id = msg.to.id savelog(msg.to.id, name_log.." ["..msg.from.id.."] requested SuperGroup mutelist") return muted_user_list(chat_id) @@ -1966,59 +1966,59 @@ end return { patterns = { - "^([Aa]dd)$", - "^([Rr]em)$", - "^([Mm]ove) (.*)$", - "^(group info)$", - "^([Aa]dmins)$", - "^([Oo]wner)$", - "^([Mm]odlist)$", - "^([Bb]ots)$", - "^([Ww]ho)$", - "^([Kk]icked)$", - "^([Bb]lock) (.*)", - "^([Bb]lock)", - "^([Tt]osuper)$", + "^/([Aa]dd)$", + "^/([Rr]em)$", + "^/([Mm]ove) (.*)$", + "^/(group info)$", + "^/([Aa]dmins)$", + "^/([Mm]ang)$", + "^/([Mm]ods)$", + "^/([Bb]ots)$", + "^/([Ww]ho)$", + "^/([Kk]ked)$", + "^/([Bb]lock) (.*)", + "^/([Bb]lock)", + "^/([Tt]osuper)$", --"^([Ii][Dd])$", --"^([Ii][Dd]) (.*)$", - "^([Kk]ickme)$", - "^([Kk]ick) (.*)$", - "^([Nn]ewlink)$", - "^([Ss]etlink)$", - "^([Ll]ink)$", - "^([Rr]es) (.*)$", - "^([Ss]etadmin) (.*)$", - "^([Ss]etadmin)", - "^([Dd]emoteadmin) (.*)$", - "^([Dd]emoteadmin)", - "^([Ss]etowner) (.*)$", - "^([Ss]etowner)$", - "^([Pp]romote) (.*)$", - "^([Pp]romote)", - "^([Dd]emote) (.*)$", - "^([Dd]emote)", - "^([Ss]etname) (.*)$", - "^([Ss]etabout) (.*)$", - "^([Ss]etrules) (.*)$", - "^([Ss]etphoto)$", - "^([Ss]etusername) (.*)$", - "^([Dd]el)$", - "^(close) (.*)$", - "^(open) (.*)$", - "^(close) ([^%s]+)$", - "^(open) ([^%s]+)$", - "^(silent)$", - "^(silent) (.*)$", - "^([Pp]ublic) (.*)$", - "^([Ss]ettings)$", - "^([Rr]ules)$", - "^([Ss]etflood) (%d+)$", - "^([Cc]lean) (.*)$", - "^([Hh])$", - "^(s group)$", - "^([Mm]utelist)$", - "(mp) (.*)", - "(md) (.*)", + "^/([Kk]kme)$", + "^/([Kk]k) (.*)$", + "^/([Rr]link)$", + "^/([Ss]etlink)$", + "^/([Ll]ink)$", + "^/([Rr]es) (.*)$", + "^/([Ss]etadmin) (.*)$", + "^/([Ss]etadmin)", + "^/([Dd]emadmin) (.*)$", + "^/([Dd]emadmin)", + "^/([Ss]etmang) (.*)$", + "^/([Ss]etmang)$", + "^/([Pp]rom) (.*)$", + "^/([Pp]rom)", + "^/([Dd]em) (.*)$", + "^/([Dd]em)", + "^/([Ss]etname) (.*)$", + "^/([Ss]etabout) (.*)$", + "^/([Ss]etrules) (.*)$", + "^/([Ss]etphoto)$", + "^/([Ss]etuser) (.*)$", + "^!([Dd]el)$", + "^/(.*) (on)$", + "^/(.*) (off)$", + "^/([^%s]+) (on)$", + "^/([^%s]+) (off)$", + "^/([Mm]ute)$", + "^/([Mm]ute) (.*)$", + "^/([Pp]ublic) (.*)$", + "^/([Ss]ettings)$", + "^/([Rr]ules)$", + "^/([Ss]etflood) (%d+)$", + "^/([Cc]lean) (.*)$", + "^/([Hh])$", + "^/([Mm]utes)$", + "^/([Mm]utelist)$", + "/(mp) (.*)", + "/(md) (.*)", "^(https://telegram.me/joinchat/%S+)$", "msg.to.peer_id", "%[(document)%]", @@ -2031,5 +2031,4 @@ return { run = run, pre_process = pre_process } ---End supergrpup.lua ---By @Rondoozle + diff --git a/plugins/text2photo.lua b/plugins/text2photo.lua new file mode 100644 index 0000000..271fca7 --- /dev/null +++ b/plugins/text2photo.lua @@ -0,0 +1,31 @@ +do + +local function send_title(cb_extra, success, result) + if success then + send_msg(cb_extra[1], cb_extra[2], ok_cb, false) + end +end + +local function run(msg, matches) + local eq = URL.escape(matches[1]) + + local url = "http://latex.codecogs.com/png.download?" + .."\\dpi{300}%20\\LARGE%20"..eq + + local receiver = get_receiver(msg) + local title = "Edit LaTeX on www.codecogs.com/eqnedit.php?latex="..eq + send_photo_from_url(receiver, url, send_title, {receiver, title}) +end + +return { + description = "Convert LaTeX equation to image", + usage = { + "ph [equation]: Convert LaTeX equation to image" + }, + patterns = { + "^/ph (.+)$" + }, + run = run +} + +end diff --git a/plugins/textphoto.lua b/plugins/textphoto.lua deleted file mode 100644 index 546b568..0000000 --- a/plugins/textphoto.lua +++ /dev/null @@ -1,42 +0,0 @@ ---[[ -▀▄ ▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀ -▀▄ ▄▀ ▀▄ ▄▀ -▀▄ ▄▀ BY @hunter18k; ▀▄ ▄▀ -▀▄ ▄▀ BY wawi8 (@wawi8) ▀▄ ▄▀ -▀▄ ▄▀JUST WRITED BY wawi&hunter18k ▀▄ ▄▀ -▀▄ ▄▀ ▀▄ ▄▀ -▀▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀ ---]] - - -do - -local function send_title(cb_extra, success, result) - if success then - send_msg(cb_extra[1], cb_extra[2], ok_cb, false) - end -end - -local function run(msg, matches) - local eq = URL.escape(matches[1]) - - local url = "http://latex.codecogs.com/png.download?" - .."\\dpi{300}%20\\LARGE%20"..eq - - local receiver = get_receiver(msg) - local title = "Edit LaTeX on www.codecogs.com/eqnedit.php?latex="..eq - send_photo_from_url(receiver, url, send_title, {receiver, title}) -end - -return { - description = "Convert LaTeX equation to image", - usage = { - "text [equation]: Convert LaTeX equation to image" - }, - patterns = { - "^[Tt]ext (.+)$" - }, - run = run -} - -end \ No newline at end of file diff --git a/plugins/taks.lua b/plugins/weather.lua similarity index 98% rename from plugins/taks.lua rename to plugins/weather.lua index 8d92db8..8eba67c 100644 --- a/plugins/taks.lua +++ b/plugins/weather.lua @@ -50,7 +50,7 @@ return { description = "weather in that city (Madrid is default)", usage = "weather (city)", patterns = { - "^weather$", + "^/weather$", "weather (.*)$" }, run = run diff --git a/plugins/welcome.lua b/plugins/welcome.lua index d088e35..436fe7e 100644 --- a/plugins/welcome.lua +++ b/plugins/welcome.lua @@ -1,6 +1,3 @@ --- Dev by @Omar_Real - - local add_user_cfg = load_from_file('data/add_user_cfg.lua') local function template_add_user(base, to_username, from_username, chat_name, chat_id) @@ -61,13 +58,13 @@ local function description_rules(msg, nama) rules = data[tostring(msg.to.id)]["rules"] rules = "\nRules :\n"..rules.."\n" end - local sambutan = "HI🍷🌝 "..nama.."\nWelcome to '"..string.gsub(msg.to.print_name, "_", " ").."'\nYou can use help for see bot commands\n" - local text = sambutan.."and You can see rules 🙏🏿 " + local sambutan = "Hello🍷🌝 "..nama.."\nWelcome to {"..string.gsub(msg.to.print_name, "_", " ").."}\nYOU CAN USE /help FOR SEE BOT COMMANDS\n" + local text = sambutan.."AND YOU CAN SEE /rules 🙏🏿 " local text = text.."" local text = text.." " - local text = text.."Out of the group kickme ☹️" + local text = text.."OUT OF THE GROUP /kickme ☹️" local text = text.."\n" - local text = text.."CHANNEL BOT : @IQ_DEV8" + local text = text.."CHANNEL BOT : @Master_CH" local receiver = get_receiver(msg) send_large_msg(receiver, text, ok_cb, false) end @@ -96,7 +93,7 @@ local function run(msg, matches) description_rules(msg, nama) elseif matches[1] == "chat_del_user" then local bye_name = msg.action.user.first_name - return 'Good Bye My Friend '..bye_name + return 'GOOD BYE '.."@"..msg.action.user.username end end @@ -111,4 +108,3 @@ return { run = run } --- Dev by @Omar_Real \ No newline at end of file diff --git "a/plugins/\331\205\331\207\331\205.lua" "b/plugins/\331\205\331\207\331\205.lua" deleted file mode 100644 index c75fe64..0000000 --- "a/plugins/\331\205\331\207\331\205.lua" +++ /dev/null @@ -1,56 +0,0 @@ -do local _ = { - about_text = "Teleseed v4\nAn advanced administration bot based on TG-CLI written in Lua\n\nhttps://github.com/SEEDTEAM/TeleSeed\n\nAdmins\n@iwals [Founder]\n@imandaneshi [Developer]\n@POTUS [Developer]\n@seyedan25 [Manager]\n@aRandomStranger [Admin]\n\nSpecial thanks to\nawkward_potato\nSiyanew\ntopkecleon\nVamptacus\n\nOur channels\n@teleseedch [English]\n@iranseed [persian]\n\nOur website \nhttp://teleseed.seedteam.org/\n", - enabled_plugins = { - "admin", - "inrealm", - "ingroup", - "inpm", - "stats", - "owners", - "set", - "get", - "broadcast", - "invite", - "all", - "leave_ban", - "supergroup", - "msg_checks", - "plugins", - "help2", - "helpme", - "help", - "textphoto", - "taks", - "voice", - "welcome", - "onxerviec", - "me", - "insta", - "Feedback", - "commands", - "addsudo", - "Version", - "arbic_lock", - "anti-spam", - "replay", - "banhammer", - "sticker", - "block", - "super-info", - "getlink", - "renk", - "id2", - "image" - }, - help_text = "Commands list :\n\n!kick [username|id]\nYou can also do it by reply\n\n!ban [ username|id]\nYou can also do it by reply\n\n!unban [id]\nYou can also do it by reply\n\n!who\nMembers list\n\n!modlist\nModerators list\n\n!promote [username]\nPromote someone\n\n!demote [username]\nDemote someone\n\n!kickme\nWill kick user\n\n!about\nGroup description\n\n!setphoto\nSet and locks group photo\n\n!setname [name]\nSet group name\n\n!rules\nGroup rules\n\n!id\nreturn group id or user id\n\n!help\nReturns help text\n\n!lock [links|flood|spam|Arabic|member|rtl|sticker|contacts|strict]\nLock group settings\n*rtl: Kick user if Right To Left Char. is in name*\n\n!unlock [links|flood|spam|Arabic|member|rtl|sticker|contacts|strict]\nUnlock group settings\n*rtl: Kick user if Right To Left Char. is in name*\n\n!mute [all|audio|gifs|photo|video]\nmute group message types\n*If \"muted\" message type: user is kicked if message type is posted \n\n!unmute [all|audio|gifs|photo|video]\nUnmute group message types\n*If \"unmuted\" message type: user is not kicked if message type is posted \n\n!set rules \nSet as rules\n\n!set about \nSet as about\n\n!settings\nReturns group settings\n\n!muteslist\nReturns mutes for chat\n\n!muteuser [username]\nMute a user in chat\n*user is kicked if they talk\n*only owners can mute | mods and owners can unmute\n\n!mutelist\nReturns list of muted users in chat\n\n!newlink\ncreate/revoke your group link\n\n!link\nreturns group link\n\n!owner\nreturns group owner id\n\n!setowner [id]\nWill set id as owner\n\n!setflood [value]\nSet [value] as flood sensitivity\n\n!stats\nSimple message statistics\n\n!save [value] \nSave as [value]\n\n!get [value]\nReturns text of [value]\n\n!clean [modlist|rules|about]\nWill clear [modlist|rules|about] and set it to nil\n\n!res [username]\nreturns user id\n\"!res @username\"\n\n!log\nReturns group logs\n\n!banlist\nwill return group ban list\n\n**You can use \"#\", \"!\", or \"/\" to begin all commands\n\n\n*Only owner and mods can add bots in group\n\n\n*Only moderators and owner can use kick,ban,unban,newlink,link,setphoto,setname,lock,unlock,set rules,set about and settings commands\n\n*Only owner can use res,setowner,promote,demote and log commands\n\n", - help_text_realm = "Realm Commands:\n\n!creategroup [Name]\nCreate a group\n\n!createrealm [Name]\nCreate a realm\n\n!setname [Name]\nSet realm name\n\n!setabout [group|sgroup] [GroupID] [Text]\nSet a group's about text\n\n!setrules [GroupID] [Text]\nSet a group's rules\n\n!lock [GroupID] [setting]\nLock a group's setting\n\n!unlock [GroupID] [setting]\nUnock a group's setting\n\n!settings [group|sgroup] [GroupID]\nSet settings for GroupID\n\n!wholist\nGet a list of members in group/realm\n\n!who\nGet a file of members in group/realm\n\n!type\nGet group type\n\n!kill chat [GroupID]\nKick all memebers and delete group\n\n!kill realm [RealmID]\nKick all members and delete realm\n\n!addadmin [id|username]\nPromote an admin by id OR username *Sudo only\n\n!removeadmin [id|username]\nDemote an admin by id OR username *Sudo only\n\n!list groups\nGet a list of all groups\n\n!list realms\nGet a list of all realms\n\n!support\nPromote user to support\n\n!-support\nDemote user from support\n\n!log\nGet a logfile of current group or realm\n\n!broadcast [text]\n!broadcast Hello !\nSend text to all groups\nOnly sudo users can run this command\n\n!bc [group_id] [text]\n!bc 123456789 Hello !\nThis command will send text to [group_id]\n\n\n**You can use \"#\", \"!\", or \"/\" to begin all commands\n\n\n*Only admins and sudo can add bots in group\n\n\n*Only admins and sudo can use kick,ban,unban,newlink,setphoto,setname,lock,unlock,set rules,set about and settings commands\n\n*Only admins and sudo can use res, setowner, commands\n", - help_text_super = "SuperGroup Commands:\n\n!info\nDisplays general info about the SuperGroup\n\n!admins\nReturns SuperGroup admins list\n\n!owner\nReturns group owner\n\n!modlist\nReturns Moderators list\n\n!bots\nLists bots in SuperGroup\n\n!who\nLists all users in SuperGroup\n\n!block\nKicks a user from SuperGroup\n*Adds user to blocked list*\n\n!ban\nBans user from the SuperGroup\n\n!unban\nUnbans user from the SuperGroup\n\n!id\nReturn SuperGroup ID or user id\n*For userID's: !id @username or reply !id*\n\n!id from\nGet ID of user message is forwarded from\n\n!kickme\nKicks user from SuperGroup\n*Must be unblocked by owner or use join by pm to return*\n\n!setowner\nSets the SuperGroup owner\n\n!promote [username|id]\nPromote a SuperGroup moderator\n\n!demote [username|id]\nDemote a SuperGroup moderator\n\n!setname\nSets the chat name\n\n!setphoto\nSets the chat photo\n\n!setrules\nSets the chat rules\n\n!setabout\nSets the about section in chat info(members list)\n\n!save [value] \nSets extra info for chat\n\n!get [value]\nRetrieves extra info for chat by value\n\n!newlink\nGenerates a new group link\n\n!link\nRetireives the group link\n\n!rules\nRetrieves the chat rules\n\n!lock [links|flood|spam|Arabic|member|rtl|sticker|contacts|strict]\nLock group settings\n*rtl: Delete msg if Right To Left Char. is in name*\n*strict: enable strict settings enforcement (violating user will be kicked)*\n\n!unlock [links|flood|spam|Arabic|member|rtl|sticker|contacts|strict]\nUnlock group settings\n*rtl: Delete msg if Right To Left Char. is in name*\n*strict: disable strict settings enforcement (violating user will not be kicked)*\n\n!mute [all|audio|gifs|photo|video|service]\nmute group message types\n*A \"muted\" message type is auto-deleted if posted\n\n!unmute [all|audio|gifs|photo|video|service]\nUnmute group message types\n*A \"unmuted\" message type is not auto-deleted if posted\n\n!setflood [value]\nSet [value] as flood sensitivity\n\n!settings\nReturns chat settings\n\n!muteslist\nReturns mutes for chat\n\n!muteuser [username]\nMute a user in chat\n*If a muted user posts a message, the message is deleted automaically\n*only owners can mute | mods and owners can unmute\n\n!mutelist\nReturns list of muted users in chat\n\n!banlist\nReturns SuperGroup ban list\n\n!clean [rules|about|modlist|mutelist]\n\n!del\nDeletes a message by reply\n\n!public [yes|no]\nSet chat visibility in pm !chats or !chatlist commands\n\n!res [username]\nReturns users name and id by username\n\n\n!log\nReturns group logs\n*Search for kick reasons using [#RTL|#spam|#lockmember]\n\n**You can use \"#\", \"!\", or \"/\" to begin all commands\n\n*Only owner can add members to SuperGroup\n(use invite link to invite)\n\n*Only moderators and owner can use block, ban, unban, newlink, link, setphoto, setname, lock, unlock, setrules, setabout and settings commands\n\n*Only owner can use res, setowner, promote, demote, and log commands\n\n", - moderation = { - data = "data/moderation.json" - }, - sudo_users = { - 127876523 - } -} -return _ -end \ No newline at end of file diff --git a/steady.sh b/steady.sh new file mode 100644 index 0000000..c2c5910 --- /dev/null +++ b/steady.sh @@ -0,0 +1,575 @@ +#!/bin/bash +# ===================================================================================================== +# Copyright (C) steady.sh v1.2 2016 iicc (@iicc1) +# ===================================================================================================== +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +# this program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# You should have received a copy of the GNU General Public License along with this program. If not, see . +# ======================================================================================================= +# It depends on Tmux https://github.com/tmux/tmux which is BSD-licensed +# and Screen https://www.gnu.org/software/screen GNU-licensed. +# ======================================================================================================= +# This script is intended to control the state of a telegram-cli telegram bot running in background. +# The idea is to get the bot fully operative all the time without any supervision by the user. +# It should be able to recover the telegram bot in any case telegram-cli crashes, freezes or whatever. +# This script works by tracing ctxt swithes value in kernel procces at a $RELOADTIME +# So it can detect any kind of kernel interruption with the procces and reload the bot. +# +#-------------------------------------------------- +#-- ____ ____ _____ -- +#-- | \| _ )_ _|___ ____ __ __ -- +#-- | |_ ) _ \ | |/ ·__| _ \_| \/ | -- +#-- |____/|____/ |_|\____/\_____|_/\/\_| -- +#-- -- +#-------------------------------------------------- +#-- -- +#-- Developers: @Josepdal & @MaSkAoS -- +#-- Support: @Skneos, @iicc1 & @serx666 -- +#-- -- +#-------------------------------------------------- + + +# Some script variables +OK=0 +BAD=0 +NONVOLUNTARY=1 +NONVOLUNTARYCHECK=0 +VOLUNTARY=1 +VOLUNTARYCHECK=0 +I=1 +BOT=Master # You can put here other bots. Also you can change it to run more than one bot in the same server. +RELOADTIME=10 # Time between checking cpu calls of the cli process. Set the value high if your bot does not receive lots of messages. + + +function tmux_mode { + +sleep 0.5 +clear +# Space invaders thanks to github.com/windelicato +f=3 b=4 +for j in f b; do + for i in {0..7}; do + printf -v $j$i %b "\e[${!j}${i}m" + done +done +bld=$'\e[1m' +rst=$'\e[0m' + +cat << EOF + + $f1 ▀▄ ▄▀ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4 ▀▄ ▄▀ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst + $f1 ▄█▀███▀█▄ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4 ▄█▀███▀█▄ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst + $f1█▀███████▀█ $f2▀▀███▀▀███▀▀ $f3▀█▀██▀█▀ $f4█▀███████▀█ $f5▀▀███▀▀███▀▀ $f6▀█▀██▀█▀$rst + $f1▀ ▀▄▄ ▄▄▀ ▀ $f2 ▀█▄ ▀▀ ▄█▀ $f3▀▄ ▄▀ $f4▀ ▀▄▄ ▄▄▀ ▀ $f5 ▀█▄ ▀▀ ▄█▀ $f6▀▄ ▄▀$rst + +EOF +echo -e " \e[100m Steady script \e[00;37;40m" +echo -e " \e[01;34m by iicc \e[00;37;40m" +echo "" +cat << EOF + $bld$f1▄ ▀▄ ▄▀ ▄ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4▄ ▀▄ ▄▀ ▄ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst + $bld$f1█▄█▀███▀█▄█ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4█▄█▀███▀█▄█ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst + $bld$f1▀█████████▀ $f2▀▀▀██▀▀██▀▀▀ $f3▀▀█▀▀█▀▀ $f4▀█████████▀ $f5▀▀▀██▀▀██▀▀▀ $f6▀▀█▀▀█▀▀$rst + $bld$f1 ▄▀ ▀▄ $f2▄▄▀▀ ▀▀ ▀▀▄▄ $f3▄▀▄▀▀▄▀▄ $f4 ▄▀ ▀▄ $f5▄▄▀▀ ▀▀ ▀▀▄▄ $f6▄▀▄▀▀▄▀▄$rst + +EOF + +sleep 1.2 + +# Checking if the bot folder is in HOME +echo -e "$bld$f4 CHECKING INSTALLED BOT...$rst" +sleep 0.5 +ls ../ | grep $BOT 2>/dev/null +if [ $? != 0 ]; then + echo -e "$f1 ERROR: BOT: $BOT NOT FOUND IN YOUR HOME DIRECTORY$rst" + sleep 4 + exit 1 +fi +echo -e "$f2 $BOT FOUND IN YOUR HOME DIRECTORY$rst" +sleep 0.5 + + +echo "" +echo -e "\033[38;5;208m ____ ____ _____ \033[0;00m" +echo -e "\033[38;5;208m | \| _ )_ _|___ ____ __ __ \033[0;00m" +echo -e "\033[38;5;208m | |_ ) _ \ | |/ .__| _ \_| \/ | \033[0;00m" +echo -e "\033[38;5;208m |____/|____/ |_|\____/\_____|_/\/\_| \033[0;00m" +echo -e "\033[38;5;208m \033[0;00m" + +sleep 1.5 +echo -e "$bld$f4 CHECKING PROCESSES...$rst" +sleep 0.7 + +# Looks for the number of screen/telegram-cli processes +CLINUM=`ps -e | grep -c telegram-cli` +echo "$f2 RUNNING $CLINUM TELEGRAM-CLI PROCESS$rst" +sleep 0.9 + +# =====Setup ends===== # + +# Opening new tmux in a daemon +echo -e "$bld$f4 ATTACHING TMUX AS DAEMON...$rst" +# It is recommended to clear cli status always before starting the bot +rm ../.telegram-cli/state 2>/dev/null +# Nested TMUX sessions trick +TMUX= tmux new-session -d -s $BOT "./launch.sh" +sleep 1.3 + +CLIPID=`ps -e | grep telegram-cli | head -1 | sed 's/^[[:space:]]*//' | cut -f 1 -d" "` +echo -e "$f2 NEW TELEGRAM-CLI PROCESS: $CLIPID$rst" +echo "" +echo "" + +# Locating telegram-cli status +cat /proc/$CLIPID/task/$CLIPID/status > STATUS +NONVOLUNTARY=`grep nonvoluntary STATUS | cut -f 2 -d":" | sed 's/^[[:space:]]*//'` + +sleep 3 + +# ::::::::::::::::::::::::: +# ::::::: MAIN LOOP ::::::: +# ::::::::::::::::::::::::: + +while true; do + + echo -e "$f2 TIMES CHECKED AND RUNNING:$f5 $OK $rst" + echo -e "$f2 TIMES FAILED AND RECOVERED:$f5 $BAD $rst" + echo "" + + cat /proc/$CLIPID/task/$CLIPID/status > CHECK + if [ $? != 0 ]; then + I=$(( $I + 1 )) + if [ $I -ge 3 ]; then + kill $CLIPID + tmux kill-session -t $BOT + rm ../.telegram-cli/state 2>/dev/null + NONVOLUNTARY=0 + NONVOLUNTARYCHECK=0 + VOLUNTARY=0 + VOLUNTARYCHECK=0 + fi + else + I=1 + fi + VOLUNTARYCHECK=`grep voluntary CHECK | head -1 | cut -f 2 -d":" | sed 's/^[[:space:]]*//'` + NONVOLUNTARYCHECK=`grep nonvoluntary CHECK | cut -f 2 -d":" | sed 's/^[[:space:]]*//'` + + if [ $NONVOLUNTARY != $NONVOLUNTARYCHECK ] || [ $VOLUNTARY != $VOLUNTARYCHECK ]; then + echo -e "$f5 BOT RUNNING!$rst" + OK=$(( $OK + 1 )) + + else + echo -e "$f5 BOT NOT RUNING, TRYING TO RELOAD IT...$rst" + BAD=$(( $BAD + 1 )) + sleep 1 + + rm ../.telegram-cli/state 2>/dev/null + + kill $CLIPID + tmux kill-session -t $BOT + + TMUX= tmux new-session -d -s $BOT "./launch.sh" + sleep 1 + + CLIPID=`ps -e | grep telegram-cli | head -1 | sed 's/^[[:space:]]*//' | cut -f 1 -d" "` + + if [ -z "${CLIPID}" ]; then + echo -e "$f1 ERROR: TELEGRAM-CLI PROCESS NOT RUNNING$rst" + echo -e "$f1 FAILED TO RECOVER BOT$rst" + sleep 3 + exit 1 + fi + + fi + + VOLUNTARY=`echo $VOLUNTARYCHECK` + NONVOLUNTARY=`echo $NONVOLUNTARYCHECK` + sleep $RELOADTIME + rm CHECK + +done + +} + + +function screen_mode { + +clear +sleep 0.5 + +# Space invaders thanks to github.com/windelicato +f=3 b=4 +for j in f b; do + for i in {0..7}; do + printf -v $j$i %b "\e[${!j}${i}m" + done +done +bld=$'\e[1m' +rst=$'\e[0m' + +cat << EOF + + $f1 ▀▄ ▄▀ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4 ▀▄ ▄▀ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst + $f1 ▄█▀███▀█▄ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4 ▄█▀███▀█▄ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst + $f1█▀███████▀█ $f2▀▀███▀▀███▀▀ $f3▀█▀██▀█▀ $f4█▀███████▀█ $f5▀▀███▀▀███▀▀ $f6▀█▀██▀█▀$rst + $f1▀ ▀▄▄ ▄▄▀ ▀ $f2 ▀█▄ ▀▀ ▄█▀ $f3▀▄ ▄▀ $f4▀ ▀▄▄ ▄▄▀ ▀ $f5 ▀█▄ ▀▀ ▄█▀ $f6▀▄ ▄▀$rst + +EOF +echo -e " \e[100m Steady script \e[00;37;40m" +echo -e " \e[01;34m by iicc \e[00;37;40m" +echo "" +cat << EOF + $bld$f1▄ ▀▄ ▄▀ ▄ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4▄ ▀▄ ▄▀ ▄ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst + $bld$f1█▄█▀███▀█▄█ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4█▄█▀███▀█▄█ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst + $bld$f1▀█████████▀ $f2▀▀▀██▀▀██▀▀▀ $f3▀▀█▀▀█▀▀ $f4▀█████████▀ $f5▀▀▀██▀▀██▀▀▀ $f6▀▀█▀▀█▀▀$rst + $bld$f1 ▄▀ ▀▄ $f2▄▄▀▀ ▀▀ ▀▀▄▄ $f3▄▀▄▀▀▄▀▄ $f4 ▄▀ ▀▄ $f5▄▄▀▀ ▀▀ ▀▀▄▄ $f6▄▀▄▀▀▄▀▄$rst + +EOF + +sleep 1.3 + +# Checking if the bot folder is in HOME +echo -e "$bld$f4 CHECKING INSTALLED BOT...$rst" +sleep 0.5 +ls ../ | grep $BOT 2>/dev/null +if [ $? != 0 ]; then + echo -e "$f1 ERROR: BOT: $BOT NOT FOUND IN YOUR HOME DIRECTORY$rst" + sleep 4 + exit 1 +fi +echo -e "$f2 $BOT FOUND IN YOUR HOME DIRECTORY$rst" +sleep 0.5 + + +echo "" +echo -e "\033[38;5;208m ____ ____ _____ \033[0;00m" +echo -e "\033[38;5;208m | \| _ )_ _|___ ____ __ __ \033[0;00m" +echo -e "\033[38;5;208m | |_ ) _ \ | |/ .__| _ \_| \/ | \033[0;00m" +echo -e "\033[38;5;208m |____/|____/ |_|\____/\_____|_/\/\_| \033[0;00m" +echo -e "\033[38;5;208m \033[0;00m" + +# Starting preliminar setup +sleep 1.5 +echo -e "$bld$f4 CHECKING PROCESSES...$rst" +sleep 0.7 + +# Looks for the number of screen/telegram-cli processes +SCREENNUM=`ps -e | grep -c screen` +CLINUM=`ps -e | grep -c telegram-cli` + +if [ $SCREENNUM -ge 3 ]; then + echo -e "$f1 ERROR: MORE THAN 2 PROCESS OF SCREEN RUNNING.$rst" + echo -e "$f1 THESE PROCESSES HAVE BE KILLED. THEN RESTART THE SCRIPT$rst" + echo -e '$f1 RUN: "killall screen" $rst' + if [ $CLINUM -ge 2 ]; then + echo -e "$f1 ERROR: MORE THAN 1 PROCESS OF TELEGRAM-CLI RUNNING.$rst" + echo -e "$f1 THESE PROCESSES WILL BE KILLED. THEN RESTART THE SCRIPT$rst" + echo -e "$f1 RUN: killall telegram-cli $rst" + fi + sleep 4 + exit 1 +fi +echo "$f2 SCREEN NUMBER AND CLI NUMBER UNDER THE SUPPORTED LIMIT" +sleep 0.7 +echo "$f2 RUNNING $SCREENNUM SCREEN PROCESS$rst" +echo "$f2 RUNNING $CLINUM TELEGRAM-CLI PROCESS$rst" +sleep 0.9 + +# Getting screen pid's +ps -e | grep screen | sed 's/^[[:space:]]*//' | cut -f 1 -d" " | while read -r line ; do + sleep 0.5 + echo -e "$f2 SCREEN NUMBER $I PID: $line$rst" + if [ $I -eq 1 ]; then + echo $line > SC1 + else + echo $line > SC2 + fi + I=$(( $I + 1 )) +done + +# I had some weird errors, so I had to do this silly fix: +SCREENPID1=`cat SC1` +SCREENPID2=`cat SC2` +rm SC1 SC2 2>/dev/null + +sleep 0.7 +CLIPID=`ps -e | grep telegram-cli | sed 's/^[[:space:]]*//' | cut -f 1 -d" "` +if [ $CLINUM -eq 1 ]; then + echo -e "$f2 RUNNING ONE PROCESS OF TELEGRAM-CLI: $CLIPID1$rst" + echo -e "$bld$f4 KILLING TELEGRAM-CLI PROCESS. NOT NEEDED NOW$rst" + kill $CLIPID1 +else + echo -e "$f2 RUNNING ZERO PROCESS OF TELEGRAM-CLI$rst" +fi +sleep 0.7 + + +CLINUM=`ps -e | grep -c telegram-cli` +if [ $CLINUM -eq 1 ]; then + echo -e "$f1 ERROR: TELEGRAM-CLI PID COULDN'T BE KILLED. IGNORE.$rst" +fi +sleep 1 + + +# =====Setup ends===== # + +# Opening new screen in a daemon +echo -e "$bld$f4 ATTACHING SCREEN AS DAEMON...$rst" +# Better to clear cli status before +rm ../.telegram-cli/state 2>/dev/null +screen -d -m bash launch.sh + +sleep 1.3 + +SCREENNUM=`ps -e | grep -c screen` +if [ $SCREENNUM != 3 ]; then + echo -e "$f1 ERROR: SCREEN RUNNING: $SCREENNUM \n SCREEN ESPECTED: 3$rst" + exit 1 +fi + +# Getting screen info +sleep 0.7 +echo -e "$bld$f4 RELOADING SCREEN INFO...$rst" +sleep 1 +echo -e "$f2 NUMBER OF SCREEN ATTACHED: $SCREENNUM$rst" +echo -e "$f2 SECONDARY SCREEN: $SCREENPID1 AND $SCREENPID2$rst" +SCREEN=`ps -e | grep -v $SCREENPID1 | grep -v $SCREENPID2 | grep screen | sed 's/^[[:space:]]*//' | cut -f 1 -d" "` + +sleep 0.5 +echo -e "$f2 PRIMARY SCREEN: $SCREEN$rst" + +sleep 0.7 +echo -e "$bld$f4 RELOADING TELEGRAM-CLI INFO...$rst" +sleep 0.7 + +# Getting new telegram-cli PID +CLIPID=`ps -e | grep telegram-cli | sed 's/^[[:space:]]*//' |cut -f 1 -d" "` +echo -e "$f2 NEW TELEGRAM-CLI PID: $CLIPID$rst" +if [ -z "${CLIPID}" ]; then + echo -e "$f1 ERROR: TELEGRAM-CLI PROCESS NOT RUNNING$rst" + sleep 3 + exit 1 +fi + + +# Locating telegram-cli status +cat /proc/$CLIPID/task/$CLIPID/status > STATUS +NONVOLUNTARY=`grep nonvoluntary STATUS | cut -f 2 -d":" | sed 's/^[[:space:]]*//'` + + +sleep 5 + +# ::::::::::::::::::::::::: +# ::::::: MAIN LOOP ::::::: +# ::::::::::::::::::::::::: + + while true; do + + echo -e "$f2 TIMES CHECKED AND RUNNING:$f5 $OK $rst" + echo -e "$f2 TIMES FAILED AND RECOVERED:$f5 $BAD $rst" + echo "" + + cat /proc/$CLIPID/task/$CLIPID/status > CHECK + if [ $? != 0 ]; then + I=$(( $I + 1 )) + if [ $I -ge 3 ]; then + rm ../.telegram-cli/state 2>/dev/null + NONVOLUNTARY=0 + NONVOLUNTARYCHECK=0 + VOLUNTARY=0 + VOLUNTARYCHECK=0 + fi + else + I=1 + fi + VOLUNTARYCHECK=`grep voluntary CHECK | head -1 | cut -f 2 -d":" | sed 's/^[[:space:]]*//'` + NONVOLUNTARYCHECK=`grep nonvoluntary CHECK | cut -f 2 -d":" | sed 's/^[[:space:]]*//'` + + if [ $NONVOLUNTARY != $NONVOLUNTARYCHECK ] || [ $VOLUNTARY != $VOLUNTARYCHECK ]; then + echo -e "$f5 BOT RUNNING!$rst" + OK=$(( $OK + 1 )) + + else + echo -e "$f5 BOT NOT RUNING, TRYING TO RELOAD IT...$rst" + BAD=$(( $BAD + 1 )) + sleep 1 + + rm ../.telegram-cli/state 2>/dev/null + + kill $CLIPID + kill $SCREEN + + screen -d -m bash launch.sh + sleep 1 + + CLIPID=`ps -e | grep telegram-cli | sed 's/^[[:space:]]*//' | cut -f 1 -d" "` + + if [ -z "${CLIPID}" ]; then + echo -e "$f1 ERROR: TELEGRAM-CLI PROCESS NOT RUNNING$rst" + echo -e "$f1 FAILED TO RECOVER BOT$rst" + sleep 1 + fi + + SCREENNUM=`ps -e | grep -c screen` + if [ $SCREENNUM != 3 ]; then + echo -e "$f1 ERROR: SCREEN RUNNING: $SCREENNUM \n SCREEN ESPECTED: 3$rst" + echo -e "$f1 FAILED TO RECOVER BOT$rst" + exit 1 + fi + + SCREEN=`ps -e | grep -v $SCREENPID1 | grep -v $SCREENPID2 | grep screen | sed 's/^[[:space:]]*//' | cut -f 1 -d" "` + echo -e "$f5 BOT HAS BEEN SUCCESFULLY RELOADED!$rst" + echo -e "$f2 TELEGRAM-CLI NEW PID: $CLIPID$rst" + echo -e "$f2 SCREEN NEW PID: $SCREEN$rst" + sleep 3 + + fi + + VOLUNTARY=`echo $VOLUNTARYCHECK` + NONVOLUNTARY=`echo $NONVOLUNTARYCHECK` + sleep $RELOADTIME + rm CHECK + + done + +} + +function tmux_detached { +clear +TMUX= tmux new-session -d -s script_detach "bash steady.sh -t" +echo -e "\e[1m" +echo -e "" +echo "Bot running in the backgroud with TMUX" +echo "" +echo -e "\e[0m" +sleep 3 +tmux kill-session script 2>/dev/null +exit 1 +} + +function screen_detached { +clear +screen -d -m bash launch.sh +echo -e "\e[1m" +echo -e "" +echo "Bot running in the backgroud with SCREEN" +echo "" +echo -e "\e[0m" +sleep 3 +quit +exit 1 +} + + + +if [ $# -eq 0 ] +then + echo -e "\e[1m" + echo -e "" + echo "Missing options!" + echo "Run: bash steady.sh -h for help!" + echo "" + echo -e "\e[0m" + sleep 1 + exit 1 +fi + +while getopts ":tsTSih" opt; do + case $opt in + t) + echo -e "\e[1m" + echo -e "" + echo "TMUX multiplexer option has been triggered." >&2 + echo "Starting script..." + sleep 1.5 + echo -e "\e[0m" + tmux_mode + exit 1 + ;; + s) + echo -e "\e[1m" + echo -e "" + echo "SCREEN multiplexer option has been triggered." >&2 + echo "Starting script..." + sleep 1.5 + echo -e "\e[0m" + screen_mode + exit 1 + ;; + T) + echo -e "\e[1m" + echo -e "" + echo "TMUX multiplexer option has been triggered." >&2 + echo "Starting script..." + sleep 1.5 + echo -e "\e[0m" + tmux_detached + exit 1 + ;; + S) + echo -e "\e[1m" + echo -e "" + echo "SCREEN multiplexer option has been triggered." >&2 + echo "Starting script..." + sleep 1.5 + echo -e "\e[0m" + screen_detached + exit 1 + ;; + i) + echo -e "\e[1m" + echo -e "" + echo "steady.sh bash script v1.2 iicc 2016 DBTeam" >&2 + echo "" + echo -e "\e[0m" +echo -e "\033[38;5;208m ____ ____ _____ \033[0;00m" +echo -e "\033[38;5;208m | \| _ )_ _|___ ____ __ __ \033[0;00m" +echo -e "\033[38;5;208m | |_ ) _ \ | |/ .__| _ \_| \/ | \033[0;00m" +echo -e "\033[38;5;208m |____/|____/ |_|\____/\_____|_/\/\_| \033[0;00m" +echo -e "\033[38;5;208m \033[0;00m" +echo "" + exit 1 + ;; + h) + echo -e "\e[1m" + echo -e "" + echo "Usage:" + echo -e "" + echo "steady.sh -t" + echo "steady.sh -s" + echo "steady.sh -T" + echo "steady.sh -S" + echo "steady.sh -h" + echo "steady.sh -i" + echo "" + echo "Options:" + echo "" + echo " -t select TMUX terminal multiplexer" + echo " -s select SCREEN terminal multiplexer" + echo " -T select TMUX and detach session after start" + echo " -S select SCREEN and detach session after start" + echo " -h script options help page" + echo " -i information about the script" + echo -e "\e[0m" + exit 1 + ;; + + \?) + echo -e "\e[1m" + echo -e "" + echo "Invalid option: -$OPTARG" >&2 + echo "Run bash $0 -h for help" + echo -e "\e[0m" + exit 1 + ;; + :) + echo "Option -$OPTARG requires an argument." >&2 + exit 1 + ;; + esac +done