├── .node-persist └── storage │ └── 4651253a81c216ecf694139dcbb20d02 ├── LICENSE ├── README.md ├── index.js ├── lib ├── ban.js ├── banned.json ├── color.js ├── fetcher.js ├── functions.js ├── help.js ├── husbu.json ├── index.js ├── msgFilter.js ├── nsfw.json ├── poll.js ├── queue.js ├── sendSticker.js ├── translate.js ├── waifu.json ├── welcome.js ├── welcome.json └── yt.js ├── media ├── Zelda.mp3 ├── images │ ├── emilia-re-zero-wallpaper-full-hd-1920x1080-158894.jpg │ └── noBg.png └── sticker │ ├── 917019253026-1601785546@g.us.gif │ ├── firstframe917019253026-1601785546@g.us.png │ └── temp917019253026-1601785546@g.us.mp4 ├── msgHandler.js └── package.json /.node-persist/storage/4651253a81c216ecf694139dcbb20d02: -------------------------------------------------------------------------------- 1 | {"key":"executablePath","value":"/usr/bin/chromium-browser"} -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 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 General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## This Project is Dead. If you're still intrested in WA-Bots, Please Check [WhatsApp-Botto-Xre](https://github.com/SomnathDas/Whatsapp-Botto-Xre). Thank you 2 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const { create } = require('@open-wa/wa-automate') 2 | const msgHandler = require('./msgHandler') 3 | const welcome = require('./lib/welcome.js') 4 | const fs = require('fs-extra') 5 | const serverOption = { 6 | headless: true, 7 | cacheEnabled: false, 8 | useChrome: true, 9 | chromiumArgs: [ 10 | '--no-sandbox', 11 | '--disable-setuid-sandbox', 12 | '--aggressive-cache-discard', 13 | '--disable-cache', 14 | '--disable-application-cache', 15 | '--disable-offline-load-stale-cache', 16 | '--disk-cache-size=0' 17 | ] 18 | } 19 | 20 | const opsys = process.platform 21 | if (opsys === 'win32' || opsys === 'win64') { 22 | serverOption.executablePath = 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe' 23 | } else if (opsys === 'linux') { 24 | serverOption.browserRevision = '737027' 25 | } else if (opsys === 'darwin') { 26 | serverOption.executablePath = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' 27 | } 28 | 29 | const startServer = async (client) => { 30 | global.sclient = client 31 | global.sendingAnimatedSticker = [] 32 | global.queueAnimatedSticker = [] 33 | global.amdownloaden = [] 34 | global.queuemp3 = [] 35 | global.queuemp4 = [] 36 | console.log('[SERVER] Server Started!') 37 | // Force it to keep the current session 38 | client.onStateChanged((state) => { 39 | console.log('[Client State]', state) 40 | if (state === 'CONFLICT' || state === 'UNLAUNCHED') client.forceRefocus() 41 | }) 42 | // listening on message 43 | client.onMessage((message) => { 44 | msgHandler(client, message) 45 | }) 46 | 47 | client.onGlobalParicipantsChanged((event) => { 48 | welcome(client, event) 49 | }) 50 | 51 | client.onAddedToGroup((chat) => { 52 | let totalMem = chat.groupMetadata.participants.length 53 | if (totalMem < 30) { 54 | client.sendText(chat.id, `This group only has ${totalMem} members, Its needs atleast 30 members to activate the services`).then(() => client.leaveGroup(chat.id)) 55 | client.deleteChat(chat.id) 56 | } else { 57 | client.sendText(chat.groupMetadata.id, `Thanks for adding me *${chat.contact.name}*. Use #help to see the usable commands`) 58 | } 59 | }) 60 | 61 | // listening on Incoming Call 62 | client.onIncomingCall((call) => { 63 | client.sendText(call.peerJid, '...') 64 | client.contactBlock(call.peerJid) 65 | ban.push(call.peerJid) 66 | fs.writeFileSync('./lib/banned.json', JSON.stringify(ban)) 67 | }) 68 | } 69 | 70 | create('session', serverOption) 71 | .then(async (client) => startServer(client)) 72 | .catch((error) => console.log(error)) 73 | -------------------------------------------------------------------------------- /lib/ban.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra') 2 | 3 | exports.ban = async function (message) { 4 | numBan = message.body.substring(message.body.indexOf('@') + 1) 5 | fs.appendFileSync('./lib/ban.txt', `${message.from} ${numBan}@c.us\n`) 6 | console.log(numBan) 7 | } 8 | 9 | exports.unban = async function (message) { 10 | numUnBan = message.body.substring(message.body.indexOf('@') + 1) 11 | fs.readFile('./lib/ban.txt', { encoding: 'utf-8'}, function (err, data) { 12 | if (err) throw err 13 | 14 | let dataArray = data.split('\n') 15 | const key = `${message.from} ${numUnBan}@c.us` 16 | let lastI = -1 17 | 18 | for (let i = 0; i < dataArray.length; i++) { 19 | if (dataArray[i].includes(key)) { 20 | lastI = i 21 | break 22 | } 23 | } 24 | dataArray.splice(lastI, 1) 25 | const dataUpdate = dataArray.join('\n') 26 | fs.writeFile('./lib/ban.txt', dataUpdate, function(err) { 27 | if (err) throw err 28 | }) 29 | }) 30 | } -------------------------------------------------------------------------------- /lib/banned.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /lib/color.js: -------------------------------------------------------------------------------- 1 | module.exports = color = (text, color) => { 2 | switch (color) { 3 | case 'red': return '\x1b[31m' + text + '\x1b[0m' 4 | case 'yellow': return '\x1b[33m' + text + '\x1b[0m' 5 | default: return '\x1b[32m' + text + '\x1b[0m' // default is green 6 | } 7 | } -------------------------------------------------------------------------------- /lib/fetcher.js: -------------------------------------------------------------------------------- 1 | const fetch = require('node-fetch'); 2 | 3 | const getBase64 = async (url) => { 4 | const response = await fetch(url, { headers: { 'User-Agent': 'okhttp/4.5.0' } }); 5 | if (!response.ok) throw new Error(`unexpected response ${response.statusText}`); 6 | const buffer = await response.buffer(); 7 | const videoBase64 = `data:${response.headers.get('content-type')};base64,` + buffer.toString('base64'); 8 | if (buffer) 9 | return videoBase64; 10 | }; 11 | 12 | exports.getBase64 = getBase64; 13 | -------------------------------------------------------------------------------- /lib/functions.js: -------------------------------------------------------------------------------- 1 | const fetch = require('node-fetch') 2 | const { getBase64 } = require("./fetcher"); 3 | 4 | const liriklagu = async (lagu) => { 5 | const response = await fetch('http://scrap.terhambar.com/lirik?word='+lagu) 6 | if (!response.ok) throw new Error(`unexpected response ${response.statusText}`); 7 | const json = await response.json() 8 | if (json.status) return `Lyrics - ${lagu}\n\n${json.result.lirik}` 9 | } 10 | 11 | const cerpen = async () => { 12 | const response = await fetch('http://api.fdci.se/cerpen') 13 | if (!response.ok) throw new Error(`nexpected response ${response.status}`) 14 | const text = await response.text() 15 | if (text.status) return text 16 | } 17 | 18 | const quotemaker = async (quotes, author = 'Zelda', type = 'random') => { 19 | var q = quotes.replace(/ /g, '%20').replace('\n','%5Cn') 20 | const response = await fetch(`https://terhambar.com/aw/qts/?kata=${q}&author=${author}&tipe=${type}`) 21 | if (!response.ok) throw new Error(`unexpected response ${response.statusText}`); 22 | const json = await response.json() 23 | if (json.status) { 24 | if (json.result !== '') { 25 | const base64 = await getBase64(json.result) 26 | return base64 27 | } 28 | } 29 | } 30 | const wall = async(query) => { 31 | var q = query.replace(/ /g, '+') 32 | const response = await fetch(`https://wall.alphacoders.com/api2.0/get.php?auth=3e7756c85df54b78f934a284c11abe4e&method=search&term=${q}`) 33 | if (!response.ok) throw new Error(`unexpected response ${response.statusText}`) 34 | const json = await response.json() 35 | console.log(json) 36 | if (json.success === true) { 37 | return json.wallpapers[0].url_image 38 | } else { 39 | return `https://c4.wallpaperflare.com/wallpaper/976/117/318/anime-girls-404-not-found-glowing-eyes-girls-frontline-wallpaper-preview.jpg` 40 | } 41 | } 42 | 43 | const custom = async (imageUrl, top, bottom) => new Promise((resolve, reject) => { 44 | topText = top.trim().replace(/\s/g, '_').replace(/\?/g, '~q').replace(/\%/g, '~p').replace(/\#/g, '~h').replace(/\//g, '~s') 45 | bottomText = bottom.trim().replace(/\s/g, '_').replace(/\?/g, '~q').replace(/\%/g, '~p').replace(/\#/g, '~h').replace(/\//g, '~s') 46 | fetchBase64(`https://api.memegen.link/images/custom/${topText}/${bottomText}.png?background=${imageUrl}`, 'image/png') 47 | .then((result) => resolve(result)) 48 | .catch((err) => { 49 | console.error(err) 50 | reject(err) 51 | }) 52 | }) 53 | 54 | module.exports = { 55 | custom 56 | } 57 | 58 | exports.liriklagu = liriklagu; 59 | exports.quotemaker = quotemaker; 60 | exports.cerpen = cerpen; 61 | exports.wall = wall; 62 | -------------------------------------------------------------------------------- /lib/help.js: -------------------------------------------------------------------------------- 1 | const botname = 'Emilia' 2 | const prefix = '#' 3 | function help( pushname ) { 4 | return `👋️Hi *${pushname}*, I'm ${botname}. 5 | 6 | ⭐️ *Command List* ⭐️ 7 | 8 | *_User Commands_* 👥️ 9 | 10 | *CMD: #profile* 📝️ 11 | *Description: Display's the profile of user in* 12 | *Usage: #profile* 13 | 14 | *CMD: #groupinfo* ❤️ 15 | *Description: Displays the information of the group* 16 | *Usage: #groupinfo* 17 | 18 | *CMD: #info* 📃️ 19 | *Description: Displays the information about the bot* 20 | *Usage: #info* 21 | 22 | *_Query commands_* 🏕️ 23 | 24 | *CMD: #anime * ⛩️ 25 | *Description: Displays the infromation of the given anime name* 26 | *Usage: #anime black butler* 27 | 28 | *CMD: #wallpaper * 🌌️ 29 | *Description: Return's a wallpaper with the specified query* 30 | *Usage: #wallpaper Zelda* 31 | 32 | *CMD: #sr * 📱️ 33 | *Description: Return's a wallpaper with the specified query* 34 | *Usage: #sr animeirl* 35 | 36 | *CMD: #translate * 📒️ 37 | *Description: Translates the quoted text* 38 | *Usage: [quoted_msg] #translate en* 39 | *Language codes: https://www.loc.gov/standards/iso639-2/php/code_list.php* 40 | 41 | *CMD: #covid * 🌍️ 42 | *Description: Return's a wallpaper with the specified query* 43 | *Usage: #covid japan* 44 | 45 | *CMD: #lyrics * 🎶️ 46 | *Description: Displays the lyrics of the given song* 47 | *Usage: #lyrics Il vento d'oro* 48 | 49 | *CMD: #quotemaker | Quote | author* 🌆️ 50 | *Description: Turns your quote into a sharable image* 51 | *Usage: #quotemaker | Courage need not to be remembered for it is never forgotten | Zelda* 52 | 53 | *_Random commands_* ✨️ 54 | 55 | *CMD: #pokemon* 🎯️ 56 | *Description: Send an image of a random pokemon* 57 | *Usage: #pokemon* 58 | 59 | *CMD: #rpaper* 🏙️ 60 | *Description: Sends a random wallpaper* 61 | *Usage: #rpaper* 62 | 63 | *CMD: #waifu* ❤️ 64 | *Description: Send the source and image of a random waifu* 65 | *Usage: #waifu* 66 | 67 | *CMD: #animeneko* 🐱️ 68 | *Description: sends an image of a cultured neko* 69 | *Usage: #animeneo* 70 | 71 | *CMD: #neko* 🐈️ 72 | *Description: Sends an image of a random neko* 73 | *Usage: #neko* 74 | 75 | *CMD: #doggo* 🐕️ 76 | *Description: sends an image of a random pup* 77 | *Usage: #doggo* 78 | 79 | 80 | *_Sticker Commands_* 🌌️ 81 | 82 | *CMD: #sticker* 🔖️ 83 | *Description: Turns images into stickers* 84 | *Usage: Send an image or video with #sticker as caption* 85 | 86 | *CMD: #tsticker* ♥️ 87 | *Description: Removes the background of images and turns into stickers* 88 | *Usage: Send an image with #tsticker as caption* [works only with images] 89 | 90 | *Admin Commands - 1* 👑️ 91 | Note:To use these commands, The person in question must be admin 92 | 93 | *CMD: #act welcome* 🎉️ 94 | *Description: If this is active, the bot will welcome new members to te group* 95 | *Usage: #act welcome* 96 | 97 | *CMD: #act nsfw* 🔐️ 98 | *Description: If this is active, the bot will be able to send 18+ content* 99 | *Usage: #act nsfw* 100 | 101 | *CMD: #ping * 🗣️ 102 | *Description: Tags all members in the group* 103 | *Usage: #ping* 104 | 105 | *CMD: #delete* 🔀️ 106 | *Description: Deletes the bot's texts* 107 | *Usage: use #delete while taging the bot's texts* 108 | 109 | *_Admin Commads - 2_* 🌠️ 110 | Note: To execute the following commands the bot and the author needs to be admin 111 | 112 | *CMD: #seticon* ❇️ 113 | *Description: Sets the quoted image as the group icon* 114 | *Usage: #seticon* 115 | 116 | *CMD: #kick @user* 🏌️ 117 | *Description: Kicks the mentioned person from the group* 118 | *Usage: #kick @+10832023922* 119 | 120 | *CMD: #promote @user* ⚖️ 121 | *Description: Makes the metioned user admin* 122 | *Usage: #promote @+10832023922* 123 | 124 | *CMD: #demote @user* ⬇️ 125 | *Description: Demotes the mentioned user from adminship* 126 | *Usage: #demote @+10832023922* 127 | 128 | 129 | 130 | We hope you have a great time!` 131 | } 132 | exports.help = help() 133 | 134 | function info() { 135 | return `*Bot infromation!* 🎉️ 136 | 137 | This bot is written in pure javascript with node.js runtime. 138 | If you'd like to know more join our support group using the link below! 139 | 140 | Support Group: https://chat.whatsapp.com/DI6qXVdkqF2BBOeLD2sLqX 141 | 142 | Github Repo: https://github.com/SomnathDas/Whatsapp-Botto-Re 143 | 144 | *Author: Alen Yohannan* 145 | *Base Code: Yoga Sakthi* 146 | *Features: MhankBarBar* 147 | *Poll: Shubham Badgujar*` 148 | 149 | } 150 | exports.info = info() 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /lib/husbu.json: -------------------------------------------------------------------------------- 1 | 2 | [ 3 | { 4 | "teks": "Mikoto Mikoshiba", 5 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/08/joi-mikorin-featured-700x394.jpg" 6 | }, 7 | { 8 | "teks": "(Top Leader) Mikazuki Augus", 9 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 10 | }, 11 | { 12 | "teks": "Azusagawa Sakuta", 13 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 14 | }, 15 | { 16 | "teks": "Hideyuki Maya", 17 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 18 | }, 19 | { 20 | "teks": "Slaine Troyard", 21 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 22 | }, 23 | { 24 | "teks": "Willem Kmetsch", 25 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 26 | }, 27 | { 28 | "teks": "Slaine Troyard", 29 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 30 | }, 31 | { 32 | "teks": "(Top Leader) Mikazuki Augus", 33 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 34 | }, 35 | { 36 | "teks": "Hideyuki Maya", 37 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 38 | }, 39 | { 40 | "teks": "Willem Kmetsch", 41 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 42 | }, 43 | { 44 | "teks": "Kinoshita Hideyoshi", 45 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 46 | }, 47 | { 48 | "teks": "Azusagawa Sakuta", 49 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 50 | }, 51 | { 52 | "teks": "Kinoshita Hideyoshi", 53 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 54 | }, 55 | { 56 | "teks": "(Top Leader) Mikazuki Augus", 57 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 58 | }, 59 | { 60 | "teks": "Slaine Troyard", 61 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 62 | }, 63 | { 64 | "teks": "Hideyuki Maya", 65 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 66 | }, 67 | { 68 | "teks": "Kinoshita Hideyoshi", 69 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 70 | }, 71 | { 72 | "teks": "Kinoshita Hideyoshi", 73 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 74 | }, 75 | { 76 | "teks": "Bakugou Katsuki", 77 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/07/kacchan_cover1-700x409.jpg?x21210" 78 | }, 79 | { 80 | "teks": "Takigawa Yoshino", 81 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 82 | }, 83 | { 84 | "teks": "Slaine Troyard", 85 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 86 | }, 87 | { 88 | "teks": "Hideyuki Maya", 89 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 90 | }, 91 | { 92 | "teks": "(Top Leader) Mikazuki Augus", 93 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 94 | }, 95 | { 96 | "teks": "(CEO) Orga Itsuka", 97 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 98 | }, 99 | { 100 | "teks": "Takigawa Yoshino", 101 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 102 | }, 103 | { 104 | "teks": "Kinoshita Hideyoshi", 105 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 106 | }, 107 | { 108 | "teks": "Slaine Troyard", 109 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 110 | }, 111 | { 112 | "teks": "Haruitsuki Abeno", 113 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2016/12/joi-abeno-featured-700x394.jpg" 114 | }, 115 | { 116 | "teks": "Azusagawa Sakuta", 117 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 118 | }, 119 | { 120 | "teks": "Azusagawa Sakuta", 121 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 122 | }, 123 | { 124 | "teks": "Hideyuki Maya", 125 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 126 | }, 127 | { 128 | "teks": "Slaine Troyard", 129 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 130 | }, 131 | { 132 | "teks": "Willem Kmetsch", 133 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 134 | }, 135 | { 136 | "teks": "Mikoto Mikoshiba", 137 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/08/joi-mikorin-featured-700x394.jpg" 138 | }, 139 | { 140 | "teks": "Mikoto Mikoshiba", 141 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/08/joi-mikorin-featured-700x394.jpg" 142 | }, 143 | { 144 | "teks": "(Top Leader) Mikazuki Augus", 145 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 146 | }, 147 | { 148 | "teks": "(CEO) Orga Itsuka", 149 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 150 | }, 151 | { 152 | "teks": "Willem Kmetsch", 153 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 154 | }, 155 | { 156 | "teks": "Bakugou Katsuki", 157 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/07/kacchan_cover1-700x409.jpg?x21210" 158 | }, 159 | { 160 | "teks": "Slaine Troyard", 161 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 162 | }, 163 | { 164 | "teks": "(Top Leader) Mikazuki Augus", 165 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 166 | }, 167 | { 168 | "teks": "Willem Kmetsch", 169 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 170 | }, 171 | { 172 | "teks": "Kinoshita Hideyoshi", 173 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 174 | }, 175 | { 176 | "teks": "Mikoto Mikoshiba", 177 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/08/joi-mikorin-featured-700x394.jpg" 178 | }, 179 | { 180 | "teks": "Willem Kmetsch", 181 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 182 | }, 183 | { 184 | "teks": "Bakugou Katsuki", 185 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/07/kacchan_cover1-700x409.jpg?x21210" 186 | }, 187 | { 188 | "teks": "Haruitsuki Abeno", 189 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2016/12/joi-abeno-featured-700x394.jpg" 190 | }, 191 | { 192 | "teks": "Takigawa Yoshino", 193 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 194 | }, 195 | { 196 | "teks": "(Top Leader) Mikazuki Augus", 197 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 198 | }, 199 | { 200 | "teks": "Slaine Troyard", 201 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 202 | }, 203 | { 204 | "teks": "(Top Leader) Mikazuki Augus", 205 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 206 | }, 207 | { 208 | "teks": "Kinoshita Hideyoshi", 209 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 210 | }, 211 | { 212 | "teks": "Willem Kmetsch", 213 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 214 | }, 215 | { 216 | "teks": "Takigawa Yoshino", 217 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 218 | }, 219 | { 220 | "teks": "Hideyuki Maya", 221 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 222 | }, 223 | { 224 | "teks": "(CEO) Orga Itsuka", 225 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 226 | }, 227 | { 228 | "teks": "(CEO) Orga Itsuka", 229 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 230 | }, 231 | { 232 | "teks": "Slaine Troyard", 233 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 234 | }, 235 | { 236 | "teks": "Haruitsuki Abeno", 237 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2016/12/joi-abeno-featured-700x394.jpg" 238 | }, 239 | { 240 | "teks": "Bakugou Katsuki", 241 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/07/kacchan_cover1-700x409.jpg?x21210" 242 | }, 243 | { 244 | "teks": "Takigawa Yoshino", 245 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 246 | }, 247 | { 248 | "teks": "Mikoto Mikoshiba", 249 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/08/joi-mikorin-featured-700x394.jpg" 250 | }, 251 | { 252 | "teks": "(Top Leader) Mikazuki Augus", 253 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 254 | }, 255 | { 256 | "teks": "(Top Leader) Mikazuki Augus", 257 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 258 | }, 259 | { 260 | "teks": "Azusagawa Sakuta", 261 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 262 | }, 263 | { 264 | "teks": "Azusagawa Sakuta", 265 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 266 | }, 267 | { 268 | "teks": "Azusagawa Sakuta", 269 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 270 | }, 271 | { 272 | "teks": "Azusagawa Sakuta", 273 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 274 | }, 275 | { 276 | "teks": "Takigawa Yoshino", 277 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 278 | }, 279 | { 280 | "teks": "(Top Leader) Mikazuki Augus", 281 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 282 | }, 283 | { 284 | "teks": "(CEO) Orga Itsuka", 285 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 286 | }, 287 | { 288 | "teks": "Mikoto Mikoshiba", 289 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/08/joi-mikorin-featured-700x394.jpg" 290 | }, 291 | { 292 | "teks": "Takigawa Yoshino", 293 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 294 | }, 295 | { 296 | "teks": "(CEO) Orga Itsuka", 297 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 298 | }, 299 | { 300 | "teks": "Slaine Troyard", 301 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 302 | }, 303 | { 304 | "teks": "Willem Kmetsch", 305 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 306 | }, 307 | { 308 | "teks": "(Top Leader) Mikazuki Augus", 309 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 310 | }, 311 | { 312 | "teks": "Bakugou Katsuki", 313 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/07/kacchan_cover1-700x409.jpg?x21210" 314 | }, 315 | { 316 | "teks": "(CEO) Orga Itsuka", 317 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 318 | }, 319 | { 320 | "teks": "Kinoshita Hideyoshi", 321 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 322 | }, 323 | { 324 | "teks": "Willem Kmetsch", 325 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 326 | }, 327 | { 328 | "teks": "(Top Leader) Mikazuki Augus", 329 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 330 | }, 331 | { 332 | "teks": "Hideyuki Maya", 333 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 334 | }, 335 | { 336 | "teks": "Takigawa Yoshino", 337 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 338 | }, 339 | { 340 | "teks": "Kinoshita Hideyoshi", 341 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 342 | }, 343 | { 344 | "teks": "Kinoshita Hideyoshi", 345 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 346 | }, 347 | { 348 | "teks": "Slaine Troyard", 349 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 350 | }, 351 | { 352 | "teks": "Bakugou Katsuki", 353 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/07/kacchan_cover1-700x409.jpg?x21210" 354 | }, 355 | { 356 | "teks": "Kinoshita Hideyoshi", 357 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 358 | }, 359 | { 360 | "teks": "Takigawa Yoshino", 361 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 362 | }, 363 | { 364 | "teks": "(Top Leader) Mikazuki Augus", 365 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 366 | }, 367 | { 368 | "teks": "Hideyuki Maya", 369 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 370 | }, 371 | { 372 | "teks": "(CEO) Orga Itsuka", 373 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 374 | }, 375 | { 376 | "teks": "Bakugou Katsuki", 377 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/07/kacchan_cover1-700x409.jpg?x21210" 378 | }, 379 | { 380 | "teks": "Slaine Troyard", 381 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 382 | }, 383 | { 384 | "teks": "Takigawa Yoshino", 385 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 386 | }, 387 | { 388 | "teks": "Azusagawa Sakuta", 389 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 390 | }, 391 | { 392 | "teks": "Willem Kmetsch", 393 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 394 | }, 395 | { 396 | "teks": "(Top Leader) Mikazuki Augus", 397 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 398 | }, 399 | { 400 | "teks": "Haruitsuki Abeno", 401 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2016/12/joi-abeno-featured-700x394.jpg" 402 | } 403 | ] 404 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | exports.translate = require('./translate') 2 | -------------------------------------------------------------------------------- /lib/msgFilter.js: -------------------------------------------------------------------------------- 1 | const usedCommandRecently = new Set() 2 | 3 | /** 4 | * Check is number filtered 5 | * @param {String} from 6 | */ 7 | const isFiltered = (from) => !!usedCommandRecently.has(from) 8 | 9 | /** 10 | * Add number to filter 11 | * @param {String} from 12 | */ 13 | const addFilter = (from) => { 14 | usedCommandRecently.add(from) 15 | setTimeout(() => usedCommandRecently.delete(from), 5000) // 5sec is delay before processing next command 16 | } 17 | 18 | module.exports = { 19 | isFiltered, 20 | addFilter 21 | } 22 | -------------------------------------------------------------------------------- /lib/nsfw.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /lib/poll.js: -------------------------------------------------------------------------------- 1 | const request = require('request'); 2 | const fs = require('fs'); 3 | const dm = require('@open-wa/wa-decrypt'); 4 | const multer = require('multer'); 5 | const upload = multer(); 6 | module.exports = { 7 | addcandidate, 8 | voteadapter, 9 | getpoll, 10 | adminpollreset, 11 | readJsonFile, 12 | saveJsonFile 13 | } 14 | 15 | function voteadapter(client, message, pollfile, voterslistfile) { 16 | console.log('flag1') 17 | //voteadapter 18 | console.log(voterslistfile, 'Zelda') 19 | if (isvoted(message, voterslistfile)) { 20 | client.reply(message.chatId, '♦️ *You already voted for this poll, Baka*', message.id, true); 21 | return; 22 | } 23 | //console.log('flag2') 24 | let data = readJsonFile(pollfile) 25 | if (data['candis'] === 'null') { 26 | client.reply(message.chatId, '📙️ No candidates Added In Poll', message.id, true); 27 | return; 28 | } 29 | let arr = data['candis'] 30 | // console.log(arr) 31 | for (let i = 0; i < arr.length; i++) { 32 | if (message.body.includes((i + 1) 33 | .toString())) { 34 | //console.log(i) 35 | addvote(client, message, i, pollfile); 36 | return; 37 | } 38 | } 39 | console.log('here') 40 | client.reply(message.chatId, 'Wrong Format!', message.id, true); 41 | } 42 | async function addcandidate(client, message, candi, pollfile, voterslistfile) { 43 | if (await isGroupAdmin(client, message, message, message.author)) { 44 | // console.log('admin logging') 45 | } else { 46 | client.reply(message.chatId, `Ask Admin to add ${candi}`, message.id, true); 47 | return; 48 | } 49 | let data = readJsonFile(pollfile) 50 | if (data['candis'] === 'null') { 51 | // let arra=[]; 52 | let cd = { 53 | name: candi, 54 | votes: 0 55 | }; 56 | // cd.put('name',candi); 57 | // cd.put('votes',0); 58 | // arra.push(cd); 59 | delete data['candis']; 60 | // data.put('candis',arra); 61 | data['candis'] = [cd, ] 62 | } else { 63 | if (data['candis'].length >= 9) { 64 | client.reply(message.chatId, '🎯️ *You can\'t add more than 9 candidates in poll, baka!*', message.id, true); 65 | return; 66 | } 67 | let cd = { 68 | name: candi, 69 | votes: 0 70 | }; 71 | data['candis'].push(cd); 72 | } 73 | //l(base.toString()); 74 | saveJsonFile(pollfile, data) 75 | client.reply(message.chatId, `🎯️ Poll Candidate ${candi} Added Successfully`, message.id, true); 76 | } 77 | 78 | function addvote(client, message, num, pollfile, voterslistfile) { 79 | console.log(num) 80 | let data = readJsonFile(pollfile) 81 | let vts = data['candis'][num]['votes']; 82 | vts = vts + 1; 83 | delete data['candis'][num]['votes']; 84 | data['candis'][num]['votes'] = vts 85 | console.log(data) 86 | saveJsonFile(pollfile, data) 87 | let op; 88 | op = '*You Voted on ' + data['candis'][num]['name'] + '*\n* 🎯️ Title : ' + data['title'] + '*\n'; 89 | let ls = ''; 90 | let arr = data['candis']; 91 | for (let i = 0; i < arr.length; i++) { 92 | let cd = arr[i]; 93 | ls = ls + ((i + 1) 94 | .toString()) + ')' + cd['name'] + ' : [' + cd['votes'] + ' Votes] \n'; 95 | } 96 | op = op + ls; 97 | op = op + '\n For voting use command *#vote candidate-number* \n [Example *#vote 2*]'; 98 | client.reply(message.chatId, op, message.id, true); 99 | addvotedlog(message); 100 | } 101 | 102 | function isvoted(message, voterslistfile) { 103 | let data = readJsonFile(voterslistfile) 104 | // console.log(data['list']) 105 | return data['list'].includes(message.author); 106 | } 107 | 108 | function addvotedlog(message) { 109 | let data = readJsonFile(voterslistfile) 110 | data['list'].push(message.author) 111 | saveJsonFile(voterslistfile, data); 112 | } 113 | 114 | function getpoll(client, message, pollfile, voterslistfile) { 115 | let data = readJsonFile(pollfile) 116 | //console.log(data) 117 | let op = ''; 118 | if (data['candis'] == 'null') { 119 | op = '🎯️ *Title : ' + data['title'] + '*\n No candidates Added \n use *#add candidate-name* to add candidate'; 120 | } else { 121 | op = '🎯️ *Title : ' + data['title'] + '*\n'; 122 | let ls = ''; 123 | let arr = data['candis']; 124 | for (let i = 0; i < arr.length; i++) { 125 | let cd = arr[i]; 126 | ls = ls + (i + 1) 127 | .toString() + ')' + cd['name'] + ' : [' + cd['votes'] + ' Votes] \n'; 128 | } 129 | op = op + ls; 130 | op = op + '\n For voting use CMD *#vote candidate-number* \n Example *#vote 2*'; 131 | } 132 | client.reply(message.chatId, op, message.id, true) 133 | } 134 | async function adminpollreset(client, message, polltitle, pollfile, voterslistfile) { 135 | if (await isGroupAdmin(client, message, message.author)) { 136 | var datetime = new Date(); 137 | // savefile(todaysdate+'.json',getFile(pollfile)); 138 | try { 139 | saveJsonFile('poll_logs.json', readJsonFile(pollfile)) 140 | } catch (e) { 141 | console.log('poll file not eist for backup') 142 | } 143 | let base = { 144 | title: polltitle, 145 | polldate: datetime.toISOString() 146 | .slice(0, 10), 147 | candis: 'null' 148 | } 149 | //l(base.toString()); 150 | saveJsonFile(pollfile, base) 151 | client.reply(message.chatId, `*🎉️ *Poll Created Successfully*\n\n 🎯️ *Title : ${polltitle}*\n \n⭐️ Use _#add candidate-name_ to add candidate`, message.id); 152 | //voterresetter 153 | let data = { 154 | list: ['testentry'] 155 | } 156 | saveJsonFile(voterslistfile, data); 157 | } else { 158 | client.reply(message.chatId, '*Admin Only Command*', message.id) 159 | } 160 | } 161 | var configFiles = './configFiles/' 162 | 163 | function readJsonFile(filename) { 164 | filename=configFiles+filename; 165 | let rawdata = fs.readFileSync(filename); 166 | return JSON.parse(rawdata); 167 | } 168 | 169 | function saveJsonFile(filename, object) { 170 | filename = configFiles + filename; 171 | // console.log('pokelog '+filename) 172 | var jsonContent = JSON.stringify(object); 173 | fs.writeFile(filename, jsonContent, 'utf8', function(err) { 174 | if (err) { 175 | console.log('An error occured while writing JSON Object to File.' + filename); 176 | return console.log(err); 177 | } 178 | }); 179 | } 180 | async function isGroupAdmin(client, message, author) { 181 | let value = await client.getGroupAdmins(message.chatId) 182 | return value.toString() 183 | .includes(message.author) 184 | } 185 | -------------------------------------------------------------------------------- /lib/queue.js: -------------------------------------------------------------------------------- 1 | const sendSticker = require('./sendSticker') 2 | 3 | exports.mp3 = async function (message) { 4 | for (let i = 0; i < queuemp3.length; i++) { 5 | if (queuemp3[i].from == message.from) { 6 | console.log(queuemp3[i].from) 7 | yt.mp3(queuemp3[i]) 8 | queuemp3.splice(i, 1) 9 | } 10 | } 11 | } 12 | 13 | exports.mp4 = async function (message) { 14 | for (let i = 0; i < queuemp4.length; i++) { 15 | if (queuemp4[i].from == message.from) { 16 | console.log(queuemp4[i].from) 17 | yt.mp4(queuemp4[i]) 18 | queuemp4.splice(i, 1) 19 | return 20 | } 21 | } 22 | } 23 | 24 | exports.sendSticker = async function (message) { 25 | for (let i = 0; i < queueSticker.length; i++) { 26 | if (queueSticker[i].from == message.from) { 27 | console.log(queueSticker[i].from) 28 | sendSticker.sendSticker(queueSticker[i]) 29 | queueSticker.splice(i, 1) 30 | } 31 | } 32 | } 33 | exports.sendAnimatedSticker = async function (message) { 34 | for (let i = 0; i < queueAnimatedSticker.length; i++) { 35 | if (queueAnimatedSticker[i].from == message.from) { 36 | console.log(queueAnimatedSticker[i].from) 37 | sendSticker.sendAnimatedSticker(queueAnimatedSticker[i]) 38 | queueAnimatedSticker.splice(i, 1) 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/sendSticker.js: -------------------------------------------------------------------------------- 1 | const { decryptMedia } = require('@open-wa/wa-decrypt') 2 | const fs = require('fs-extra') 3 | const mime = require('mime-types') 4 | const nrc = require('node-run-cmd') 5 | const sizeOf = require('image-size') 6 | const gifFrames = require('gif-frames') 7 | const Jimp = require('jimp') 8 | const { GifFrame, GifUtil, GifCodec } = require('gifwrap') 9 | const queuejs = require('./queue') 10 | 11 | exports.sendAnimatedSticker = async function (message, client) { 12 | if (sendingAnimatedSticker.indexOf(message.from) > -1) { 13 | queueAnimatedSticker.push(message) 14 | return 15 | } else { 16 | } 17 | sendingAnimatedSticker.push(message.from) 18 | const buffer = await decryptMedia(message) 19 | const fileName = `./media/sticker/temp${message.from}.${mime.extension(message.mimetype)}` 20 | fs.writeFile(fileName, buffer, function (err) {}) 21 | await nrc.run('ffmpeg -y -i ./media/sticker/temp' + message.from + '.mp4 ./media/sticker/' + message.from + '.gif') 22 | await gifFrames({ url: './media/sticker/' + message.from + '.gif', frames: 0 }).then(function (frameData) { 23 | frameData[0].getImage().pipe(fs.createWriteStream('./media/sticker/firstframe' + message.from + '.png')) 24 | }) 25 | await Jimp.read('./media/sticker/firstframe' + message.from + '.png') 26 | .then((image) => { 27 | image.brightness(0.04) 28 | image.write('./media/sticker/firstframe' + message.from + '.png') 29 | }) 30 | .catch((err) => { 31 | // Handle an exception. 32 | }) 33 | //await nrc.run('convert ' + 'media/sticker/' + message.from + '.gif -delete 0 media/sticker/' + message.from + '.gif') 34 | var dimensions = await sizeOf('media/sticker/' + message.from + '.gif') 35 | if (dimensions.width < dimensions.height) { 36 | await nrc.run('mogrify -bordercolor transparent -border ' + (dimensions.height - dimensions.width) / 2 + 'x0 ./media/sticker/' + message.from + '.gif') 37 | await nrc.run('mogrify -bordercolor transparent -border ' + (dimensions.height - dimensions.width) / 2 + 'x0 ./media/sticker/firstframe' + message.from + '.png') 38 | } else if (dimensions.width > dimensions.height) { 39 | await nrc.run('mogrify -bordercolor transparent -border 0x' + (dimensions.width - dimensions.height) / 2 + ' ./media/sticker/' + message.from + '.gif') 40 | await nrc.run('mogrify -bordercolor transparent -border 0x' + (dimensions.width - dimensions.height) / 2 + ' ./media/sticker/firstframe' + message.from + '.png') 41 | } else { 42 | } 43 | await nrc.run('convert ' + './media/sticker/firstframe' + message.from + '.png' + ' ./media/sticker/' + message.from + '.gif' + ' media/sticker/' + message.from + '.gif') 44 | try { 45 | const contents = await fs.readFile(`./media/sticker/${message.from}.gif`, {encoding: 'base64'}) 46 | await sclient.sendImageAsSticker(message.from, `data:image/gif;base64,${contents.toString('base64')}`) 47 | await fs.unlinkSync(`./media/sticker/${message.from}.gif`) 48 | await fs.unlinkSync(`./media/sticker/firstframe${message.from}.png`) 49 | await fs.unlinkSync(`./media/sticker/temp${message.from}.mp4`) 50 | } catch (error) { 51 | console.log(error) 52 | if (String(error) == 'Error: Processed image is too large for the WebP format') { 53 | client.reply(message.from, String(error), message.id.toString()) //Error: Processed image is too large for the WebP format 54 | } 55 | } 56 | 57 | for (let index = 0; index < sendingAnimatedSticker.length; index++) { 58 | if (sendingAnimatedSticker[index] == message.from) { 59 | sendingAnimatedSticker.splice([index], 1) 60 | } 61 | } 62 | if (queueAnimatedSticker.length != 0) { 63 | queuejs.sendAnimatedSticker(message) 64 | } 65 | delete require.cache[require.resolve('./queue')] 66 | } 67 | -------------------------------------------------------------------------------- /lib/translate.js: -------------------------------------------------------------------------------- 1 | const { default: translate } = require('google-translate-open-api') 2 | 3 | /** 4 | * Translate Text 5 | * @param {String} text 6 | * @param {String} lang 7 | */ 8 | 9 | module.exports = doing = (text, lang) => new Promise((resolve, reject) => { 10 | console.log(`Translate text to ${lang}...`) 11 | translate(text, { tld: 'cn', to: lang }) 12 | .then((text) => resolve(text.data[0])) 13 | .catch((err) => reject(err)) 14 | }) 15 | -------------------------------------------------------------------------------- /lib/waifu.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "teks": "Yui Hirasawa from K-ON!", 4 | "image": "http://randomwaifu.altervista.org/images/0030.png" 5 | }, 6 | { 7 | "teks": "Mea Kurosaki from To Love-Ru", 8 | "image": "http://randomwaifu.altervista.org/images/0008.png" 9 | }, 10 | { 11 | "teks": "Ochaco Uraraka from My Hero Academia", 12 | "image": "http://randomwaifu.altervista.org/images/0057.png" 13 | }, 14 | { 15 | "teks": "Jibril from No Game No Life", 16 | "image": "http://randomwaifu.altervista.org/images/0056.png" 17 | }, 18 | { 19 | "teks": "Tohru from Miss Kobayashi's Dragon Maid", 20 | "image": "http://randomwaifu.altervista.org/images/0045.png" 21 | }, 22 | { 23 | "teks": "Android N21 from Dragon Ball", 24 | "image": "http://randomwaifu.altervista.org/images/0078.png" 25 | }, 26 | { 27 | "teks": "Misaki Okusawa from BanG Dream!", 28 | "image": "http://randomwaifu.altervista.org/images/0035.png" 29 | }, 30 | { 31 | "teks": "Reina Kousaka from Hibike! Euphonium", 32 | "image": "http://randomwaifu.altervista.org/images/0027.png" 33 | }, 34 | { 35 | "teks": "Tohru from Miss Kobayashi's Dragon Maid", 36 | "image": "http://randomwaifu.altervista.org/images/0045.png" 37 | }, 38 | { 39 | "teks": "Azusa Azuki from Hentai oji to warawanai neko", 40 | "image": "http://randomwaifu.altervista.org/images/0086.png" 41 | }, 42 | { 43 | "teks": "Raphtalia from The Rising of the Shield Hero", 44 | "image": "http://randomwaifu.altervista.org/images/0085.png" 45 | }, 46 | { 47 | "teks": "Kurumi Tokisaki from Date a Live!", 48 | "image": "http://randomwaifu.altervista.org/images/0044.png" 49 | }, 50 | { 51 | "teks": "Tsurumaki Kokoro from BanG Dream!", 52 | "image": "http://randomwaifu.altervista.org/images/0069.png" 53 | }, 54 | { 55 | "teks": "Satsuki Kiryuin from Kill la Kill", 56 | "image": "http://randomwaifu.altervista.org/images/0022.png" 57 | }, 58 | { 59 | "teks": "Ruri Gokou from Oreimo", 60 | "image": "http://randomwaifu.altervista.org/images/0004.png" 61 | }, 62 | { 63 | "teks": "Dono from Dono-san chi no doe", 64 | "image": "http://randomwaifu.altervista.org/images/0015.png" 65 | }, 66 | { 67 | "teks": "Reina Kousaka from Hibike! Euphonium", 68 | "image": "http://randomwaifu.altervista.org/images/0027.png" 69 | }, 70 | { 71 | "teks": "Yuri Nakamura from Angel Beats!", 72 | "image": "http://randomwaifu.altervista.org/images/0050.png" 73 | }, 74 | { 75 | "teks": "Uzaki Hana from Uzaki-chan wa Asobitai", 76 | "image": "http://randomwaifu.altervista.org/images/0013.png" 77 | }, 78 | { 79 | "teks": "Shuten Douji from Fate/Grand Order", 80 | "image": "http://randomwaifu.altervista.org/images/0083.png" 81 | }, 82 | { 83 | "teks": "Mirai Kuriyama from Kyoukai no Kanata", 84 | "image": "http://randomwaifu.altervista.org/images/0025.png" 85 | }, 86 | { 87 | "teks": "Kyouko Toshinou from Yuru Yuri!", 88 | "image": "http://randomwaifu.altervista.org/images/0018.png" 89 | }, 90 | { 91 | "teks": "Ochaco Uraraka from My Hero Academia", 92 | "image": "http://randomwaifu.altervista.org/images/0057.png" 93 | }, 94 | { 95 | "teks": "Unknown from Unknown", 96 | "image": "http://randomwaifu.altervista.org/images/0067.png" 97 | }, 98 | { 99 | "teks": "Nadeshiko Kagamihara from Yuru Camp", 100 | "image": "http://randomwaifu.altervista.org/images/0099.png" 101 | }, 102 | { 103 | "teks": "Albedo from Overlord", 104 | "image": "http://randomwaifu.altervista.org/images/0093.png" 105 | }, 106 | { 107 | "teks": "Reina Kousaka from Hibike! Euphonium", 108 | "image": "http://randomwaifu.altervista.org/images/0027.png" 109 | }, 110 | { 111 | "teks": "Sasaki Chiho from Hataraku Maou-sama!", 112 | "image": "http://randomwaifu.altervista.org/images/0041.png" 113 | }, 114 | { 115 | "teks": "Unknown from Unknown", 116 | "image": "http://randomwaifu.altervista.org/images/0067.png" 117 | }, 118 | { 119 | "teks": "Kaori Miyazono from Your Lie in April", 120 | "image": "http://randomwaifu.altervista.org/images/0097.png" 121 | }, 122 | { 123 | "teks": "Shuten Douji from Fate/Grand Order", 124 | "image": "http://randomwaifu.altervista.org/images/0083.png" 125 | }, 126 | { 127 | "teks": "Himari Uehara from BanG Dream!", 128 | "image": "http://randomwaifu.altervista.org/images/0084.png" 129 | }, 130 | { 131 | "teks": "Haruhi Suzumiya from The Melancholy of Haruhi Suzumiya", 132 | "image": "http://randomwaifu.altervista.org/images/0006.png" 133 | }, 134 | { 135 | "teks": "Misaki Okusawa from BanG Dream!", 136 | "image": "http://randomwaifu.altervista.org/images/0035.png" 137 | }, 138 | { 139 | "teks": "Azusa Miura from The Idolmaster", 140 | "image": "http://randomwaifu.altervista.org/images/0036.png" 141 | }, 142 | { 143 | "teks": "Manami Tamura from Oreimo", 144 | "image": "http://randomwaifu.altervista.org/images/0059.png" 145 | }, 146 | { 147 | "teks": "Yoshiko Tsushima from Love Live! Sunshine", 148 | "image": "http://randomwaifu.altervista.org/images/0087.png" 149 | }, 150 | { 151 | "teks": "Francesca Lucchini from Strike Witches", 152 | "image": "http://randomwaifu.altervista.org/images/0061.png" 153 | }, 154 | { 155 | "teks": "Rikka Takarada from SSSS. Gridman", 156 | "image": "http://randomwaifu.altervista.org/images/0071.png" 157 | }, 158 | { 159 | "teks": "Ran Mitake from BanG Dream!", 160 | "image": "http://randomwaifu.altervista.org/images/0066.png" 161 | }, 162 | { 163 | "teks": "Himiko Toga from My Hero Academia", 164 | "image": "http://randomwaifu.altervista.org/images/0009.png" 165 | }, 166 | { 167 | "teks": "Karen Aijo from Shoujo-Kageki Revue Starlight", 168 | "image": "http://randomwaifu.altervista.org/images/0075.png" 169 | }, 170 | { 171 | "teks": "Uzaki Hana from Uzaki-chan wa Asobitai", 172 | "image": "http://randomwaifu.altervista.org/images/0013.png" 173 | }, 174 | { 175 | "teks": "Ako Udagawa from BanG Dream!", 176 | "image": "http://randomwaifu.altervista.org/images/0095.png" 177 | }, 178 | { 179 | "teks": "Sasaki Chiho from Hataraku Maou-sama!", 180 | "image": "http://randomwaifu.altervista.org/images/0041.png" 181 | }, 182 | { 183 | "teks": "Rimi Ushigome from BanG Dream!", 184 | "image": "http://randomwaifu.altervista.org/images/0052.png" 185 | }, 186 | { 187 | "teks": "Kirino Kousaka from Oreimo", 188 | "image": "http://randomwaifu.altervista.org/images/0048.png" 189 | }, 190 | { 191 | "teks": "Lilliluka Arde from DanMachi", 192 | "image": "http://randomwaifu.altervista.org/images/0026.png" 193 | }, 194 | { 195 | "teks": "Princess King Boo from Internet", 196 | "image": "http://randomwaifu.altervista.org/images/0082.png" 197 | }, 198 | { 199 | "teks": "Elizabeth Lyonesse from The Seven Deadly Sins", 200 | "image": "http://randomwaifu.altervista.org/images/0079.png" 201 | }, 202 | { 203 | "teks": "Albedo from Overlord", 204 | "image": "http://randomwaifu.altervista.org/images/0093.png" 205 | }, 206 | { 207 | "teks": "Nadeshiko Kagamihara from Yuru Camp", 208 | "image": "http://randomwaifu.altervista.org/images/0099.png" 209 | }, 210 | { 211 | "teks": "Lilliluka Arde from DanMachi", 212 | "image": "http://randomwaifu.altervista.org/images/0026.png" 213 | }, 214 | { 215 | "teks": "Madoka Kaname from Puella Magi Madoka Magica", 216 | "image": "http://randomwaifu.altervista.org/images/0032.png" 217 | }, 218 | { 219 | "teks": "Nano Shinonome from Nichijou", 220 | "image": "http://randomwaifu.altervista.org/images/0011.png" 221 | }, 222 | { 223 | "teks": "Uzaki Hana from Uzaki-chan wa Asobitai", 224 | "image": "http://randomwaifu.altervista.org/images/0013.png" 225 | }, 226 | { 227 | "teks": "Nadeko Sengoku from Monogatari Series", 228 | "image": "http://randomwaifu.altervista.org/images/0017.png" 229 | }, 230 | { 231 | "teks": "Illyasviel von Einzbern from Fate/Stay Night", 232 | "image": "http://randomwaifu.altervista.org/images/0012.png" 233 | }, 234 | { 235 | "teks": "Shuten Douji from Fate/Grand Order", 236 | "image": "http://randomwaifu.altervista.org/images/0083.png" 237 | }, 238 | { 239 | "teks": "Elizabeth Lyonesse from The Seven Deadly Sins", 240 | "image": "http://randomwaifu.altervista.org/images/0079.png" 241 | }, 242 | { 243 | "teks": "Shinobu Oshino from Monogatari Series", 244 | "image": "http://randomwaifu.altervista.org/images/0010.png" 245 | }, 246 | { 247 | "teks": "Madoka Kaname from Puella Magi Madoka Magica", 248 | "image": "http://randomwaifu.altervista.org/images/0032.png" 249 | }, 250 | { 251 | "teks": "Tohru from Miss Kobayashi's Dragon Maid", 252 | "image": "http://randomwaifu.altervista.org/images/0045.png" 253 | }, 254 | { 255 | "teks": "Tobiichi Origami from Date a Live!", 256 | "image": "http://randomwaifu.altervista.org/images/0043.png" 257 | }, 258 | { 259 | "teks": "Sasaki Chiho from Hataraku Maou-sama!", 260 | "image": "http://randomwaifu.altervista.org/images/0041.png" 261 | }, 262 | { 263 | "teks": "Mai Sakurajima from Seishun buta yar?", 264 | "image": "http://randomwaifu.altervista.org/images/0063.png" 265 | }, 266 | { 267 | "teks": "Nadeko Sengoku from Monogatari Series", 268 | "image": "http://randomwaifu.altervista.org/images/0017.png" 269 | }, 270 | { 271 | "teks": "Ai-chan from Getsuyoubi no Tawawa", 272 | "image": "http://randomwaifu.altervista.org/images/0096.png" 273 | }, 274 | { 275 | "teks": "Kirino Kousaka from Oreimo", 276 | "image": "http://randomwaifu.altervista.org/images/0048.png" 277 | }, 278 | { 279 | "teks": "Mea Kurosaki from To Love-Ru", 280 | "image": "http://randomwaifu.altervista.org/images/0008.png" 281 | }, 282 | { 283 | "teks": "Nadeshiko Kagamihara from Yuru Camp", 284 | "image": "http://randomwaifu.altervista.org/images/0099.png" 285 | }, 286 | { 287 | "teks": "Lily Hoshikawa from Zombieland Saga", 288 | "image": "http://randomwaifu.altervista.org/images/0064.png" 289 | }, 290 | { 291 | "teks": "Unknown from Unknown", 292 | "image": "http://randomwaifu.altervista.org/images/0089.png" 293 | }, 294 | { 295 | "teks": "Makoto Kikuchi from The Idolmaster", 296 | "image": "http://randomwaifu.altervista.org/images/0034.png" 297 | }, 298 | { 299 | "teks": "Ruri Gokou from Oreimo", 300 | "image": "http://randomwaifu.altervista.org/images/0004.png" 301 | }, 302 | { 303 | "teks": "Rikka Takanashi from Chuunibyou Demo Koi Ga Shitai!", 304 | "image": "http://randomwaifu.altervista.org/images/0049.png" 305 | }, 306 | { 307 | "teks": "Ako Udagawa from BanG Dream!", 308 | "image": "http://randomwaifu.altervista.org/images/0095.png" 309 | }, 310 | { 311 | "teks": "Kurumi Tokisaki from Date a Live!", 312 | "image": "http://randomwaifu.altervista.org/images/0044.png" 313 | }, 314 | { 315 | "teks": "Kurisu Makise from Steins;Gate", 316 | "image": "http://randomwaifu.altervista.org/images/0005.png" 317 | }, 318 | { 319 | "teks": "Mirai Kuriyama from Kyoukai no Kanata", 320 | "image": "http://randomwaifu.altervista.org/images/0025.png" 321 | }, 322 | { 323 | "teks": "Sarashiki Tatenashi from Infinite Stratos", 324 | "image": "http://randomwaifu.altervista.org/images/0040.png" 325 | }, 326 | { 327 | "teks": "Yukiho Hagiwara from The Idolmaster", 328 | "image": "http://randomwaifu.altervista.org/images/0031.png" 329 | }, 330 | { 331 | "teks": "Ako Udagawa from BanG Dream!", 332 | "image": "http://randomwaifu.altervista.org/images/0095.png" 333 | }, 334 | { 335 | "teks": "Android N18 from Dragon Ball", 336 | "image": "http://randomwaifu.altervista.org/images/0094.png" 337 | }, 338 | { 339 | "teks": "Yoko Littner from Tengen Toppa Gurren Lagann", 340 | "image": "http://randomwaifu.altervista.org/images/0046.png" 341 | }, 342 | { 343 | "teks": "Ako Udagawa from BanG Dream!", 344 | "image": "http://randomwaifu.altervista.org/images/0095.png" 345 | }, 346 | { 347 | "teks": "Satsuki Kiryuin from Kill la Kill", 348 | "image": "http://randomwaifu.altervista.org/images/0022.png" 349 | }, 350 | { 351 | "teks": "Shuchi from Shuchi no ryouko", 352 | "image": "http://randomwaifu.altervista.org/images/0016.png" 353 | }, 354 | { 355 | "teks": "Illyasviel von Einzbern from Fate/Stay Night", 356 | "image": "http://randomwaifu.altervista.org/images/0012.png" 357 | }, 358 | { 359 | "teks": "Ranko Kanzaki from The Idolmaster", 360 | "image": "http://randomwaifu.altervista.org/images/0088.png" 361 | }, 362 | { 363 | "teks": "Eru Chitanda from Hyouka", 364 | "image": "http://randomwaifu.altervista.org/images/0054.png" 365 | }, 366 | { 367 | "teks": "Chitoge Kirisaki from Nisekoi", 368 | "image": "http://randomwaifu.altervista.org/images/0020.png" 369 | }, 370 | { 371 | "teks": "Ai-chan from Getsuyoubi no Tawawa", 372 | "image": "http://randomwaifu.altervista.org/images/0096.png" 373 | }, 374 | { 375 | "teks": "Satsuki Kiryuin from Kill la Kill", 376 | "image": "http://randomwaifu.altervista.org/images/0022.png" 377 | }, 378 | { 379 | "teks": "Ochaco Uraraka from My Hero Academia", 380 | "image": "http://randomwaifu.altervista.org/images/0057.png" 381 | }, 382 | { 383 | "teks": "Unknown from Unknown", 384 | "image": "http://randomwaifu.altervista.org/images/0067.png" 385 | }, 386 | { 387 | "teks": "Azusa Azuki from Hentai oji to warawanai neko", 388 | "image": "http://randomwaifu.altervista.org/images/0086.png" 389 | }, 390 | { 391 | "teks": "Satsuki Kiryuin from Kill la Kill", 392 | "image": "http://randomwaifu.altervista.org/images/0022.png" 393 | }, 394 | { 395 | "teks": "Kurumi Tokisaki from Date a Live!", 396 | "image": "http://randomwaifu.altervista.org/images/0044.png" 397 | }, 398 | { 399 | "teks": "Isuzu Sento from Amagi Brilliant Park", 400 | "image": "http://randomwaifu.altervista.org/images/0023.png" 401 | }, 402 | { 403 | "teks": "Yuri Nakamura from Angel Beats!", 404 | "image": "http://randomwaifu.altervista.org/images/0050.png" 405 | }, 406 | { 407 | "teks": "Moca Aoba from BanG Dream!", 408 | "image": "http://randomwaifu.altervista.org/images/0068.png" 409 | }, 410 | { 411 | "teks": "Mea Kurosaki from To Love-Ru", 412 | "image": "http://randomwaifu.altervista.org/images/0008.png" 413 | }, 414 | { 415 | "teks": "Mikoto Misaka from A Certain Magical Index", 416 | "image": "http://randomwaifu.altervista.org/images/0047.png" 417 | }, 418 | { 419 | "teks": "Aqua from Konosuba", 420 | "image": "http://randomwaifu.altervista.org/images/0098.png" 421 | }, 422 | { 423 | "teks": "Manami Tamura from Oreimo", 424 | "image": "http://randomwaifu.altervista.org/images/0059.png" 425 | }, 426 | { 427 | "teks": "Misaki Okusawa from BanG Dream!", 428 | "image": "http://randomwaifu.altervista.org/images/0035.png" 429 | }, 430 | { 431 | "teks": "Dono from Dono-san chi no doe", 432 | "image": "http://randomwaifu.altervista.org/images/0015.png" 433 | }, 434 | { 435 | "teks": "Rimi Ushigome from BanG Dream!", 436 | "image": "http://randomwaifu.altervista.org/images/0052.png" 437 | }, 438 | { 439 | "teks": "Tamaki Ako from Netoge no yome wa onna no ko janai to omotta?", 440 | "image": "http://randomwaifu.altervista.org/images/0092.png" 441 | }, 442 | { 443 | "teks": "Kanade Tachibana from Angel Beats!", 444 | "image": "http://randomwaifu.altervista.org/images/0058.png" 445 | }, 446 | { 447 | "teks": "Ako Udagawa from BanG Dream!", 448 | "image": "http://randomwaifu.altervista.org/images/0095.png" 449 | }, 450 | { 451 | "teks": "Satsuki Kiryuin from Kill la Kill", 452 | "image": "http://randomwaifu.altervista.org/images/0022.png" 453 | }, 454 | { 455 | "teks": "Ochaco Uraraka from My Hero Academia", 456 | "image": "http://randomwaifu.altervista.org/images/0057.png" 457 | }, 458 | { 459 | "teks": "Misaki Okusawa from BanG Dream!", 460 | "image": "http://randomwaifu.altervista.org/images/0035.png" 461 | }, 462 | { 463 | "teks": "Kurisu Makise from Steins;Gate", 464 | "image": "http://randomwaifu.altervista.org/images/0005.png" 465 | }, 466 | { 467 | "teks": "Tsurumaki Kokoro from BanG Dream!", 468 | "image": "http://randomwaifu.altervista.org/images/0069.png" 469 | }, 470 | { 471 | "teks": "RO500 from Kantai Collection", 472 | "image": "http://randomwaifu.altervista.org/images/0072.png" 473 | }, 474 | { 475 | "teks": "Lilliluka Arde from DanMachi", 476 | "image": "http://randomwaifu.altervista.org/images/0026.png" 477 | }, 478 | { 479 | "teks": "Unknown from Unknown", 480 | "image": "http://randomwaifu.altervista.org/images/0067.png" 481 | }, 482 | { 483 | "teks": "Princess King Boo from Internet", 484 | "image": "http://randomwaifu.altervista.org/images/0082.png" 485 | }, 486 | { 487 | "teks": "Illyasviel von Einzbern from Fate/Stay Night", 488 | "image": "http://randomwaifu.altervista.org/images/0012.png" 489 | }, 490 | { 491 | "teks": "Kurisu Makise from Steins;Gate", 492 | "image": "http://randomwaifu.altervista.org/images/0005.png" 493 | }, 494 | { 495 | "teks": "Saber Alter from Fate/Stay Night", 496 | "image": "http://randomwaifu.altervista.org/images/0076.png" 497 | }, 498 | { 499 | "teks": "Himiko Toga from My Hero Academia", 500 | "image": "http://randomwaifu.altervista.org/images/0009.png" 501 | }, 502 | { 503 | "teks": "Tsubasa Hanekawa from Monogatari Series", 504 | "image": "http://randomwaifu.altervista.org/images/0055.png" 505 | }, 506 | { 507 | "teks": "Saber from Fate/Stay Night", 508 | "image": "http://randomwaifu.altervista.org/images/0077.png" 509 | }, 510 | { 511 | "teks": "Chitoge Kirisaki from Nisekoi", 512 | "image": "http://randomwaifu.altervista.org/images/0020.png" 513 | }, 514 | { 515 | "teks": "Mikoto Misaka from A Certain Magical Index", 516 | "image": "http://randomwaifu.altervista.org/images/0047.png" 517 | }, 518 | { 519 | "teks": "Zero Two from Darling in the Franxx", 520 | "image": "http://randomwaifu.altervista.org/images/0081.png" 521 | }, 522 | { 523 | "teks": "Saori Makishima from Oreimo", 524 | "image": "http://randomwaifu.altervista.org/images/0037.png" 525 | }, 526 | { 527 | "teks": "Azusa Miura from The Idolmaster", 528 | "image": "http://randomwaifu.altervista.org/images/0036.png" 529 | }, 530 | { 531 | "teks": "Eru Chitanda from Hyouka", 532 | "image": "http://randomwaifu.altervista.org/images/0054.png" 533 | }, 534 | { 535 | "teks": "Kyouko Toshinou from Yuru Yuri!", 536 | "image": "http://randomwaifu.altervista.org/images/0018.png" 537 | }, 538 | { 539 | "teks": "Unknown from Unknown", 540 | "image": "http://randomwaifu.altervista.org/images/0051.png" 541 | }, 542 | { 543 | "teks": "Lilliluka Arde from DanMachi", 544 | "image": "http://randomwaifu.altervista.org/images/0026.png" 545 | }, 546 | { 547 | "teks": "Mirai Kuriyama from Kyoukai no Kanata", 548 | "image": "http://randomwaifu.altervista.org/images/0025.png" 549 | }, 550 | { 551 | "teks": "Tamaki Ako from Netoge no yome wa onna no ko janai to omotta?", 552 | "image": "http://randomwaifu.altervista.org/images/0092.png" 553 | }, 554 | { 555 | "teks": "Sarashiki Tatenashi from Infinite Stratos", 556 | "image": "http://randomwaifu.altervista.org/images/0040.png" 557 | }, 558 | { 559 | "teks": "Himari Uehara from BanG Dream!", 560 | "image": "http://randomwaifu.altervista.org/images/0084.png" 561 | }, 562 | { 563 | "teks": "Revy from Black Lagoon", 564 | "image": "http://randomwaifu.altervista.org/images/0062.png" 565 | }, 566 | { 567 | "teks": "Android N18 from Dragon Ball", 568 | "image": "http://randomwaifu.altervista.org/images/0094.png" 569 | }, 570 | { 571 | "teks": "Ai-chan from Getsuyoubi no Tawawa", 572 | "image": "http://randomwaifu.altervista.org/images/0096.png" 573 | }, 574 | { 575 | "teks": "Android N21 from Dragon Ball", 576 | "image": "http://randomwaifu.altervista.org/images/0078.png" 577 | }, 578 | { 579 | "teks": "Unknown from Unknown", 580 | "image": "http://randomwaifu.altervista.org/images/0090.png" 581 | }, 582 | { 583 | "teks": "Revy from Black Lagoon", 584 | "image": "http://randomwaifu.altervista.org/images/0062.png" 585 | }, 586 | { 587 | "teks": "Himiko Toga from My Hero Academia", 588 | "image": "http://randomwaifu.altervista.org/images/0009.png" 589 | }, 590 | { 591 | "teks": "Marisa Kirisame from Touhou Project", 592 | "image": "http://randomwaifu.altervista.org/images/0065.png" 593 | }, 594 | { 595 | "teks": "Nadeshiko Kagamihara from Yuru Camp", 596 | "image": "http://randomwaifu.altervista.org/images/0099.png" 597 | }, 598 | { 599 | "teks": "Yuno Gasai from Mirai Nikki", 600 | "image": "http://randomwaifu.altervista.org/images/0019.png" 601 | }, 602 | { 603 | "teks": "Abigail Williams from Fate/Grand Order", 604 | "image": "http://randomwaifu.altervista.org/images/0074.png" 605 | }, 606 | { 607 | "teks": "Nadeshiko Kagamihara from Yuru Camp", 608 | "image": "http://randomwaifu.altervista.org/images/0099.png" 609 | }, 610 | { 611 | "teks": "RO500 from Kantai Collection", 612 | "image": "http://randomwaifu.altervista.org/images/0072.png" 613 | }, 614 | { 615 | "teks": "Ran Mitake from BanG Dream!", 616 | "image": "http://randomwaifu.altervista.org/images/0066.png" 617 | }, 618 | { 619 | "teks": "Rei Ayanami from Neon Genesis Evangelion", 620 | "image": "http://randomwaifu.altervista.org/images/0003.png" 621 | }, 622 | { 623 | "teks": "Shinobu Oshino from Monogatari Series", 624 | "image": "http://randomwaifu.altervista.org/images/0010.png" 625 | }, 626 | { 627 | "teks": "Lisa Imai from BanG Dream!", 628 | "image": "http://randomwaifu.altervista.org/images/0038.png" 629 | }, 630 | { 631 | "teks": "Manami Tamura from Oreimo", 632 | "image": "http://randomwaifu.altervista.org/images/0059.png" 633 | }, 634 | { 635 | "teks": "Gertrud Barkhorn from Strike Witches", 636 | "image": "http://randomwaifu.altervista.org/images/0060.png" 637 | }, 638 | { 639 | "teks": "Madoka Kaname from Puella Magi Madoka Magica", 640 | "image": "http://randomwaifu.altervista.org/images/0032.png" 641 | }, 642 | { 643 | "teks": "Unknown from Unknown", 644 | "image": "http://randomwaifu.altervista.org/images/0067.png" 645 | }, 646 | { 647 | "teks": "Abigail Williams from Fate/Grand Order", 648 | "image": "http://randomwaifu.altervista.org/images/0074.png" 649 | }, 650 | { 651 | "teks": "Shinobu Oshino from Monogatari Series", 652 | "image": "http://randomwaifu.altervista.org/images/0010.png" 653 | }, 654 | { 655 | "teks": "Manami Tamura from Oreimo", 656 | "image": "http://randomwaifu.altervista.org/images/0059.png" 657 | }, 658 | { 659 | "teks": "Abigail Williams from Fate/Grand Order", 660 | "image": "http://randomwaifu.altervista.org/images/0074.png" 661 | }, 662 | { 663 | "teks": "Saori Makishima from Oreimo", 664 | "image": "http://randomwaifu.altervista.org/images/0037.png" 665 | }, 666 | { 667 | "teks": "Isuzu Sento from Amagi Brilliant Park", 668 | "image": "http://randomwaifu.altervista.org/images/0023.png" 669 | }, 670 | { 671 | "teks": "Misaki Okusawa from BanG Dream!", 672 | "image": "http://randomwaifu.altervista.org/images/0035.png" 673 | }, 674 | { 675 | "teks": "Elizabeth Lyonesse from The Seven Deadly Sins", 676 | "image": "http://randomwaifu.altervista.org/images/0079.png" 677 | }, 678 | { 679 | "teks": "Ranko Kanzaki from The Idolmaster", 680 | "image": "http://randomwaifu.altervista.org/images/0088.png" 681 | }, 682 | { 683 | "teks": "Rei Ayanami from Neon Genesis Evangelion", 684 | "image": "http://randomwaifu.altervista.org/images/0003.png" 685 | }, 686 | { 687 | "teks": "Rei Ayanami from Neon Genesis Evangelion", 688 | "image": "http://randomwaifu.altervista.org/images/0003.png" 689 | }, 690 | { 691 | "teks": "Mai Sakurajima from Seishun buta yar?", 692 | "image": "http://randomwaifu.altervista.org/images/0063.png" 693 | }, 694 | { 695 | "teks": "Aqua from Konosuba", 696 | "image": "http://randomwaifu.altervista.org/images/0098.png" 697 | }, 698 | { 699 | "teks": "Chitoge Kirisaki from Nisekoi", 700 | "image": "http://randomwaifu.altervista.org/images/0020.png" 701 | }, 702 | { 703 | "teks": "Dono from Dono-san chi no doe", 704 | "image": "http://randomwaifu.altervista.org/images/0015.png" 705 | }, 706 | { 707 | "teks": "Satsuki Kiryuin from Kill la Kill", 708 | "image": "http://randomwaifu.altervista.org/images/0022.png" 709 | }, 710 | { 711 | "teks": "Ran Mitake from BanG Dream!", 712 | "image": "http://randomwaifu.altervista.org/images/0066.png" 713 | }, 714 | { 715 | "teks": "Inori Yuzuriha from Guilty Crown", 716 | "image": "http://randomwaifu.altervista.org/images/0029.png" 717 | }, 718 | { 719 | "teks": "Tomoe Udagawa from BanG Dream!", 720 | "image": "http://randomwaifu.altervista.org/images/0039.png" 721 | }, 722 | { 723 | "teks": "Dono from Dono-san chi no doe", 724 | "image": "http://randomwaifu.altervista.org/images/0015.png" 725 | }, 726 | { 727 | "teks": "Aqua from Konosuba", 728 | "image": "http://randomwaifu.altervista.org/images/0098.png" 729 | }, 730 | { 731 | "teks": "Makoto Kikuchi from The Idolmaster", 732 | "image": "http://randomwaifu.altervista.org/images/0034.png" 733 | }, 734 | { 735 | "teks": "Holo from Spice and Wolf", 736 | "image": "http://randomwaifu.altervista.org/images/0007.png" 737 | }, 738 | { 739 | "teks": "Unknown from Unknown", 740 | "image": "http://randomwaifu.altervista.org/images/0053.png" 741 | }, 742 | { 743 | "teks": "Yuno Gasai from Mirai Nikki", 744 | "image": "http://randomwaifu.altervista.org/images/0019.png" 745 | }, 746 | { 747 | "teks": "Rin Shibuya from The Idolmaster", 748 | "image": "http://randomwaifu.altervista.org/images/0042.png" 749 | }, 750 | { 751 | "teks": "Jibril from No Game No Life", 752 | "image": "http://randomwaifu.altervista.org/images/0056.png" 753 | }, 754 | { 755 | "teks": "Satsuki Kiryuin from Kill la Kill", 756 | "image": "http://randomwaifu.altervista.org/images/0022.png" 757 | }, 758 | { 759 | "teks": "Himiko Toga from My Hero Academia", 760 | "image": "http://randomwaifu.altervista.org/images/0009.png" 761 | }, 762 | { 763 | "teks": "Tamaki Ako from Netoge no yome wa onna no ko janai to omotta?", 764 | "image": "http://randomwaifu.altervista.org/images/0092.png" 765 | }, 766 | { 767 | "teks": "Yuno Gasai from Mirai Nikki", 768 | "image": "http://randomwaifu.altervista.org/images/0019.png" 769 | }, 770 | { 771 | "teks": "Lisa Imai from BanG Dream!", 772 | "image": "http://randomwaifu.altervista.org/images/0038.png" 773 | }, 774 | { 775 | "teks": "Tomoe Udagawa from BanG Dream!", 776 | "image": "http://randomwaifu.altervista.org/images/0039.png" 777 | }, 778 | { 779 | "teks": "Sakura Kinomoto from Card Captor Sakura", 780 | "image": "http://randomwaifu.altervista.org/images/0070.png" 781 | }, 782 | { 783 | "teks": "Haruhi Suzumiya from The Melancholy of Haruhi Suzumiya", 784 | "image": "http://randomwaifu.altervista.org/images/0006.png" 785 | }, 786 | { 787 | "teks": "Azusa Azuki from Hentai oji to warawanai neko", 788 | "image": "http://randomwaifu.altervista.org/images/0086.png" 789 | }, 790 | { 791 | "teks": "Ochaco Uraraka from My Hero Academia", 792 | "image": "http://randomwaifu.altervista.org/images/0057.png" 793 | }, 794 | { 795 | "teks": "Yui Hirasawa from K-ON!", 796 | "image": "http://randomwaifu.altervista.org/images/0030.png" 797 | }, 798 | { 799 | "teks": "Yuri Nakamura from Angel Beats!", 800 | "image": "http://randomwaifu.altervista.org/images/0050.png" 801 | } 802 | ] -------------------------------------------------------------------------------- /lib/welcome.js: -------------------------------------------------------------------------------- 1 | var emojiStrip = require('emoji-strip') 2 | const fs = require('fs-extra') 3 | 4 | module.exports = welcome = async (client, event) => { 5 | if (event.who == '9074161917@c.us') return 6 | const wel = JSON.parse(fs.readFileSync('./lib/welcome.json')) 7 | const iswel = wel.includes(event.chat) 8 | try { 9 | if ((event.action == 'add') && (iswel == true)) { 10 | const det = await client.getChatById(event.chat) 11 | const person = await client.getContact(event.who) 12 | const personname = person.pushname 13 | const groupname = det.contact.formattedName 14 | const unique = `https://dynamage.herokuapp.com/api?id=eAsHzSIZ9krEJNefBI7AldCkp&width=1366&height=768&var1=${groupname}&var2=${personname}` 15 | const url = emojiStrip(unique) 16 | console.log(url) 17 | const filename = 'welcome.png' 18 | await client.sendTextWithMentions(event.chat, `Welcome to *${groupname}!* \n\n@${event.who.replace('@c.us', '')} \n\nHave fun with us✨ \n\n *Group Description* ❇️ \n\n ${det.groupMetadata.desc}`) 19 | await client.sendFileFromUrl(event.chat, url, filename, '') 20 | } 21 | 22 | } catch(err) { 23 | 24 | console.log(err) 25 | 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /lib/welcome.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /lib/yt.js: -------------------------------------------------------------------------------- 1 | const nrc = require('node-run-cmd') 2 | const fs = require('fs') 3 | const ytdl = require('ytdl-core') 4 | const queuejs = require('./queue') 5 | 6 | exports.mp3 = async function (message) { 7 | if (amdownloaden.indexOf(message.from) > -1) { 8 | sclient.sendText(message.from, 'Audio added to Queue') 9 | queuemp3.push(message) 10 | return 11 | } else { 12 | } 13 | amdownloaden.push(message.from) 14 | 15 | var link = String(message.body.match(/\bhttps?:\/\/\S+/gi)) 16 | if (link == 'null') { 17 | sclient.sendText(message.from, 'No Video Link') 18 | for (let index = 0; index < amdownloaden.length; index++) { 19 | if (amdownloaden[index] == message.from) { 20 | amdownloaden.splice([index], 1) 21 | } 22 | } 23 | return 24 | } 25 | sclient.sendText(message.from, 'Mp3 Downloading...') 26 | await nrc.run('youtube-dl --extract-audio --audio-quality 0 --audio-format mp3 --output ' + './media/audio/' + message.from + '.%(ext)s" ' + link) 27 | if (Math.round(fs.statSync('./media/audio/' + message.from + '.mp3').size / 1000000) > 99) { 28 | sclient.sendText(message.from, "File bigger then 100 Mb can't send file") 29 | if (queuemp3.length != 0) { 30 | queuejs.mp3(message) 31 | } 32 | return 33 | } 34 | sclient.sendFile(message.from, './media/audio/' + message.from + '.mp3', '', '') 35 | if (Math.round(fs.statSync('./media/audio/' + message.from + '.mp3').size / 1000000) == 0) { 36 | var größe = Math.round(fs.statSync('./media/audio/' + message.from + '.mp3').size / 1000) + ' kB' 37 | } else { 38 | var größe = Math.round(fs.statSync('./media/audio/' + message.from + '.mp3').size / 1000000) + ' MB' 39 | } 40 | 41 | sclient.sendText(message.from, 'Sending Audio... \nSize: ' + größe) 42 | for (let index = 0; index < amdownloaden.length; index++) { 43 | if (amdownloaden[index] == message.from) { 44 | amdownloaden.splice([index], 1) 45 | } 46 | } 47 | if (queuemp3.length != 0) { 48 | queuejs.mp3(message) 49 | } 50 | delete require.cache[require.resolve('./queue')] 51 | } 52 | 53 | exports.mp4 = async function (message) { 54 | if (amdownloaden.indexOf(message.from) > -1) { 55 | sclient.sendText(message.from, 'Video added to Queue') 56 | queuemp4.push(message) 57 | return 58 | } else { 59 | } 60 | // amdownloaden.push(message.from) 61 | 62 | var link = String(message.body.match(/\bhttps?:\/\/\S+/gi)) 63 | if (link == 'null') { 64 | sclient.sendText(message.from, 'There\'s no Link') 65 | for (let index = 0; index < amdownloaden.length; index++) { 66 | if (amdownloaden[index] == message.from) { 67 | amdownloaden.splice([index], 1) 68 | } 69 | } 70 | return 71 | } 72 | sclient.sendText(message.from, 'Video downloading...') 73 | await nrc.run('youtube-dl --format mp4 --no-continue --output "./media/video/' + message.from + '.%(ext)s" ' + link) 74 | if (Math.round(fs.statSync('./media/video/' + message.from + '.mp4').size / 1000000) > 63) { 75 | sclient.sendText(message.from, "File bigger then 64 Mb can't send file") 76 | if (queuemp4.length != 0) { 77 | queuejs.mp4(message) 78 | } 79 | return 80 | } 81 | await sclient.sendFile(message.from, './media/video/' + message.from + '.mp4', '', '') 82 | 83 | if (Math.round(fs.statSync('./media/video/' + message.from + '.mp4').size / 1000000) == 0) { 84 | var größe = Math.round(fs.statSync('./media/video/' + message.from + '.mp4').size / 1000) + ' kB' 85 | } else { 86 | var größe = Math.round(fs.statSync('./media/video/' + message.from + '.mp4').size / 1000000) + ' MB' 87 | } 88 | 89 | sclient.sendText(message.from, 'Video sending\nSize: ' + größe) 90 | Sleep(10000) 91 | for (let index = 0; index < amdownloaden.length; index++) { 92 | if (amdownloaden[index] == message.from) { 93 | amdownloaden.splice([index], 1) 94 | } 95 | } 96 | if (queuemp4.length != 0) { 97 | queuejs.mp4(message) 98 | } 99 | delete require.cache[require.resolve('./queue')] 100 | } 101 | 102 | function Sleep(milliseconds) { 103 | return new Promise((resolve) => setTimeout(resolve, milliseconds)) 104 | } 105 | 106 | var dataCallback = function (data) { 107 | daten = data 108 | } 109 | 110 | -------------------------------------------------------------------------------- /media/Zelda.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlenVelocity/Whatsapp-Anime-Bot/8bb524d9503d6614fcf3489ce6e1dda4be6a3c33/media/Zelda.mp3 -------------------------------------------------------------------------------- /media/images/emilia-re-zero-wallpaper-full-hd-1920x1080-158894.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlenVelocity/Whatsapp-Anime-Bot/8bb524d9503d6614fcf3489ce6e1dda4be6a3c33/media/images/emilia-re-zero-wallpaper-full-hd-1920x1080-158894.jpg -------------------------------------------------------------------------------- /media/sticker/917019253026-1601785546@g.us.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlenVelocity/Whatsapp-Anime-Bot/8bb524d9503d6614fcf3489ce6e1dda4be6a3c33/media/sticker/917019253026-1601785546@g.us.gif -------------------------------------------------------------------------------- /media/sticker/firstframe917019253026-1601785546@g.us.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlenVelocity/Whatsapp-Anime-Bot/8bb524d9503d6614fcf3489ce6e1dda4be6a3c33/media/sticker/firstframe917019253026-1601785546@g.us.png -------------------------------------------------------------------------------- /media/sticker/temp917019253026-1601785546@g.us.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlenVelocity/Whatsapp-Anime-Bot/8bb524d9503d6614fcf3489ce6e1dda4be6a3c33/media/sticker/temp917019253026-1601785546@g.us.mp4 -------------------------------------------------------------------------------- /msgHandler.js: -------------------------------------------------------------------------------- 1 | const { decryptMedia } = require('@open-wa/wa-decrypt') 2 | const { RemoveBgResult, removeBackgroundFromImageBase64, removeBackgroundFromImageFile } = require('remove.bg') 3 | const fs = require('fs-extra') 4 | const axios = require('axios') 5 | const nrc = require('node-run-cmd') 6 | const moment = require('moment-timezone') 7 | const get = require('got') 8 | const { exec } = require('child_process') 9 | const wel = JSON.parse(fs.readFileSync('./lib/welcome.json')) 10 | const nsfwgrp = JSON.parse(fs.readFileSync('./lib/nsfw.json')) 11 | const akaneko = require('akaneko') 12 | const fetch = require('node-fetch') 13 | const bent = require('bent') 14 | var request = require('request'); 15 | 16 | const errorurl = 'https://steamuserimages-a.akamaihd.net/ugc/954087817129084207/5B7E46EE484181A676C02DFCAD48ECB1C74BC423/?imw=512&&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=false' 17 | const errorurl2 = 'https://steamuserimages-a.akamaihd.net/ugc/954087817129084207/5B7E46EE484181A676C02DFCAD48ECB1C74BC423/?imw=512&&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=false' 18 | 19 | // Author YogaSakti 20 | const color = require('./lib/color') 21 | const { doing } = require('./lib/translate.js') 22 | const { translate } = require('./lib') 23 | 24 | // Author MhankBarBar 25 | const msgFilter = require('./lib/msgFilter') 26 | const { liriklagu, quotemaker, wall, costom } = require('./lib/functions') 27 | const { help, info, } = require('./lib/help') 28 | const ban = JSON.parse(fs.readFileSync('./lib/banned.json')) 29 | 30 | // Author Shubham Badgujar 31 | const feature = require('./lib/poll'); 32 | 33 | // Author FredWuz 34 | const yt = require('./lib/yt') 35 | const sendSticker = require('./lib/sendSticker') 36 | 37 | 38 | 39 | 40 | function sleep(ms) { 41 | return new Promise(resolve => setTimeout(resolve, ms)); 42 | } 43 | 44 | module.exports = msgHandler = async (client, message) => { 45 | try { 46 | const { type, id, from, t, sender, isGroupMsg, chat, chatId, caption, isMedia, mimetype, quotedMsg, mentionedJidList, author, quotedMsgObj } = message 47 | let { body } = message 48 | const { name } = chat 49 | let { pushname, verifiedName } = sender 50 | const prefix = '#' 51 | body = (type === 'chat' && body.startsWith(prefix)) ? body : ((type === 'image' && caption || type === 'video' && caption) && caption.startsWith(prefix)) ? caption : '' 52 | const command = body.slice(prefix.length).trim().split(/ +/).shift().toLowerCase() 53 | const args = body.slice(prefix.length).trim().split(/ +/).slice(1) 54 | const isCmd = body.startsWith(prefix) 55 | 56 | const time = moment(t * 1000).format('DD/MM HH:mm:ss') 57 | 58 | if (isCmd && msgFilter.isFiltered(from) && !isGroupMsg) return console.log(color('[SPAM!]', 'red'), color(time, 'yellow'), color(`${command} [${args.length}]`), 'from', color(pushname)) 59 | if (isCmd && msgFilter.isFiltered(from) && isGroupMsg) return console.log(color('[SPAM!]', 'red'), color(time, 'yellow'), color(`${command} [${args.length}]`), 'from', color(pushname), 'in', color(name)) 60 | if (!isCmd && !isGroupMsg) return console.log('[RECV]', color(time, 'yellow'), 'Message from', color(pushname)) 61 | if (!isCmd && isGroupMsg) return console.log('[RECV]', color(time, 'yellow'), 'Message from', color(pushname), 'in', color(name)) 62 | if (isCmd && !isGroupMsg) console.log(color('[EXEC]'), color(time, 'yellow'), color(`${command} [${args.length}]`), 'from', color(pushname)) 63 | 64 | if (isCmd && isGroupMsg) console.log(color('[EXEC]'), color(time, 'yellow'), color(`${command} [${args.length}]`), 'from', color(pushname), 'in', color(name)) 65 | const botNumber = await client.getHostNumber() 66 | const groupId = isGroupMsg ? chat.groupMetadata.id : '' 67 | const groupAdmins = isGroupMsg ? await client.getGroupAdmins(groupId) : '' 68 | const isGroupAdmins = isGroupMsg ? groupAdmins.includes(sender.id) : false 69 | const isBotGroupAdmins = isGroupMsg ? groupAdmins.includes(botNumber + '@c.us') : false 70 | const isBanned = ban.includes(chatId) 71 | const botadmins = ['919744375687@c.us'] //add the number of people that you want to the be bot admins 72 | const isbotadmin = botadmins.includes(sender.id) 73 | const isnsfw = nsfwgrp.includes(chat.id) 74 | const isQuotedImage = quotedMsg && quotedMsg.type === 'image' 75 | global.pollfile = 'poll_Config_'+chat.id+'.json' 76 | global.voterslistfile = 'poll_voters_Config_'+chat.id+'.json' 77 | 78 | 79 | msgFilter.addFilter(from) 80 | 81 | const uaOverride = 'WhatsApp/2.2029.4 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36' 82 | const isUrl = new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi) 83 | if (!isBanned) { 84 | switch (command) { 85 | case 'sticker': 86 | case 'stiker': 87 | if (isMedia) { 88 | if (type == 'video') { 89 | if (message.duration < 15) { 90 | sendSticker.sendAnimatedSticker(message) 91 | } else { 92 | await client.reply(from, 'The given file is too large for converting', id) 93 | } 94 | } else if (type == 'image') { 95 | const mediaData = await decryptMedia(message) 96 | const imageBase64 = `data:${mimetype};base64,${mediaData.toString('base64')}` 97 | const baseImg = imageBase64.replace('video/mp4','image/gif') 98 | await client.sendImageAsSticker(from, baseImg) 99 | } 100 | } else if (quotedMsg && quotedMsg.type == 'image') { 101 | const mediaData = await decryptMedia(quotedMsg) 102 | const imageBase64 = `data:${quotedMsg.mimetype};base64,${mediaData.toString('base64')}` 103 | await client.sendImageAsSticker(from, imageBase64) 104 | } else if (quotedMsg && quotedMsg.type == 'video') { 105 | if (message.duration < 15) { 106 | sendSticker.sendAnimatedSticker(message) 107 | } else { 108 | await client.reply(from, 'The given file is too large for converting', id) 109 | } 110 | } else { 111 | client.reply(from, 'You did not tag a picture or video, Baka', message.id) 112 | } 113 | break 114 | break 115 | case 'zelda': 116 | case 'sing-a-song': 117 | client.sendPtt(from, './media/Zelda.mp3') 118 | break 119 | case 'donate': 120 | client.sendLinkWithAutoPreview(from, '...', '...') 121 | break 122 | case 'mp3' : 123 | yt.mp3(message) 124 | case 'mp4' : 125 | break 126 | yt.mp4(message) 127 | case 'costom': 128 | arg = body.trim().split('|') 129 | if ((isMedia || isQuotedImage) && arg.length >= 2) { 130 | const top = arg[1] 131 | const bottom = arg[2] 132 | const encryptMedia = isQuotedImage ? quotedMsg : message 133 | const mediaData = await decryptMedia(encryptMedia, uaOverride) 134 | const getUrl = await uploadImages(mediaData, false) 135 | const ImageBase64 = await custom(getUrl, top, bottom) 136 | await client.sendFile(from, ImageBase64, 'image.png', '', '...', true) 137 | } else { 138 | await client.reply(from, 'Wrong Format!', id) 139 | } 140 | break 141 | case 'tsticker': 142 | if (isMedia && type == 'image') { 143 | try { 144 | const mediaData = await decryptMedia(message, uaOverride) 145 | const imageBase64 = `data:${mimetype};base64,${mediaData.toString('base64')}` 146 | const base64img = imageBase64 147 | const filename = "./media/images/pic.jpg"; 148 | //console.log(base64img) 149 | const outFile = './media/images/noBg.png' 150 | const result = await removeBackgroundFromImageBase64({ base64img, apiKey: 'mjaPoWpXB1o6LmfaYH1eLL4W', size: 'auto', type: 'auto', outFile }) 151 | console.log(result.base64img) 152 | await fs.writeFile(outFile, result.base64img) 153 | await client.sendImageAsSticker(from, `data:${mimetype};base64,${result.base64img}`) 154 | } catch(err) { 155 | console.log(err) 156 | } 157 | } 158 | break 159 | case 'tts': 160 | if (args.length == 0) return client.reply(from, 'Wrong Fromat!') 161 | const ttsEn = require('node-gtts')('en') 162 | const ttsJp = require('node-gtts')('ja') 163 | const dataText = body.slice(8) 164 | if (dataText === '') return client.reply(from, 'Baka?', message.id) 165 | if (dataText.length > 250) return client.reply(from, 'Unable to convert', message.id) 166 | var dataBhs = body.slice(5, 7) 167 | if (dataBhs == 'id') { 168 | } else if (dataBhs == 'en') { 169 | ttsEn.save('./tts/resEn.mp3', dataText, function () { 170 | client.sendPtt(from, './media/tts/resEn.mp3', message.id) 171 | }) 172 | } else if (dataBhs == 'jp') { 173 | ttsJp.save('./tts/resJp.mp3', dataText, function () { 174 | client.sendPtt(from, './media/tts/resJp.mp3', message.id) 175 | }) 176 | } else { 177 | client.reply(from, 'Currently only English and Japanese are supported!', message.id) 178 | } 179 | break 180 | case 'quotemaker': 181 | arg = body.trim().split('|') 182 | if (arg.length >= 3) { 183 | client.reply(from, 'Processing...', message.id) 184 | const quotes = arg[1] 185 | const author = arg[2] 186 | const theme = arg[3] 187 | try { 188 | const resolt = await quotemaker(quotes, author, theme) 189 | client.sendFile(from, resolt, 'quotesmaker.jpg','...') 190 | } catch { 191 | client.reply(from, 'It looks like that the image failed to process', message.id) 192 | } 193 | } else { 194 | client.reply(from, 'Usage: \n#quotemaker | quote | author', message.id) 195 | } 196 | break 197 | case 'poll': 198 | feature.getpoll(client, message, pollfile, voterslistfile) 199 | break 200 | case 'vote' : 201 | feature.voteadapter(client, message, pollfile, voterslistfile) 202 | break 203 | case 'resetpoll': 204 | feature.adminpollreset(client, message, message.body.slice(10), pollfile, voterslistfile) 205 | break 206 | case 'add': 207 | feature.addcandidate(client, message, message.body.slice(4), pollfile, voterslistfile) 208 | break 209 | case 'translate': 210 | arg = body.trim().split(' ') 211 | if (arg.length != 2) return client.reply(from, 'Wrong Format!', id) 212 | if (!quotedMsg) return client.reply(from, 'Wrong Format!', id) 213 | const quoteText = quotedMsg.type == 'chat' ? quotedMsg.body : quotedMsg.type == 'image' ? quotedMsg.caption : '' 214 | translate(quoteText, arg[1]) 215 | .then((result) => client.sendText(from, result)) 216 | .catch(() => client.sendText(from, 'An error occured!')) 217 | break 218 | case 'waifu': 219 | const waifu = await axios.get('https://mhankbarbar.herokuapp.com/api/waifu') 220 | console.log(waifu.image) 221 | client.sendFileFromUrl(from, waifu.data.image, 'Waifu.jpg', `❤️ Name : ${waifu.data.name}\n🎉️ Description : ${waifu.data.desc}\n\n❇️ Source : ${waifu.data.source}`, id) 222 | break 223 | case 'husbando': 224 | const diti = fs.readFileSync('./lib/husbu.json') 225 | const ditiJsin = JSON.parse(diti) 226 | const rindIndix = Math.floor(Math.random() * ditiJsin.length) 227 | const rindKiy = ditiJsin[rindIndix] 228 | client.sendFileFromUrl(from, rindKiy.image, 'Husbando.jpg', rindKiy.teks, id) 229 | break 230 | case 'bc': 231 | let msg = body.slice(4) 232 | const chatz = await client.getAllChatIds() 233 | for (let ids of chatz) { 234 | var cvk = await client.getChatById(ids) 235 | if (!cvk.isReadOnly) client.sendText(ids, `${msg}`) 236 | } 237 | client.reply(from, 'Broadcast Success!', message.id) 238 | break 239 | case 'user': 240 | const username = body.slice(6) 241 | const result = await axios.get(`https://api.jikan.moe/v3/user/${username}`) 242 | const jikan = result.data 243 | 244 | var Data = `🔖️ Username: ${jikan.username} 245 | 246 | 📒️ User ID: ${jikan.user_id} 247 | 248 | ❤️ Gender: ${jikan.gender} 249 | 250 | 🌍️ Location: ${jikan.location} 251 | 252 | 📆️ Joined: ${jikan.joined} 253 | 254 | ⭐️ Anime Stats ⭐️ 255 | 256 | Days Watched: ${jikan.anime_stats.days_watched} 257 | 258 | Mean Score: ${jikan.anime_stats.mean_score} 259 | 260 | Currently Watching: ${jikan.anime_stats.watching} 261 | 262 | Completed: ${jikan.anime_stats.completed} 263 | 264 | On Hold: ${jikan.anime_stats.on_hold} 265 | 266 | Dropped: ${jikan.anime_stats.dropped} 267 | 268 | Plan to Watch: ${jikan.anime_stats.plan_to_watch} 269 | 270 | 🎯️ Manga Stats 🎯️ 271 | 272 | Days Read: ${jikan.manga_stats.days_read} 273 | 274 | Mean Score: ${jikan.manga_stats.mean_score} 275 | 276 | Currently Reading: ${jikan.manga_stats.reading} 277 | 278 | Completed: ${jikan.manga_stats.completed} 279 | 280 | On Hold: ${jikan.manga_stats.on_hold} 281 | 282 | Dropped: ${jikan.manga_stats.dropped} 283 | 284 | Plan to Read: ${jikan.manga_stats.plan_to_read}` 285 | await client.sendFileFromUrl(from, `${jikan.image_url}`,`user.png`, Data) 286 | break 287 | case 'ban': 288 | if(!isbotadmin) return client.reply(from, 'Only Bot admins can use this CMD, Baka!', message.id) 289 | for (let i = 0; i < mentionedJidList.length; i++) { 290 | ban.push(mentionedJidList[i]) 291 | fs.writeFileSync('./lib/banned.json', JSON.stringify(ban)) 292 | client.reply(from, 'Succes ban target!', message.id) 293 | } 294 | break 295 | case 'covid': 296 | arg = body.trim().split(' ') 297 | console.log(...arg[1]) 298 | var slicedArgs = Array.prototype.slice.call(arg, 1); 299 | console.log(slicedArgs) 300 | const country = await slicedArgs.join(' ') 301 | console.log(country) 302 | const response2 = await axios.get('https://coronavirus-19-api.herokuapp.com/countries/' + country + '/') 303 | const { cases, todayCases, deaths, todayDeaths, active } = response2.data 304 | await client.sendText(from, '🌎️Covid Info -' + country + ' 🌍️\n\n✨️Total Cases: ' + `${cases}` + '\n📆️Today\'s Cases: ' + `${todayCases}` + '\n☣️Total Deaths: ' + `${deaths}` + '\n☢️Today\'s Deaths: ' + `${todayDeaths}` + '\n⛩️Active Cases: ' + `${active}` + '.') 305 | break 306 | case 'ping': 307 | if (!isGroupMsg) return client.reply(from, 'Baka!, This command can only be used in groups', message.id) 308 | if (!isGroupAdmins) return client.reply(from, 'Baka!, only admins can use this command', message.id) 309 | const groupMem = await client.getGroupMembers(groupId) 310 | let hehe = `${body.slice(6)} - ${pushname} \n` 311 | for (let i = 0; i < groupMem.length; i++) { 312 | hehe += '✨️' 313 | hehe += ` @${groupMem[i].id.replace(/@c.us/g, '')}\n` 314 | } 315 | hehe += '----------------------' 316 | await client.sendTextWithMentions(from, hehe) 317 | break 318 | case 'act': 319 | arg = body.trim().split(' ') 320 | if (!isGroupAdmins) return client.reply(from, 'Only Admins can use this command, Baka >.<', id) 321 | if (arg[1] == 'welcome') { 322 | wel.push(chat.id) 323 | fs.writeFileSync('./lib/welcome.json', JSON.stringify(wel)) 324 | client.reply(from, `Welcome is now registered on *${name}*`, message.id) 325 | } else if (arg[1] == 'nsfw') { 326 | nsfwgrp.push(chat.id) 327 | fs.writeFileSync('./lib/nsfw.json', JSON.stringify(nsfwgrp)) 328 | client.reply(from, `NSFW is now registered on *${name}*`, message.id) 329 | } 330 | break 331 | case 'deact': 332 | arg = body.trim().split(' ') 333 | if (!isGroupAdmins) return client.reply(from, 'Only Admins can use this command, Baka >.<', id) 334 | if (arg[1] == 'welcome') { 335 | let inx = ban.indexOf(from) 336 | wel.splice(inx, 1) 337 | fs.writeFileSync('./lib/welcome.json', JSON.stringify(wel)) 338 | client.reply(from, `Welcome is now unregistered on *${name}*`, message.id) 339 | } else if (arg[1] == 'nsfw') { 340 | let inx = ban.indexOf(from) 341 | nsfwgrp.splice(inx, 1) 342 | fs.writeFileSync('./lib/nsfw.json', JSON.stringify(nsfwgrp)) 343 | client.reply(from, `NSFW is now unregistered on *${name}*`, message.id) 344 | } 345 | break 346 | case 'kickall': 347 | const isGroupOwner = sender.id === chat.groupMetadata.owner 348 | if(!isGroupOwner) return client.reply(from, 'Baka!, Only group owner can use this CMD', message.id) 349 | if (!isGroupMsg) return client.reply(from, 'This command can only be used in groups', message.id) 350 | if(!isBotGroupAdmins) return client.reply(from, 'You need to make me admin before doing so, Baka!', message.id) 351 | const allMem = await client.getGroupMembers(from) 352 | console.log(isGroupAdmins) 353 | for (let i = 0; i < allMem.length; i++) { 354 | if (groupAdmins.includes(allMem[i].id)) return 355 | await client.removeParticipant(groupId, allMem[i].id) 356 | } 357 | client.reply(from, 'Done!', message.id) 358 | break 359 | case 'clearall': 360 | if (!isbotadmin) return client.reply(from, 'Owner only', message.id) 361 | const allChatz = await client.getAllChats() 362 | for (let dchat of allChatz) { 363 | await client.deleteChat(dchat.id) 364 | } 365 | client.reply(from, 'Done', message.id) 366 | break 367 | case 'unban': 368 | if(!isbotadmin) return client.reply(from, 'Only bot admins can use this CMD', message.id) 369 | let inx = ban.indexOf(mentionedJidList[0]) 370 | ban.splice(inx, 1) 371 | fs.writeFileSync('./lib/banned.json', JSON.stringify(ban)) 372 | client.reply(from, 'Unbanned User!', message.id) 373 | break 374 | case 'kick': 375 | if(!isGroupMsg) return client.reply(from, '...', message.id) 376 | if(!isGroupAdmins) return client.reply(from, 'You are not an admin, Sorry', message.id) 377 | if(!isBotGroupAdmins) return client.reply(from, 'You need to make me admin to use this CMD', message.id) 378 | if(mentionedJidList.length === 0) return client.reply(from, 'Wrong format', message.id) 379 | await client.sendText(from, `Request Accepted! issued:\n${mentionedJidList.join('\n')}`) 380 | for (let i = 0; i < mentionedJidList.length; i++) { 381 | if (groupAdmins.includes(mentionedJidList[i])) return await client.reply(from, '....', message.id) 382 | await client.removeParticipant(groupId, mentionedJidList[i]) 383 | } 384 | break 385 | case 'delete': 386 | if (!isGroupAdmins) return client.reply(from, 'Only admins can use this command', id) 387 | if (!quotedMsg) return client.reply(from, 'Wrong Format!', id) 388 | if (!quotedMsgObj.fromMe) return client.reply(from, 'Wrong Format!', id) 389 | client.deleteMessage(quotedMsgObj.chatId, quotedMsgObj.id, false) 390 | break 391 | case 'leave': 392 | if(!isGroupMsg) return client.reply(from, '...', message.id) 393 | if(!isGroupAdmins) return client.reply(from, 'You are not an admin', message.id) 394 | await client.sendText(from,'Sayonara').then(() => client.leaveGroup(groupId)) 395 | break 396 | case 'promote': 397 | if(!isGroupMsg) return client.reply(from, '.', message.id) 398 | if(!isGroupAdmins) return client.reply(from, 'You are not an admin', message.id) 399 | if(!isBotGroupAdmins) return client.reply(from, 'You need to make me admin to use this CMD', message.id) 400 | if (mentionedJidList.length === 0) return await client.reply(from, 'Wrong format!', message.id) 401 | if (mentionedJidList.length >= 2) return await client.reply(from, 'One user at a time', message.id) 402 | if (groupAdmins.includes(mentionedJidList[0])) return await client.reply(from, 'This user is already admin', message.id) 403 | await client.promoteParticipant(groupId, mentionedJidList[0]) 404 | await client.sendTextWithMentions(from, `@${mentionedJidList[0].replace('@c.us', '')} is now an admin`) 405 | break 406 | case 'demote': 407 | if(!isGroupAdmins) return client.reply(from, 'You are not an admin', message.id) 408 | if(!isBotGroupAdmins) return client.reply(from, 'You need to make me admin to use this CMD', message.id) 409 | if (mentionedJidList.length === 0) return client.reply(from, 'Wrong Format', message.id) 410 | if (mentionedJidList.length >= 2) return await client.reply(from, 'One user at a time', message.id) 411 | if (!groupAdmins.includes(mentionedJidList[0])) return await client.reply(from, 'The user isn\'t an admin', message.id) 412 | await client.demoteParticipant(groupId, mentionedJidList[0]) 413 | await client.sendTextWithMentions(from, `Demoted @${mentionedJidList[0].replace('@c.us', '')}.`) 414 | break 415 | case 'join': 416 | if (chat.id == invitegrp) { 417 | if (args.length == 0) return client.reply(from, 'Wrong Format', message.id) 418 | const link = body.slice(6) 419 | const minMem = 30 420 | const isLink = link.match(/(https:\/\/chat.whatsapp.com)/gi) 421 | const check = await client.inviteInfo(link) 422 | if (!isLink) return client.reply(from, 'Where\'s the link?', message.id) 423 | if (check.size < minMem) return client.reply(from, 'The group does not have 30+ members', message.id) 424 | await client.joinGroupViaLink(link).then( async () => { 425 | await client.reply(from, '*Joined* ✨️', message.id) 426 | }).catch(error => { 427 | client.reply(from, 'An error occured 💔️', message.id) 428 | }) 429 | } 430 | break 431 | case 'groupinfo' : 432 | if (!isGroupMsg) return client.reply(from, '.', message.id) 433 | var totalMem = chat.groupMetadata.participants.length 434 | var desc = chat.groupMetadata.desc 435 | var groupname = name 436 | var welgrp = wel.includes(chat.id) 437 | var ngrp = nsfwgrp.includes(chat.id) 438 | var grouppic = await client.getProfilePicFromServer(chat.id) 439 | if (grouppic == undefined) { 440 | var pfp = errorurl 441 | } else { 442 | var pfp = grouppic 443 | } 444 | await client.sendFileFromUrl(from, pfp, 'group.png', `*${groupname}* 445 | 446 | 🌐️ *Members: ${totalMem}* 447 | 448 | 💌️ *Welcome: ${welgrp}* 449 | 450 | ⚜️ *NSFW: ${ngrp}* 451 | 452 | 📃️ *Group Description* 453 | 454 | ${desc}`) 455 | break 456 | case 'sauce': 457 | if (isMedia) { 458 | const mediaData = await decryptMedia(message) 459 | const imageBase64 = `data:${mimetype};base64,${mediaData.toString('base64')}` 460 | try { 461 | const raw = await fetch("https://trace.moe/api/search", { 462 | method: "POST", 463 | body: JSON.stringify({ image: imageBase64 }), 464 | headers: { "Content-Type": "application/json" } 465 | }) 466 | const parsedResult = await raw.json() 467 | const { anime, episode, title_english } = parsedResult.docs[0] 468 | const content = `*Anime Found!* \n⛩️ *Japanese Title:* ${anime} \n✨️ *English Title:* ${title_english} \n💚️ *Source Episode:* ${episode} ` 469 | await client.sendImage(from, imageBase64, 'sauce.png', content, id) 470 | console.log("Sent!") 471 | } catch (err) { 472 | await client.sendFileFromUrl(from, errorurl, 'error.png', '💔️ An Error Occured', id) 473 | } 474 | } else if (quotedMsg && quotedMsg.type == 'image') { 475 | const mediaData = await decryptMedia(quotedMsg) 476 | const imageBase64 = `data:${quotedMsg.mimetype};base64,${mediaData.toString('base64')}` 477 | try { 478 | const raw = await fetch("https://trace.moe/api/search", { 479 | method: "POST", 480 | body: JSON.stringify({ image: imageBase64 }), 481 | headers: { "Content-Type": "application/json" } 482 | }) 483 | const parsedResult = await raw.json() 484 | const { anime, episode, title_english } = parsedResult.docs[0] 485 | const content = `*Anime Found!* \n⛩️ *Japanese Title:* ${anime} \n✨️ *English Title: ${title_english} \n💚️ *Source Episode:* ${episode} ` 486 | await client.sendImage(from, imageBase64, 'sauce.png', content, id) 487 | console.log("Sent!") 488 | } catch (err) { 489 | throw new Error(err.message) 490 | await client.sendFileFromUrl(from, errorurl, 'error.png', '💔️ An Error Occured', id) 491 | } 492 | } 493 | break 494 | case 'sr': 495 | arg = body.trim().split(' ') 496 | const sr = arg[1] 497 | try { 498 | const response1 = await axios.get('https://meme-api.herokuapp.com/gimme/' + sr + '/'); 499 | const { 500 | postLink, 501 | title, 502 | subreddit, 503 | url, 504 | nsfw, 505 | spoiler 506 | } = response1.data 507 | 508 | 509 | 510 | if (nsfw == true) { 511 | if ((isGroupMsg) && (isnsfw)) { 512 | await client.sendFileFromUrl(from, `${url}`, 'Reddit.jpg', `${title}` + '\n\nPostlink:' + `${postLink}`) 513 | } else if ((isGroupMsg) && (!isnsfw)) { 514 | await client.reply(from, `NSFW is not registered on *${name}*`, id) 515 | } 516 | } else { 517 | await client.sendFileFromUrl(from, `${url}`, 'Reddit.jpg', `${title}` + '\n\nPostlink:' + `${postLink}`) 518 | } 519 | } catch(err) { 520 | await client.reply(from, 'There is no such subreddit, Baka!', id) 521 | } 522 | break 523 | case 'cgc': 524 | arg = body.trim().split(' ') 525 | const gcname = arg[1] 526 | client.createGroup(gcname, mentionedJidList) 527 | client.sendText(from, 'Group Created ✨️') 528 | break 529 | case 'lyrics': 530 | if (args.length == 0) return client.reply(from, 'Wrong Format, BAKA', message.id) 531 | const lagu = body.slice(7) 532 | console.log(lagu) 533 | const lirik = await liriklagu(lagu) 534 | client.sendText(from, lirik) 535 | break 536 | case 'anime': 537 | const keyword = message.body.replace('#anime', '') 538 | try { 539 | const data = await fetch( 540 | `https://api.jikan.moe/v3/search/anime?q=${keyword}` 541 | ) 542 | const parsed = await data.json() 543 | if (!parsed) { 544 | await client.sendFileFromUrl(from, errorurl2, 'error.png', '💔️ Sorry, Couldn\'t find the requested anime', id) 545 | return null 546 | } 547 | const { title, synopsis, episodes, url, rated, score, image_url } = parsed.results[0] 548 | const content = `*Anime Found!* 549 | ✨️ *Title:* ${title} 550 | 551 | 🎆️ *Episodes:* ${episodes} 552 | 553 | 💌️ *Rating:* ${rated} 554 | 555 | ❤️ *Score:* ${score} 556 | 557 | 💚️ *Synopsis:* ${synopsis} 558 | 559 | 🌐️ *URL*: ${url}` 560 | 561 | const image = await bent("buffer")(image_url) 562 | const base64 = `data:image/jpg;base64,${image.toString("base64")}` 563 | client.sendImage(from, base64, title, content) 564 | } catch (err) { 565 | console.error(err.message) 566 | await client.sendFileFromUrl(from, errorurl2, 'error.png', '💔️ Sorry, Couldn\'t find the requested anime') 567 | } 568 | break 569 | case 'wallpaper': 570 | if (args.length == 0) return client.reply(from, 'Wrong Format!', id) 571 | const query = body.slice(6) 572 | const walls = await wall(query) 573 | console.log(walls) 574 | await client.sendFileFromUrl(from, walls, 'walls.jpg', '', id) 575 | break 576 | case 'animeneko': 577 | client.sendFileFromUrl(from, akaneko.neko(), 'neko.jpg', 'Neko *Nyaa*~') 578 | break 579 | case 'doggo': 580 | const list = ["https://cdn.shibe.online/shibes/247d0ac978c9de9d9b66d72dbdc65f2dac64781d.jpg","https://cdn.shibe.online/shibes/1cf322acb7d74308995b04ea5eae7b520e0eae76.jpg","https://cdn.shibe.online/shibes/1ce955c3e49ae437dab68c09cf45297d68773adf.jpg","https://cdn.shibe.online/shibes/ec02bee661a797518d37098ab9ad0c02da0b05c3.jpg","https://cdn.shibe.online/shibes/1e6102253b51fbc116b887e3d3cde7b5c5083542.jpg","https://cdn.shibe.online/shibes/f0c07a7205d95577861eee382b4c8899ac620351.jpg","https://cdn.shibe.online/shibes/3eaf3b7427e2d375f09fc883f94fa8a6d4178a0a.jpg","https://cdn.shibe.online/shibes/c8b9fcfde23aee8d179c4c6f34d34fa41dfaffbf.jpg","https://cdn.shibe.online/shibes/55f298bc16017ed0aeae952031f0972b31c959cb.jpg","https://cdn.shibe.online/shibes/2d5dfe2b0170d5de6c8bc8a24b8ad72449fbf6f6.jpg","https://cdn.shibe.online/shibes/e9437de45e7cddd7d6c13299255e06f0f1d40918.jpg","https://cdn.shibe.online/shibes/6c32141a0d5d089971d99e51fd74207ff10751e7.jpg","https://cdn.shibe.online/shibes/028056c9f23ff40bc749a95cc7da7a4bb734e908.jpg","https://cdn.shibe.online/shibes/4fb0c8b74dbc7653e75ec1da597f0e7ac95fe788.jpg","https://cdn.shibe.online/shibes/125563d2ab4e520aaf27214483e765db9147dcb3.jpg","https://cdn.shibe.online/shibes/ea5258fad62cebe1fedcd8ec95776d6a9447698c.jpg","https://cdn.shibe.online/shibes/5ef2c83c2917e2f944910cb4a9a9b441d135f875.jpg","https://cdn.shibe.online/shibes/6d124364f02944300ae4f927b181733390edf64e.jpg","https://cdn.shibe.online/shibes/92213f0c406787acd4be252edb5e27c7e4f7a430.jpg","https://cdn.shibe.online/shibes/40fda0fd3d329be0d92dd7e436faa80db13c5017.jpg","https://cdn.shibe.online/shibes/e5c085fc427528fee7d4c3935ff4cd79af834a82.jpg","https://cdn.shibe.online/shibes/f83fa32c0da893163321b5cccab024172ddbade1.jpg","https://cdn.shibe.online/shibes/4aa2459b7f411919bf8df1991fa114e47b802957.jpg","https://cdn.shibe.online/shibes/2ef54e174f13e6aa21bb8be3c7aec2fdac6a442f.jpg","https://cdn.shibe.online/shibes/fa97547e670f23440608f333f8ec382a75ba5d94.jpg","https://cdn.shibe.online/shibes/fb1b7150ed8eb4ffa3b0e61ba47546dd6ee7d0dc.jpg","https://cdn.shibe.online/shibes/abf9fb41d914140a75d8bf8e05e4049e0a966c68.jpg","https://cdn.shibe.online/shibes/f63e3abe54c71cc0d0c567ebe8bce198589ae145.jpg","https://cdn.shibe.online/shibes/4c27b7b2395a5d051b00691cc4195ef286abf9e1.jpg","https://cdn.shibe.online/shibes/00df02e302eac0676bb03f41f4adf2b32418bac8.jpg","https://cdn.shibe.online/shibes/4deaac9baec39e8a93889a84257338ebb89eca50.jpg","https://cdn.shibe.online/shibes/199f8513d34901b0b20a33758e6ee2d768634ebb.jpg","https://cdn.shibe.online/shibes/f3efbf7a77e5797a72997869e8e2eaa9efcdceb5.jpg","https://cdn.shibe.online/shibes/39a20ccc9cdc17ea27f08643b019734453016e68.jpg","https://cdn.shibe.online/shibes/e67dea458b62cf3daa4b1e2b53a25405760af478.jpg","https://cdn.shibe.online/shibes/0a892f6554c18c8bcdab4ef7adec1387c76c6812.jpg","https://cdn.shibe.online/shibes/1b479987674c9b503f32e96e3a6aeca350a07ade.jpg","https://cdn.shibe.online/shibes/0c80fc00d82e09d593669d7cce9e273024ba7db9.jpg","https://cdn.shibe.online/shibes/bbc066183e87457b3143f71121fc9eebc40bf054.jpg","https://cdn.shibe.online/shibes/0932bf77f115057c7308ef70c3de1de7f8e7c646.jpg","https://cdn.shibe.online/shibes/9c87e6bb0f3dc938ce4c453eee176f24636440e0.jpg","https://cdn.shibe.online/shibes/0af1bcb0b13edf5e9b773e34e54dfceec8fa5849.jpg","https://cdn.shibe.online/shibes/32cf3f6eac4673d2e00f7360753c3f48ed53c650.jpg","https://cdn.shibe.online/shibes/af94d8eeb0f06a0fa06f090f404e3bbe86967949.jpg","https://cdn.shibe.online/shibes/4b55e826553b173c04c6f17aca8b0d2042d309fb.jpg","https://cdn.shibe.online/shibes/a0e53593393b6c724956f9abe0abb112f7506b7b.jpg","https://cdn.shibe.online/shibes/7eba25846f69b01ec04de1cae9fed4b45c203e87.jpg","https://cdn.shibe.online/shibes/fec6620d74bcb17b210e2cedca72547a332030d0.jpg","https://cdn.shibe.online/shibes/26cf6be03456a2609963d8fcf52cc3746fcb222c.jpg","https://cdn.shibe.online/shibes/c41b5da03ad74b08b7919afc6caf2dd345b3e591.jpg","https://cdn.shibe.online/shibes/7a9997f817ccdabac11d1f51fac563242658d654.jpg","https://cdn.shibe.online/shibes/7221241bad7da783c3c4d84cfedbeb21b9e4deea.jpg","https://cdn.shibe.online/shibes/283829584e6425421059c57d001c91b9dc86f33b.jpg","https://cdn.shibe.online/shibes/5145c9d3c3603c9e626585cce8cffdfcac081b31.jpg","https://cdn.shibe.online/shibes/b359c891e39994af83cf45738b28e499cb8ffe74.jpg","https://cdn.shibe.online/shibes/0b77f74a5d9afaa4b5094b28a6f3ee60efcb3874.jpg","https://cdn.shibe.online/shibes/adccfdf7d4d3332186c62ed8eb254a49b889c6f9.jpg","https://cdn.shibe.online/shibes/3aac69180f777512d5dabd33b09f531b7a845331.jpg","https://cdn.shibe.online/shibes/1d25e4f592db83039585fa480676687861498db8.jpg","https://cdn.shibe.online/shibes/d8349a2436420cf5a89a0010e91bf8dfbdd9d1cc.jpg","https://cdn.shibe.online/shibes/eb465ef1906dccd215e7a243b146c19e1af66c67.jpg","https://cdn.shibe.online/shibes/3d14e3c32863195869e7a8ba22229f457780008b.jpg","https://cdn.shibe.online/shibes/79cedc1a08302056f9819f39dcdf8eb4209551a3.jpg","https://cdn.shibe.online/shibes/4440aa827f88c04baa9c946f72fc688a34173581.jpg","https://cdn.shibe.online/shibes/94ea4a2d4b9cb852e9c1ff599f6a4acfa41a0c55.jpg","https://cdn.shibe.online/shibes/f4478196e441aef0ada61bbebe96ac9a573b2e5d.jpg","https://cdn.shibe.online/shibes/96d4db7c073526a35c626fc7518800586fd4ce67.jpg","https://cdn.shibe.online/shibes/196f3ed10ee98557328c7b5db98ac4a539224927.jpg","https://cdn.shibe.online/shibes/d12b07349029ca015d555849bcbd564d8b69fdbf.jpg","https://cdn.shibe.online/shibes/80fba84353000476400a9849da045611a590c79f.jpg","https://cdn.shibe.online/shibes/94cb90933e179375608c5c58b3d8658ef136ad3c.jpg","https://cdn.shibe.online/shibes/8447e67b5d622ef0593485316b0c87940a0ef435.jpg","https://cdn.shibe.online/shibes/c39a1d83ad44d2427fc8090298c1062d1d849f7e.jpg","https://cdn.shibe.online/shibes/6f38b9b5b8dbf187f6e3313d6e7583ec3b942472.jpg","https://cdn.shibe.online/shibes/81a2cbb9a91c6b1d55dcc702cd3f9cfd9a111cae.jpg","https://cdn.shibe.online/shibes/f1f6ed56c814bd939645138b8e195ff392dfd799.jpg","https://cdn.shibe.online/shibes/204a4c43cfad1cdc1b76cccb4b9a6dcb4a5246d8.jpg","https://cdn.shibe.online/shibes/9f34919b6154a88afc7d001c9d5f79b2e465806f.jpg","https://cdn.shibe.online/shibes/6f556a64a4885186331747c432c4ef4820620d14.jpg","https://cdn.shibe.online/shibes/bbd18ae7aaf976f745bc3dff46b49641313c26a9.jpg","https://cdn.shibe.online/shibes/6a2b286a28183267fca2200d7c677eba73b1217d.jpg","https://cdn.shibe.online/shibes/06767701966ed64fa7eff2d8d9e018e9f10487ee.jpg","https://cdn.shibe.online/shibes/7aafa4880b15b8f75d916b31485458b4a8d96815.jpg","https://cdn.shibe.online/shibes/b501169755bcf5c1eca874ab116a2802b6e51a2e.jpg","https://cdn.shibe.online/shibes/a8989bad101f35cf94213f17968c33c3031c16fc.jpg","https://cdn.shibe.online/shibes/f5d78feb3baa0835056f15ff9ced8e3c32bb07e8.jpg","https://cdn.shibe.online/shibes/75db0c76e86fbcf81d3946104c619a7950e62783.jpg","https://cdn.shibe.online/shibes/8ac387d1b252595bbd0723a1995f17405386b794.jpg","https://cdn.shibe.online/shibes/4379491ef4662faa178f791cc592b52653fb24b3.jpg","https://cdn.shibe.online/shibes/4caeee5f80add8c3db9990663a356e4eec12fc0a.jpg","https://cdn.shibe.online/shibes/99ef30ea8bb6064129da36e5673649e957cc76c0.jpg","https://cdn.shibe.online/shibes/aeac6a5b0a07a00fba0ba953af27734d2361fc10.jpg","https://cdn.shibe.online/shibes/9a217cfa377cc50dd8465d251731be05559b2142.jpg","https://cdn.shibe.online/shibes/65f6047d8e1d247af353532db018b08a928fd62a.jpg","https://cdn.shibe.online/shibes/fcead395cbf330b02978f9463ac125074ac87ab4.jpg","https://cdn.shibe.online/shibes/79451dc808a3a73f99c339f485c2bde833380af0.jpg","https://cdn.shibe.online/shibes/bedf90869797983017f764165a5d97a630b7054b.jpg","https://cdn.shibe.online/shibes/dd20e5801badd797513729a3645c502ae4629247.jpg","https://cdn.shibe.online/shibes/88361ee50b544cb1623cb259bcf07b9850183e65.jpg","https://cdn.shibe.online/shibes/0ebcfd98e8aa61c048968cb37f66a2b5d9d54d4b.jpg"] 581 | let kya = list[Math.floor(Math.random() * list.length)] 582 | client.sendFileFromUrl(from, kya, 'Dog.jpeg', 'Doggo ✨️', id) 583 | break 584 | case 'neko': 585 | q2 = Math.floor(Math.random() * 900) + 300; 586 | q3 = Math.floor(Math.random() * 900) + 300; 587 | client.sendFileFromUrl(from, 'http://placekitten.com/'+q3+'/'+q2, 'neko.png','Neko 🌠️', id) 588 | break 589 | case 'roll': 590 | const dice = Math.floor(Math.random() * 6) + 1 591 | await client.sendStickerfromUrl(from, 'https://www.random.org/dice/dice' + dice + '.png') 592 | break 593 | case 'flip': 594 | const side = Math.floor(Math.random() * 2) + 1 595 | if (side == 1) { 596 | client.sendStickerfromUrl(from, 'https://i.ibb.co/LJjkVK5/heads.png') 597 | } else { 598 | client.sendStickerfromUrl(from, 'https://i.ibb.co/wNnZ4QD/tails.png') 599 | } 600 | break 601 | case 'ship': 602 | arg = body.trim().split(' ') 603 | const per = Math.floor(Math.random() * 100) 604 | 605 | if (per < 25) { 606 | var sentence = `${per}% Worse than average ♦️` 607 | } else if (per < 50) { 608 | var sentence = `${per}% I don't know how i feel about it ❇️` 609 | } else if (per < 75) { 610 | var sentence = `${per}% Good, I guess... ⭐️` 611 | } else if (per < 90) { 612 | var sentence = `${per}% Sugoii! Go for it!🤩️` 613 | } else { 614 | var sentence = `${per}% Incredible! You two will be an amazing couple 😍️` 615 | } 616 | 617 | var shiptext = `❣️ *Matchmaking...* 618 | 619 | --------------------------------- 620 | *${arg[1]} x ${arg[2]}* 621 | --------------------------------- 622 | 623 | ${sentence}` 624 | await client.sendTextWithMentions(from, shiptext) 625 | break 626 | case 'pokemon': 627 | q7 = Math.floor(Math.random() * 890) + 1; 628 | client.sendFileFromUrl(from, 'https://assets.pokemon.com/assets/cms2/img/pokedex/full/'+q7+'.png','Pokemon.png','.', id) 629 | break 630 | case 'rpaper' : 631 | const walnime = ['https://cdn.nekos.life/wallpaper/QwGLg4oFkfY.png','https://cdn.nekos.life/wallpaper/bUzSjcYxZxQ.jpg','https://cdn.nekos.life/wallpaper/j49zxzaUcjQ.jpg','https://cdn.nekos.life/wallpaper/YLTH5KuvGX8.png','https://cdn.nekos.life/wallpaper/Xi6Edg133m8.jpg','https://cdn.nekos.life/wallpaper/qvahUaFIgUY.png','https://cdn.nekos.life/wallpaper/leC8q3u8BSk.jpg','https://cdn.nekos.life/wallpaper/tSUw8s04Zy0.jpg','https://cdn.nekos.life/wallpaper/sqsj3sS6EJE.png','https://cdn.nekos.life/wallpaper/HmjdX_s4PU4.png','https://cdn.nekos.life/wallpaper/Oe2lKgLqEXY.jpg','https://cdn.nekos.life/wallpaper/GTwbUYI-xTc.jpg','https://cdn.nekos.life/wallpaper/nn_nA8wTeP0.png','https://cdn.nekos.life/wallpaper/Q63o6v-UUa8.png','https://cdn.nekos.life/wallpaper/ZXLFm05K16Q.jpg','https://cdn.nekos.life/wallpaper/cwl_1tuUPuQ.png','https://cdn.nekos.life/wallpaper/wWhtfdbfAgM.jpg','https://cdn.nekos.life/wallpaper/3pj0Xy84cPg.jpg','https://cdn.nekos.life/wallpaper/sBoo8_j3fkI.jpg','https://cdn.nekos.life/wallpaper/gCUl_TVizsY.png','https://cdn.nekos.life/wallpaper/LmTi1k9REW8.jpg','https://cdn.nekos.life/wallpaper/sbq_4WW2PUM.jpg','https://cdn.nekos.life/wallpaper/QOSUXEbzDQA.png','https://cdn.nekos.life/wallpaper/khaqGIHsiqk.jpg','https://cdn.nekos.life/wallpaper/iFtEXugqQgA.png','https://cdn.nekos.life/wallpaper/deFKIDdRe1I.jpg','https://cdn.nekos.life/wallpaper/OHZVtvDm0gk.jpg','https://cdn.nekos.life/wallpaper/YZYa00Hp2mk.jpg','https://cdn.nekos.life/wallpaper/R8nPIKQKo9g.png','https://cdn.nekos.life/wallpaper/_brn3qpRBEE.jpg','https://cdn.nekos.life/wallpaper/ADTEQdaHhFI.png','https://cdn.nekos.life/wallpaper/MGvWl6om-Fw.jpg','https://cdn.nekos.life/wallpaper/YGmpjZW3AoQ.jpg','https://cdn.nekos.life/wallpaper/hNCgoY-mQPI.jpg','https://cdn.nekos.life/wallpaper/3db40hylKs8.png','https://cdn.nekos.life/wallpaper/iQ2FSo5nCF8.jpg','https://cdn.nekos.life/wallpaper/meaSEfeq9QM.png','https://cdn.nekos.life/wallpaper/CmEmn79xnZU.jpg','https://cdn.nekos.life/wallpaper/MAL18nB-yBI.jpg','https://cdn.nekos.life/wallpaper/FUuBi2xODuI.jpg','https://cdn.nekos.life/wallpaper/ez-vNNuk6Ck.jpg','https://cdn.nekos.life/wallpaper/K4-z0Bc0Vpc.jpg','https://cdn.nekos.life/wallpaper/Y4JMbswrNg8.jpg','https://cdn.nekos.life/wallpaper/ffbPXIxt4-0.png','https://cdn.nekos.life/wallpaper/x63h_W8KFL8.jpg','https://cdn.nekos.life/wallpaper/lktzjDRhWyg.jpg','https://cdn.nekos.life/wallpaper/j7oQtvRZBOI.jpg','https://cdn.nekos.life/wallpaper/MQQEAD7TUpQ.png','https://cdn.nekos.life/wallpaper/lEG1-Eeva6Y.png','https://cdn.nekos.life/wallpaper/Loh5wf0O5Aw.png','https://cdn.nekos.life/wallpaper/yO6ioREenLA.png','https://cdn.nekos.life/wallpaper/4vKWTVgMNDc.jpg','https://cdn.nekos.life/wallpaper/Yk22OErU8eg.png','https://cdn.nekos.life/wallpaper/Y5uf1hsnufE.png','https://cdn.nekos.life/wallpaper/xAmBpMUd2Zw.jpg','https://cdn.nekos.life/wallpaper/f_RWFoWciRE.jpg','https://cdn.nekos.life/wallpaper/Y9qjP2Y__PA.jpg','https://cdn.nekos.life/wallpaper/eqEzgohpPwc.jpg','https://cdn.nekos.life/wallpaper/s1MBos_ZGWo.jpg','https://cdn.nekos.life/wallpaper/PtW0or_Pa9c.png','https://cdn.nekos.life/wallpaper/32EAswpy3M8.png','https://cdn.nekos.life/wallpaper/Z6eJZf5xhcE.png','https://cdn.nekos.life/wallpaper/xdiSF731IFY.jpg','https://cdn.nekos.life/wallpaper/Y9r9trNYadY.png','https://cdn.nekos.life/wallpaper/8bH8CXn-sOg.jpg','https://cdn.nekos.life/wallpaper/a02DmIFzRBE.png','https://cdn.nekos.life/wallpaper/MnrbXcPa7Oo.png','https://cdn.nekos.life/wallpaper/s1Tc9xnugDk.jpg','https://cdn.nekos.life/wallpaper/zRqEx2gnfmg.jpg','https://cdn.nekos.life/wallpaper/PtW0or_Pa9c.png','https://cdn.nekos.life/wallpaper/0ECCRW9soHM.jpg','https://cdn.nekos.life/wallpaper/kAw8QHl_wbM.jpg','https://cdn.nekos.life/wallpaper/ZXcaFmpOlLk.jpg','https://cdn.nekos.life/wallpaper/WVEdi9Ng8UE.png','https://cdn.nekos.life/wallpaper/IRu29rNgcYU.png','https://cdn.nekos.life/wallpaper/LgIJ_1AL3rM.jpg','https://cdn.nekos.life/wallpaper/DVD5_fLJEZA.jpg','https://cdn.nekos.life/wallpaper/siqOQ7k8qqk.jpg','https://cdn.nekos.life/wallpaper/CXNX_15eGEQ.png','https://cdn.nekos.life/wallpaper/s62tGjOTHnk.jpg','https://cdn.nekos.life/wallpaper/tmQ5ce6EfJE.png','https://cdn.nekos.life/wallpaper/Zju7qlBMcQ4.jpg','https://cdn.nekos.life/wallpaper/CPOc_bMAh2Q.png','https://cdn.nekos.life/wallpaper/Ew57S1KtqsY.jpg','https://cdn.nekos.life/wallpaper/hVpFbYJmZZc.jpg','https://cdn.nekos.life/wallpaper/sb9_J28pftY.jpg','https://cdn.nekos.life/wallpaper/JDoIi_IOB04.jpg','https://cdn.nekos.life/wallpaper/rG76AaUZXzk.jpg','https://cdn.nekos.life/wallpaper/9ru2luBo360.png','https://cdn.nekos.life/wallpaper/ghCgiWFxGwY.png','https://cdn.nekos.life/wallpaper/OSR-i-Rh7ZY.png','https://cdn.nekos.life/wallpaper/65VgtPyweCc.jpg','https://cdn.nekos.life/wallpaper/3vn-0FkNSbM.jpg','https://cdn.nekos.life/wallpaper/u02Y0-AJPL0.jpg','https://cdn.nekos.life/wallpaper/_-Z-0fGflRc.jpg','https://cdn.nekos.life/wallpaper/3VjNKqEPp58.jpg','https://cdn.nekos.life/wallpaper/NoG4lKnk6Sc.jpg','https://cdn.nekos.life/wallpaper/xiTxgRMA_IA.jpg','https://cdn.nekos.life/wallpaper/yq1ZswdOGpg.png','https://cdn.nekos.life/wallpaper/4SUxw4M3UMA.png','https://cdn.nekos.life/wallpaper/cUPnQOHNLg0.jpg','https://cdn.nekos.life/wallpaper/zczjuLWRisA.jpg','https://cdn.nekos.life/wallpaper/TcxvU_diaC0.png','https://cdn.nekos.life/wallpaper/7qqWhEF_uoY.jpg','https://cdn.nekos.life/wallpaper/J4t_7DvoUZw.jpg','https://cdn.nekos.life/wallpaper/xQ1Pg5D6J4U.jpg','https://cdn.nekos.life/wallpaper/aIMK5Ir4xho.jpg','https://cdn.nekos.life/wallpaper/6gneEXrNAWU.jpg','https://cdn.nekos.life/wallpaper/PSvNdoISWF8.jpg','https://cdn.nekos.life/wallpaper/SjgF2-iOmV8.jpg','https://cdn.nekos.life/wallpaper/vU54ikOVY98.jpg','https://cdn.nekos.life/wallpaper/QjnfRwkRU-Q.jpg','https://cdn.nekos.life/wallpaper/uSKqzz6ZdXc.png','https://cdn.nekos.life/wallpaper/AMrcxZOnVBE.jpg','https://cdn.nekos.life/wallpaper/N1l8SCMxamE.jpg','https://cdn.nekos.life/wallpaper/n2cBaTo-J50.png','https://cdn.nekos.life/wallpaper/ZXcaFmpOlLk.jpg','https://cdn.nekos.life/wallpaper/7bwxy3elI7o.png','https://cdn.nekos.life/wallpaper/7VW4HwF6LcM.jpg','https://cdn.nekos.life/wallpaper/YtrPAWul1Ug.png','https://cdn.nekos.life/wallpaper/1p4_Mmq95Ro.jpg','https://cdn.nekos.life/wallpaper/EY5qz5iebJw.png','https://cdn.nekos.life/wallpaper/aVDS6iEAIfw.jpg','https://cdn.nekos.life/wallpaper/veg_xpHQfjE.jpg','https://cdn.nekos.life/wallpaper/meaSEfeq9QM.png','https://cdn.nekos.life/wallpaper/Xa_GtsKsy-s.png','https://cdn.nekos.life/wallpaper/6Bx8R6D75eM.png','https://cdn.nekos.life/wallpaper/zXOGXH_b8VY.png','https://cdn.nekos.life/wallpaper/VQcviMxoQ00.png','https://cdn.nekos.life/wallpaper/CJnRl-PKWe8.png','https://cdn.nekos.life/wallpaper/zEWYfFL_Ero.png','https://cdn.nekos.life/wallpaper/_C9Uc5MPaz4.png','https://cdn.nekos.life/wallpaper/zskxNqNXyG0.jpg','https://cdn.nekos.life/wallpaper/g7w14PjzzcQ.jpg','https://cdn.nekos.life/wallpaper/KavYXR_GRB4.jpg','https://cdn.nekos.life/wallpaper/Z_r9WItzJBc.jpg','https://cdn.nekos.life/wallpaper/Qps-0JD6834.jpg','https://cdn.nekos.life/wallpaper/Ri3CiJIJ6M8.png','https://cdn.nekos.life/wallpaper/ArGYIpJwehY.jpg','https://cdn.nekos.life/wallpaper/uqYKeYM5h8w.jpg','https://cdn.nekos.life/wallpaper/h9cahfuKsRg.jpg','https://cdn.nekos.life/wallpaper/iNPWKO8d2a4.jpg','https://cdn.nekos.life/wallpaper/j2KoFVhsNig.jpg','https://cdn.nekos.life/wallpaper/z5Nc-aS6QJ4.jpg','https://cdn.nekos.life/wallpaper/VUFoK8l1qs0.png','https://cdn.nekos.life/wallpaper/rQ8eYh5mXN8.png','https://cdn.nekos.life/wallpaper/D3NxNISDavQ.png','https://cdn.nekos.life/wallpaper/Z_CiozIenrU.jpg','https://cdn.nekos.life/wallpaper/np8rpfZflWE.jpg','https://cdn.nekos.life/wallpaper/ED-fgS09gik.jpg','https://cdn.nekos.life/wallpaper/AB0Cwfs1X2w.jpg','https://cdn.nekos.life/wallpaper/DZBcYfHouiI.jpg','https://cdn.nekos.life/wallpaper/lC7pB-GRAcQ.png','https://cdn.nekos.life/wallpaper/zrI-sBSt2zE.png','https://cdn.nekos.life/wallpaper/_RJhylwaCLk.jpg','https://cdn.nekos.life/wallpaper/6km5m_GGIuw.png','https://cdn.nekos.life/wallpaper/3db40hylKs8.png','https://cdn.nekos.life/wallpaper/oggceF06ONQ.jpg','https://cdn.nekos.life/wallpaper/ELdH2W5pQGo.jpg','https://cdn.nekos.life/wallpaper/Zun_n5pTMRE.png','https://cdn.nekos.life/wallpaper/VqhFKG5U15c.png','https://cdn.nekos.life/wallpaper/NsMoiW8JZ60.jpg','https://cdn.nekos.life/wallpaper/XE4iXbw__Us.png','https://cdn.nekos.life/wallpaper/a9yXhS2zbhU.jpg','https://cdn.nekos.life/wallpaper/jjnd31_3Ic8.jpg','https://cdn.nekos.life/wallpaper/Nxanxa-xO3s.png','https://cdn.nekos.life/wallpaper/dBHlPcbuDc4.jpg','https://cdn.nekos.life/wallpaper/6wUZIavGVQU.jpg','https://cdn.nekos.life/wallpaper/_-Z-0fGflRc.jpg','https://cdn.nekos.life/wallpaper/H9OUpIrF4gU.jpg','https://cdn.nekos.life/wallpaper/xlRdH3fBMz4.jpg','https://cdn.nekos.life/wallpaper/7IzUIeaae9o.jpg','https://cdn.nekos.life/wallpaper/FZCVL6PyWq0.jpg','https://cdn.nekos.life/wallpaper/5dG-HH6d0yw.png','https://cdn.nekos.life/wallpaper/ddxyA37HiwE.png','https://cdn.nekos.life/wallpaper/I0oj_jdCD4k.jpg','https://cdn.nekos.life/wallpaper/ABchTV97_Ts.png','https://cdn.nekos.life/wallpaper/58C37kkq39Y.png','https://cdn.nekos.life/wallpaper/HMS5mK7WSGA.jpg','https://cdn.nekos.life/wallpaper/1O3Yul9ojS8.jpg','https://cdn.nekos.life/wallpaper/hdZI1XsYWYY.jpg','https://cdn.nekos.life/wallpaper/h8pAJJnBXZo.png','https://cdn.nekos.life/wallpaper/apO9K9JIUp8.jpg','https://cdn.nekos.life/wallpaper/p8f8IY_2mwg.jpg','https://cdn.nekos.life/wallpaper/HY1WIB2r_cE.jpg','https://cdn.nekos.life/wallpaper/u02Y0-AJPL0.jpg','https://cdn.nekos.life/wallpaper/jzN74LcnwE8.png','https://cdn.nekos.life/wallpaper/IeAXo5nJhjw.jpg','https://cdn.nekos.life/wallpaper/7lgPyU5fuLY.jpg','https://cdn.nekos.life/wallpaper/f8SkRWzXVxk.png','https://cdn.nekos.life/wallpaper/ZmDTpGGeMR8.jpg','https://cdn.nekos.life/wallpaper/AMrcxZOnVBE.jpg','https://cdn.nekos.life/wallpaper/ZhP-f8Icmjs.jpg','https://cdn.nekos.life/wallpaper/7FyUHX3fE2o.jpg','https://cdn.nekos.life/wallpaper/CZoSLK-5ng8.png','https://cdn.nekos.life/wallpaper/pSNDyxP8l3c.png','https://cdn.nekos.life/wallpaper/AhYGHF6Fpck.jpg','https://cdn.nekos.life/wallpaper/ic6xRRptRes.jpg','https://cdn.nekos.life/wallpaper/89MQq6KaggI.png','https://cdn.nekos.life/wallpaper/y1DlFeHHTEE.png'] 632 | let walnimek = walnime[Math.floor(Math.random() * walnime.length)] 633 | client.sendFileFromUrl(from, walnimek, 'Nimek.jpg', '', message.id) 634 | break 635 | case 'meme': 636 | const response = await axios.get('https://meme-api.herokuapp.com/gimme/wholesomeanimemes'); 637 | const { postlink, title, subreddit, url, nsfw, spoiler } = response.data 638 | await client.sendFileFromUrl(from, `${url}`, 'meme.jpg', `${title}`) 639 | break 640 | case 'help': 641 | client.reply(from, help.replace(undefined, pushname), message.id) 642 | break 643 | case 'info': 644 | client.sendLinkWithAutoPreview(from, 'https://github.com/SomnathDas/whatsapp-botto-re', info) 645 | break 646 | case 'profile': 647 | var role = 'None' 648 | if (isGroupMsg) { 649 | if (!quotedMsg) { 650 | var block = ban.includes(author) 651 | var pic = await client.getProfilePicFromServer(author) 652 | var namae = pushname 653 | var sts = await client.getStatus(author) 654 | var adm = isGroupAdmins 655 | const { status } = sts 656 | if (pic == undefined) { 657 | var pfp = errorurl 658 | } else { 659 | var pfp = pic 660 | } 661 | await client.sendFileFromUrl(from, pfp, 'pfp.jpg', `🔖️ *Username: ${namae}*\n\n💌️ *User Info: ${status}*\n\n*💔️ Ban: ${block}*\n\n✨️ *Role: ${role}*\n\n 👑️ *Admin: ${adm}*`) 662 | } else if (quotedMsg) { 663 | var qmid = quotedMsgObj.sender.id 664 | var block = ban.includes(qmid) 665 | var pic = await client.getProfilePicFromServer(qmid) 666 | var namae = quotedMsgObj.sender.formattedName 667 | var sts = await client.getStatus(qmid) 668 | var admgrp = await client.getGroupAdmins(from) 669 | var adm = admgrp.includes(qmid) 670 | const { status } = sts 671 | if (pic == undefined) { 672 | var pfp = errorurl 673 | } else { 674 | var pfp = pic 675 | } 676 | await client.sendFileFromUrl(from, pfp, 'pfo.jpg', `🔖️ *Username: ${namae}*\n\n💌️ *User Info: ${status}*\n\n*💔️ Ban: ${block}*\n\n✨️ *Role: ${role}*\n\n 👑️ *Admin: ${adm}*`) 677 | } 678 | } 679 | break 680 | case 'snk': 681 | client.reply(from, snk, message.id) 682 | default: 683 | await client.reply(from, `Don't use unlisted commands, Baka!`, id) 684 | console.log(color('[UNLISTED]', 'red'), color(time, 'yellow'), 'Unregistered Command from', color(pushname)) 685 | break 686 | } 687 | } 688 | } catch (err) { 689 | console.log(color('[ERROR]', 'red'), err) 690 | } 691 | } 692 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "whatsapp-botto-re", 3 | "version": "3.0.0", 4 | "description": "Anime Bot", 5 | "main": "kntl.js", 6 | "scripts": { 7 | "start": "node index.js", 8 | "test": "node test.js" 9 | }, 10 | "author": "Ban Takahiro", 11 | "license": "Apache-2.0", 12 | "dependencies": { 13 | "@open-wa/wa-automate": "^2.0.28", 14 | "@open-wa/wa-decrypt": "^2.0.1", 15 | "akaneko": "^3.3.0", 16 | "area-selection-js": "0.0.2", 17 | "axios": "^0.19.2", 18 | "bent": "^7.3.10", 19 | "brainly-scraper": "^1.0.1", 20 | "emoji-strip": "^1.0.1", 21 | "ffmpeg": "0.0.4", 22 | "fs-extra": "^9.0.1", 23 | "gif-frames": "^1.0.1", 24 | "gifit": "0.0.3", 25 | "gifwrap": "^0.9.2", 26 | "gify": "^0.2.0", 27 | "google-translate-open-api": "^1.3.5", 28 | "got": "^11.5.2", 29 | "image-size": "^0.9.1", 30 | "image-to-pdf": "^1.0.0", 31 | "jimp": "^0.16.1", 32 | "moment-timezone": "^0.5.31", 33 | "multer": "^1.4.2", 34 | "nana-api": "^1.1.2", 35 | "nhentai-api": "^3.0.2", 36 | "nhentai-js": "^4.0.0", 37 | "node-fetch": "^2.6.1", 38 | "node-gtts": "^2.0.2", 39 | "node-run-cmd": "^1.0.1", 40 | "remove.bg": "^1.3.0", 41 | "request": "^2.88.2", 42 | "saucenao": "0.0.2", 43 | "thumbbot": "^0.4.1", 44 | "tiktok-scraper": "^1.3.0", 45 | "video-crop": "^1.1.0", 46 | "video-crop-cli": "^1.1.0", 47 | "video-url-link": "^0.1.4", 48 | "ytdl": "^1.3.5" 49 | }, 50 | "directories": { 51 | "lib": "lib" 52 | }, 53 | "devDependencies": {}, 54 | "repository": { 55 | "type": "git", 56 | "url": "git+https://github.com/AlenSaito1/Whatsapp-Anime-Bot.git" 57 | }, 58 | "keywords": [ 59 | "Whatsapp-Bot" 60 | ], 61 | "bugs": { 62 | "url": "https://github.com/AlenSaito1/Whatsapp-Anime-Bot.git" 63 | }, 64 | "homepage": "https://github.com/AlenSaito1/Whatsapp-Anime-Bot.git" 65 | } 66 | --------------------------------------------------------------------------------