├── .gitignore ├── LICENSE ├── Procfile ├── README.md ├── index.js ├── install.sh ├── lib ├── actions │ ├── call.js │ ├── chat.js │ ├── connect.js │ └── group.js ├── color.js ├── command.js ├── command │ ├── asupan.js │ ├── downloader.js │ ├── fun.js │ ├── generator.js │ ├── group.js │ ├── image.js │ ├── info.js │ ├── islamic.js │ ├── maker.js │ ├── menu.js │ ├── multipleclient.js │ ├── news.js │ ├── other.js │ ├── owner.js │ ├── random.js │ ├── randomtag.js │ ├── search.js │ ├── stalk.js │ └── tools.js └── functions.js ├── main.js ├── package.json └── src ├── images ├── 20210929_010325.jpg ├── 20210929_225016.png ├── logo.jpg ├── wallpaper1.jpg └── wallpaper2.jpg ├── json ├── botInfo.json ├── group.json ├── media.json └── user.json └── kali.cat /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | src/json/botInfo.json 4 | src/json/user.json 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published by 637 | the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | worker: npm start 2 | worker2: node index.js 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |

3 | 4 |

5 | 6 |

7 |

8 | GitHub 9 |

10 |
11 | 12 |

13 | WhatsApp 14 | Deploy To Heroku 15 |

16 | 17 | ### Description 18 | Bot ini dibuat menggunakan base dari [`Zobin33`](https://github.com/Zobin33) 19 | 20 | Jika ada pertanyaan atau request sesuatu, kamu bisa masukkan issue 21 | 22 | ### Changelog 23 | ```rb 24 | Added Feature 25 | - Shortlink 26 | ``` 27 | 28 | ## Installation 29 | * [`Download ffmpeg`](https://ffmpeg.org/download.html#build-windows) and set path 30 | * [`Download wget`](https://eternallybored.org/misc/wget/releases/) and set path 31 | * [`Download Node JS`](https://nodejs.org/en/download/) 32 | * [`Download Git`](https://git-scm.com/downloads) 33 | ```cmd 34 | > git clone https://github.com/Zacros-Team/ZacrosBot 35 | > cd Zacros 36 | > npm i -g 37 | ``` 38 | 39 | ## Run Bot 40 | ```cmd 41 | $ cd ZacrosBot 42 | $ node . 43 | ``` 44 | 45 | ## Yang perlu di edit 46 | [`./src/botInfo.json`](./src/json/botInfo.json) 47 | 48 | ### Owner Number 49 | `Ex : "62884677889"`
50 | If you want to add multiple owners
51 | Example : `["62xxxxxx","62xxxxxx"]` 52 | 53 | ### Special Thanks To 54 | 55 | * Allah | God 56 | * Nabi Muhammad Saw 57 | * Keluarga 58 | * [`Adiwajshing`](https://github.com/adiwajshing/Baileys) 59 | * [`Zobin33`](https://github.com/Zobin33) 60 | * [`Rrull`](https://github.com/arl03) 61 | * [`Dt`](https://github.com/Dete4) 62 | * [`VEXG`](https://github.com/VEXG) 63 | * [`Manurios`](http://wa.me/50377257600) 64 | * [`Lindow Amamiya`](https://github.com/mccnlight) 65 | * [`Loli Protector`](https://github.com/Arya-was) 66 | * [`Anu Team`](https://chat.whatsapp.com/JMGFxm0SSEF9Ajm0MWJtzh) 67 | 68 | 69 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const { spawn } = require("child_process"); 2 | const path = require("path"); 3 | const fs = require("fs"); 4 | var isRunning = false; 5 | 6 | function start(file) { 7 | if (isRunning) return; 8 | isRunning = true; 9 | let pathFile = [path.join(__dirname, file), ...process.argv.slice(2)]; 10 | let run = spawn(process.argv[0], pathFile, { 11 | stdio: ["inherit", "inherit", "inherit", "ipc"], 12 | }); 13 | run.on("message", (data) => { 14 | switch (data) { 15 | case "reset": 16 | run.kill(); 17 | isRunning = false; 18 | start.apply(this, arguments); 19 | break; 20 | case "uptime": 21 | run.send(process.uptime()); 22 | break; 23 | case "close": 24 | run.kill(); 25 | process.kill(); 26 | break; 27 | } 28 | }); 29 | run.on("exit", (code) => { 30 | isRunning = false; 31 | if (code == 1) return process.kill(); 32 | console.error("Exited with code:", code); 33 | fs.watchFile(pathFile[0], () => { 34 | fs.unwatchFile(pathFile[0]); 35 | start(file); 36 | }); 37 | }); 38 | } 39 | start("main.js"); 40 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | apt-get update && apt-get upgrade 3 | apt-get install git libwebp ffmpeg nodejs 4 | npm install -g 5 | echo "Instalation Complete, Donate Lah Bang:v" -------------------------------------------------------------------------------- /lib/actions/call.js: -------------------------------------------------------------------------------- 1 | client.on("CB:Call", (json) => { 2 | if (botinfo.settings.callBlock == true) { 3 | client 4 | .query({ 5 | json: [ 6 | "action", 7 | "call", 8 | [ 9 | "call", 10 | { 11 | from: client.user.jid, 12 | to: json[1].from, 13 | id: baileys.generateMessageID(), 14 | }, 15 | [ 16 | [ 17 | "reject", 18 | { 19 | "call-id": json[1].id, 20 | "call-creator": json[1].from, 21 | count: "0", 22 | }, 23 | null, 24 | ], 25 | ], 26 | ], 27 | ], 28 | }) 29 | .then(() => { 30 | setTimeout(async () => { 31 | if (client.blocklist.includes(json[1].from)) return; 32 | client.blockUser(json[1].from, "add"); 33 | }, 3000); 34 | }) 35 | .catch(); 36 | } 37 | }); 38 | -------------------------------------------------------------------------------- /lib/actions/chat.js: -------------------------------------------------------------------------------- 1 | client.on("chat-update", async (chat) => { 2 | try { 3 | if (!chat.hasNewMessage) return; 4 | if ( 5 | !Object.keys(chat.messages.array[0]).includes("message") || 6 | !Object.keys(chat.messages.array[0]).includes("key") 7 | ) 8 | return; 9 | const msg = await functions.metadataMsg(client, chat.messages.array[0]); 10 | if (msg.key.id.length < 20 || msg.key.remoteJid == "status@broadcast") 11 | return; 12 | cmd.execute(msg); 13 | cmd.handlerB(msg); 14 | if (botinfo.settings.autoRead == true) { 15 | client.chatRead(msg.from); 16 | } 17 | } catch (e) { 18 | if (!String(e).includes("this.isZero")) { 19 | console.log(e); 20 | await client.sendMessage( 21 | botinfo.ownerNumber[0] + `@s.whatsapp.net`, 22 | "Info Error!", 23 | "conversation" 24 | ); 25 | await client.sendMessage( 26 | botinfo.ownerNumber[0] + `@s.whatsapp.net`, 27 | functions.util.format(e), 28 | "conversation" 29 | ); 30 | return 1; 31 | } 32 | } 33 | }); 34 | -------------------------------------------------------------------------------- /lib/actions/connect.js: -------------------------------------------------------------------------------- 1 | var alreadyConnected = false; 2 | 3 | client.on("qr", async (qr) => { 4 | console.log("Scan Qr Di Atas"); 5 | await functions.delay(7000); 6 | }); 7 | 8 | client.on("connecting", (anu, ena) => { 9 | if (alreadyConnected) { 10 | functions.animate.add("Connecting", { 11 | text: "Menghubungkan Ulang Ke Koneksi " + client.user.name, 12 | }); 13 | } else { 14 | functions.animate.add("Connecting", { 15 | text: "Menghubungkan Ke Koneksi....", 16 | }); 17 | } 18 | }); 19 | 20 | client.on("open", () => { 21 | alreadyConnected = true; 22 | functions.animate.succeed("Connecting", { 23 | text: "Sukses Terhubung Ke " + client.user.name, 24 | }); 25 | botinfo.session = client.base64EncodedAuthInfo(); 26 | functions.fs.writeFileSync( 27 | "./src/json/botInfo.json", 28 | JSON.stringify(botinfo, null, 2) 29 | ); 30 | }); 31 | 32 | client.on("close", ({ isReconnecting, reason }) => { 33 | isReconnecting 34 | ? console.log( 35 | functions.logColor( 36 | `✖ Koneksi Terputus, Mencoba Mengubungkan Ulang Ke ` + 37 | client.user.name, 38 | "red" 39 | ) 40 | ) 41 | : console.log( 42 | functions.logColor(`✖ Koneksi Terputus, Menutup Koneksi`, "red") 43 | ) && process.send("close"); 44 | }); 45 | -------------------------------------------------------------------------------- /lib/actions/group.js: -------------------------------------------------------------------------------- 1 | client.on("group-participants-update", async (group_update) => { 2 | if (!groupDb[group_update.jid]?.welcome) return; 3 | let groupData = await client.groupMetadata(group_update.jid); 4 | let pp_user = await client 5 | .getProfilePicture(group_update.participants[0]) 6 | .catch( 7 | async () => 8 | await client 9 | .getProfilePicture(group_update.jid) 10 | .catch( 11 | () => 12 | `https://i.pinimg.com/200x150/14/11/f1/1411f1484bcdafaad19ef411dc601831.jpg` 13 | ) 14 | ); 15 | let buffer = (await client.getBuffer(pp_user)).buffer; 16 | let locationMessage = { 17 | jpegThumbnail: buffer, 18 | }; 19 | let buttons = [ 20 | { 21 | buttonId: `.menu`, 22 | buttonText: { 23 | displayText: `Menu Bot`, 24 | }, 25 | type: 1, 26 | }, 27 | ]; 28 | let user_number = ``; 29 | let user_name = ``; 30 | let user_tag = ``; 31 | let user_link = ``; 32 | for (let a of group_update.participants) { 33 | user_number = a.split("@")[0] + ` `; 34 | user_link = `https://wa.me/` + a.split("@")[0]; 35 | user_tag = `@` + a.split("@")[0] + ` `; 36 | user_name = client.contacts[a] 37 | ? client.contacts[a].name || 38 | client.contacts[a].vname || 39 | client.contacts[a].notify || 40 | client.contacts[a].short || 41 | "Unknown" 42 | : "Unknown" + ` `; 43 | } 44 | user_number = user_number.trim(); 45 | user_name = user_name.trim(); 46 | user_tag = user_tag.trim(); 47 | user_link = user_link.trim(); 48 | let content = groupDb[group_update.jid].welcome[group_update.action] 49 | .replace(/%user_number/gi, user_number) 50 | .replace(/%user_name/gi, user_name) 51 | .replace(/%user_link/gi, user_link) 52 | .replace(/%user_tag/gi, user_tag) 53 | .replace(/%group_name/gi, groupData.subject) 54 | .replace(/%group_desc/, groupData.desc); 55 | let buttonsMessage = { 56 | locationMessage, 57 | footerText: `${ 58 | group_update.action[0].toUpperCase() + group_update.action.slice(1) 59 | } Message...`, 60 | contentText: content, 61 | buttons, 62 | headerType: "LOCATION", 63 | contextInfo: { 64 | mentionedJid: group_update.participants, 65 | }, 66 | }; 67 | client.sendMessageFromContent(group_update.jid, { 68 | buttonsMessage, 69 | }); 70 | }); 71 | -------------------------------------------------------------------------------- /lib/color.js: -------------------------------------------------------------------------------- 1 | const chalk = require("chalk"); 2 | 3 | const color = (text, color) => { 4 | return !color ? chalk.green(text) : chalk.keyword(color)(text); 5 | }; 6 | 7 | const bgcolor = (text, bgcolor) => { 8 | return !bgcolor ? chalk.green(text) : chalk.bgKeyword(bgcolor)(text); 9 | }; 10 | 11 | module.exports = { 12 | color, 13 | bgcolor, 14 | }; 15 | -------------------------------------------------------------------------------- /lib/command.js: -------------------------------------------------------------------------------- 1 | class Command { 2 | constructor(client, botinfo, functions) { 3 | this._events = []; 4 | this._handler = {}; 5 | this._tags = {}; 6 | this.default_prefix = /^z/; 7 | this.prefix = botinfo.prefix.map((tr) => 8 | tr instanceof RegExp 9 | ? tr 10 | : new RegExp(`^(${functions.parseRegex(tr)})`, "i") 11 | ); 12 | this.client = client; 13 | this.functions = functions; 14 | this.botinfo = botinfo; 15 | } 16 | 17 | before(eventName, callback = () => {}, opt = {}) { 18 | let eventObj = Object.keys(this._handler); 19 | let nitip = !this._handler[eventName] 20 | ? `Loading Event|Command ${eventName}` 21 | : `Checking Event|Command ${eventName}`; 22 | this._handler[eventName] = { 23 | eventName, 24 | callback, 25 | ...opt, 26 | }; 27 | } 28 | 29 | handlerB(msg) { 30 | return new Promise(async (resolve, reject) => { 31 | for (let eventCmd in this._handler) { 32 | try { 33 | let event = this._handler[eventCmd]; 34 | await event.callback(msg, { 35 | ...msg, 36 | client: this.client, 37 | }); 38 | resolve({ 39 | status: 200, 40 | response: "ok", 41 | event: event, 42 | msg, 43 | }); 44 | } catch (e) { 45 | let data = { 46 | response: "bad", 47 | status: null, 48 | event: event.eventName, 49 | error: functions.util.format(e), 50 | }; 51 | console.log(data); 52 | this.client.sendMessage( 53 | botinfo.ownerNumber[0] + "@s.whatsapp.net", 54 | this.functions.util.format(data), 55 | "conversation" 56 | ); 57 | return; 58 | } 59 | } 60 | }); 61 | } 62 | 63 | on(eventName, command = [], tags = [], callback = () => {}, opt = {}) { 64 | let eventObj = Object.keys(this._events); 65 | let nitip = !this._events[eventName] 66 | ? `Loading Event|Command ${eventName}` 67 | : `Checking Event|Command ${eventName}`; 68 | let regCommand = command.map((tr) => 69 | tr instanceof RegExp 70 | ? tr 71 | : new RegExp(`^(${functions.parseRegex(tr)})`, "i") 72 | ); 73 | let result_event = { 74 | eventName, 75 | _command: regCommand, 76 | command: command.map((tr) => tr.toString()), 77 | callback, 78 | usedPrefix: true, 79 | enable: true, 80 | tags, 81 | info: "Tidak Ada Info", 82 | ...opt, 83 | }; 84 | this._events.push(result_event); 85 | this.functions.logLoading(`${nitip}`); 86 | for (let a of tags) { 87 | this._tags[a] = Boolean(this._tags[a]) ? this._tags[a] : []; 88 | this._tags[a].push(result_event); 89 | } 90 | } 91 | 92 | modify(name = -1, objectName = "", toValue = "") { 93 | let index = this._events.findIndex((tr) => tr.eventName == name); 94 | if (!this._events[index]) return; 95 | this._events[index][objectName] = toValue; 96 | return this._events[index]; 97 | } 98 | 99 | async execute(msg) { 100 | try { 101 | let cmds = []; 102 | let events = []; 103 | for (let event of this._events) { 104 | if (!event.enable) continue; 105 | let findPrefix = this.prefix.filter((tr) => tr.test(msg.string)); 106 | findPrefix = findPrefix.sort( 107 | (a, b) => b.toString().length - a.toString().length 108 | ); 109 | findPrefix = findPrefix[0]; 110 | var prefix = !event.usedPrefix 111 | ? event._command.find((tr) => tr.test(msg.string)) && 112 | event._command.find((tr) => tr.test(msg.string)).exec(msg.string) 113 | : (findPrefix && findPrefix.exec(msg.string)) || 114 | this.default_prefix.exec(msg.string); 115 | prefix = prefix || event.stc; 116 | if (!prefix) continue; 117 | var usedPref = prefix[0]; 118 | var stringCmd = event.usedPrefix 119 | ? msg.string.replace(usedPref, "") 120 | : "" + msg.string; 121 | var findCmd = event._command.filter((tr) => tr.test(stringCmd)); 122 | if (findCmd.length < 1) continue; 123 | cmds = cmds.concat( 124 | typeof msg.body == "object" && 125 | event.stc && 126 | event.stc == msg.body.fileSha256 127 | ? [event._command] 128 | : findCmd 129 | ); 130 | events.push(event); 131 | } 132 | if (cmds.length < 1) return; 133 | cmds = cmds.sort((a, b) => b.toString().length - a.toString().length); 134 | let cmd = cmds[0].exec(stringCmd); 135 | let command = cmd[0]; 136 | var event = events.find((tr) => 137 | tr._command.find( 138 | (rt) => 139 | rt.toString().toLowerCase().trim() == 140 | cmds[0].toString().toLowerCase().trim() 141 | ) 142 | ); 143 | if (!event) return; 144 | let commandNpref = event?.usedPrefix ? usedPref + command : command; 145 | let args = msg.string.split(" "); 146 | let text = msg.string; 147 | let query = msg.string.replace(commandNpref, "").trim(); 148 | let number = Number(msg.string.replace(/[^0-9]/g, "")); 149 | let isOwner = msg.isOwner; 150 | let group = msg.isGroup ? await msg.groupMetadata() : false; 151 | let isAdmin = (msg.isGroup && msg.sender.isAdmin) || isOwner; 152 | let quotedMsg = msg.quotedMsg ? await msg.loadQuotedMsg() : false; 153 | let isUrl = this.functions.isUrl(query); 154 | if (!userDb[msg.sender.jid] && !event.eventName.includes("register")) { 155 | userDb[msg.sender.jid] = msg.sender; 156 | return functions.fs.writeFileSync( 157 | "./src/json/user.json", 158 | JSON.stringify(userDb, null, 2) 159 | ); 160 | } 161 | if (event.group && !msg.isGroup) { 162 | let resultResponse = 163 | typeof event.group == "boolean" 164 | ? this.botinfo.response.group 165 | : event.group; 166 | if (resultResponse == "--noresp") return; 167 | return this.client.reply(msg, resultResponse); 168 | } 169 | if (event.private && msg.isGroup) { 170 | let resultResponse = 171 | typeof event.private == "boolean" 172 | ? this.botinfo.response.private 173 | : event.private; 174 | if (resultResponse == "--noresp") return; 175 | return this.client.reply(msg, resultResponse); 176 | } 177 | if (event.admin && !isAdmin) { 178 | let resultResponse = 179 | typeof event.admin == "boolean" 180 | ? this.botinfo.response.admin 181 | : event.admin; 182 | if (resultResponse == "--noresp") return; 183 | return this.client.reply(msg, resultResponse); 184 | } 185 | if (event.clientAdmin && !msg.client.isAdmin) { 186 | let resultResponse = 187 | typeof event.clientAdmin == "boolean" 188 | ? this.botinfo.response.botAdmin 189 | : event.clientAdmin; 190 | if (resultResponse == "--noresp") return; 191 | return this.client.reply(msg, resultResponse); 192 | } 193 | if (event.owner && !isOwner) { 194 | let resultResponse = 195 | typeof event.owner == "boolean" 196 | ? this.botinfo.response.owner 197 | : event.owner; 198 | if (resultResponse == "--noresp") return; 199 | return this.client.reply(msg, resultResponse); 200 | } 201 | if (event.fromMe && quotedMsg && !quotedMsg.fromMe) { 202 | let resultResponse = 203 | typeof event.fromMe == "boolean" 204 | ? this.botinfo.response.fromMe 205 | : event.fromMe; 206 | if (resultResponse == "--noresp") return; 207 | return this.client.reply(msg, resultResponse); 208 | } 209 | if (event.query && query.length < 1) { 210 | let resultResponse = 211 | typeof event.query == "boolean" 212 | ? this.botinfo.response.query 213 | : event.query; 214 | if (resultResponse == "--noresp") return; 215 | return this.client.reply(msg, resultResponse); 216 | } 217 | if (event.url && !query.startsWith("http")) query = "https://" + query; 218 | if (event.url && !isUrl) { 219 | let resultResponse = 220 | typeof event.url == "boolean" 221 | ? this.botinfo.response.notUrl 222 | : event.url; 223 | if (resultResponse == "--noresp") return; 224 | return this.client.reply(msg, resultResponse); 225 | } 226 | //if (event.url && isUrl && !(new RegExp(this.functions.parseRegex(event.url),'gi').test(isUrl[0]))) return this.client.reply(msg,this.botinfo.response.notUrl + `, Link Yang Anda Masukan Bukan Dari ${event.url}`); 227 | if (event.media && !msg.isMedia) { 228 | let resultResponse = 229 | typeof event.media == "boolean" 230 | ? this.botinfo.response.media 231 | : event.media; 232 | if (resultResponse == "--noresp") return; 233 | return this.client.reply(msg, resultResponse); 234 | } 235 | if (event.mention && !msg.mentionedJid) { 236 | let resultResponse = 237 | typeof event.mention == "boolean" 238 | ? this.botinfo.response.mention 239 | : event.mention; 240 | if (resultResponse == "--noresp") return; 241 | return this.client.reply(msg, resultResponse); 242 | } 243 | if (event.quoted && !msg.quotedMsg) { 244 | let resultResponse = 245 | typeof event.quoted == "boolean" 246 | ? this.botinfo.response.quoted 247 | : event.quoted; 248 | if (resultResponse == "--noresp") return; 249 | return this.client.reply(msg, resultResponse); 250 | } 251 | if ( 252 | event._media && 253 | !msg.isMedia && 254 | (!quotedMsg || (quotedMsg && !quotedMsg.isMedia)) 255 | ) { 256 | let resultResponse = 257 | typeof event._media == "boolean" 258 | ? this.botinfo.response._media 259 | : event._media; 260 | if (resultResponse == "--noresp") return; 261 | return this.client.reply(msg, resultResponse); 262 | } 263 | if (event.wait) { 264 | typeof event.wait === "boolean" 265 | ? client.reply(msg, this.botinfo.response.wait) 266 | : client.reply(msg, event.wait); 267 | } 268 | if (event.info && msg.string.endsWith("--info")) 269 | return this.client.reply(msg, event.info); 270 | if (event.usage && msg.string.endsWith("--contoh")) 271 | return await event.usage({ 272 | text, 273 | group, 274 | isUrl, 275 | isAdmin, 276 | isClientAdmin, 277 | query, 278 | command, 279 | commandNpref, 280 | prefix, 281 | usedPref, 282 | args, 283 | cmd, 284 | number, 285 | msg, 286 | client: this.client, 287 | quotedMsg, 288 | }); 289 | event.callback(msg, { 290 | text, 291 | group, 292 | isUrl, 293 | isAdmin, 294 | query, 295 | command, 296 | commandNpref, 297 | prefix, 298 | usedPref, 299 | args, 300 | cmd, 301 | number, 302 | ...msg, 303 | client: this.client, 304 | quotedMsg, 305 | }); 306 | } catch (e) { 307 | if (!functions.util.format(e).includes("this.isZero")) { 308 | let data = { 309 | response: "bad", 310 | status: null, 311 | event: event?.eventName, 312 | error: this.functions.util.format(e), 313 | }; 314 | console.log(data); 315 | this.client.sendMessage( 316 | botinfo.ownerNumber[0] + "@s.whatsapp.net", 317 | this.functions.util.format(data), 318 | "conversation" 319 | ); 320 | this.client.reply(msg, this.botinfo.response.Error); 321 | } 322 | } 323 | } 324 | } 325 | 326 | module.exports = Command; 327 | -------------------------------------------------------------------------------- /lib/command/asupan.js: -------------------------------------------------------------------------------- 1 | cmd.on("ceweindo", ["indo"], ["asupan"], async (msg, { client }) => { 2 | return client.sendImage( 3 | msg.from, 4 | botinfo.linkApi.zacros + "/asupan/indonesia/" 5 | ); 6 | }); 7 | 8 | cmd.on("cewevietnam", ["vietnam"], ["asupan"], async (msg, { client }) => { 9 | return client.sendImage( 10 | msg.from, 11 | botinfo.linkApi.zacros + "/asupan/vietnam/" 12 | ); 13 | }); 14 | 15 | cmd.on("cewemalaysia", ["malaysia"], ["asupan"], async (msg, { client }) => { 16 | return client.sendImage( 17 | msg.from, 18 | botinfo.linkApi.zacros + "/asupan/malaysia/" 19 | ); 20 | }); 21 | 22 | cmd.on("cewekorea", ["korea"], ["asupan"], async (msg, { client }) => { 23 | return client.sendImage(msg.from, botinfo.linkApi.zacros + "/asupan/korea/"); 24 | }); 25 | 26 | cmd.on("cewejepang", ["jepang"], ["asupan"], async (msg, { client }) => { 27 | return client.sendImage(msg.from, botinfo.linkApi.zacros + "/asupan/japan/"); 28 | }); 29 | 30 | cmd.on("cewethailand", ["thailand"], ["asupan"], async (msg, { client }) => { 31 | return client.sendImage( 32 | msg.from, 33 | botinfo.linkApi.zacros + "/asupan/thailand/" 34 | ); 35 | }); 36 | 37 | cmd.on("cewechina", ["china"], ["asupan"], async (msg, { client }) => { 38 | return client.sendImage(msg.from, botinfo.linkApi.zacros + "/asupan/china/"); 39 | }); 40 | 41 | cmd.on("cewecantik", ["cecan"], ["asupan"], async (msg, { client }) => { 42 | return client.sendImage(msg.from, botinfo.linkApi.zacros + "/asupan/cecan/"); 43 | }); 44 | 45 | cmd.on("ukhty", ["ukhty"], ["asupan"], async (msg, { client }) => { 46 | return client.sendVideo(msg.from, botinfo.linkApi.zacros + "/asupan/ukhty/"); 47 | }); 48 | 49 | cmd.on("santuy", ["santuy"], ["asupan"], async (msg, { client }) => { 50 | return client.sendVideo(msg.from, botinfo.linkApi.zacros + "/asupan/santuy/"); 51 | }); 52 | 53 | cmd.on("loli", ["loli"], ["asupan"], async (msg, { client }) => { 54 | return client.sendVideo(msg.from, botinfo.linkApi.zacros + "/asupan/loli/"); 55 | }); 56 | 57 | cmd.on("hijaber", ["hijaber"], ["asupan"], async (msg, { client }) => { 58 | return client.sendImage( 59 | msg.from, 60 | botinfo.linkApi.zacros + "/asupan/hijaber/" 61 | ); 62 | }); 63 | -------------------------------------------------------------------------------- /lib/command/downloader.js: -------------------------------------------------------------------------------- 1 | cmd.on( 2 | "yt", 3 | ["ytmp3", "ytmp4"], 4 | ["downloader"], 5 | async (msg, { client, query, prefix, isUrl, command }) => { 6 | if (!isUrl) 7 | return client.reply(msg, `Link Yang Anda Masukan Bukan Dari Url`); 8 | let info = (await functions.axios.get(botinfo.linkApi.zacros + "/downloader/youtube?link="+ isUrl[0])).data 9 | let type = 10 | command.endsWith("3") || 11 | command.endsWith("audio") || 12 | command.endsWith("aud") 13 | ? (await functions.axios.get(botinfo.linkApi.zacros + "/downloader/youtube?link="+ isUrl[0])).data.medias[4] 14 | : (await functions.axios.get(botinfo.linkApi.zacros + "/downloader/youtube?link="+ isUrl[0])).data.medias[1] 15 | let data = 16 | command.endsWith("3") || 17 | command.endsWith("audio") || 18 | command.endsWith("aud") 19 | ? { 20 | type: "document", 21 | mimetype: "audio/mpeg", 22 | filename: info.title + ".mp3", 23 | quoted: msg, 24 | } 25 | : { 26 | type: "video", 27 | mimetype: "video/mp4", 28 | filename: info.title + ".mp4", 29 | quoted: msg, 30 | }; 31 | let thumbnail = (await client.getBuffer(info.thumbnail)).buffer; 32 | client.sendMessage(msg.from, thumbnail, "imageMessage", { 33 | quoted: msg, 34 | caption: info.title, 35 | }); 36 | client.sendMessage( 37 | msg.from, 38 | (await client.getBuffer(type.url)).buffer, 39 | data.type + "Message", 40 | { 41 | ...data, 42 | contextInfo: { 43 | externalAdReply: { 44 | title: info.title, 45 | description: `Zacros`, 46 | mediaType: "VIDEO", 47 | thumbnail, 48 | mediaUrl: isUrl[0], 49 | thumbnailUrl: info.thumbnail, 50 | }, 51 | }, 52 | } 53 | ); 54 | }, 55 | { 56 | query: `Masukan Link Youtube`, 57 | param: functions.needed("Link Youtube/Video"), 58 | } 59 | ); 60 | 61 | cmd.on( 62 | "play", 63 | ["play", "playvid", "playaud"], 64 | ["downloader"], 65 | async (msg, { query, client, prefix }) => { 66 | let res = await functions.ytSearch(query); 67 | let data = res.videos[0]; 68 | let buttons = [ 69 | { 70 | buttonId: `${prefix[0]}ytmp4 ${data.url}`, 71 | buttonText: { displayText: "Video" }, 72 | type: 1, 73 | }, 74 | { 75 | buttonId: `${prefix[0]}ytmp3 ${data.url}`, 76 | buttonText: { displayText: "Audio" }, 77 | type: 1, 78 | }, 79 | ]; 80 | let buffer_thumb = (await client.getBuffer(data.thumbnail)).buffer; 81 | let imageMessage = ( 82 | await client.prepareMessageMedia(buffer_thumb, "imageMessage", { 83 | thumbnail: Buffer.alloc(0), 84 | }) 85 | ).imageMessage; 86 | let buttonsMessage = { 87 | footerText: 88 | `Jika Tidak Bisa Menekan Tombol, Ketik ${prefix[0]}ytmp3/4 ` + data.url, 89 | contentText: functions.parseResult(data, { title: "Youtube Play" }), 90 | buttons, 91 | imageMessage, 92 | headerType: "IMAGE", 93 | }; 94 | return client.sendMessageFromContent( 95 | msg.from, 96 | { buttonsMessage }, 97 | { quoted: msg } 98 | ); 99 | }, 100 | { 101 | query: 102 | "Masukan Link Atau Judul Lagu \nContoh : /play https://www.youtube.com/watch?v=eVTXPUF4Oz4 \n/play Linkin Park - In The End", 103 | param: functions.needed("query"), 104 | } 105 | ); 106 | 107 | cmd.on( 108 | "tiktok", 109 | ["tiktok"], 110 | ["downloader"], 111 | async (msg, { query, client }) => { 112 | return client.sendVideo( 113 | msg.from, 114 | botinfo.linkApi.zacros + "/downloader/tiktoknowm?link=" + query 115 | ); 116 | }, 117 | { 118 | query: 119 | "Masukan Link TIKTOK \nContoh : /tiktok https://www.tiktok.com/@yourrkayesss/video/7040534981671701786", 120 | param: functions.needed("link video"), 121 | } 122 | ); 123 | 124 | cmd.on( 125 | "fbdl", 126 | ["facebookdl", "fb", "facebook"], 127 | ["downloader"], 128 | async (msg, { query, client }) => { 129 | let res = await functions.axios.get( 130 | botinfo.linkApi.zacros + "/downloader/fbdl?link=" + query 131 | ); 132 | let video = res.data.medias[0]; 133 | return client.sendVideo(msg.from, video.url); 134 | }, 135 | { 136 | query: 137 | "Masukan Link FB \nContoh : /fb https://www.facebook.com/onickayessfansbase/posts/227884412849835", 138 | param: functions.needed("link"), 139 | } 140 | ); 141 | 142 | cmd.on( 143 | "ig", 144 | ["igvideo", "instagram", "ig"], 145 | ["downloader"], 146 | async (msg, { query, client }) => { 147 | let result = ( 148 | await functions.axios.get( 149 | botinfo.linkApi.zacros + "/downloader/igdl?link=" + query 150 | ) 151 | ).data; 152 | for (let i = 0; i < result.length; i++) { 153 | client.sendVideo(msg.from, result); 154 | } 155 | }, 156 | { 157 | query: 158 | "Masukan Link IG \nContoh : /instagram https://www.instagram.com/p/CXvv2lVpaju", 159 | param: functions.needed("link video"), 160 | } 161 | ); 162 | 163 | cmd.on( 164 | "yts", 165 | ["ytsearch"], 166 | ["search", "downloader"], 167 | async (msg, { query, client }) => { 168 | let a = (await functions.ytSearch(query)).all; 169 | let b = ``; 170 | for (let c of a) 171 | b += 172 | functions.parseResult(c, { 173 | title: "Youtube Search", 174 | ignoreKey: ["duration"], 175 | }) + "\n"; 176 | return client.sendText(msg.from, b.trim()); 177 | }, 178 | { 179 | query: "Isi Dengan Kata Kunci \nContoh : /ytsearch Linkin Park", 180 | param: functions.needed("query"), 181 | } 182 | ); 183 | 184 | cmd.on( 185 | "soundcloud", 186 | ["soundcloud"], 187 | ["downloader"], 188 | async (msg, { query, client }) => { 189 | let res = ( 190 | await functions.axios.get( 191 | botinfo.linkApi.zacros + "/downloader/scdl?link=" + query 192 | ) 193 | ).data; 194 | await client.sendImage(msg.from, res.thumb, res.title); 195 | client.sendAudio(msg.from, res.link); 196 | }, 197 | { 198 | wait: true, 199 | query: 200 | "Isi Link SOUNDCLOUD \nContoh : /soundcloud https://soundcloud.com/linkin_park/in-the-end", 201 | param: functions.needed("link"), 202 | } 203 | ); 204 | -------------------------------------------------------------------------------- /lib/command/fun.js: -------------------------------------------------------------------------------- 1 | class TicTacToe { 2 | constructor(playerX = 'x', playerO = 'o') { 3 | this.playerX = playerX 4 | this.playerO = playerO 5 | this._currentTurn = false 6 | this._x = 0 7 | this._o = 0 8 | this.turns = 0 9 | } 10 | 11 | get board() { 12 | return this._x | this._o 13 | } 14 | 15 | get currentTurn() { 16 | return this._currentTurn ? this.playerO : this.playerX 17 | } 18 | 19 | get enemyTurn() { 20 | return this._currentTurn ? this.playerX : this.playerO 21 | } 22 | 23 | static check(state) { 24 | for (let combo of [7, 56, 73, 84, 146, 273, 292, 448]) 25 | if ((state & combo) === combo) 26 | return !0 27 | return !1 28 | } 29 | 30 | /** 31 | * ```js 32 | * TicTacToe.toBinary(1, 2) // 0b010000000 33 | * ``` 34 | */ 35 | static toBinary(x = 0, y = 0) { 36 | if (x < 0 || x > 2 || y < 0 || y > 2) throw new Error('invalid position') 37 | return 1 << x + (3 * y) 38 | } 39 | 40 | /** 41 | * @param player `0` is `X`, `1` is `O` 42 | * 43 | * - `-3` `Game Ended` 44 | * - `-2` `Invalid` 45 | * - `-1` `Invalid Position` 46 | * - ` 0` `Position Occupied` 47 | * - ` 1` `Sucess` 48 | * @returns {-3|-2|-1|0|1} 49 | */ 50 | turn(player = 0, x = 0, y) { 51 | if (this.board === 511) return -3 52 | let pos = 0 53 | if (y == null) { 54 | if (x < 0 || x > 8) return -1 55 | pos = 1 << x 56 | } else { 57 | if (x < 0 || x > 2 || y < 0 || y > 2) return -1 58 | pos = TicTacToe.toBinary(x, y) 59 | } 60 | if (this._currentTurn ^ player) return -2 61 | if (this.board & pos) return 0 62 | this[this._currentTurn ? '_o' : '_x'] |= pos 63 | this._currentTurn = !this._currentTurn 64 | this.turns++ 65 | return 1 66 | } 67 | 68 | /** 69 | * @returns {('X'|'O'|1|2|3|4|5|6|7|8|9)[]} 70 | */ 71 | static render(boardX = 0, boardO = 0) { 72 | let x = parseInt(boardX.toString(2), 4) 73 | let y = parseInt(boardO.toString(2), 4) * 2 74 | return [...(x + y).toString(4).padStart(9, '0')].reverse().map((value, index) => value == 1 ? 'X' : value == 2 ? 'O' : ++index) 75 | } 76 | 77 | /** 78 | * @returns {('X'|'O'|1|2|3|4|5|6|7|8|9)[]} 79 | */ 80 | render() { 81 | return TicTacToe.render(this._x, this._o) 82 | } 83 | 84 | get winner() { 85 | let x = TicTacToe.check(this._x) 86 | let o = TicTacToe.check(this._o) 87 | return x ? this.playerX : o ? this.playerO : false 88 | } 89 | } 90 | 91 | new TicTacToe().turn 92 | 93 | module.exports = TicTacToe 94 | client.game = client.game ? client.game : {}; 95 | 96 | let debugMode = !1; 97 | 98 | cmd.on( 99 | "dare", 100 | ["dare"], 101 | ["fun"], 102 | async (msg, { command, client }) => { 103 | res = await functions.axios.get( 104 | botinfo.linkApi.zacros + `/randomtext/dare` 105 | ); 106 | anu = res.data.result; 107 | return client.sendText(msg.from, `Dare\n\n${anu}`, msg); 108 | }, 109 | { usedPrefix: true } 110 | ); 111 | 112 | cmd.on( 113 | "truth", 114 | ["truth"], 115 | ["fun"], 116 | async (msg, { command, client }) => { 117 | res = await functions.axios.get( 118 | botinfo.linkApi.zacros + `/randomtext/truth` 119 | ); 120 | anu = res.data.result; 121 | return client.sendText(msg.from, `Truth\n\n${anu}`, msg); 122 | }, 123 | { usedPrefix: true } 124 | ); 125 | 126 | cmd.on( 127 | "bisakah", 128 | ["bisakah"], 129 | ["fun"], 130 | async (msg, { query, client }) => { 131 | let a = ["Tidak Bisa", "Bisa", "Ya Gatau", "Mungkin Saja", "Coba Ulangi"]; 132 | let b = functions.randomize(a); 133 | return client.sendText(msg.from, `Bisakah ${query}\n\nJawaban : ${b}`); 134 | }, 135 | { query: "Masukkan Query", param: functions.needed("query") } 136 | ); 137 | 138 | cmd.on( 139 | "kapankah", 140 | ["kapankah"], 141 | ["fun"], 142 | async (msg, { query, client }) => { 143 | let a = [ 144 | "Hari", 145 | "Minggu", 146 | "Abad", 147 | "Detik", 148 | "Menit", 149 | "Jam", 150 | "Hari", 151 | "Tahun", 152 | "Dekade", 153 | ]; 154 | let b = functions.randomize(a); 155 | let c = functions.randomize(100); 156 | return client.sendText( 157 | msg.from, 158 | `Kapankah ${query}\n\nJawaban : ${c} ${b} Lagi` 159 | ); 160 | }, 161 | { query: "Masukkan Query", param: functions.needed("query") } 162 | ); 163 | 164 | cmd.on( 165 | "howgay", 166 | ["howgay"], 167 | ["fun"], 168 | async (msg, { query, client }) => { 169 | let a = functions.randomize(100); 170 | let b = "How gay " + query + "\n" + query + " is " + a + "% Gay"; 171 | return client.sendText(msg.from, b); 172 | }, 173 | { query: "Masukkan query!", param: functions.needed("query") } 174 | ); 175 | 176 | cmd.on( 177 | "howbucin", 178 | ["howbucin"], 179 | ["fun"], 180 | async (msg, { query, client }) => { 181 | let a = functions.randomize(100); 182 | let b = "How bucin " + query + "\n" + query + " is " + a + "% Bucin"; 183 | return client.sendText(msg.from, b); 184 | }, 185 | { query: "Masukkan query!", param: functions.needed("query") } 186 | ); 187 | 188 | cmd.on( 189 | "howstress", 190 | ["howstress"], 191 | ["fun"], 192 | async (msg, { query, client }) => { 193 | let a = functions.randomize(100); 194 | let b = "How Stress " + query + "\n" + query + " is " + a + "% Stress"; 195 | return client.sendText(msg.from, b); 196 | }, 197 | { query: "Masukkan query!", param: functions.needed("query") } 198 | ); 199 | 200 | cmd.on( 201 | "TicTacToe", 202 | ["tictactoe", "ttt"], 203 | ["fun"], 204 | async (m, { usedPref, query, command }) => { 205 | if ( 206 | Object.values(client.game).find( 207 | (room) => 208 | room.id.startsWith("tictactoe") && 209 | [room.game.playerX, room.game.playerO].includes(m.sender.jid) 210 | ) 211 | ) 212 | return client.reply(m, "Kamu masih didalam game"); 213 | let room = Object.values(client.game).find( 214 | (room) => room.state === "WAITING" && (query ? room.name === query : true) 215 | ); 216 | // m.reply('[WIP Feature]') 217 | if (room) { 218 | client.reply(m, "Partner ditemukan!"); 219 | room.o = m.from; 220 | room.game.playerO = m.sender.jid; 221 | room.state = "PLAYING"; 222 | let arr = room.game.render().map((v) => { 223 | return { 224 | X: "❌", 225 | O: "⭕", 226 | 1: "1️⃣", 227 | 2: "2️⃣", 228 | 3: "3️⃣", 229 | 4: "4️⃣", 230 | 5: "5️⃣", 231 | 6: "6️⃣", 232 | 7: "7️⃣", 233 | 8: "8️⃣", 234 | 9: "9️⃣", 235 | }[v]; 236 | }); 237 | let str = ` 238 | Room ID: ${room.id} 239 | ${arr.slice(0, 3).join("")} 240 | ${arr.slice(3, 6).join("")} 241 | ${arr.slice(6).join("")} 242 | Menunggu @${room.game.currentTurn.split("@")[0]} 243 | Ketik *nyerah* untuk nyerah 244 | `.trim(); 245 | if (room.x !== room.o) 246 | client.reply(m, str, { 247 | contextInfo: { 248 | mentionedJid: client.getMentionedJidList(str), 249 | }, 250 | }); 251 | client.reply(m, str, { 252 | contextInfo: { 253 | mentionedJid: client.getMentionedJidList(str), 254 | }, 255 | }); 256 | } else { 257 | room = { 258 | id: "tictactoe-" + +new Date(), 259 | x: m.from, 260 | o: "", 261 | game: new TicTacToe(m.sender.jid, "o"), 262 | state: "WAITING", 263 | }; 264 | if (query) room.name = query; 265 | client.reply( 266 | m, 267 | "Menunggu partner" + 268 | (query 269 | ? `mengetik command dibawah ini 270 | ${usedPref}${command} ${query}` 271 | : "") 272 | ); 273 | client.game[room.id] = room; 274 | } 275 | }, 276 | { param: functions.optional("Custom room name"), group: true } 277 | ); 278 | 279 | cmd.before("tictactoe", async (m) => { 280 | let ok; 281 | let isWin = !1; 282 | let isTie = !1; 283 | let isSurrender = !1; 284 | let bantuan = typeof m.string === "string" ? m.string.toLowerCase() : ""; 285 | let room = Object.values(client.game).find( 286 | (room) => 287 | room.id && 288 | room.game && 289 | room.state && 290 | room.id.startsWith("tictactoe") && 291 | [room.game.playerX, room.game.playerO].includes(m.sender.jid) && 292 | room.state == "PLAYING" 293 | ); 294 | if (room) { 295 | // client.reply(m, `[DEBUG]\n${parseInt(m.text)}`) 296 | if (!/^([1-9]|(me)?nyerah|surr?ender)$/i.test(bantuan)) return !0; 297 | isSurrender = !/^[1-9]$/.test(bantuan); 298 | if (m.sender.jid !== room.game.currentTurn) { 299 | // nek wayahku 300 | if (!isSurrender) return !0; 301 | } 302 | if (debugMode) 303 | client.reply( 304 | m, 305 | "[DEBUG]\n" + 306 | require("util").format({ 307 | isSurrender, 308 | text: bantuan, 309 | }) 310 | ); 311 | if ( 312 | !isSurrender && 313 | 1 > 314 | (ok = room.game.turn( 315 | m.sender.jid === room.game.playerO, 316 | parseInt(bantuan) - 1 317 | )) 318 | ) { 319 | client.reply( 320 | m, 321 | { 322 | "-3": "Game telah berakhir", 323 | "-2": "Invalid", 324 | "-1": "Posisi Invalid", 325 | 0: "Posisi Invalid", 326 | }[ok] 327 | ); 328 | return !0; 329 | } 330 | if (m.sender.jid === room.game.winner) isWin = true; 331 | else if (room.game.board === 511) isTie = true; 332 | let arr = room.game.render().map((v) => { 333 | return { 334 | X: "❌", 335 | O: "⭕", 336 | 1: "1️⃣", 337 | 2: "2️⃣", 338 | 3: "3️⃣", 339 | 4: "4️⃣", 340 | 5: "5️⃣", 341 | 6: "6️⃣", 342 | 7: "7️⃣", 343 | 8: "8️⃣", 344 | 9: "9️⃣", 345 | }[v]; 346 | }); 347 | if (isSurrender) { 348 | room.game._currentTurn = m.sender.jid === room.game.playerX; 349 | isWin = true; 350 | } 351 | let winner = isSurrender ? room.game.currentTurn : room.game.winner; 352 | let str = ` 353 | ${arr.slice(0, 3).join("")} 354 | ${arr.slice(3, 6).join("")} 355 | ${arr.slice(6).join("")} 356 | ${ 357 | isWin 358 | ? `@${winner.split("@")[0]} Menang!` 359 | : isTie 360 | ? `Game berakhir !` 361 | : `Giliran ${["❌", "⭕"][1 * room.game._currentTurn]} (@${ 362 | room.game.currentTurn.split("@")[0] 363 | })` 364 | } 365 | ❌: @${room.game.playerX.split("@")[0]} 366 | ⭕: @${room.game.playerO.split("@")[0]} 367 | Ketik *nyerah* untuk nyerah 368 | Room ID: ${room.id} 369 | `.trim(); 370 | //let users = global.db.data.users 371 | if ((room.game._currentTurn ^ isSurrender ? room.x : room.o) !== m.from) 372 | room[room.game._currentTurn ^ isSurrender ? "x" : "o"] = m.from; 373 | if (room.x !== room.o) 374 | client.reply(m, str, { 375 | contextInfo: { 376 | mentionedJid: client.getMentionedJidList(str), 377 | }, 378 | }); 379 | client.reply(m, str, { 380 | contextInfo: { 381 | mentionedJid: client.getMentionedJidList(str), 382 | }, 383 | }); 384 | if (isTie || isWin) { 385 | if (debugMode) 386 | client.reply(m, "[DEBUG]\n" + require("util").format(room)); 387 | delete client.game[room.id]; 388 | } 389 | } 390 | return !0; 391 | }); 392 | -------------------------------------------------------------------------------- /lib/command/generator.js: -------------------------------------------------------------------------------- 1 | cmd.on( 2 | "stres", 3 | [ 4 | "swaifu", 5 | "wangy", 6 | "pregnant", 7 | "simp", 8 | "sherk", 9 | "gemeteran", 10 | "nenen", 11 | "koboi", 12 | ], 13 | ["generator"], 14 | async (req, res) => { 15 | if (!res.query) 16 | return client.reply(req, "Masukan Namanya!\nContoh : .wangy danski"); 17 | if (res.command.match("wangy")) { 18 | return client.generateStres(req.from, `${res.query}`, "wangy"); 19 | } 20 | if (res.command.match("pregnant")) { 21 | return client.generateStres(req.from, `${res.query}`, "pregnant"); 22 | } 23 | if (res.command.match("swaifu")) { 24 | return client.generateStres(req.from, `${res.query}`, "waifu"); 25 | } 26 | if (res.command.match("simp")) { 27 | return client.generateStres(req.from, `${res.query}`, "simp"); 28 | } 29 | if (res.command.match("sherk")) { 30 | return client.generateStres(req.from, `${res.query}`, "sherk"); 31 | } 32 | if (res.command.match("nenen")) { 33 | return client.generateStres(req.from, `${res.query}`, "nenen"); 34 | } 35 | if (res.command.match("gemeteran")) { 36 | return client.generateStres(req.from, `${res.query}`, "gemeteran"); 37 | } 38 | if (res.command.match("koboi")) { 39 | return client.generateStres(req.from, `${res.query}`, "koboi"); 40 | } 41 | }, 42 | { param: functions.needed("name") } 43 | ); 44 | -------------------------------------------------------------------------------- /lib/command/group.js: -------------------------------------------------------------------------------- 1 | cmd.on( 2 | "add", 3 | ["add"], 4 | ["group"], 5 | async (msg, { client, query }) => { 6 | let intNumber = query.replace(/[^0-9]/g, "") + "@s.whatsapp.net"; 7 | if (query.replace(/[^0-9]/g, "").startsWith("0")) 8 | return client.reply( 9 | msg, 10 | "*REJECTED* | Masukan Nomor Valid Dengan Kode Negara Contoh +62 / 62" 11 | ); 12 | let checkNumber = await client.isOnWhatsApp(intNumber); 13 | if (!checkNumber) 14 | return client.reply( 15 | msg, 16 | "*REJECTED* | Nomor Yang Anda Masukan Tidak Terdaftar Di Whatsapp" 17 | ); 18 | let groupInvite = await client.groupAdd(msg.from, [intNumber]); 19 | let statusInt = groupInvite[intNumber.replace("@s.whatsapp.net", "@c.us")]; 20 | let inviteId = await client.groupInviteCode(msg.from); 21 | if (statusInt == 409) 22 | return client.reply(msg, "*FAILED* | Member Telah Ada Disini"); 23 | else if (statusInt == 403) { 24 | client.reply( 25 | msg, 26 | `*FAILED* | @${ 27 | intNumber.split("@")[0] 28 | } Tidak Bisa Di Invite Karena Di Private!, Mengirim Link Grub....`, 29 | { 30 | contextInfo: { 31 | mentionedJid: [intNumber], 32 | }, 33 | } 34 | ); 35 | return client.sendMessage( 36 | intNumber, 37 | "https://chat.whatsapp.com/" + 38 | inviteId + 39 | `\n Kamu Di Invite Oleh @${msg.sender.jid.split("@")[0]}`, 40 | "conversation", 41 | { 42 | contextInfo: { 43 | mentionedJid: [msg.sender.jid], 44 | }, 45 | } 46 | ); 47 | } 48 | return client.reply(msg, `Berhasil Memasukan User!`); 49 | }, 50 | { 51 | param: functions.needed("No Hp"), 52 | query: "Harap ketikkan nomor whatsapp untuk memasukkan ke dalam group!", 53 | admin: true, 54 | clientAdmin: true, 55 | group: true, 56 | } 57 | ); 58 | 59 | cmd.on( 60 | "kick", 61 | ["kick"], 62 | ["group"], 63 | async (msg, { client, query, prefix }) => { 64 | if (!msg.mentionedJid && !query) 65 | return client.reply( 66 | msg, 67 | `*REJECTED* | Tag Seseorang Atau Masukan No Yang Akan Di Kick` 68 | ); 69 | if (!msg.mentionedJid && query) { 70 | if (query.replace(/[^0-9]/g, "").startsWith("0")) 71 | return client.reply( 72 | msg, 73 | "*REJECTED* | Masukan Nomor Valid Dengan Kode Negara Contoh +62 / 62" 74 | ); 75 | msg.mentionedJid = [query.replace(/[^0-9]/g, "") + "@s.whatsapp.net"]; 76 | } 77 | for (let a of msg.mentionedJid) { 78 | await functions.delay(2000); 79 | let checkNumber = await client.isOnWhatsApp(a); 80 | if (!checkNumber) 81 | return client.reply( 82 | msg, 83 | "*REJECTED* | Nomor Yang Anda Masukan Tidak Terdaftar Di Whatsapp" 84 | ); 85 | let find = msg.groupData.groupAdmins.find((tr) => tr.jid == a); 86 | if (find && find.isAdmin) { 87 | if (query.endsWith("--force")) { 88 | return client.groupRemove(msg.from, [a]); 89 | } 90 | await client.sendMessageFromContent( 91 | msg.from, 92 | { 93 | buttonsMessage: { 94 | footerText: `Jika Tidak Bisa Tekan Tombol, Ketik ${prefix[0]}kick @Tag Orang --force`, 95 | contentText: 96 | "*WARNING* | Yang Di Kick Adalah Admin Apakah Anda Yakin?", 97 | buttons: [ 98 | { 99 | buttonId: `${prefix[0]}kick ${a.split("@")[0]} --force`, 100 | buttonText: { 101 | displayText: "Ya", 102 | }, 103 | type: 1, 104 | }, 105 | ], 106 | headerType: "EMPTY", 107 | }, 108 | }, 109 | { 110 | contextInfo: { 111 | mentionedJid: [a], 112 | }, 113 | } 114 | ); 115 | continue; 116 | } 117 | await client.groupRemove(msg.from, [a]); 118 | } 119 | }, 120 | { 121 | param: functions.needed("tag"), 122 | wait: true, 123 | admin: true, 124 | clientAdmin: true, 125 | group: true, 126 | } 127 | ); 128 | 129 | cmd.on( 130 | "demote", 131 | ["demote"], 132 | ["group"], 133 | async (msg, { client }) => { 134 | try { 135 | let demoteGroup = await client.groupDemoteAdmin( 136 | msg.from, 137 | msg.mentionedJid 138 | ); 139 | client.reply(msg, "Suksess menurunkan jabatannya!"); 140 | } catch (err) { 141 | client.reply(msg, functions.util.format(err)); 142 | } 143 | }, 144 | { 145 | param: functions.needed("tag"), 146 | mention: true, 147 | admin: true, 148 | clientAdmin: true, 149 | group: true, 150 | } 151 | ); 152 | 153 | cmd.on( 154 | "promote", 155 | ["promote"], 156 | ["group"], 157 | async (msg, res) => { 158 | try { 159 | let promoteGroup = await client.groupMakeAdmin( 160 | msg.from, 161 | msg.mentionedJid 162 | ); 163 | client.reply(msg, "Suksess menaikkan jabatannya!"); 164 | } catch (err) { 165 | client.reply(msg, functions.util.format(err)); 166 | } 167 | }, 168 | { 169 | param: functions.needed("tag"), 170 | mention: true, 171 | admin: true, 172 | clientAdmin: true, 173 | group: true, 174 | } 175 | ); 176 | 177 | cmd.on( 178 | "set-subject", 179 | ["setnamegroup"], 180 | ["group"], 181 | async (msg, res) => { 182 | try { 183 | let nameInt = res.query; 184 | let groupSubject = await client.groupUpdateSubject(msg.from, nameInt); 185 | if (groupSubject.status !== 200) 186 | return client.reply( 187 | msg, 188 | "some error when trying changing group subject" 189 | ); 190 | client.reply( 191 | msg, 192 | "Success change group Name" + 193 | `\n\nFrom: ${res.group.subject}` + 194 | `\nTo: ${nameInt}` 195 | ); 196 | } catch (err) { 197 | client.reply(msg, functions.util.format(err)); 198 | } 199 | }, 200 | { 201 | param: functions.needed("text"), 202 | query: "Harap ketikkan nama grup", 203 | admin: true, 204 | clientAdmin: true, 205 | group: true, 206 | } 207 | ); 208 | 209 | cmd.on( 210 | "set-desc", 211 | ["setdescgroup"], 212 | ["group"], 213 | async (msg, res) => { 214 | try { 215 | let nameInt = res.query; 216 | let groupDesc = await client.groupUpdateDescription(msg.from, nameInt); 217 | if (groupDesc.status !== 200) 218 | return client.reply( 219 | msg, 220 | "some error when trying changing group subject" 221 | ); 222 | client.reply( 223 | msg, 224 | "Success change group Description\n\nFrom: " + 225 | res.group.desc + 226 | "\nTo: " + 227 | nameInt 228 | ); 229 | } catch (err) { 230 | client.reply(msg, functions.util.format(err)); 231 | } 232 | }, 233 | { 234 | param: functions.needed("text"), 235 | query: "Harap ketikkan group deskripsi", 236 | admin: true, 237 | clientAdmin: true, 238 | group: true, 239 | } 240 | ); 241 | 242 | cmd.on( 243 | "leave", 244 | ["leave"], 245 | ["group"], 246 | async (msg, res) => { 247 | client 248 | .groupLeave(msg.from) 249 | .then((response) => { 250 | client.sendMessage( 251 | msg.sender.jid, 252 | "Success Keluar dari group " + res.group.subject, 253 | "conversation" 254 | ); 255 | }) 256 | .catch((err) => client.reply(msg, functions.util.format(err))); 257 | }, 258 | { 259 | admin: true, 260 | group: true, 261 | } 262 | ); 263 | 264 | cmd.on( 265 | "create-group", 266 | ["create-group"], 267 | ["group", "owner"], 268 | async (msg, res) => { 269 | let arrInt = [msg.sender.jid, ...msg.mentionedJid]; 270 | let groupName = res.query.split(/ @/)[0]; 271 | client 272 | .groupCreate(groupName, arrInt) 273 | .then((response) => { 274 | client.reply( 275 | msg, 276 | "groupId: " + 277 | response.gid + 278 | "\nParticipants: " + 279 | response.participants + 280 | "\n\nSuccess membuat group dengan nama " + 281 | groupName 282 | ); 283 | }) 284 | .catch((err) => client.reply(msg, functions.util.format(err))); 285 | }, 286 | { 287 | param: `${functions.needed("text")}|${functions.needed("tag")}`, 288 | query: "Harap ketikkan nama group!", 289 | mention: true, 290 | owner: true, 291 | group: true, 292 | } 293 | ); 294 | 295 | cmd.on( 296 | "group-link", 297 | ["group-link"], 298 | ["group"], 299 | async (msg, res) => { 300 | try { 301 | let inviteId = await client.groupInviteCode(msg.from); 302 | let groupCode = "https://chat.whatsapp.com/" + inviteId; 303 | client.reply(msg, "Link Group: " + groupCode); 304 | } catch (err) { 305 | client.reply(msg, functions.util.format(err)); 306 | } 307 | }, 308 | { 309 | admin: true, 310 | clientAdmin: true, 311 | group: true, 312 | } 313 | ); 314 | 315 | cmd.on( 316 | "group-revoke", 317 | ["group-revoke"], 318 | ["group"], 319 | async (msg, res) => { 320 | try { 321 | let revokeResponse = await client.revokeInvite(msg.from); 322 | client.reply( 323 | msg, 324 | "Link Group baru: https://chat.whatsapp.com/" + revokeResponse.code 325 | ); 326 | } catch (err) { 327 | client.reply(msg, functions.util.format(err)); 328 | } 329 | }, 330 | { 331 | admin: true, 332 | clientAdmin: true, 333 | group: true, 334 | } 335 | ); 336 | 337 | cmd.on( 338 | "group-join", 339 | ["group-join"], 340 | ["group", "owner"], 341 | async (msg, res) => { 342 | try { 343 | if (res.query.match("chat.whatsapp.com")) { 344 | let codeId = res.query.split("chat.whatsapp.com/")[1]; 345 | let acceptInvite = await client.acceptInvite(codeId); 346 | client.reply( 347 | msg, 348 | "groupId: " + 349 | acceptInvite.gid + 350 | "\ngroupCode: " + 351 | codeId + 352 | "\n\n Suksess memasukkan bot kedalam group" 353 | ); 354 | } else { 355 | client.reply(msg, "Invalid link group"); 356 | } 357 | } catch (err) { 358 | client.reply(msg, functions.util.format(err)); 359 | } 360 | }, 361 | { 362 | param: functions.needed("link WA"), 363 | url: "whatsapp", 364 | owner: true, 365 | } 366 | ); 367 | 368 | cmd.on( 369 | "group-close", 370 | ["group-close"], 371 | ["group"], 372 | async (msg, res) => { 373 | let response = await client.groupSettingChange( 374 | msg.from, 375 | "announcement", 376 | true 377 | ); 378 | client.reply( 379 | msg, 380 | "Success mengubah group kedalam mode admin!\nSekarang hanya admin dapat mengirimkan pesan" 381 | ); 382 | }, 383 | { 384 | group: true, 385 | admin: true, 386 | } 387 | ); 388 | 389 | cmd.on( 390 | "group-open", 391 | ["group-open"], 392 | ["group"], 393 | async (msg, res) => { 394 | let response = await client.groupSettingChange( 395 | msg.from, 396 | "announcement", 397 | false 398 | ); 399 | client.reply( 400 | msg, 401 | "Success mengubah group kedalam mode publik!\nSekarang semua member bisa mengirimkan pesan" 402 | ); 403 | }, 404 | { 405 | group: true, 406 | admin: true, 407 | } 408 | ); 409 | 410 | cmd.on( 411 | "group-locked", 412 | ["group-locked"], 413 | ["group"], 414 | async (msg, res) => { 415 | let response = await client.groupSettingChange(msg.from, "locked", true); 416 | client.reply(msg, "Success mengubah group info hanya dalam mode admin!"); 417 | }, 418 | { 419 | group: true, 420 | admin: true, 421 | } 422 | ); 423 | 424 | cmd.on( 425 | "group-unlock", 426 | ["group-unlock"], 427 | ["group"], 428 | async (msg, res) => { 429 | let response = await client.groupSettingChange(msg.from, "locked", false); 430 | client.reply(msg, "Success mengubah group info ke semua member!"); 431 | }, 432 | { 433 | group: true, 434 | admin: true, 435 | } 436 | ); 437 | 438 | cmd.on( 439 | "set-profile", 440 | ["set-profile"], 441 | ["group"], 442 | async (msg, res) => { 443 | let isValidUrl = res.query.match( 444 | new RegExp(/(http[s]?:\/\/.*\.(?:png|jpg|gif|svg|jpeg))/, "i") 445 | ); 446 | if (isValidUrl) { 447 | let buffer = (await client.getBuffer(res.query)).buffer; 448 | let groupProfile = await client.updateProfilePicture(msg.from, buffer); 449 | client.sendImage( 450 | msg.from, 451 | res.query, 452 | "Success update Group Profile Picture!", 453 | msg 454 | ); 455 | } else { 456 | client.reply(msg, "Invalid Image Url"); 457 | } 458 | }, 459 | { 460 | param: functions.needed("Url"), 461 | group: true, 462 | query: "Harap ketikkan Link Gambar dari source code mana saja!", 463 | admin: true, 464 | clientAdmin: true, 465 | } 466 | ); 467 | 468 | cmd.on( 469 | "hidetag", 470 | ["hidetag", "everyone"], 471 | ["group"], 472 | async (msg, { query, client }) => { 473 | return client.reply(msg, query, { 474 | contextInfo: { 475 | mentionedJid: msg.groupData.participants.map((tr) => tr.jid), 476 | }, 477 | }); 478 | }, 479 | { 480 | query: "Masukkan query", 481 | param: functions.needed("query"), 482 | admin: true, 483 | clientAdmin: true, 484 | group: true, 485 | } 486 | ); 487 | cmd.on( 488 | "welkom", 489 | ["welkom", "welcome", "welcom"], 490 | ["group", "useless"], 491 | async (msg, { client, query, prefix }) => { 492 | if (!groupDb[msg.from]) groupDb[msg.from] = {}; 493 | if ( 494 | !query || 495 | !["nyala", "nyalain", "on", "mati", "matiin", "off"].includes(query) 496 | ) { 497 | let buttons = [ 498 | { 499 | buttonId: `${prefix[0]}welcome nyala`, 500 | buttonText: { 501 | displayText: "Nyalakan", 502 | }, 503 | type: 1, 504 | }, 505 | { 506 | buttonId: `${prefix[0]}welcome mati`, 507 | buttonText: { 508 | displayText: "Matikan", 509 | }, 510 | type: 1, 511 | }, 512 | ]; 513 | return client.sendMessageFromContent(msg.from, { 514 | buttonsMessage: { 515 | footerText: `Jika Tidak Bisa Menekan Tombol, Ketik ${prefix[0]}welcome nyala atau ${prefix[0]}welcome mati`, 516 | contentText: "Pilih Kak Nyalain Atau Matiin Welcome", 517 | buttons, 518 | headerType: "EMPTY", 519 | }, 520 | }); 521 | } 522 | let mode = query.toLowerCase().trim(); 523 | if (["nyala", "nyalain", "on"].includes(mode)) { 524 | if (groupDb[msg.from]?.welcome) 525 | return client.reply(msg, `*REJECTED* | Sudah Nyala Dari Tadi`); 526 | groupDb[msg.from].welcome = { 527 | add: `Selamat Datang di %group_name berikut desc nya %group_desc`, 528 | promote: `Jadi Atmin di %group_name %user_name`, 529 | demote: `Kasian si @%user_tag`, 530 | remove: `Dadah %user_name`, 531 | }; 532 | return client.reply( 533 | msg, 534 | `*SUCCESS* | Sukses Memasukan Ke Database Welkom!` 535 | ); 536 | } else if (["mati", "matiin", "off"].includes(mode)) { 537 | if (!groupDb[msg.from]?.welcome) 538 | return client.reply(msg, `*REJECTED* | Sudah Mati Dari Tadi`); 539 | delete groupDb[msg.from].welcome; 540 | return client.reply(msg, `*SUCCESS* | Sukses Menghapus Database Welkom!`); 541 | } 542 | }, 543 | { 544 | group: true, 545 | admin: true, 546 | param: functions.optional(`nyalain|matiin`), 547 | } 548 | ); 549 | 550 | cmd.on( 551 | "welkom", 552 | ["setwelcome", "setwelkom", "setwelcom"], 553 | ["group", "useless"], 554 | (msg, { query, prefix, client }) => { 555 | if (!groupDb[msg.from]?.welcome) 556 | return client.reply(msg, `*REJECTED* | Welkom Nya Mati`); 557 | if (!query.includes("|")) 558 | return client.reply( 559 | msg, 560 | `*REJECTED* | Format Salah Harusnya ${prefix[0]}setwelcome type|isinya contoh ${prefix[0]}setwelcome promote|cie di promote %user_tag` 561 | ); 562 | let type = query.split("|")[0].toLowerCase().trim(); 563 | let isinya = query.split("|")[1]; 564 | if (!Object.keys(groupDb[msg.from].welcome).includes(type)) 565 | return client.reply( 566 | msg, 567 | `*REJECTED* | Type Yang Anda Masukan Tidak Valid, Berikut Type Type Nya ${Object.keys( 568 | groupDb[msg.from].welcome 569 | )}` 570 | ); 571 | groupDb[msg.from].welcome[type] = isinya; 572 | return client.reply( 573 | msg, 574 | `*SUCCESS* | Sukses Mengubah Data Welcome ${type} Ke ${isinya}` 575 | ); 576 | }, 577 | { 578 | group: true, 579 | admin: true, 580 | query: `*REJECTED* | Masukan Input Query`, 581 | param: functions.needed(`type`) + `|` + functions.needed(`isi`), 582 | } 583 | ); 584 | -------------------------------------------------------------------------------- /lib/command/image.js: -------------------------------------------------------------------------------- 1 | cmd.on( 2 | "pinterest", 3 | ["pinterest"], 4 | ["image", "search"], 5 | async (msg, { query, client }) => { 6 | let res = await functions.searchImage(`${query} Pinterest`); 7 | res = res.filter((tr) => tr.url.includes("pinimg")); 8 | if (res.length < 1) 9 | return client.reply(msg, "Image Yang Anda Cari Tidak Di Temukan:("); 10 | let random = functions.randomize(res); 11 | return client 12 | .sendButton( 13 | msg.from, 14 | (await client.getBuffer(random.url)).buffer, 15 | "imageMessage", 16 | [{ id: `.pinterest ${query}`, text: "Get Again" }], 17 | { 18 | caption: functions.parseResult(random, { title: "Pinterest Image" }), 19 | footer: botinfo.footerText, 20 | } 21 | ) 22 | .catch((e) => 23 | client.reply( 24 | msg, 25 | `Terjadi Kesalahan Dalam Mengirim Media, ${random.url}` 26 | ) 27 | ); 28 | }, 29 | { 30 | wait: true, 31 | query: `Masukkan Query Anda Untuk Info Ketik .pinterest --info`, 32 | param: `${functions.needed("query")}`, 33 | info: "Mencarikan Foto Di Pinterest", 34 | } 35 | ); 36 | 37 | cmd.on( 38 | "alphacoders", 39 | ["alphacoders"], 40 | ["image", "search"], 41 | async (msg, { query, client }) => { 42 | return client.sendButton( 43 | msg.from, 44 | ( 45 | await client.getBuffer( 46 | botinfo.linkApi.zacros + "/search/alphacoders?query=" + query 47 | ) 48 | ).buffer, 49 | "imageMessage", 50 | [{ id: `.alphacoders ${query}`, text: "Get Again" }], 51 | { 52 | caption: functions.parseResult({ title: "Alphacoders Search" }), 53 | footer: botinfo.footerText, 54 | } 55 | ); 56 | }, 57 | { 58 | wait: true, 59 | query: `Masukkan Query Anda Untuk Info Ketik .alphacoders --info`, 60 | param: `${functions.needed("query")}`, 61 | info: "Mencarikan Foto Di Alphacoders", 62 | } 63 | ); 64 | 65 | cmd.on( 66 | "wallpapercave", 67 | ["wallpapercave"], 68 | ["image", "search"], 69 | async (msg, { query, client }) => { 70 | return client.sendButton( 71 | msg.from, 72 | ( 73 | await client.getBuffer( 74 | botinfo.linkApi.zacros + "/search/wallpapercave?query=" + query 75 | ) 76 | ).buffer, 77 | "imageMessage", 78 | [{ id: `.wallpapercave ${query}`, text: "Get Again" }], 79 | { 80 | caption: functions.parseResult({ title: "Wallpaper Cave Search" }), 81 | footer: botinfo.footerText, 82 | } 83 | ); 84 | }, 85 | { 86 | wait: true, 87 | query: `Masukkan Query Anda Untuk Info Ketik .wallpapercave --info`, 88 | param: `${functions.needed("query")}`, 89 | info: "Mencarikan Foto Di Wallpapercave", 90 | } 91 | ); 92 | 93 | cmd.on( 94 | "googleimage", 95 | ["gimage", "googleimage", "searchimage"], 96 | ["image", "search"], 97 | async (msg, { query, client, command }) => { 98 | let res = await functions.searchImage(`${query}`); 99 | if (res.length < 1) 100 | return client.reply(msg, "Hasil Di Google Tidak Di Temukan:("); 101 | let random = functions.randomize(res); 102 | await client.reply( 103 | { 104 | key: { fromMe: false, remoteJid: msg.from }, 105 | message: { videoMessage: { viewOnce: true } }, 106 | participant: "0@s.whatsapp.net", 107 | }, 108 | "Loading..." 109 | ); 110 | return client 111 | .sendMessage( 112 | msg.from, 113 | (await client.getBuffer(random.url)).buffer, 114 | "imageMessage", 115 | { 116 | quoted: msg, 117 | caption: functions.parseResult(random, { title: command }), 118 | } 119 | ) 120 | .catch((e) => 121 | client.reply( 122 | msg, 123 | `Terjadi Kesalahan Dalam Mengirim Media, ${random.url}` 124 | ) 125 | ); 126 | }, 127 | { 128 | query: `* Masukkan Query Anda Untuk Info Ketik .gimage --info`, 129 | param: `${functions.needed("query")}`, 130 | info: "Mencarikan Foto Di Google", 131 | } 132 | ); 133 | 134 | cmd.on( 135 | "wallpaperflare", 136 | ["wallpaper", "gambarhd"], 137 | ["image", "search"], 138 | async (msg, { query, client }) => { 139 | let res = await functions.searchImage(`${query} Wallpaper flare`); 140 | res = res.filter((tr) => tr.width > 700 && tr.height > 600); 141 | if (res.length < 1) 142 | return client.reply(msg, "Image Yang Anda Cari Tidak Di Temukan:("); 143 | let random = functions.randomize(res); 144 | await client.reply( 145 | { 146 | key: { fromMe: false, remoteJid: msg.from }, 147 | message: { videoMessage: { viewOnce: true } }, 148 | participant: "0@s.whatsapp.net", 149 | }, 150 | "Loading..." 151 | ); 152 | return client 153 | .sendMessage( 154 | msg.from, 155 | (await client.getBuffer(random.url)).buffer, 156 | "imageMessage", 157 | { 158 | quoted: msg, 159 | caption: functions.parseResult(random, { title: "Wallpaper Image" }), 160 | } 161 | ) 162 | .catch((e) => 163 | client.reply( 164 | msg, 165 | `Terjadi Kesalahan Dalam Mengirim Media, ${random.url}` 166 | ) 167 | ); 168 | }, 169 | { 170 | query: `Masukkan Query Anda Untuk Info Ketik .wallpaper --info`, 171 | param: `${functions.needed("query")}`, 172 | info: "Mencarikan Foto Wallpaper", 173 | } 174 | ); 175 | 176 | cmd.on( 177 | "pixiv", 178 | ["pixiv"], 179 | ["image", "search"], 180 | async (msg, { query, client }) => { 181 | let res = await functions.searchImage(`${query} Pixiv`); 182 | res = res.filter((tr) => tr.url.includes("pximg.net")); 183 | if (res.length < 1) 184 | return client.reply(msg, "Hasil Di Pixiv Tidak Di Temukan:("); 185 | let random = functions.randomize(res); 186 | await client.reply( 187 | { 188 | key: { fromMe: false, remoteJid: msg.from }, 189 | message: { videoMessage: { viewOnce: true } }, 190 | participant: "0@s.whatsapp.net", 191 | }, 192 | "Loading..." 193 | ); 194 | return client 195 | .sendMessage( 196 | msg.from, 197 | (await client.getBuffer(random.url)).buffer, 198 | "imageMessage", 199 | { 200 | quoted: msg, 201 | caption: functions.parseResult(random, { title: "Pixiv Image" }), 202 | } 203 | ) 204 | .catch((e) => 205 | client.reply( 206 | msg, 207 | `Terjadi Kesalahan Dalam Mengirim Media, ${random.url} ` 208 | ) 209 | ); 210 | }, 211 | { 212 | query: `Masukkan Query Anda Untuk Info Ketik .pixiv --info`, 213 | param: `${functions.needed("query")}`, 214 | info: "Mencarikan Foto Di Pixiv", 215 | } 216 | ); 217 | 218 | cmd.on( 219 | "vector", 220 | ["vector", "vectorstock"], 221 | ["image", "search"], 222 | async (msg, { query, client }) => { 223 | let res = await functions.searchImage(`${query} VectorStock`); 224 | res = res.filter((tr) => tr.url.includes("vectorstock")); 225 | if (res.length < 1) 226 | return client.reply(msg, "Hasil Di VectorStock Tidak Di Temukan:("); 227 | let random = functions.randomize(res); 228 | await client.reply( 229 | { 230 | key: { fromMe: false, remoteJid: msg.from }, 231 | message: { videoMessage: { viewOnce: true } }, 232 | participant: "0@s.whatsapp.net", 233 | }, 234 | "Loading..." 235 | ); 236 | return client 237 | .sendMessage( 238 | msg.from, 239 | (await client.getBuffer(random.url)).buffer, 240 | "imageMessage", 241 | { 242 | quoted: msg, 243 | caption: functions.parseResult(random, { 244 | title: "Vector Stock Image", 245 | }), 246 | } 247 | ) 248 | .catch((e) => 249 | client.reply( 250 | msg, 251 | `Terjadi Kesalahan Dalam Mengirim Media, ${random.url}` 252 | ) 253 | ); 254 | }, 255 | { 256 | query: `Masukan Query Anda Untuk Info Ketik .vector --info`, 257 | param: `${functions.needed("query")}`, 258 | info: "Mencarikan Foto Di Vector Stock", 259 | } 260 | ); 261 | 262 | cmd.on( 263 | "milf", 264 | ["milf"], 265 | ["image", "random"], 266 | async (msg, { query, client }) => { 267 | return client.sendImage( 268 | msg.from, 269 | botinfo.linkApi.zacros + "/randomimg/milf" 270 | ); 271 | } 272 | ); 273 | 274 | cmd.on( 275 | "waifu", 276 | ["waifu"], 277 | ["image", "random"], 278 | async (msg, { query, client }) => { 279 | return client.sendImage( 280 | msg.from, 281 | botinfo.linkApi.zacros + "/randomimg/waifu" 282 | ); 283 | } 284 | ); 285 | 286 | cmd.on( 287 | "husbu", 288 | ["husbu"], 289 | ["image", "random"], 290 | async (msg, { query, client }) => { 291 | return client.sendImage( 292 | msg.from, 293 | botinfo.linkApi.zacros + "/randomimg/husbu" 294 | ); 295 | } 296 | ); 297 | 298 | cmd.on( 299 | "cosplay", 300 | ["cosplay"], 301 | ["image", "random"], 302 | async (msg, { query, client }) => { 303 | return client.sendImage( 304 | msg.from, 305 | botinfo.linkApi.zacros + "/randomimg/cosplay" 306 | ); 307 | } 308 | ); 309 | -------------------------------------------------------------------------------- /lib/command/info.js: -------------------------------------------------------------------------------- 1 | cmd.on("covidindo", ["covidindo"], ["info"], async (msg, { query, client }) => { 2 | res = await functions.axios.get(`${botinfo.linkApi.zacros}/info/covid-indo`); 3 | let anu = res.data.result[0]; 4 | client.reply(msg, functions.parseResult(anu)); 5 | }); 6 | 7 | cmd.on( 8 | "infogempa", 9 | ["infogempa"], 10 | ["info"], 11 | async (msg, { query, client }) => { 12 | res = await functions.axios.get(`${botinfo.linkApi.zacros}/info/gempa`); 13 | let anu = res.data.result; 14 | let b = ``; 15 | for (let c of anu) 16 | b += functions.parseResult(c, { title: "Info Gempa / BMKG" }) + "\n"; 17 | return client.sendText(msg.from, b.trim()); 18 | }, 19 | { param: functions.needed("query") } 20 | ); 21 | 22 | cmd.on( 23 | "sc", 24 | ["sc", "script", "scriptbot"], 25 | ["info"], 26 | async (msg, { query, client }) => { 27 | client.sendText( 28 | msg.from, 29 | ` 30 | Link Script Bot ini : https://github.com/Zacros-Team/ZacrosBot 31 | Base Bot : https://github.com/Zobin33/Anu-wabot 32 | `, 33 | msg 34 | ); 35 | } 36 | ); 37 | 38 | cmd.on("botstats", ["botstats"], ["info"], async (msg, { client }) => { 39 | let os = require("os"); 40 | let nos = require("node-os-utils"); 41 | let moment = require("moment-timezone"); 42 | let anu = ``; 43 | for (let a of os.cpus()) { 44 | anu += "• *Model* : " + a.model + "\n"; 45 | anu += "• *Speed* : " + a.speed + "\n\n"; 46 | } 47 | let mess = ` Info Server 48 | 49 | • *Hostname* : ${os.hostname()} 50 | • *Ram* : ${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed( 51 | 2 52 | )}MB / ${Math.round(require(`os`).totalmem() / 1024 / 1024)}MB 53 | • *Platfrom* : ${os.platform()} 54 | • *Core* : ${os.cpus().length} 55 | • *Cpu Model* : ${os.cpus()[0].model} 56 | • *Ping* : ${moment().millisecond()} 57 | • *Version* : ${os.version()} 58 | • *Arch* : ${os.arch()} 59 | • *Type* : ${os.type()} 60 | 61 | *Cpu* 62 | 63 | ${anu.trim()} 64 | `; 65 | 66 | return client.sendText(msg.from, mess); 67 | }); 68 | -------------------------------------------------------------------------------- /lib/command/islamic.js: -------------------------------------------------------------------------------- 1 | cmd.on( 2 | "asmaulhusna", 3 | ["asmaulhusna"], 4 | ["islamic"], 5 | async (msg, { query, client }) => { 6 | let res = await functions.axios.get( 7 | botinfo.linkApi.zacros + "/islami/asmaulhusna" 8 | ); 9 | anu = res.data.result; 10 | return client.sendText(msg.from, functions.parseResult(anu)); 11 | } 12 | ); 13 | 14 | cmd.on( 15 | "doaseharian", 16 | ["doaseharian"], 17 | ["islamic"], 18 | async (msg, { query, client }) => { 19 | let res = await functions.axios.get( 20 | botinfo.linkApi.zacros + "/islami/doaseharian" 21 | ); 22 | anu = res.data.result; 23 | return client.sendText( 24 | msg.from, 25 | functions.parseResult(functions.randomize(anu)) 26 | ); 27 | } 28 | ); 29 | 30 | cmd.on( 31 | "quran", 32 | ["quran", "randomquran"], 33 | ["islamic"], 34 | async (msg, { query, client }) => { 35 | let res = await functions.axios.get( 36 | botinfo.linkApi.zacros + "/islami/quran" 37 | ); 38 | anu = res.data.result; 39 | await client.sendText( 40 | msg.from, 41 | functions.parseResult(anu, { title: "Random Quran" }) 42 | ); 43 | return client.sendAudio(msg.from, anu.audio); 44 | } 45 | ); 46 | -------------------------------------------------------------------------------- /lib/command/maker.js: -------------------------------------------------------------------------------- 1 | cmd.on( 2 | "stickermaker", 3 | ["sticker", "stiker"], 4 | ["maker"], 5 | async (msg, { query, usedPref, commandNpref, command }) => { 6 | if ( 7 | (msg.isMedia && !msg.type.includes("videoMessage")) || 8 | (msg.quotedMsg.isMedia && !msg.quotedMsg.type.includes("videoMessage")) 9 | ) { 10 | const getbuff = msg.quotedMsg.isMedia ? msg.quotedMsg : msg; 11 | const dlfile = await client.downloadMediaMessage(getbuff); 12 | const baper = new Buffer.from(dlfile); 13 | await client.sendSticker(msg.from, baper, { quoted: msg }); 14 | } else if ( 15 | (msg.isMedia && msg.message.videoMessage.seconds < 11) || 16 | (msg.quotedMsg.type.includes("videoMessage") && 17 | msg.quotedMsg.message.videoMessage.seconds < 11) 18 | ) { 19 | const getbuff = msg.quotedMsg.isMedia ? msg.quotedMsg : msg; 20 | const dlfile = await client.downloadMediaMessage(getbuff); 21 | const baper = new Buffer.from(dlfile); 22 | const exif = functions.createExif(botinfo.botname, "By "+ botinfo.ownername ,"watermark"); 23 | await client.sendSticker(msg.from, baper, { quoted: msg }, "./tmp/watermark.exif"); 24 | } else { 25 | client.reply( 26 | msg, 27 | `Pastikan kirim gambar/video dengan caption *${commandNpref}* atau tag gambar/video yang sudah dikirim\nNote : Durasi video maximal 10 detik` 28 | ); 29 | } 30 | }, 31 | { wait: true, _media: true } 32 | ); 33 | 34 | cmd.on( 35 | "toimg", 36 | ["toimg"], 37 | ["maker"], 38 | async (msg, { client }) => { 39 | client.toImage(msg.from, (await msg.quotedMsg.downloadMsg()).buffer); 40 | }, 41 | { usedPrefix: true, param: functions.needed("Tag sticker") } 42 | ); 43 | 44 | cmd.on("skytext", ["skytext"], ["maker"], async (msg, { query, client }) => { 45 | if (!query) 46 | return client.sendText(msg.from, `Isi Query!!\nContoh : .skytext Anu`, msg); 47 | res = await functions.axios.get( 48 | `https://exneph-api.herokuapp.com/api/maker2?text=${query 49 | .toLowerCase() 50 | .trim()}&apikey=ZYY` 51 | ); 52 | let anu = res.data.result; 53 | await client.reply( 54 | { 55 | key: { fromMe: false, remoteJid: msg.from }, 56 | message: { videoMessage: { viewOnce: true } }, 57 | participant: "0@s.whatsapp.net", 58 | }, 59 | "Loading..." 60 | ); 61 | return client.sendMessage( 62 | msg.from, 63 | (await client.getBuffer(anu.results)).buffer, 64 | "imageMessage", 65 | { caption: ``, quoted: msg }, 66 | { thumbnail: buffer.alloc(0) } 67 | ); 68 | }); 69 | 70 | cmd.on( 71 | "tiktok", 72 | ["glitch"], 73 | ["maker"], 74 | async (msg, { query, client }) => { 75 | let q = query.split("|"); 76 | if (!q[0]) return client.sendText(msg.from, "Masukan Teks 1!", msg); 77 | if (!q[1]) return client.sendText(msg.from, "Masukan Teks 2!", msg); 78 | let tod = await functions.axios.get( 79 | botinfo.linkApi.zacros + 80 | "/photooxy/tik_tok?text=" + 81 | q[0] + 82 | "&text2=" + 83 | q[1] 84 | ); 85 | client.sendImage(msg.from, tod, botinfo.response.success); 86 | }, 87 | { param: functions.needed("query"), wait: true } 88 | ); 89 | 90 | cmd.on( 91 | "nulis", 92 | ["nulis"], 93 | ["maker"], 94 | async (msg, { query, client }) => { 95 | let tod = await functions.axios.get( 96 | botinfo.linkApi.zacros + "/other/nulis?text=" + query 97 | ); 98 | client.sendImage(msg.from, tod, botinfo.response.success); 99 | }, 100 | { param: functions.needed("query"), wait: true } 101 | ); 102 | -------------------------------------------------------------------------------- /lib/command/menu.js: -------------------------------------------------------------------------------- 1 | cmd.on( 2 | "menu-cmd", 3 | ["menu", "help", "command", "commands"], 4 | [], 5 | async (msg, { prefix, client, query, usedPrefix }) => { 6 | let { list, body, upper, down, line, head } = botinfo.unicode; 7 | let type = query && query.toLowerCase(); 8 | let lama = []; 9 | if (!cmd._tags[type]) { 10 | let sections = []; 11 | let list_now = 0; 12 | let list_nitip = {}; 13 | for (let b in cmd._tags) { 14 | let tit = 15 | list_now == 0 16 | ? `${upper}${list} ${list}${line.repeat(13)}${list} ${ 17 | list_now + 1 18 | } ${list}${line.repeat(13)}${list}` 19 | : `${body}${list} ${list}${line.repeat(13)}${list} ${ 20 | list_now + 1 21 | } ${list}${line.repeat(13)}${list}`; 22 | sections.push({ 23 | title: tit, 24 | rows: [ 25 | { 26 | title: `${b[0].toUpperCase() + b.slice(1).toLowerCase()} Menu`, 27 | rowId: prefix[0] + `menu${b}`, 28 | description: 29 | "Membuka Menu " + b[0].toUpperCase() + b.slice(1).toLowerCase(), 30 | }, 31 | ], 32 | }); 33 | list_nitip[b] = prefix[0] + `menu${b}`; 34 | list_now++; 35 | } 36 | return client.sendMessageFromContent(msg.from, { 37 | listMessage: { 38 | title: `*Hai ${msg.sender.name}!*`, 39 | description: `Berikut Daftar Menunya!`, 40 | footerText: `Tekan tombol yang bertuliskan "Daftar Menu" yaa!\n\nJika mengalami kesulitan dalam menggunakan bot, kamu bisa mengetik .infopenggunaan dalam kolom chat`, 41 | buttonText: "Daftar Menu", 42 | listType: "SINGLE_SELECT", 43 | sections, 44 | }, 45 | }); 46 | } 47 | for (let a of cmd._tags[type]) { 48 | if (!a.enable) continue; 49 | let prek = a.usedPrefix ? prefix[0] : ""; 50 | let param = a.param ? a.param : ""; 51 | lama = lama.concat(a.command.map((value) => prek + value + ` ${param}`)); 52 | } 53 | 54 | let hasil = `${head}${line.repeat(4)}${list} *${ 55 | type[0].toUpperCase() + type.slice(1).toLowerCase() 56 | } Menu*\n`; 57 | for (let b of lama) { 58 | hasil += list + ` ${b.toLowerCase()}\n`; 59 | } 60 | 61 | hasil = hasil.trim() + `\n${head}${line.repeat(2)}${list}`; 62 | 63 | buttons = [ 64 | { 65 | buttonId: `.info`, 66 | buttonText: { 67 | displayText: "Information", 68 | }, 69 | type: 1, 70 | }, 71 | { 72 | buttonId: prefix[0] + `snk`, 73 | buttonText: { 74 | displayText: "Syarat Dan Ketentuan", 75 | }, 76 | type: 1, 77 | }, 78 | ]; 79 | let locationMessage = { jpegThumbnail: logo.buffer }; 80 | used_logo = (used_logo + 1) % 3; 81 | let buttonsMessage = { 82 | contentText: hasil, 83 | footerText: 84 | botinfo.footerText + 85 | " | " + 86 | Object.keys(userDb).length + 87 | " User Registered", 88 | buttons, 89 | headerType: 1, 90 | }; 91 | return client.sendMessageFromContent(msg.from, { buttonsMessage }); 92 | } 93 | ); 94 | -------------------------------------------------------------------------------- /lib/command/multipleclient.js: -------------------------------------------------------------------------------- 1 | cmd.on( 2 | "multipleclient", 3 | ["multipleclient"], 4 | ["owner"], 5 | async (msg, res) => { 6 | let id = Date.now() + ``; 7 | res.client.reply(msg, botinfo.wait); 8 | clients[id] = new (require("../functions.js").WAConnection)(); 9 | clients[id].cmd = new (require("../command.js"))( 10 | clients[id], 11 | botinfo, 12 | functions 13 | ); 14 | clients[id].cmd._events = cmd._events; 15 | 16 | clients[id].on("qr", async (code) => { 17 | let message = await res.client.sendMessage( 18 | msg.from, 19 | await functions.qrcode.toBuffer(code), 20 | "imageMessage", 21 | { quoted: msg, caption: "Scan Qr Ini!" } 22 | ); 23 | await functions.delay(40000); 24 | return res.client.deleteMessage(message.key.jid, message.key); 25 | }); 26 | 27 | clients[id].on("chat-update", async (chat) => { 28 | if (!chat.hasNewMessage) return; 29 | if ( 30 | !Object.keys(chat.messages.array[0]).includes("message") || 31 | !Object.keys(chat.messages.array[0]).includes("key") 32 | ) 33 | return; 34 | const msg = functions.metadataMsg(client, chat.messages.array[0]); 35 | if (msg.key.id.length < 20 || msg.key.remoteJid == "status@broadcast") 36 | return; 37 | try { 38 | clients[id].cmd.execute(msg); 39 | } catch (e) { 40 | console.log(e); 41 | await client.sendMessage( 42 | botinfo.ownerNumber[0] + `@s.whatsapp.net`, 43 | "Info Error!", 44 | "conversation" 45 | ); 46 | await client.sendMessage( 47 | botinfo.ownerNumber[0] + `@s.whatsapp.net`, 48 | functions.util.format(e), 49 | "conversation" 50 | ); 51 | return 1; 52 | } 53 | }); 54 | 55 | res.query && clients[id].loadAuthInfo(query); 56 | clients[id].connect().catch((e) => client.reply(msg, "Gagal Terhubung")); 57 | 58 | return res.client.reply( 59 | msg, 60 | "Berhasil Menautkan Ke" + clients[id].user.name 61 | ); 62 | }, 63 | { owner: true } 64 | ); 65 | -------------------------------------------------------------------------------- /lib/command/news.js: -------------------------------------------------------------------------------- 1 | let NewsApi = require("@dhnapi/news-api"); 2 | let dapi = new NewsApi(); 3 | let plugins = dapi._plugins.map((item) => 4 | Object.keys(item)[0].replace(/(\.\w+)/gi, "news") 5 | ); 6 | 7 | cmd.on( 8 | "NewsApi", 9 | plugins, 10 | ["news"], 11 | (msg, res) => { 12 | dapi[res.command.split("news")[0]]((response, error) => { 13 | if (error) return client.reply(msg, error.message); 14 | let txt = ""; 15 | for (let data of response.data.result) 16 | txt += functions.parseResult(data) + "\n\n"; 17 | txt += ""; 18 | return client.reply(msg, txt); 19 | }); 20 | }, 21 | { 22 | wait: true, 23 | } 24 | ); 25 | -------------------------------------------------------------------------------- /lib/command/other.js: -------------------------------------------------------------------------------- 1 | cmd.on("example3", ["speed", "response"], ["other"], async (req, res) => { 2 | timestamp = functions.Speed(); 3 | latensi = functions.Speed(); 4 | -timestamp; 5 | return client.sendText( 6 | req.from, 7 | "Speed Response is " + latensi.toFixed(4) + " Second", 8 | req 9 | ); 10 | }); 11 | 12 | cmd.on("btnrespon", ["carapenggunaan"], ["info"], async (msg, res) => { 13 | txt = `_*Cara Penggunaan*_ 14 | 15 | • Untuk Command Yang Bertanda ** 16 | artinya kamu harus reply media dengan command tersebut, contoh : .sticker (media/ reply video/gambar) 17 | 18 | • Untuk command yang bertanda ** 19 | artinya kamu harus reply sticker dengan command tersebut, contoh : .toimg (sticker/ reply sticker/sticker gif) 20 | 21 | • Untuk command yang bertanda *