@queenanya/baileys 7.3.7 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +941 -0
- package/WAProto/GenerateStatics.sh +4 -0
- package/WAProto/WAProto.proto +3344 -0
- package/WAProto/index.d.ts +37016 -0
- package/WAProto/index.js +101044 -0
- package/WASignalGroup/GroupProtocol.js +1697 -0
- package/WASignalGroup/ciphertext_message.js +16 -0
- package/WASignalGroup/group_cipher.js +120 -0
- package/WASignalGroup/group_session_builder.js +46 -0
- package/WASignalGroup/index.js +5 -0
- package/WASignalGroup/keyhelper.js +21 -0
- package/WASignalGroup/protobufs.js +3 -0
- package/WASignalGroup/queue_job.js +69 -0
- package/WASignalGroup/sender_chain_key.js +50 -0
- package/WASignalGroup/sender_key_distribution_message.js +78 -0
- package/WASignalGroup/sender_key_message.js +92 -0
- package/WASignalGroup/sender_key_name.js +70 -0
- package/WASignalGroup/sender_key_record.js +56 -0
- package/WASignalGroup/sender_key_state.js +129 -0
- package/WASignalGroup/sender_message_key.js +39 -0
- package/lib/Defaults/baileys-version.json +3 -0
- package/lib/Defaults/index.d.ts +284 -0
- package/lib/Defaults/index.js +122 -0
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Signal/libsignal.d.ts +3 -0
- package/lib/Signal/libsignal.js +152 -0
- package/lib/Socket/Client/abstract-socket-client.d.ts +17 -0
- package/lib/Socket/Client/abstract-socket-client.js +13 -0
- package/lib/Socket/Client/index.d.ts +3 -0
- package/lib/Socket/Client/index.js +19 -0
- package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
- package/lib/Socket/Client/mobile-socket-client.js +65 -0
- package/lib/Socket/Client/web-socket-client.d.ts +12 -0
- package/lib/Socket/Client/web-socket-client.js +62 -0
- package/lib/Socket/business.d.ts +177 -0
- package/lib/Socket/business.js +260 -0
- package/lib/Socket/chats.d.ts +91 -0
- package/lib/Socket/chats.js +950 -0
- package/lib/Socket/groups.d.ts +137 -0
- package/lib/Socket/groups.js +314 -0
- package/lib/Socket/index.d.ts +179 -0
- package/lib/Socket/index.js +10 -0
- package/lib/Socket/messages-recv.d.ts +164 -0
- package/lib/Socket/messages-recv.js +921 -0
- package/lib/Socket/messages-send.d.ts +157 -0
- package/lib/Socket/messages-send.js +779 -0
- package/lib/Socket/newsletter.d.ts +143 -0
- package/lib/Socket/newsletter.js +249 -0
- package/lib/Socket/registration.d.ts +271 -0
- package/lib/Socket/registration.js +166 -0
- package/lib/Socket/socket.d.ts +44 -0
- package/lib/Socket/socket.js +620 -0
- package/lib/Store/index.d.ts +3 -0
- package/lib/Store/index.js +10 -0
- package/lib/Store/make-cache-manager-store.d.ts +14 -0
- package/lib/Store/make-cache-manager-store.js +83 -0
- package/lib/Store/make-in-memory-store.d.ts +118 -0
- package/lib/Store/make-in-memory-store.js +422 -0
- package/lib/Store/make-ordered-dictionary.d.ts +13 -0
- package/lib/Store/make-ordered-dictionary.js +81 -0
- package/lib/Store/object-repository.d.ts +10 -0
- package/lib/Store/object-repository.js +27 -0
- package/lib/Types/Auth.d.ts +111 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Call.d.ts +13 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Chat.d.ts +107 -0
- package/lib/Types/Chat.js +4 -0
- package/lib/Types/Contact.d.ts +19 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Events.d.ts +199 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/GroupMetadata.d.ts +56 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/Label.d.ts +46 -0
- package/lib/Types/Label.js +27 -0
- package/lib/Types/LabelAssociation.d.ts +29 -0
- package/lib/Types/LabelAssociation.js +9 -0
- package/lib/Types/Message.d.ts +278 -0
- package/lib/Types/Message.js +9 -0
- package/lib/Types/Newsletter.d.ts +79 -0
- package/lib/Types/Newsletter.js +18 -0
- package/lib/Types/Product.d.ts +78 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Signal.d.ts +57 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Socket.d.ts +118 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/State.d.ts +27 -0
- package/lib/Types/State.js +2 -0
- package/lib/Types/index.d.ts +65 -0
- package/lib/Types/index.js +42 -0
- package/lib/Utils/auth-utils.d.ts +18 -0
- package/lib/Utils/auth-utils.js +206 -0
- package/lib/Utils/baileys-event-stream.d.ts +16 -0
- package/lib/Utils/baileys-event-stream.js +63 -0
- package/lib/Utils/business.d.ts +22 -0
- package/lib/Utils/business.js +234 -0
- package/lib/Utils/chat-utils.d.ts +72 -0
- package/lib/Utils/chat-utils.js +740 -0
- package/lib/Utils/crypto.d.ts +42 -0
- package/lib/Utils/crypto.js +153 -0
- package/lib/Utils/decode-wa-message.d.ts +20 -0
- package/lib/Utils/decode-wa-message.js +207 -0
- package/lib/Utils/event-buffer.d.ts +35 -0
- package/lib/Utils/event-buffer.js +520 -0
- package/lib/Utils/generics.d.ts +115 -0
- package/lib/Utils/generics.js +440 -0
- package/lib/Utils/history.d.ts +19 -0
- package/lib/Utils/history.js +94 -0
- package/lib/Utils/index.d.ts +17 -0
- package/lib/Utils/index.js +33 -0
- package/lib/Utils/link-preview.d.ts +21 -0
- package/lib/Utils/link-preview.js +93 -0
- package/lib/Utils/logger.d.ts +2 -0
- package/lib/Utils/logger.js +7 -0
- package/lib/Utils/lt-hash.d.ts +12 -0
- package/lib/Utils/lt-hash.js +51 -0
- package/lib/Utils/make-mutex.d.ts +7 -0
- package/lib/Utils/make-mutex.js +43 -0
- package/lib/Utils/messages-media.d.ts +131 -0
- package/lib/Utils/messages-media.js +793 -0
- package/lib/Utils/messages.d.ts +78 -0
- package/lib/Utils/messages.js +771 -0
- package/lib/Utils/noise-handler.d.ts +22 -0
- package/lib/Utils/noise-handler.js +155 -0
- package/lib/Utils/process-message.d.ts +42 -0
- package/lib/Utils/process-message.js +354 -0
- package/lib/Utils/signal.d.ts +32 -0
- package/lib/Utils/signal.js +156 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +12 -0
- package/lib/Utils/use-multi-file-auth-state.js +93 -0
- package/lib/Utils/validate-connection.d.ts +11 -0
- package/lib/Utils/validate-connection.js +205 -0
- package/lib/WABinary/constants.d.ts +27 -0
- package/lib/WABinary/constants.js +40 -0
- package/lib/WABinary/decode.d.ts +8 -0
- package/lib/WABinary/decode.js +254 -0
- package/lib/WABinary/encode.d.ts +2 -0
- package/lib/WABinary/encode.js +228 -0
- package/lib/WABinary/generic-utils.d.ts +16 -0
- package/lib/WABinary/generic-utils.js +110 -0
- package/lib/WABinary/index.d.ts +5 -0
- package/lib/WABinary/index.js +21 -0
- package/lib/WABinary/jid-utils.d.ts +31 -0
- package/lib/WABinary/jid-utils.js +62 -0
- package/lib/WABinary/types.d.ts +18 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WAM/BinaryInfo.d.ts +18 -0
- package/lib/WAM/BinaryInfo.js +13 -0
- package/lib/WAM/constants.d.ts +38 -0
- package/lib/WAM/constants.js +15350 -0
- package/lib/WAM/encode.d.ts +4 -0
- package/lib/WAM/encode.js +155 -0
- package/lib/WAM/index.d.ts +3 -0
- package/lib/WAM/index.js +19 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +30 -0
- package/package.json +102 -2
- package/.anya-md/.replit +0 -2
- package/.anya-md/.temp/.temp +0 -1
- package/.anya-md/Dockerfile +0 -16
- package/.anya-md/LICENCE +0 -674
- package/.anya-md/README.md +0 -301
- package/.anya-md/app.json +0 -81
- package/.anya-md/config.js +0 -74
- package/.anya-md/heroku.yml +0 -5
- package/.anya-md/index.js +0 -47
- package/.anya-md/koyeb.yaml +0 -14
- package/.anya-md/lib/.dev.js +0 -47
- package/.anya-md/lib/Assets/aliveMedia.mp4 +0 -0
- package/.anya-md/lib/Assets/goodbyeBG.jpg +0 -0
- package/.anya-md/lib/Assets/image_1.jpg +0 -0
- package/.anya-md/lib/Assets/image_2.jpg +0 -0
- package/.anya-md/lib/Assets/menuMedia.mp4 +0 -0
- package/.anya-md/lib/Assets/ownerMentionMp3.mp3 +0 -0
- package/.anya-md/lib/Assets/port.html +0 -36
- package/.anya-md/lib/Assets/reaction/angry/angry108202410.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202412.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202413.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202414.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202415.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202416.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202417.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202418.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202419.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202420.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202421.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202423.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202425.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202426.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202427.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202428.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202429.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202430.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202431.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry108202469.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry10820249.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry11.mp4 +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry12.mp4 +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry14.jpg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry2.mp4 +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry3.mp4 +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry5.jpg +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry6.png +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry8.png +0 -0
- package/.anya-md/lib/Assets/reaction/angry/angry9.jpg +0 -0
- package/.anya-md/lib/Assets/reaction/confused/confused1.png +0 -0
- package/.anya-md/lib/Assets/reaction/confused/confused2.jpg +0 -0
- package/.anya-md/lib/Assets/reaction/confused/confused3.jpg +0 -0
- package/.anya-md/lib/Assets/reaction/confused/confused4.mp4 +0 -0
- package/.anya-md/lib/Assets/reaction/confused/confused5.jpg +0 -0
- package/.anya-md/lib/Assets/reaction/confused/confused6.webp +0 -0
- package/.anya-md/lib/Assets/reaction/confused/confused7.png +0 -0
- package/.anya-md/lib/Assets/reaction/confused/confused8.jpg +0 -0
- package/.anya-md/lib/Assets/reaction/cry/cry1.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/cry/cry12.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/cry/cry13.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/cry/cry14.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/cry/cry15.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/cry/cry16.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/cry/cry17.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/cry/cry18.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/cry/cry19.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/cry/cry22.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/cry/cry23.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/cry/cry5.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/cry/cry9.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/happy/happyrect1.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/no/_pika +0 -1
- package/.anya-md/lib/Assets/reaction/no/no1.jpg +0 -0
- package/.anya-md/lib/Assets/reaction/no/no2.png +0 -0
- package/.anya-md/lib/Assets/reaction/no/no3.jpg +0 -0
- package/.anya-md/lib/Assets/reaction/no/no4.png +0 -0
- package/.anya-md/lib/Assets/reaction/no/no5.png +0 -0
- package/.anya-md/lib/Assets/reaction/no/no6.jpg +0 -0
- package/.anya-md/lib/Assets/reaction/no/no7.jpg +0 -0
- package/.anya-md/lib/Assets/reaction/no/no8.jpg +0 -0
- package/.anya-md/lib/Assets/reaction/no/no9.mp4 +0 -0
- package/.anya-md/lib/Assets/reaction/smug/059e1bdc-e62a-4943-b85e-ea372709f6a7.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/smug/8fda90b3-bc98-4d24-ac10-4402c4e7be93.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/smug/Aqua.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/smug/Karasuma Chitose.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/smug/Smug Face - Fibel Sistine.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/smug/bf8d78ec-4fcc-4ff7-b3c3-91a0c5f22567.jpeg +0 -0
- package/.anya-md/lib/Assets/reaction/smug//330/247/330/255/331/204/330/247/331/213 /330/247/330/250/330/252/330/263/330/247/331/205/331/207 /330/264/330/261/331/212/330/261/331/207/360/237/230/255/360/237/230/255/360/237/230/255.jpeg +0 -0
- package/.anya-md/lib/Assets/verifyIMG.jpg +0 -0
- package/.anya-md/lib/Assets/welcomeGIF.mp4 +0 -0
- package/.anya-md/lib/database/categories.json +0 -77
- package/.anya-md/lib/database/cooldown.json +0 -1
- package/.anya-md/lib/database/disk/main.js +0 -43
- package/.anya-md/lib/database/emoji.js +0 -23
- package/.anya-md/lib/database/games/quiz/Questions.js +0 -44
- package/.anya-md/lib/database/games/quiz/Quiz.js +0 -169
- package/.anya-md/lib/database/games/quiz/database.json +0 -1
- package/.anya-md/lib/database/games/quiz/index.js +0 -7
- package/.anya-md/lib/database/json/.pika.js +0 -3
- package/.anya-md/lib/database/json/animeQuotes.json +0 -51062
- package/.anya-md/lib/database/json/bioQuotes.json +0 -5744
- package/.anya-md/lib/database/json/cogan.json +0 -102
- package/.anya-md/lib/database/json/countries.json +0 -21210
- package/.anya-md/lib/database/json/countries2.json +0 -1
- package/.anya-md/lib/database/json/couplepp.json +0 -725
- package/.anya-md/lib/database/json/flaming.json +0 -7
- package/.anya-md/lib/database/json/ganpati.json +0 -102
- package/.anya-md/lib/database/json/husbu.json +0 -1967
- package/.anya-md/lib/database/json/islamicWall.json +0 -501
- package/.anya-md/lib/database/json/pickupLines.json +0 -118
- package/.anya-md/lib/database/json/shreeram.json +0 -49
- package/.anya-md/lib/database/json/truthDare.json +0 -643
- package/.anya-md/lib/database/mongodb/README.md +0 -142
- package/.anya-md/lib/database/mongodb/bot.js +0 -12
- package/.anya-md/lib/database/mongodb/cmd.js +0 -17
- package/.anya-md/lib/database/mongodb/group.js +0 -22
- package/.anya-md/lib/database/mongodb/index.js +0 -24
- package/.anya-md/lib/database/mongodb/plugins.js +0 -124
- package/.anya-md/lib/database/mongodb/system.js +0 -34
- package/.anya-md/lib/database/mongodb/ui.js +0 -15
- package/.anya-md/lib/database/mongodb/user.js +0 -17
- package/.anya-md/lib/database/mongodb/warn.js +0 -136
- package/.anya-md/lib/database/sessions/.pika.js +0 -3
- package/.anya-md/lib/frameworks/index.js +0 -5
- package/.anya-md/lib/frameworks/reactionMedia.js +0 -91
- package/.anya-md/lib/lib/README.md +0 -29
- package/.anya-md/lib/lib/ai/README.md +0 -35
- package/.anya-md/lib/lib/ai/aiArt.js +0 -47
- package/.anya-md/lib/lib/ai/index.js +0 -7
- package/.anya-md/lib/lib/buttons.js +0 -530
- package/.anya-md/lib/lib/connectionMsg.js +0 -72
- package/.anya-md/lib/lib/converter.js +0 -355
- package/.anya-md/lib/lib/cooldown.js +0 -46
- package/.anya-md/lib/lib/events.js +0 -47
- package/.anya-md/lib/lib/functions.js +0 -47
- package/.anya-md/lib/lib/greeting.js +0 -115
- package/.anya-md/lib/lib/index.js +0 -381
- package/.anya-md/lib/lib/logger.js +0 -7
- package/.anya-md/lib/lib/maker/remini.js +0 -35
- package/.anya-md/lib/lib/mongoUrlFix.js +0 -46
- package/.anya-md/lib/lib/myfunc.js +0 -47
- package/.anya-md/lib/lib/plugins.js +0 -20
- package/.anya-md/lib/lib/prefix.js +0 -47
- package/.anya-md/lib/lib/scraper/README.md +0 -35
- package/.anya-md/lib/lib/scraper/SoundCloud.js +0 -47
- package/.anya-md/lib/lib/scraper/WebToons.js +0 -47
- package/.anya-md/lib/lib/scraper/android1.js +0 -47
- package/.anya-md/lib/lib/scraper/happymodSearch.js +0 -47
- package/.anya-md/lib/lib/scraper/index.js +0 -27
- package/.anya-md/lib/lib/scraper/konaChanSearch.js +0 -47
- package/.anya-md/lib/lib/scraper/pinterest.js +0 -47
- package/.anya-md/lib/lib/scraper/playstore.js +0 -47
- package/.anya-md/lib/lib/scraper/ringtone.js +0 -47
- package/.anya-md/lib/lib/scraper/steam.js +0 -47
- package/.anya-md/lib/lib/scraper/trendingTwitter.js +0 -51
- package/.anya-md/lib/lib/scraper/wattpad.js +0 -61
- package/.anya-md/lib/lib/scraper/wikipediaSearch.js +0 -42
- package/.anya-md/lib/lib/scraper.js +0 -47
- package/.anya-md/lib/lib/session.js +0 -47
- package/.anya-md/lib/lib/session2.js +0 -47
- package/.anya-md/lib/lib/similar.js +0 -47
- package/.anya-md/lib/lib/stylish-font.js +0 -2302
- package/.anya-md/lib/lib/unicode.js +0 -877
- package/.anya-md/lib/lib/upload/index.js +0 -3
- package/.anya-md/lib/lib/upload/webp2mp4File.js +0 -56
- package/.anya-md/lib/lib/ytdl-core.js +0 -47
- package/.anya-md/lib/plugins/README.md +0 -83
- package/.anya-md/lib/plugins/_menu.js +0 -810
- package/.anya-md/lib/plugins/_plugins.js +0 -239
- package/.anya-md/lib/plugins/admins.js +0 -689
- package/.anya-md/lib/plugins/ai.js +0 -160
- package/.anya-md/lib/plugins/autoreply.js +0 -101
- package/.anya-md/lib/plugins/broadcast.js +0 -204
- package/.anya-md/lib/plugins/convert.js +0 -293
- package/.anya-md/lib/plugins/core.js +0 -941
- package/.anya-md/lib/plugins/download.js +0 -373
- package/.anya-md/lib/plugins/fun.js +0 -75
- package/.anya-md/lib/plugins/games.js +0 -33
- package/.anya-md/lib/plugins/gcswitches.js +0 -204
- package/.anya-md/lib/plugins/general.js +0 -456
- package/.anya-md/lib/plugins/maker.js +0 -41
- package/.anya-md/lib/plugins/owner.js +0 -1049
- package/.anya-md/lib/plugins/religious.js +0 -81
- package/.anya-md/lib/plugins/search.js +0 -902
- package/.anya-md/lib/plugins/stalker.js +0 -187
- package/.anya-md/lib/plugins/sticker.js +0 -125
- package/.anya-md/lib/plugins/tools.js +0 -193
- package/.anya-md/lib/plugins/youtube.js +0 -204
- package/.anya-md/package.json +0 -75
- package/.anya-md/railway.json +0 -12
- package/.anya-md/render.yaml +0 -48
- package/.anya-md/replit.nix +0 -18
- package/.bash_history +0 -500
- package/.config/gh/config.yml +0 -19
- package/.config/gh/hosts.yml +0 -11
- package/.config/ngrok/ngrok.yml +0 -3
- package/.config/yarn/global/package.json +0 -5
- package/.gitconfig +0 -772
- package/.node_repl_history +0 -0
- package/.npm/_cacache/content-v2/sha512/02/b3/d1abf5af06222f7de440ab1b057deb21f9dfb0ce0a8f5064b2ba00595933bbcbbaa040b4616f951d9f8ba48d67491df1198a4831fbd8ee26eb27dde36511 +0 -0
- package/.npm/_cacache/content-v2/sha512/49/7b/0cdbb4861f7c9358a7367ca478498371b269efb8143d75de901ed1169a267f56a68e60f008952f3ebcc727dbb60bb401011af3514a1dd33cdbed8d981fa8 +0 -0
- package/.npm/_cacache/content-v2/sha512/54/3a/647bceb49b7632e6e700cb9f1b66f0f528d4ca71f4f73e76a1e7c8c50b563a2d0bb7734c18f93e6c03b7ea93167db35db0e1999ab13b08ed6b250eed2d2a +0 -1
- package/.npm/_cacache/content-v2/sha512/56/7c/4d5820233a7278225351642f7355d9889af42e7efbbfe27d6b201727efad972a59fa32063c7e1159d01dbf27ba014095ca1349ec0d0767746c39441178fa +0 -1
- package/.npm/_cacache/content-v2/sha512/89/88/d295c7e4f4d0f4621676d4c499bea2a1c72b0c31a84ff78a8bb8f83042da2bcf596e664c021d21025b296cdd4aecb57a036ea366e39466df5a129fa471df +0 -0
- package/.npm/_cacache/content-v2/sha512/8b/46/42882ebb46a975b0ce6b9cdea357190c41b51bb59a21df41c575418850b28115921e130709846d8ff9cabeae72544ec37a48ee7ccb074fe94da925250e55 +0 -1
- package/.npm/_cacache/content-v2/sha512/dd/0d/f856b793da0619d18260556498dfff13391593abb6d6a582bf052f03ba35a03a1444bf5c2d40b7515d268ec2cb3e67a17a42f09f5e668c3bb9b743e3b8a7 +0 -1
- package/.npm/_cacache/content-v2/sha512/dd/15/702501c36ce653a003d2b101034a0cb9c0fd262fa77797f1a286a161a0b2dce51ef13199e9a3fa58008bdbbf4646a33b6f1a24a2807691093cb89beefb00 +0 -1
- package/.npm/_cacache/index-v5/35/f9/e8cc076ef93c1bc40804d3fe05171053366095c922f515b1fab2b580116f +0 -4
- package/.npm/_cacache/index-v5/6a/a2/780c77f928115d4dad58a9dc4fa241de8d914abfff994e44602cc93a697c +0 -2
- package/.npm/_cacache/index-v5/71/ba/d0bb16fddeb617bbbb3713f46750d1bf5b57742abb6feb6dee4d16c68da4 +0 -4
- package/.npm/_cacache/index-v5/72/ae/c69532318093b3bd13618450ca5c26adc018a4afc0e020786207068593cf +0 -2
- package/.npm/_cacache/index-v5/7e/5e/9683ad4854f4201d7e53bf9beb2aefafa7b1efbb2c6ac7b36b78d0b218c8 +0 -2
- package/.npm/_cacache/index-v5/eb/a0/19e529094c594367a9e1aa68096a313d3dc5509d410761bf50122826a6d2 +0 -4
- package/.npm/_cacache/index-v5/f1/fa/2d2f12de549683d1275ec0f2ff15610b408fd89d1b7a755ddb7b77c00371 +0 -2
- package/.npm/_logs/2024-10-03T05_52_01_853Z-debug-0.log +0 -52
- package/.npm/_logs/2024-10-03T05_52_08_135Z-debug-0.log +0 -52
- package/.npm/_logs/2024-10-03T05_52_14_087Z-debug-0.log +0 -52
- package/.npm/_logs/2024-10-03T05_52_22_730Z-debug-0.log +0 -52
- package/.npm/_logs/2024-10-03T05_52_29_410Z-debug-0.log +0 -52
- package/.npm/_logs/2024-10-03T05_52_35_375Z-debug-0.log +0 -52
- package/.npm/_logs/2024-10-03T15_32_57_465Z-debug-0.log +0 -20
- package/.npm/_logs/2024-10-10T05_40_23_847Z-debug-0.log +0 -254
- package/.npm/_logs/2024-10-10T05_40_50_397Z-debug-0.log +0 -73
- package/.npm/_logs/2024-10-10T05_40_59_931Z-debug-0.log +0 -52
- package/.npm/_logs/2024-10-10T05_42_07_969Z-debug-0.log +0 -52
- package/.pm2/logs/anya-error.log +0 -0
- package/.pm2/logs/anya-out.log +0 -59
- package/.pm2/logs/anya-v2-error.log +0 -2184
- package/.pm2/logs/anya-v2-out.log +0 -362
- package/.pm2/module_conf.json +0 -1
- package/.pm2/pm2.log +0 -919
- package/.pm2/pm2.pid +0 -1
- package/.pm2/touch +0 -1
- package/.ssh/authorized_keys +0 -0
- package/.termux/termux.properties +0 -180
- package/.wget-hsts +0 -5
|
@@ -1,1049 +0,0 @@
|
|
|
1
|
-
const Config = require('../../config');
|
|
2
|
-
const {
|
|
3
|
-
anya,
|
|
4
|
-
delay,
|
|
5
|
-
User,
|
|
6
|
-
Bot,
|
|
7
|
-
UI,
|
|
8
|
-
System,
|
|
9
|
-
getAdmin,
|
|
10
|
-
addWarn,
|
|
11
|
-
delWarn,
|
|
12
|
-
clearWarn,
|
|
13
|
-
reactions
|
|
14
|
-
} = require('../lib');
|
|
15
|
-
const PhoneNumber = require('awesome-phonenumber');
|
|
16
|
-
|
|
17
|
-
//༺─────────────────────────────────────༻
|
|
18
|
-
|
|
19
|
-
anya({
|
|
20
|
-
name: "block",
|
|
21
|
-
react: "🚧",
|
|
22
|
-
need: "user",
|
|
23
|
-
category: "owner",
|
|
24
|
-
desc: "Block users from bot number",
|
|
25
|
-
rule: 1,
|
|
26
|
-
filename: __filename
|
|
27
|
-
}, async (anyaV2, pika, { db, args, prefix, command }) => {
|
|
28
|
-
if (!pika.quoted && args.length < 1) return pika.reply(`Eg: ${prefix + command} @user1, @user2, @user3 etc...\n\n*Tag one or more users with "," between them to block!*`);
|
|
29
|
-
const text = args.join(" ");
|
|
30
|
-
const users = pika.quoted ? [pika.quoted.sender] : text.split(',').map(v => v.replace(/[^0-9,]/g, '') + '@s.whatsapp.net');
|
|
31
|
-
const { key } = await pika.keyMsg(Config.message.wait);
|
|
32
|
-
const bot = db.Bot?.[0];
|
|
33
|
-
const [blocklist, botNumber, userOwner] = await Promise.all([
|
|
34
|
-
anyaV2.fetchBlocklist(),
|
|
35
|
-
anyaV2.decodeJid(anyaV2.user.id),
|
|
36
|
-
Promise.resolve([...bot.modlist, Config.ownernumber, anyaV2.user.id].map(v => v.replace(/[^0-9]/g, "") + "@s.whatsapp.net"))
|
|
37
|
-
]);
|
|
38
|
-
const caption = await Promise.all(users.map(async i => {
|
|
39
|
-
const userId = i.split('@')[0];
|
|
40
|
-
const exist = await anyaV2.onWhatsApp(userId);
|
|
41
|
-
if (exist.length < 1) {
|
|
42
|
-
return `❌ Can't find *@${userId}* on WhatsApp`;
|
|
43
|
-
} else if (userOwner.includes(i)) {
|
|
44
|
-
return `🌟 Can't block my owner *@${userId}*`;
|
|
45
|
-
} else if (blocklist.includes(i)) {
|
|
46
|
-
return `☑️ *@${userId}* is already blocked`;
|
|
47
|
-
} else {
|
|
48
|
-
await anyaV2.updateBlockStatus(i, 'block');
|
|
49
|
-
return `✅ Blocked *@${userId}*`;
|
|
50
|
-
}
|
|
51
|
-
}));
|
|
52
|
-
pika.edit(caption.join('\n\n'), key, { mentions: users });
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
//༺─────────────────────────────────────
|
|
56
|
-
|
|
57
|
-
anya({
|
|
58
|
-
name: "unblock",
|
|
59
|
-
react: "🚧",
|
|
60
|
-
need: "user",
|
|
61
|
-
category: "owner",
|
|
62
|
-
desc: "Unblock users from bot number",
|
|
63
|
-
rule: 1,
|
|
64
|
-
filename: __filename
|
|
65
|
-
}, async (anyaV2, pika, { args, prefix, command }) => {
|
|
66
|
-
if (!pika.quoted && args.length < 1) return pika.reply(`Eg: ${prefix + command} @user1, @user2, @user3 etc...\n\n*Tag one or more users with "," between them to unblock!*`);
|
|
67
|
-
const text = args.join(" ");
|
|
68
|
-
const users = pika.quoted ? [pika.quoted.sender] : text.split(',').map(v => v.replace(/[^0-9,]/g, '') + '@s.whatsapp.net');
|
|
69
|
-
const { key } = await pika.keyMsg(Config.message.wait);
|
|
70
|
-
const blocklist = await anyaV2.fetchBlocklist();
|
|
71
|
-
const caption = await Promise.all(users.map(async i => {
|
|
72
|
-
const userId = i.split('@')[0];
|
|
73
|
-
const exist = await anyaV2.onWhatsApp(userId);
|
|
74
|
-
if (exist.length < 1) {
|
|
75
|
-
return `❌ Can't find *@${userId}* on WhatsApp`;
|
|
76
|
-
} else if (!blocklist.includes(i)) {
|
|
77
|
-
return `⭕ *@${userId}* is already unblocked`;
|
|
78
|
-
} else {
|
|
79
|
-
await anyaV2.updateBlockStatus(i, 'unblock');
|
|
80
|
-
return `✅ Unblocked *@${userId}*`;
|
|
81
|
-
}
|
|
82
|
-
}));
|
|
83
|
-
pika.edit(caption.join('\n\n'), key, { mentions: users });
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
//༺─────────────────────────────────────
|
|
87
|
-
|
|
88
|
-
anya({
|
|
89
|
-
name: "setpp",
|
|
90
|
-
alias: ['setbotpp'],
|
|
91
|
-
react: "🧿",
|
|
92
|
-
need: "image",
|
|
93
|
-
category: "owner",
|
|
94
|
-
desc: "Set bot profile picture",
|
|
95
|
-
rule: 1,
|
|
96
|
-
filename: __filename
|
|
97
|
-
}, async (anyaV2, pika, { prefix, command }) => {
|
|
98
|
-
const quoted = pika.quoted ? pika.quoted : pika;
|
|
99
|
-
const mime = quoted.mimetype || quoted.mediaType || pika.mtype;
|
|
100
|
-
if (/image/.test(mime)) {
|
|
101
|
-
const { key } = await pika.keyMsg(Config.message.wait);
|
|
102
|
-
try {
|
|
103
|
-
const media = await quoted.download();
|
|
104
|
-
const botnumber = await anyaV2.decodeJid(anyaV2.user.id);
|
|
105
|
-
await anyaV2.updateProfilePicture(botnumber, media);
|
|
106
|
-
pika.edit(Config.message.success, key);
|
|
107
|
-
} catch (err) {
|
|
108
|
-
console.error(err);
|
|
109
|
-
pika.edit(Config.message.error, key);
|
|
110
|
-
}
|
|
111
|
-
} else {
|
|
112
|
-
pika.reply(`_❗Tag or reply to an image with the caption *${prefix + command}*_`);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
//༺─────────────────────────────────────
|
|
117
|
-
|
|
118
|
-
anya({
|
|
119
|
-
name: "ban",
|
|
120
|
-
react: "🚫",
|
|
121
|
-
category: "owner",
|
|
122
|
-
need: "user",
|
|
123
|
-
desc: "Ban user from using commands",
|
|
124
|
-
rule: 1,
|
|
125
|
-
filename: __filename
|
|
126
|
-
}, async (anyaV2, pika, { db, args, prefix, command }) => {
|
|
127
|
-
if (!pika.quoted && args.length < 1) return pika.reply(`*Eg:* ${prefix + command} @user1, @user2, @user3 etc...\n\n*Tag one or more users with "," between them to ban!*`);
|
|
128
|
-
|
|
129
|
-
const text = args.join(" ");
|
|
130
|
-
const users = pika.quoted ? [pika.quoted.sender] : text.split(',').map(v => v.replace(/[^0-9,]/g, '') + '@s.whatsapp.net');
|
|
131
|
-
//const { key } = await pika.keyMsg(Config.message.wait);
|
|
132
|
-
|
|
133
|
-
const bot = db.Bot?.[0];
|
|
134
|
-
const botNumber = await anyaV2.decodeJid(anyaV2.user.id);
|
|
135
|
-
const userOwner = new Set([...bot.modlist, Config.ownernumber, botNumber.split("@")[0]].map(v => v.replace(/[^0-9]/g) + "@s.whatsapp.net"));
|
|
136
|
-
const caption = [];
|
|
137
|
-
|
|
138
|
-
for (const user of users) {
|
|
139
|
-
const userId = user.split('@')[0];
|
|
140
|
-
const exist = await anyaV2.onWhatsApp(userId);
|
|
141
|
-
|
|
142
|
-
if (exist.length < 1) {
|
|
143
|
-
caption.push(`❌ Can't find *@${userId}* on WhatsApp`);
|
|
144
|
-
} else if (userOwner.has(user)) {
|
|
145
|
-
caption.push(`🌟 Can't ban my owner *@${userId}*`);
|
|
146
|
-
} else {
|
|
147
|
-
const userData = db.User.find(v => v.id === userId) || await new User({ id: userId }).save();
|
|
148
|
-
if (userData.ban) {
|
|
149
|
-
caption.push(`☑️ *@${userId}* is already banned`);
|
|
150
|
-
} else {
|
|
151
|
-
caption.push(`✅ Banned *@${userId}*`);
|
|
152
|
-
await User.findOneAndUpdate({ id: userId }, { $set: { ban: true } }, { new: true });
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
return pika.reply(caption.join('\n\n'), { mentions: users });
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
//༺─────────────────────────────────────
|
|
161
|
-
|
|
162
|
-
anya({
|
|
163
|
-
name: "unban",
|
|
164
|
-
react: "🥁",
|
|
165
|
-
category: "owner",
|
|
166
|
-
need: "user",
|
|
167
|
-
desc: "Unban user from using commands",
|
|
168
|
-
rule: 1,
|
|
169
|
-
filename: __filename
|
|
170
|
-
}, async (anyaV2, pika, { db, args, prefix, command }) => {
|
|
171
|
-
if (!pika.quoted && args.length < 1) return pika.reply(`*Eg:* ${prefix + command} @user1, @user2, @user3 etc...\n\n*Tag one or more users with "," between them to unban!*`);
|
|
172
|
-
const text = args.join(" ");
|
|
173
|
-
const users = pika.quoted ? [pika.quoted.sender] : text.split(',').map(v => v.replace(/[^0-9,]/g, '') + '@s.whatsapp.net');
|
|
174
|
-
//const { key } = await pika.keyMsg(Config.message.wait);
|
|
175
|
-
const caption = [];
|
|
176
|
-
for (const user of users) {
|
|
177
|
-
const userId = user.split('@')[0];
|
|
178
|
-
const exist = await anyaV2.onWhatsApp(userId);
|
|
179
|
-
if (exist.length < 1) {
|
|
180
|
-
caption.push(`❌ Can't find *@${userId}* on WhatsApp`);
|
|
181
|
-
} else {
|
|
182
|
-
const userData = db.User.find(v => v.id === userId) || await new User({ id: userId }).save();
|
|
183
|
-
if (!userData.ban) {
|
|
184
|
-
caption.push(`⭕ *@${userId}* is already unbanned`);
|
|
185
|
-
} else {
|
|
186
|
-
caption.push(`✅ Unbanned *@${userId}*`);
|
|
187
|
-
await User.findOneAndUpdate({ id: userId }, { $set: { ban: false } }, { new: true });
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
return pika.reply(caption.join('\n\n'), { mentions: users });
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
//༺─────────────────────────────────────
|
|
195
|
-
|
|
196
|
-
anya({
|
|
197
|
-
name: "addmod",
|
|
198
|
-
react: "🌟",
|
|
199
|
-
category: "owner",
|
|
200
|
-
need: "user",
|
|
201
|
-
desc: "Add users as bot owner",
|
|
202
|
-
rule: 1,
|
|
203
|
-
filename: __filename
|
|
204
|
-
}, async (anyaV2, pika, { db, args, prefix, command }) => {
|
|
205
|
-
if (!pika.quoted && args.length < 1) return pika.reply(`*Eg:* ${prefix + command} @user1, @user2, @user3 etc...\n\n*Tag one or more users with "," between them to add to modlist!*`);
|
|
206
|
-
const text = args.join(" ");
|
|
207
|
-
const users = pika.quoted ? [pika.quoted.sender] : text.split(',').map(v => v.replace(/[^0-9,]/g, '') + '@s.whatsapp.net');
|
|
208
|
-
const { key } = await pika.keyMsg(Config.message.wait);
|
|
209
|
-
const bot = await Bot.findOne({ id: 'anyabot' });
|
|
210
|
-
const botNumber = await anyaV2.decodeJid(anyaV2.user.id);
|
|
211
|
-
const userOwnerSet = new Set([...bot.modlist, Config.ownernumber, botNumber.split("@")[0]].map(v => v.replace(/[^0-9]/g) + "@s.whatsapp.net"));
|
|
212
|
-
const caption = [];
|
|
213
|
-
for (const user of users) {
|
|
214
|
-
const userId = user.split('@')[0];
|
|
215
|
-
const exist = await anyaV2.onWhatsApp(userId);
|
|
216
|
-
if (exist.length < 1) {
|
|
217
|
-
caption.push(`❌ Can't find *@${userId}* on WhatsApp`);
|
|
218
|
-
} else {
|
|
219
|
-
if (userOwnerSet.has(user)) {
|
|
220
|
-
caption.push(`☑️ *@${userId}* is already a mod`);
|
|
221
|
-
} else {
|
|
222
|
-
bot.modlist.push(userId);
|
|
223
|
-
await bot.save();
|
|
224
|
-
caption.push(`✅ Added *@${userId}* as mod`);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return pika.edit(caption.join('\n\n'), key, { mentions: users });
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
//༺─────────────────────────────────────
|
|
232
|
-
|
|
233
|
-
anya({
|
|
234
|
-
name: "delmod",
|
|
235
|
-
react: "🎋",
|
|
236
|
-
category: "owner",
|
|
237
|
-
need: "user",
|
|
238
|
-
desc: "Remove users from the bot owner's modlist",
|
|
239
|
-
rule: 1,
|
|
240
|
-
filename: __filename
|
|
241
|
-
}, async (anyaV2, pika, { /*db,*/ args, prefix, command }) => {
|
|
242
|
-
if (!pika.quoted && args.length < 1) return pika.reply(`*Eg:* ${prefix + command} @user1, @user2, @user3 etc...\n\n*Tag one or more users with "," between them to remove from modlist!*`);
|
|
243
|
-
const text = args.join(" ");
|
|
244
|
-
const users = pika.quoted ? (text.includes("selectedButtonMsg") ? text.split(',').map(v => v.replace(/[^0-9,]/g, '') + '@s.whatsapp.net') : [pika.quoted.sender]) : text.split(',').map(v => v.replace(/[^0-9,]/g, '') + '@s.whatsapp.net');
|
|
245
|
-
const { key } = await pika.keyMsg(Config.message.wait);
|
|
246
|
-
const bot = await Bot.findOne({ id: 'anyabot' });
|
|
247
|
-
const caption = [];
|
|
248
|
-
for (const user of users) {
|
|
249
|
-
const userId = user.split('@')[0];
|
|
250
|
-
const exist = await anyaV2.onWhatsApp(userId);
|
|
251
|
-
if (exist.length < 1) {
|
|
252
|
-
caption.push(`❌ Can't find *@${userId}* on WhatsApp`);
|
|
253
|
-
} else {
|
|
254
|
-
const userIndex = bot.modlist.indexOf(userId);
|
|
255
|
-
if (userIndex === -1) {
|
|
256
|
-
caption.push(`⭕ *@${userId}* is not a mod`);
|
|
257
|
-
} else {
|
|
258
|
-
bot.modlist.splice(userIndex, 1);
|
|
259
|
-
await bot.save();
|
|
260
|
-
caption.push(`✅ Removed *@${userId}* from modlist`);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
return pika.edit(caption.join('\n\n'), key, { mentions: users });
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
//༺─────────────────────────────────────
|
|
268
|
-
|
|
269
|
-
anya({
|
|
270
|
-
name: "leavegc",
|
|
271
|
-
alias: ['leavegroup'],
|
|
272
|
-
react: "🌱",
|
|
273
|
-
category: "owner",
|
|
274
|
-
desc: "Leave group by bot Number",
|
|
275
|
-
rule: 6,
|
|
276
|
-
filename: __filename
|
|
277
|
-
}, async (anyaV2, pika, { db }) => {
|
|
278
|
-
pika.reply("```🌠 Leaving Group...```");
|
|
279
|
-
await delay(1000);
|
|
280
|
-
await anyaV2.groupLeave(pika.chat);
|
|
281
|
-
const botNumber = await anyaV2.decodeJid(anyaV2.user.id);
|
|
282
|
-
const bot = db.Bot?.[0];
|
|
283
|
-
const owners = [...bot.modlist, Config.ownernumber, botNumber.split("@")[0]].map(v => v.replace(/[^0-9]/g) + "@s.whatsapp.net");
|
|
284
|
-
const media = reactions.get("smug");
|
|
285
|
-
for (const i of owners) {
|
|
286
|
-
await anyaV2.sendReactionMedia(i, {
|
|
287
|
-
buffer: media.buffer,
|
|
288
|
-
extension: media.extension,
|
|
289
|
-
caption: `🌇 Leaved A Group By \`@${pika.sender.split("@")[0]}\``,
|
|
290
|
-
mentions: [pika.sender]
|
|
291
|
-
}, { quoted:pika }).catch(()=>{});
|
|
292
|
-
await delay(1000);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
);
|
|
296
|
-
|
|
297
|
-
//༺─────────────────────────────────────༻
|
|
298
|
-
|
|
299
|
-
anya({
|
|
300
|
-
name: "join",
|
|
301
|
-
react: "💖",
|
|
302
|
-
category: "owner",
|
|
303
|
-
need: "url",
|
|
304
|
-
desc: "Join groups with this number",
|
|
305
|
-
filename: __filename
|
|
306
|
-
}, async (anyaV2, pika, { args }) => {
|
|
307
|
-
try {
|
|
308
|
-
if (args.length < 1 || !/https:\/\/chat.whatsapp.com\//.test(args.join(" "))) return pika.reply("❕Enter a valid group chat link to join");
|
|
309
|
-
const inviteCode = args.join(" ").split("https://chat.whatsapp.com/")[1];
|
|
310
|
-
const info = await anyaV2.groupGetInviteInfo(inviteCode).catch(() => {});
|
|
311
|
-
if (!info) return pika.reply("*❎ Invalid Url or unable to fetch group info*");
|
|
312
|
-
const metadata = await anyaV2.groupMetadata(info.id).catch(() => {});
|
|
313
|
-
const botNumber = await anyaV2.decodeJid(anyaV2.user.id);
|
|
314
|
-
if (metadata && metadata.participants.map(v => v.id).includes(botNumber)) return pika.reply("_☑️ I'm already in this group chat!_");
|
|
315
|
-
await anyaV2.groupAcceptInvite(inviteCode);
|
|
316
|
-
return pika.reply(Config.message.success);
|
|
317
|
-
} catch (e) {
|
|
318
|
-
console.error(e);
|
|
319
|
-
return pika.reply("❌ Unable to join this group chat");
|
|
320
|
-
}
|
|
321
|
-
});
|
|
322
|
-
|
|
323
|
-
//༺─────────────────────────────────────
|
|
324
|
-
|
|
325
|
-
anya({
|
|
326
|
-
name: "edit",
|
|
327
|
-
alias: ['e'],
|
|
328
|
-
need: "text",
|
|
329
|
-
react: "✅",
|
|
330
|
-
category: "owner",
|
|
331
|
-
desc: "Edit messages sent by this number",
|
|
332
|
-
rule: 1,
|
|
333
|
-
filename: __filename
|
|
334
|
-
}, async (anyaV2, pika, { args }) => {
|
|
335
|
-
if (!pika.quoted) return pika.reply("❕ Tag a message to edit");
|
|
336
|
-
if (args.length < 1) return pika.reply("❕ Write a message also, to replace the current message");
|
|
337
|
-
const botNumber = await anyaV2.decodeJid(anyaV2.user.id);
|
|
338
|
-
if (pika.quoted.sender !== botNumber) return pika.reply("This message isn't sent by me!");
|
|
339
|
-
return await pika.edit(args.join(" "), pika.quoted.fakeObj.key);
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
//༺─────────────────────────────────────
|
|
343
|
-
|
|
344
|
-
anya({
|
|
345
|
-
name: "delete",
|
|
346
|
-
alias: ['del'],
|
|
347
|
-
react: "✅",
|
|
348
|
-
category: "owner",
|
|
349
|
-
desc: "Delete messages sent by this number",
|
|
350
|
-
rule: 1,
|
|
351
|
-
filename: __filename
|
|
352
|
-
}, async (anyaV2, pika, { prefix, command }) => {
|
|
353
|
-
if (!pika.quoted) return pika.reply("Tag a message to delete");
|
|
354
|
-
const botNumber = await anyaV2.decodeJid(anyaV2.user.id);
|
|
355
|
-
if (pika.quoted.sender !== botNumber) {
|
|
356
|
-
return pika.reply(
|
|
357
|
-
!pika.isGroup
|
|
358
|
-
? "Tag a message sent by this number"
|
|
359
|
-
: `Use *${prefix + command}2* to delete other's messages as admin`
|
|
360
|
-
);
|
|
361
|
-
}
|
|
362
|
-
anyaV2.sendMessage(pika.chat, { delete: pika.quoted.fakeObj.key });
|
|
363
|
-
});
|
|
364
|
-
|
|
365
|
-
//༺─────────────────────────────────────
|
|
366
|
-
|
|
367
|
-
anya({
|
|
368
|
-
name: "setbio",
|
|
369
|
-
alias: ['setstatus'],
|
|
370
|
-
react: "💫",
|
|
371
|
-
need: "text",
|
|
372
|
-
category: "owner",
|
|
373
|
-
desc: "Set bot number status",
|
|
374
|
-
rule: 1,
|
|
375
|
-
filename: __filename
|
|
376
|
-
}, async (anyaV2, pika, { db, args, prefix }) => {
|
|
377
|
-
if (!pika.quoted && args.length < 1) return pika.reply("Enter some texts to update status");
|
|
378
|
-
const bot = db.Bot?.[0];
|
|
379
|
-
const statusText = pika.quoted ? pika.quoted.text : args.join(" ");
|
|
380
|
-
try {
|
|
381
|
-
await anyaV2.updateProfileStatus(statusText);
|
|
382
|
-
const hint = bot.autoBio
|
|
383
|
-
? `_❕ Your status will automatically get changed because *${prefix}autobio* is enabled._`
|
|
384
|
-
: `> *Hint:* Use ${prefix}autobio to set random anime quotes in bio automatically.`;
|
|
385
|
-
pika.reply(`${Config.message.success}\n\n${hint}`);
|
|
386
|
-
} catch (err) {
|
|
387
|
-
console.error(err);
|
|
388
|
-
pika.reply(Config.message.error);
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
|
|
392
|
-
//༺─────────────────────────────────────
|
|
393
|
-
|
|
394
|
-
const ownerSwitches = [
|
|
395
|
-
{
|
|
396
|
-
name: "autoreply",
|
|
397
|
-
name2: "Auto Reply",
|
|
398
|
-
alias: false,
|
|
399
|
-
emoji: "🍄",
|
|
400
|
-
desc: "Bot will automatically reply if specific parameters are matched",
|
|
401
|
-
id: "autoReply",
|
|
402
|
-
turnOff: []
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
name: "chatbot",
|
|
406
|
-
name2: "Chatbot",
|
|
407
|
-
alias: false,
|
|
408
|
-
emoji: "🤖",
|
|
409
|
-
desc: "Chatbot for private chats",
|
|
410
|
-
id: "chatbot",
|
|
411
|
-
turnOff: []
|
|
412
|
-
},
|
|
413
|
-
{
|
|
414
|
-
name: "cooldown",
|
|
415
|
-
name2: "Cooldown",
|
|
416
|
-
alias: false,
|
|
417
|
-
emoji: "❄️",
|
|
418
|
-
desc: "Commands cooldown after every command input",
|
|
419
|
-
id: "cooldown",
|
|
420
|
-
turnOff: [
|
|
421
|
-
{ id: " ", message: " " }
|
|
422
|
-
]
|
|
423
|
-
},
|
|
424
|
-
{
|
|
425
|
-
name: "autobio",
|
|
426
|
-
name2: "Autobio",
|
|
427
|
-
alias: false,
|
|
428
|
-
emoji: "💖",
|
|
429
|
-
desc: "Automatically change bot account status after every restart",
|
|
430
|
-
id: "autoBio",
|
|
431
|
-
turnOff: []
|
|
432
|
-
},
|
|
433
|
-
{
|
|
434
|
-
name: "autoblock",
|
|
435
|
-
name2: "Autoblock",
|
|
436
|
-
alias: false,
|
|
437
|
-
emoji: "🚏",
|
|
438
|
-
desc: "Automatically block if someone messages in private",
|
|
439
|
-
id: "autoBlock",
|
|
440
|
-
turnOff: [
|
|
441
|
-
{ id: "antipm", message: "> ☑️ Automatically Turned Off Antipm" },
|
|
442
|
-
{ id: "onlypm", message: "> ☑️ Automatically Turned Off Onlypm" }
|
|
443
|
-
]
|
|
444
|
-
},
|
|
445
|
-
{
|
|
446
|
-
name: "onlypm",
|
|
447
|
-
name2: "Onlypm",
|
|
448
|
-
alias: ["onlypc"],
|
|
449
|
-
emoji: "🐾",
|
|
450
|
-
desc: "Bot will run only in private chat",
|
|
451
|
-
id: "onlypm",
|
|
452
|
-
turnOff: [
|
|
453
|
-
{ id: "antipm", message: "> ☑️ Automatically Turned Off Antipm" },
|
|
454
|
-
{ id: "autoBlock", message: "> ☑️ Automatically Turned Off Autoblock" }
|
|
455
|
-
]
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
name: "antipm",
|
|
459
|
-
name2: "Antipm",
|
|
460
|
-
alias: ['onlygc', 'antipc'],
|
|
461
|
-
emoji: "🌀",
|
|
462
|
-
desc: `Bot will warn ${Config.warns} times then block if someone chats in private.`,
|
|
463
|
-
id: "antipm",
|
|
464
|
-
turnOff: [
|
|
465
|
-
{ id: "onlypm", message: "> ☑️ Automatically Turned Off Onlypm" },
|
|
466
|
-
{ id: "autoBlock", message: "> ☑️ Automatically Turned Off Autoblock" }
|
|
467
|
-
]
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
name: "autoread",
|
|
471
|
-
name2: "Auto Message Read",
|
|
472
|
-
alias: ['automsgread'],
|
|
473
|
-
emoji: "📑",
|
|
474
|
-
desc: "Automatically read upcoming messages",
|
|
475
|
-
id: "autoMsgRead",
|
|
476
|
-
turnOff: []
|
|
477
|
-
},
|
|
478
|
-
{
|
|
479
|
-
name: "autotyping",
|
|
480
|
-
name2: "Auto Typing",
|
|
481
|
-
alias: ['autotype'],
|
|
482
|
-
emoji: "✍🏻",
|
|
483
|
-
desc: "Auto typing seen switch",
|
|
484
|
-
id: "autoTyping",
|
|
485
|
-
turnOff: []
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
name: "welcome",
|
|
489
|
-
name2: "Welcome Message",
|
|
490
|
-
alias: false,
|
|
491
|
-
emoji: "💐",
|
|
492
|
-
desc: "Welcome message when someone enters the group chat",
|
|
493
|
-
id: "welcome",
|
|
494
|
-
turnOff: []
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
name: "goodbye",
|
|
498
|
-
name2: "Goodbye Message",
|
|
499
|
-
alias: false,
|
|
500
|
-
emoji: "👋🏻",
|
|
501
|
-
desc: "Goodbye message when someone left the group chat",
|
|
502
|
-
id: "goodbye",
|
|
503
|
-
turnOff: []
|
|
504
|
-
},
|
|
505
|
-
{
|
|
506
|
-
name: "pdm",
|
|
507
|
-
name2: "Promote/Demote Message",
|
|
508
|
-
alias: false,
|
|
509
|
-
emoji: "🧩",
|
|
510
|
-
desc: "Promote • Demote message when someone gets promoted to member or admin",
|
|
511
|
-
id: "pdm",
|
|
512
|
-
turnOff: []
|
|
513
|
-
},
|
|
514
|
-
{
|
|
515
|
-
name: "gcm",
|
|
516
|
-
name2: "Group Changes Messages",
|
|
517
|
-
alias: false,
|
|
518
|
-
emoji: "🎀",
|
|
519
|
-
desc: "Group changes messages",
|
|
520
|
-
id: "gcm",
|
|
521
|
-
turnOff: []
|
|
522
|
-
},
|
|
523
|
-
{
|
|
524
|
-
name: "antionce",
|
|
525
|
-
name2: "Anti Once View",
|
|
526
|
-
alias: ['antionceview'],
|
|
527
|
-
emoji: "🕜",
|
|
528
|
-
desc: "No one will be able to once view media in this group chat",
|
|
529
|
-
id: "antionce",
|
|
530
|
-
turnOff: []
|
|
531
|
-
}
|
|
532
|
-
];
|
|
533
|
-
|
|
534
|
-
ownerSwitches.forEach(switchObj => {
|
|
535
|
-
anya({
|
|
536
|
-
name: switchObj.name,
|
|
537
|
-
alias: switchObj.alias,
|
|
538
|
-
react: switchObj.emoji,
|
|
539
|
-
category: "owner",
|
|
540
|
-
desc: switchObj.desc,
|
|
541
|
-
rule: 1,
|
|
542
|
-
filename: __filename
|
|
543
|
-
},
|
|
544
|
-
async (anyaV2, pika, { db, args, prefix, command }) => {
|
|
545
|
-
const name = switchObj.name2;
|
|
546
|
-
const system = db.System?.[0] || await new System({ id: "system" }).save();
|
|
547
|
-
const reply = [];
|
|
548
|
-
if (/on/.test(args[0])) {
|
|
549
|
-
if (system[switchObj.id]) {
|
|
550
|
-
reply.push(`_${switchObj.emoji} Already \`Enabled\` ${name} Darling 💕_`);
|
|
551
|
-
} else {
|
|
552
|
-
await System.updateOne({ id: "system" }, { $set: { [switchObj.id]: true } }, { new: true });
|
|
553
|
-
reply.push(`✅ ${name} Turned \`On\`!`);
|
|
554
|
-
|
|
555
|
-
for (const { id, message } of switchObj.turnOff) {
|
|
556
|
-
await System.updateOne({ id: "system" }, { $set: { [id]: false } }, { new: true });
|
|
557
|
-
if (system[id]) reply.push(`\n${message}`);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
} else if (/off/.test(args[0])) {
|
|
561
|
-
if (!system[switchObj.id]) {
|
|
562
|
-
reply.push(`_${switchObj.emoji} Already \`Disabled\` ${name} Baby~ 💖_`);
|
|
563
|
-
} else {
|
|
564
|
-
await System.updateOne({ id: "system" }, { $set: { [switchObj.id]: false } }, { new: true });
|
|
565
|
-
reply.push(`✅ ${name} Turned \`Off\`!`);
|
|
566
|
-
}
|
|
567
|
-
} else {
|
|
568
|
-
const ui = db.UI?.[0] || (await new UI({ id: "userInterface" }).save());
|
|
569
|
-
if (ui.buttons) return await anyaV2.sendButtonText(pika.chat, {
|
|
570
|
-
text: "Choose a option below to turn `on/off, " + name + "`",
|
|
571
|
-
footer: Config.footer,
|
|
572
|
-
buttons: [
|
|
573
|
-
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"Turn On ✅\",\"id\":\"${prefix + command} on\"}` },
|
|
574
|
-
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"Turn Off ❌\",\"id\":\"${prefix + command} off\"}` },
|
|
575
|
-
]
|
|
576
|
-
}, { quoted: pika });
|
|
577
|
-
else return pika.reply(`Example: \`${prefix + command} on/off\`\n\n> Info: ${switchObj.desc}`);
|
|
578
|
-
}
|
|
579
|
-
pika.reply(reply.join("\n"));
|
|
580
|
-
});
|
|
581
|
-
});
|
|
582
|
-
|
|
583
|
-
//༺─────────────────────────────────────
|
|
584
|
-
|
|
585
|
-
anya({
|
|
586
|
-
name: "reactcmd",
|
|
587
|
-
alias: ['autoreact', 'autoreactcmd', 'autoreaction'],
|
|
588
|
-
react: "💝",
|
|
589
|
-
category: "owner",
|
|
590
|
-
desc: "Commands reaction switch",
|
|
591
|
-
rule: 1,
|
|
592
|
-
filename: __filename
|
|
593
|
-
}, async (anyaV2, pika, { db, args, prefix, command }) => {
|
|
594
|
-
const state = args.join(" ").toLowerCase();
|
|
595
|
-
const bot = db.Bot?.[0];
|
|
596
|
-
const system = db.System?.[0] || await new System({ id: "system" }).save();
|
|
597
|
-
const ui = db.UI?.[0] || (await new UI({ id: "userInterface" }).save());
|
|
598
|
-
let reply = [];
|
|
599
|
-
if (state === "on") {
|
|
600
|
-
if (bot.react) {
|
|
601
|
-
reply.push("_⭕ Command Reaction Already Enabled_");
|
|
602
|
-
} else {
|
|
603
|
-
await Bot.updateOne({ id: "anyabot" }, { react: true });
|
|
604
|
-
reply.push("✅ Command Reaction Turned On!");
|
|
605
|
-
if (system.autoReactMsg) {
|
|
606
|
-
await System.updateOne({ id: "system" }, { autoReactMsg: false });
|
|
607
|
-
reply.push("> ☑️ Automatically Turned Off Auto React All Messages");
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
} else if (state === "off") {
|
|
611
|
-
if (!bot.react) {
|
|
612
|
-
reply.push("_⭕ Command Reaction Already Disabled_");
|
|
613
|
-
} else {
|
|
614
|
-
await Bot.updateOne({ id: "anyabot" }, { react: false });
|
|
615
|
-
reply.push("✅ Command Reaction Turned Off!");
|
|
616
|
-
}
|
|
617
|
-
} else {
|
|
618
|
-
if (ui.buttons) {
|
|
619
|
-
return await anyaV2.sendButtonText(pika.chat, {
|
|
620
|
-
text: "Choose an option below to turn `on/off` Command Reaction:",
|
|
621
|
-
footer: Config.footer,
|
|
622
|
-
buttons: [
|
|
623
|
-
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"Turn On ✅\",\"id\":\"${prefix + command} on\"}` },
|
|
624
|
-
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"Turn Off ❌\",\"id\":\"${prefix + command} off\"}` }
|
|
625
|
-
]
|
|
626
|
-
}, { quoted: pika });
|
|
627
|
-
} else {
|
|
628
|
-
return pika.reply(`*${Config.themeemoji} Example:* ${prefix + command} on/off\n\n> Bot will react to command messages.`);
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
pika.reply(reply.join("\n"));
|
|
632
|
-
});
|
|
633
|
-
|
|
634
|
-
//༺─────────────────────────────────────
|
|
635
|
-
|
|
636
|
-
anya({
|
|
637
|
-
name: "reactmsg",
|
|
638
|
-
alias: ['reactionmsg'],
|
|
639
|
-
react: "💗",
|
|
640
|
-
category: "owner",
|
|
641
|
-
desc: "Auto React All Messages switch",
|
|
642
|
-
rule: 1,
|
|
643
|
-
filename: __filename
|
|
644
|
-
}, async (anyaV2, pika, { db, args, prefix, command }) => {
|
|
645
|
-
const state = args.join(" ").toLowerCase();
|
|
646
|
-
const system = db.System?.[0] || await new System({ id: "system" }).save();
|
|
647
|
-
const bot = db.Bot?.[0];
|
|
648
|
-
const ui = db.UI?.[0] || (await new UI({ id: "userInterface" }).save());
|
|
649
|
-
let reply = [];
|
|
650
|
-
if (state === "on") {
|
|
651
|
-
if (system.autoReactMsg) {
|
|
652
|
-
reply.push("_⭕ Auto React All Messages Already Enabled_");
|
|
653
|
-
} else {
|
|
654
|
-
await System.updateOne({ id: "system" }, { autoReactMsg: true });
|
|
655
|
-
reply.push("✅ Auto React All Messages Turned On!");
|
|
656
|
-
if (bot.react) {
|
|
657
|
-
await Bot.updateOne({ id: "anyabot" }, { react: false });
|
|
658
|
-
reply.push("> ☑️ Automatically Turned Off Command Reaction");
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
} else if (state === "off") {
|
|
662
|
-
if (!system.autoReactMsg) {
|
|
663
|
-
reply.push("_⭕ Auto React All Messages Already Disabled_");
|
|
664
|
-
} else {
|
|
665
|
-
await System.updateOne({ id: "system" }, { autoReactMsg: false });
|
|
666
|
-
reply.push("✅ Auto React All Messages Turned Off!");
|
|
667
|
-
}
|
|
668
|
-
} else {
|
|
669
|
-
if (ui.buttons) {
|
|
670
|
-
return await anyaV2.sendButtonText(pika.chat, {
|
|
671
|
-
text: "Choose an option below to turn `on/off` Auto React All Messages:",
|
|
672
|
-
footer: Config.footer,
|
|
673
|
-
buttons: [
|
|
674
|
-
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"Turn On ✅\",\"id\":\"${prefix + command} on\"}` },
|
|
675
|
-
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"Turn Off ❌\",\"id\":\"${prefix + command} off\"}` }
|
|
676
|
-
]
|
|
677
|
-
}, { quoted: pika });
|
|
678
|
-
} else {
|
|
679
|
-
return pika.reply(`*${Config.themeemoji} Example:* ${prefix + command} on/off\n\n> Bot will react to every message.`);
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
pika.reply(reply.join("\n"));
|
|
683
|
-
});
|
|
684
|
-
|
|
685
|
-
//༺─────────────────────────────────────
|
|
686
|
-
|
|
687
|
-
anya({
|
|
688
|
-
name: "autostatus",
|
|
689
|
-
react: "👀",
|
|
690
|
-
category: "owner",
|
|
691
|
-
desc: "Automatically mark contacts' statuses as seen",
|
|
692
|
-
rule: 1,
|
|
693
|
-
filename: __filename
|
|
694
|
-
}, async (anyaV2, pika, { db, args, prefix, command }) => {
|
|
695
|
-
const state = args.join(" ").toLowerCase();
|
|
696
|
-
const bot = db.Bot?.[0];
|
|
697
|
-
const ui = db.UI?.[0] || (await new UI({ id: "userInterface" }).save());
|
|
698
|
-
if (state === "on") {
|
|
699
|
-
if (bot.autoStatusRead) {
|
|
700
|
-
return pika.reply("_⭕ Already Enabled Auto Status View_");
|
|
701
|
-
} else {
|
|
702
|
-
await Bot.updateOne({ id: "anyabot" }, { autoStatusRead: true });
|
|
703
|
-
return pika.reply("✅ Enabled Auto Status View");
|
|
704
|
-
}
|
|
705
|
-
} else if (state === "off") {
|
|
706
|
-
if (!bot.autoStatusRead) {
|
|
707
|
-
return pika.reply("_⭕ Already Disabled Auto Status View_");
|
|
708
|
-
} else {
|
|
709
|
-
await Bot.updateOne({ id: "anyabot" }, { autoStatusRead: false });
|
|
710
|
-
return pika.reply("✅ Disabled Auto Status View");
|
|
711
|
-
}
|
|
712
|
-
} else {
|
|
713
|
-
if (ui.buttons) {
|
|
714
|
-
return await anyaV2.sendButtonText(pika.chat, {
|
|
715
|
-
text: "Choose an option below to turn `on/off` Auto Status Seen:",
|
|
716
|
-
footer: Config.footer,
|
|
717
|
-
buttons: [
|
|
718
|
-
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"Turn On ✅\",\"id\":\"${prefix + command} on\"}` },
|
|
719
|
-
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"Turn Off ❌\",\"id\":\"${prefix + command} off\"}` }
|
|
720
|
-
]
|
|
721
|
-
}, { quoted: pika });
|
|
722
|
-
} else {
|
|
723
|
-
return pika.reply(`*${Config.themeemoji} Example:* ${prefix + command} on/off\n\n> Bot will see contact list WhatsApp statuses.`);
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
});
|
|
727
|
-
|
|
728
|
-
//༺─────────────────────────────────────
|
|
729
|
-
|
|
730
|
-
anya({
|
|
731
|
-
name: "addwarn",
|
|
732
|
-
alias: ['warn'],
|
|
733
|
-
react: "📈",
|
|
734
|
-
need: "user",
|
|
735
|
-
category: "owner",
|
|
736
|
-
desc: "Warn users",
|
|
737
|
-
rule: 1,
|
|
738
|
-
filename: __filename
|
|
739
|
-
}, async (anyaV2, pika, { db, args, prefix, command }) => {
|
|
740
|
-
if (!pika.quoted && args.length < 1) return pika.reply(`Eg: ${prefix + command} @user1, @user2, @user3 etc...\n\n*Tag one or more users with "," between them to warn!*`);
|
|
741
|
-
const text = args.join(" ");
|
|
742
|
-
const users = pika.quoted ? [pika.quoted.sender] : text.split(',').map(v => v.replace(/[^0-9,]/g, '') + '@s.whatsapp.net');
|
|
743
|
-
const reason = users.length > 1 ? "can't specify" : (args.length > 0 ? text : "not provided");
|
|
744
|
-
const keyMsg = await pika.keyMsg(Config.message.wait);
|
|
745
|
-
const bot = db.Bot?.[0];
|
|
746
|
-
const botNumber = await anyaV2.decodeJid(anyaV2.user.id);
|
|
747
|
-
const userOwner = [...bot.modlist, Config.ownernumber, botNumber.split("@")[0]].map(v => v.replace(/[^0-9]/g) + "@s.whatsapp.net");
|
|
748
|
-
const caption = [];
|
|
749
|
-
const exceeded = [];
|
|
750
|
-
const userPromises = users.map(async i => {
|
|
751
|
-
const userId = i.split('@')[0];
|
|
752
|
-
const exist = await anyaV2.onWhatsApp(userId);
|
|
753
|
-
if (exist.length < 1) {
|
|
754
|
-
caption.push(`❌ Can't find *@${userId}* on WhatsApp`);
|
|
755
|
-
} else if (userOwner.includes(i)) {
|
|
756
|
-
caption.push(`🌟 Can't warn my owner *@${userId}*`);
|
|
757
|
-
} else {
|
|
758
|
-
const res = await addWarn(userId, { chat: pika.isGroup ? 1 : 2, reason });
|
|
759
|
-
if (res.status === 201 || res.status === 200) {
|
|
760
|
-
caption.push(`✅ Warned *@${userId}*\n└ _current warns : ${res.warn}/${Config.warns}_\n└ _reason : ${reason}_`);
|
|
761
|
-
} else if (res.status === 429) {
|
|
762
|
-
caption.push(`⭕ *@${userId}* already exceeded warns limit\n└ _current warns : ${res.warn}/${Config.warns}_\n└ _reason : ${reason}_`);
|
|
763
|
-
if (/after/.test(res.message)) {
|
|
764
|
-
exceeded.push(i);
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
});
|
|
769
|
-
await Promise.all(userPromises);
|
|
770
|
-
pika.edit(caption.join(caption.length > 2 ? '\n┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈\n' : '\n\n'), keyMsg.key, { mentions: users });
|
|
771
|
-
if (exceeded.length > 0) {
|
|
772
|
-
const array = exceeded.length > 1
|
|
773
|
-
? `${exceeded.slice(0, -1).map(v => "@" + v.split("@")[0]).join(", ")} and @${exceeded[exceeded.length - 1].split("@")[0]}`
|
|
774
|
-
: `@${exceeded[0].split("@")[0]}`;
|
|
775
|
-
const groupAdmins = await getAdmin(anyaV2, pika);
|
|
776
|
-
const isBotAdmin = pika.isGroup ? groupAdmins.includes(botNumber) : false;
|
|
777
|
-
await anyaV2.sendMessage(pika.chat, {
|
|
778
|
-
text: `💫 *${array}* exceeded their warn limits so I'm ${!isBotAdmin ? 'banning and blocking' : 'banning, blocking and kicking'} them!`,
|
|
779
|
-
mentions: exceeded
|
|
780
|
-
}, { quoted: pika });
|
|
781
|
-
await Promise.all(exceeded.map(async i => {
|
|
782
|
-
const userId = i.split("@")[0];
|
|
783
|
-
await anyaV2.updateBlockStatus(i, 'block');
|
|
784
|
-
await User.findOneAndUpdate({ id: userId }, { $set: { ban: true } }, { new: true });
|
|
785
|
-
if (isBotAdmin) {
|
|
786
|
-
await anyaV2.groupParticipantsUpdate(pika.chat, [i], 'remove');
|
|
787
|
-
}
|
|
788
|
-
}));
|
|
789
|
-
}
|
|
790
|
-
});
|
|
791
|
-
|
|
792
|
-
//༺─────────────────────────────────────
|
|
793
|
-
|
|
794
|
-
anya({
|
|
795
|
-
name: "delwarn",
|
|
796
|
-
react: "📉",
|
|
797
|
-
category: "owner",
|
|
798
|
-
need: "user",
|
|
799
|
-
desc: "Decrease user's warns",
|
|
800
|
-
rule: 1,
|
|
801
|
-
filename: __filename
|
|
802
|
-
}, async (anyaV2, pika, { args, prefix, command }) => {
|
|
803
|
-
if (!pika.quoted && args.length < 1) return pika.reply(`Eg: ${prefix + command} @user1, @user2, @user3 etc...\n\n*Tag one or more users with "," between them to decrease their warn!*`);
|
|
804
|
-
const text = args.join(" ");
|
|
805
|
-
const users = pika.quoted ? [pika.quoted.sender] : text.split(',').map(v => v.replace(/[^0-9,]/g, '') + '@s.whatsapp.net');
|
|
806
|
-
const reason = users.length > 1 ? "can't specify" : (args.length > 0 ? text : "not provided");
|
|
807
|
-
const keyMsg = await pika.keyMsg(Config.message.wait);
|
|
808
|
-
const caption = [];
|
|
809
|
-
const userPromises = users.map(async i => {
|
|
810
|
-
const userId = i.split('@')[0];
|
|
811
|
-
const exist = await anyaV2.onWhatsApp(userId);
|
|
812
|
-
if (exist.length < 1) {
|
|
813
|
-
caption.push(`❌ Can't find *@${userId}* on WhatsApp`);
|
|
814
|
-
} else {
|
|
815
|
-
const res = await delWarn(userId, { chat: pika.isGroup ? 1 : 2, reason });
|
|
816
|
-
if (res.status === 404 || (res.status === 200 && /already/.test(res.message))) {
|
|
817
|
-
caption.push(`❌ *@${userId}* has 0 warns\n└ _current warns : ${res.warn}/${Config.warns}_\n└ _reason : ${reason}_`);
|
|
818
|
-
} else if (res.status === 200 && /became/.test(res.message)) {
|
|
819
|
-
caption.push(`✅ Reseted *@${userId}'s* warns to 0\n└ _current warns : ${res.warn}/${Config.warns}_\n└ _reason : ${reason}_`);
|
|
820
|
-
} else if (res.status === 200 && /decreased/.test(res.message)) {
|
|
821
|
-
caption.push(`✅ Unwarned *@${userId}*\n└ _current warns : ${res.warn}/${Config.warns}_\n└ _reason : ${reason}_`);
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
});
|
|
825
|
-
await Promise.all(userPromises);
|
|
826
|
-
pika.edit(caption.join(caption.length > 2 ? '\n┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈\n' : '\n\n'), keyMsg.key, { mentions: users });
|
|
827
|
-
});
|
|
828
|
-
|
|
829
|
-
//༺─────────────────────────────────────
|
|
830
|
-
|
|
831
|
-
anya({
|
|
832
|
-
name: "resetwarn",
|
|
833
|
-
alias: ['clearwarn', 'resetwarns', 'clearwarns'],
|
|
834
|
-
react: "📊",
|
|
835
|
-
category: "owner",
|
|
836
|
-
need: "user",
|
|
837
|
-
desc: "Reset user's all warns",
|
|
838
|
-
rule: 1,
|
|
839
|
-
filename: __filename
|
|
840
|
-
}, async (anyaV2, pika, { args, prefix, command }) => {
|
|
841
|
-
if (!pika.quoted && args.length < 1) return pika.reply(`Eg: ${prefix + command} @user1, @user2, @user3 etc...\n\n*Tag one or more users with "," between them to reset their warn!*`);
|
|
842
|
-
const text = args.join(" ");
|
|
843
|
-
const users = pika.quoted ? [pika.quoted.sender] : text.split(',').map(v => v.replace(/[^0-9,]/g, '') + '@s.whatsapp.net');
|
|
844
|
-
const keyMsg = await pika.keyMsg(Config.message.wait);
|
|
845
|
-
const captions = await Promise.all(users.map(async (i) => {
|
|
846
|
-
const userId = i.split('@')[0];
|
|
847
|
-
const exist = await anyaV2.onWhatsApp(userId);
|
|
848
|
-
if (exist.length < 1) return `❌ Can't find *@${userId}* on WhatsApp`;
|
|
849
|
-
const res = await clearWarn(userId);
|
|
850
|
-
if (res.status === 404) {
|
|
851
|
-
return `❌ *@${userId}* has 0 warns\n└ _current warns : 0_`;
|
|
852
|
-
} else if (res.status === 200) {
|
|
853
|
-
return `✅ Reseted *@${userId}'s* warns to 0\n└ _current warns : 0_`;
|
|
854
|
-
}
|
|
855
|
-
}));
|
|
856
|
-
const filteredCaptions = captions.filter(Boolean);
|
|
857
|
-
pika.edit(
|
|
858
|
-
filteredCaptions.join(filteredCaptions.length > 1 ? '\n┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈\n' : '\n\n'),
|
|
859
|
-
keyMsg.key,
|
|
860
|
-
{ mentions: users }
|
|
861
|
-
);
|
|
862
|
-
});
|
|
863
|
-
|
|
864
|
-
//༺─────────────────────────────────────
|
|
865
|
-
|
|
866
|
-
anya({
|
|
867
|
-
name: "antiwords",
|
|
868
|
-
alias: ['antiword', 'antitoxic', 'antibad'],
|
|
869
|
-
react: "🎀",
|
|
870
|
-
category: "owner",
|
|
871
|
-
need: "words",
|
|
872
|
-
desc: "Add words to the antibad list",
|
|
873
|
-
rule: 1,
|
|
874
|
-
filename: __filename
|
|
875
|
-
}, async (anyaV2, pika, { db, args, prefix, command }) => {
|
|
876
|
-
const text = args.join(" ").toLowerCase();
|
|
877
|
-
if (/^on|off$/.test(args[0].toLowerCase())) return pika.reply(`Use \`${prefix}act <on|off>\` to turn on or off this function`);
|
|
878
|
-
if (!pika.quoted && args.length < 1) return pika.reply(`*Eg:* ${prefix + command} word1, word2, word3 etc...\n\n*Use ${prefix}enable antiword to enable antiwords*`);
|
|
879
|
-
const words = pika.quoted
|
|
880
|
-
? pika.quoted.text.split(',').map(v => v.trim().toLowerCase())
|
|
881
|
-
: text.split(',').map(v => v.trim().toLowerCase());
|
|
882
|
-
const system = db.System?.[0] || await new System({ id: "system" }).save();
|
|
883
|
-
const existings = system.badWords.filter(existing => words.some(newWord => existing.includes(newWord)));
|
|
884
|
-
const newWords = new Set([...system.badWords, ...words]);
|
|
885
|
-
if (existings.length === words.length) return pika.reply("❎ All words already exist");
|
|
886
|
-
system.badWords = Array.from(newWords);
|
|
887
|
-
await system.save();
|
|
888
|
-
const reply = [`✅ Added words to antiword: *${words.join("*, *")}*`];
|
|
889
|
-
if (existings.length > 0) reply.push(`⭕ Already existing antiwords: *${existings.join("*, *")}*`);
|
|
890
|
-
reply.push(`_Hint : Use ${prefix}delword to delete words_`);
|
|
891
|
-
return pika.reply(reply.join("\n\n"));
|
|
892
|
-
});
|
|
893
|
-
|
|
894
|
-
//༺─────────────────────────────────────
|
|
895
|
-
|
|
896
|
-
anya({
|
|
897
|
-
name: "delword",
|
|
898
|
-
alias: ['deleteword', 'removeword'],
|
|
899
|
-
react: "🗑️",
|
|
900
|
-
category: "owner",
|
|
901
|
-
need: "words",
|
|
902
|
-
desc: "Remove words from the antibad list",
|
|
903
|
-
rule: 1,
|
|
904
|
-
filename: __filename
|
|
905
|
-
}, async (anyaV2, pika, { db, args, prefix, command }) => {
|
|
906
|
-
if (args.length < 1) return pika.reply(`*Eg:* ${prefix + command} word1, word2, word3 etc...`);
|
|
907
|
-
const wordsToRemove = args.join(" ").split(',').map(v => v.trim().toLowerCase());
|
|
908
|
-
const system = db.System?.[0] || await new System({ id: "system" }).save();
|
|
909
|
-
// if (!system) return pika.reply("System not found.");
|
|
910
|
-
const existingWords = system.badWords.map(word => word.toLowerCase());
|
|
911
|
-
const wordsNotFound = wordsToRemove.filter(word => !existingWords.includes(word));
|
|
912
|
-
const wordsToRemoveFromList = wordsToRemove.filter(word => existingWords.includes(word));
|
|
913
|
-
if (wordsToRemoveFromList.length === 0) return pika.reply(`❎ Words not found in the antibad list: *${wordsNotFound.join("*, *")}*`);
|
|
914
|
-
system.badWords = existingWords.filter(word => !wordsToRemove.includes(word));
|
|
915
|
-
await system.save();
|
|
916
|
-
const responseMessages = [];
|
|
917
|
-
if (wordsToRemoveFromList.length > 0) {
|
|
918
|
-
responseMessages.push(`✅ Removed words from antiword: *${wordsToRemoveFromList.join("*, *")}*`);
|
|
919
|
-
}
|
|
920
|
-
if (wordsNotFound.length > 0) {
|
|
921
|
-
responseMessages.push(`⭕ Words not found in antiword: *${wordsNotFound.join("*, *")}*`);
|
|
922
|
-
}
|
|
923
|
-
return pika.reply(responseMessages.join("\n\n"));
|
|
924
|
-
});
|
|
925
|
-
|
|
926
|
-
//༺─────────────────────────────────────
|
|
927
|
-
|
|
928
|
-
anya({
|
|
929
|
-
name: "listword",
|
|
930
|
-
alias: ['showwords', 'viewwords'],
|
|
931
|
-
react: "📜",
|
|
932
|
-
category: "owner",
|
|
933
|
-
need: "words",
|
|
934
|
-
desc: "List all words in the antibad list",
|
|
935
|
-
rule: 1,
|
|
936
|
-
filename: __filename
|
|
937
|
-
}, async (anyaV2, pika, { db, prefix, command }) => {
|
|
938
|
-
const system = db.System?.[0] || await new System({ id: "system" }).save();
|
|
939
|
-
if (!system || !system.badWords || system.badWords.length === 0) return pika.reply(`*🤖 Bot Name:* ${Config.botname}\n*📃 Total Anti Words:* _0 words_\n\nNo antiwords found.`);
|
|
940
|
-
const antiWordsList = system.badWords.map((word, index) => `${index + 1}. ${word}`).join('\n');
|
|
941
|
-
const totalWords = system.badWords.length;
|
|
942
|
-
const reply = `*🤖 Bot Name:* ${Config.botname}\n*📃 Total Anti Words:* _${totalWords} words_\n\n🍄 List Of Anti Words:\n${antiWordsList}\n\n> ${Config.footer}`;
|
|
943
|
-
return pika.reply(reply);
|
|
944
|
-
});
|
|
945
|
-
|
|
946
|
-
//༺─────────────────────────────────────
|
|
947
|
-
|
|
948
|
-
anya({
|
|
949
|
-
name: "antifake",
|
|
950
|
-
react: "🤥",
|
|
951
|
-
category: "owner",
|
|
952
|
-
desc: "Remove fake numbers from the group",
|
|
953
|
-
rule: 2,
|
|
954
|
-
filename: __filename
|
|
955
|
-
}, async (anyaV2, pika, { db, args, prefix, command }) => {
|
|
956
|
-
const text = args.join(" ").toLowerCase();
|
|
957
|
-
const system = db.System?.[0] || await new System({ id: "system" }).save();
|
|
958
|
-
if (/on/.test(text)) {
|
|
959
|
-
if (system.fakelist.length < 1) return pika.reply(`❕Please add country codes to the fake list using *${prefix}addantifake* before turning it on.`);
|
|
960
|
-
if (system.antifake) return pika.reply("_⭕ Already Enabled Antifake_");
|
|
961
|
-
if (!pika.isGroup) return;
|
|
962
|
-
const botNumber = await anyaV2.decodeJid(anyaV2.user.id);
|
|
963
|
-
const groupAdmins = await getAdmin(anyaV2, pika);
|
|
964
|
-
const metadata = await anyaV2.groupMetadata(pika.chat);
|
|
965
|
-
await System.updateOne({ id: "system" }, { $set: { antifake: true } }, { new: true });
|
|
966
|
-
pika.reply("✅ Antifake Turned On!");
|
|
967
|
-
const fakelist = new Set(system.fakelist);
|
|
968
|
-
for (const mem of metadata.participants) {
|
|
969
|
-
const code = PhoneNumber('+' + mem.id.split('@')[0]).getCountryCode();
|
|
970
|
-
if (fakelist.has(Number(code))) {
|
|
971
|
-
try {
|
|
972
|
-
await anyaV2.groupParticipantsUpdate(pika.chat, [mem.id], 'remove');
|
|
973
|
-
} catch (e) {
|
|
974
|
-
console.error("☎️ Antifake Error:", e);
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
} else if (/off/.test(text)) {
|
|
979
|
-
if (!system.antifake) {
|
|
980
|
-
return pika.reply("_⭕ Already Disabled Antifake_");
|
|
981
|
-
}
|
|
982
|
-
await System.updateOne({ id: "system" }, { $set: { antifake: false } }, { new: true });
|
|
983
|
-
return pika.reply("✅ Antifake Turned Off!");
|
|
984
|
-
} else {
|
|
985
|
-
pika.reply(`*${Config.themeemoji} Example:* ${prefix + command} on/off\n\n> Bot will remove group members by detecting entered country codes.`);
|
|
986
|
-
}
|
|
987
|
-
});
|
|
988
|
-
|
|
989
|
-
//༺─────────────────────────────────────
|
|
990
|
-
|
|
991
|
-
anya({
|
|
992
|
-
name: "addantifake",
|
|
993
|
-
react: "📈",
|
|
994
|
-
category: "owner",
|
|
995
|
-
need: "numbers",
|
|
996
|
-
desc: "Add fake numbers country codes",
|
|
997
|
-
rule: 1,
|
|
998
|
-
filename: __filename
|
|
999
|
-
}, async (anyaV2, pika, { db, args, prefix, command }) => {
|
|
1000
|
-
if (!pika.quoted && args.length < 1) return pika.reply(`*Eg:* ${prefix + command} +1, +44, +92 etc...`);
|
|
1001
|
-
const text = args.join(" ");
|
|
1002
|
-
const numbers = pika.quoted
|
|
1003
|
-
? pika.quoted.text.split(',').map(v => v.trim().replace(/[^0-9]/g, ''))
|
|
1004
|
-
: text.split(',').map(v => v.trim().replace(/[^0-9]/g, ''));
|
|
1005
|
-
if (numbers.length === 0) return pika.reply(`*Eg:* ${prefix + command} +1, +44, +92 etc...`);
|
|
1006
|
-
const system = db.System?.[0] || await new System({ id: "system" }).save();
|
|
1007
|
-
const existingCodes = new Set(system.fakelist.map(num => num.replace(/[^0-9]/g, '')));
|
|
1008
|
-
const newNumbers = new Set(numbers);
|
|
1009
|
-
const alreadyExists = Array.from(newNumbers).filter(num => existingCodes.has(num));
|
|
1010
|
-
const toAdd = Array.from(newNumbers).filter(num => !existingCodes.has(num));
|
|
1011
|
-
if (toAdd.length === 0) return pika.reply("❎ All country codes already exist");
|
|
1012
|
-
system.fakelist = Array.from(new Set([...existingCodes, ...toAdd]));
|
|
1013
|
-
await system.save();
|
|
1014
|
-
const reply = [
|
|
1015
|
-
`✅ Added country codes to antifake: *+${toAdd.join("*, *+")}*`,
|
|
1016
|
-
alreadyExists.length > 0 ? `⭕ Already existing country codes: *+${alreadyExists.join("*, *+")}*` : '',
|
|
1017
|
-
`_Hint : Use ${prefix}delantifake to delete country codes_`
|
|
1018
|
-
].filter(Boolean).join("\n\n");
|
|
1019
|
-
return pika.reply(reply);
|
|
1020
|
-
});
|
|
1021
|
-
|
|
1022
|
-
//༺─────────────────────────────────────
|
|
1023
|
-
|
|
1024
|
-
anya({
|
|
1025
|
-
name: "delantifake",
|
|
1026
|
-
react: "🗑️",
|
|
1027
|
-
category: "owner",
|
|
1028
|
-
need: "numbers",
|
|
1029
|
-
desc: "Delete fake numbers country codes",
|
|
1030
|
-
rule: 1,
|
|
1031
|
-
filename: __filename
|
|
1032
|
-
}, async (anyaV2, pika, { db, args, prefix, command }) => {
|
|
1033
|
-
if (args.length < 1) return pika.reply(`*Eg:* ${prefix + command} +1, +44, +92 etc...`);
|
|
1034
|
-
const text = args.join(" ");
|
|
1035
|
-
const numbers = text.split(',').map(v => v.trim().replace(/[^0-9]/g, ''));
|
|
1036
|
-
if (numbers.length === 0) return pika.reply(`*Eg:* ${prefix + command} +1, +44, +92 etc...`);
|
|
1037
|
-
const system = db.System?.[0] || await new System({ id: "system" }).save();
|
|
1038
|
-
const existingCodes = new Set(system.fakelist.map(num => num.replace(/[^0-9]/g, '')));
|
|
1039
|
-
const toRemove = numbers.filter(num => existingCodes.has(num));
|
|
1040
|
-
const notFound = numbers.filter(num => !existingCodes.has(num));
|
|
1041
|
-
if (toRemove.length === 0) return pika.reply(`❎ Country codes not found in the antifake list: *+${notFound.join("*, *+")}*`);
|
|
1042
|
-
system.fakelist = Array.from(existingCodes).filter(num => !numbers.includes(num));
|
|
1043
|
-
await system.save();
|
|
1044
|
-
const reply = [
|
|
1045
|
-
`✅ Removed country codes from antifake list: *+${toRemove.join("*, *+")}*`,
|
|
1046
|
-
notFound.length > 0 ? `⭕ Country codes not found in antifake list: *+${notFound.join("*, *+")}*` : ''
|
|
1047
|
-
].filter(Boolean).join("\n\n");
|
|
1048
|
-
return pika.reply(reply);
|
|
1049
|
-
});
|