├── .gitignore
├── LICENSE
├── README.md
├── awesome
├── __init__.py
├── data
│ ├── baidu_stopwords.txt
│ ├── cn_stopwords.txt
│ ├── dataset.txt
│ ├── patterns.txt
│ └── words.txt
├── plugins
│ ├── bullshit
│ │ ├── .gitignore
│ │ ├── __init__.py
│ │ ├── data.json
│ │ ├── generator.py
│ │ ├── readJSON.js
│ │ └── readJSON.py
│ ├── chat.py
│ ├── daily.py
│ ├── hitokoto.py
│ ├── img_filter.py
│ ├── joke.py
│ ├── lovelive.py
│ ├── pastebin.py
│ ├── repeater.py
│ ├── text_filter.py
│ ├── translate.py
│ ├── weather.py
│ └── zhihu.py
└── utils
│ ├── ac.py
│ ├── ai.py
│ └── bayes.py
├── bot.py
├── config.py.sample
└── requirements.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | /go-cqhttp
2 | /go-cqhttp.exe
3 | /config.json
4 | /device.json
5 | /config.py
6 | /data
7 | /logs
8 | __pycache__
9 | .DS_Store
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU AFFERO GENERAL PUBLIC LICENSE
2 | Version 3, 19 November 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU Affero General Public License is a free, copyleft license for
11 | software and other kinds of works, specifically designed to ensure
12 | cooperation with the community in the case of network server software.
13 |
14 | The licenses for most software and other practical works are designed
15 | to take away your freedom to share and change the works. By contrast,
16 | our General Public Licenses are intended to guarantee your freedom to
17 | share and change all versions of a program--to make sure it remains free
18 | software for all its users.
19 |
20 | When we speak of free software, we are referring to freedom, not
21 | price. Our General Public Licenses are designed to make sure that you
22 | have the freedom to distribute copies of free software (and charge for
23 | them if you wish), that you receive source code or can get it if you
24 | want it, that you can change the software or use pieces of it in new
25 | free programs, and that you know you can do these things.
26 |
27 | Developers that use our General Public Licenses protect your rights
28 | with two steps: (1) assert copyright on the software, and (2) offer
29 | you this License which gives you legal permission to copy, distribute
30 | and/or modify the software.
31 |
32 | A secondary benefit of defending all users' freedom is that
33 | improvements made in alternate versions of the program, if they
34 | receive widespread use, become available for other developers to
35 | incorporate. Many developers of free software are heartened and
36 | encouraged by the resulting cooperation. However, in the case of
37 | software used on network servers, this result may fail to come about.
38 | The GNU General Public License permits making a modified version and
39 | letting the public access it on a server without ever releasing its
40 | source code to the public.
41 |
42 | The GNU Affero General Public License is designed specifically to
43 | ensure that, in such cases, the modified source code becomes available
44 | to the community. It requires the operator of a network server to
45 | provide the source code of the modified version running there to the
46 | users of that server. Therefore, public use of a modified version, on
47 | a publicly accessible server, gives the public access to the source
48 | code of the modified version.
49 |
50 | An older license, called the Affero General Public License and
51 | published by Affero, was designed to accomplish similar goals. This is
52 | a different license, not a version of the Affero GPL, but Affero has
53 | released a new version of the Affero GPL which permits relicensing under
54 | this license.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | TERMS AND CONDITIONS
60 |
61 | 0. Definitions.
62 |
63 | "This License" refers to version 3 of the GNU Affero General Public License.
64 |
65 | "Copyright" also means copyright-like laws that apply to other kinds of
66 | works, such as semiconductor masks.
67 |
68 | "The Program" refers to any copyrightable work licensed under this
69 | License. Each licensee is addressed as "you". "Licensees" and
70 | "recipients" may be individuals or organizations.
71 |
72 | To "modify" a work means to copy from or adapt all or part of the work
73 | in a fashion requiring copyright permission, other than the making of an
74 | exact copy. The resulting work is called a "modified version" of the
75 | earlier work or a work "based on" the earlier work.
76 |
77 | A "covered work" means either the unmodified Program or a work based
78 | on the Program.
79 |
80 | To "propagate" a work means to do anything with it that, without
81 | permission, would make you directly or secondarily liable for
82 | infringement under applicable copyright law, except executing it on a
83 | computer or modifying a private copy. Propagation includes copying,
84 | distribution (with or without modification), making available to the
85 | public, and in some countries other activities as well.
86 |
87 | To "convey" a work means any kind of propagation that enables other
88 | parties to make or receive copies. Mere interaction with a user through
89 | a computer network, with no transfer of a copy, is not conveying.
90 |
91 | An interactive user interface displays "Appropriate Legal Notices"
92 | to the extent that it includes a convenient and prominently visible
93 | feature that (1) displays an appropriate copyright notice, and (2)
94 | tells the user that there is no warranty for the work (except to the
95 | extent that warranties are provided), that licensees may convey the
96 | work under this License, and how to view a copy of this License. If
97 | the interface presents a list of user commands or options, such as a
98 | menu, a prominent item in the list meets this criterion.
99 |
100 | 1. Source Code.
101 |
102 | The "source code" for a work means the preferred form of the work
103 | for making modifications to it. "Object code" means any non-source
104 | form of a work.
105 |
106 | A "Standard Interface" means an interface that either is an official
107 | standard defined by a recognized standards body, or, in the case of
108 | interfaces specified for a particular programming language, one that
109 | is widely used among developers working in that language.
110 |
111 | The "System Libraries" of an executable work include anything, other
112 | than the work as a whole, that (a) is included in the normal form of
113 | packaging a Major Component, but which is not part of that Major
114 | Component, and (b) serves only to enable use of the work with that
115 | Major Component, or to implement a Standard Interface for which an
116 | implementation is available to the public in source code form. A
117 | "Major Component", in this context, means a major essential component
118 | (kernel, window system, and so on) of the specific operating system
119 | (if any) on which the executable work runs, or a compiler used to
120 | produce the work, or an object code interpreter used to run it.
121 |
122 | The "Corresponding Source" for a work in object code form means all
123 | the source code needed to generate, install, and (for an executable
124 | work) run the object code and to modify the work, including scripts to
125 | control those activities. However, it does not include the work's
126 | System Libraries, or general-purpose tools or generally available free
127 | programs which are used unmodified in performing those activities but
128 | which are not part of the work. For example, Corresponding Source
129 | includes interface definition files associated with source files for
130 | the work, and the source code for shared libraries and dynamically
131 | linked subprograms that the work is specifically designed to require,
132 | such as by intimate data communication or control flow between those
133 | subprograms and other parts of the work.
134 |
135 | The Corresponding Source need not include anything that users
136 | can regenerate automatically from other parts of the Corresponding
137 | Source.
138 |
139 | The Corresponding Source for a work in source code form is that
140 | same work.
141 |
142 | 2. Basic Permissions.
143 |
144 | All rights granted under this License are granted for the term of
145 | copyright on the Program, and are irrevocable provided the stated
146 | conditions are met. This License explicitly affirms your unlimited
147 | permission to run the unmodified Program. The output from running a
148 | covered work is covered by this License only if the output, given its
149 | content, constitutes a covered work. This License acknowledges your
150 | rights of fair use or other equivalent, as provided by copyright law.
151 |
152 | You may make, run and propagate covered works that you do not
153 | convey, without conditions so long as your license otherwise remains
154 | in force. You may convey covered works to others for the sole purpose
155 | of having them make modifications exclusively for you, or provide you
156 | with facilities for running those works, provided that you comply with
157 | the terms of this License in conveying all material for which you do
158 | not control copyright. Those thus making or running the covered works
159 | for you must do so exclusively on your behalf, under your direction
160 | and control, on terms that prohibit them from making any copies of
161 | your copyrighted material outside their relationship with you.
162 |
163 | Conveying under any other circumstances is permitted solely under
164 | the conditions stated below. Sublicensing is not allowed; section 10
165 | makes it unnecessary.
166 |
167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168 |
169 | No covered work shall be deemed part of an effective technological
170 | measure under any applicable law fulfilling obligations under article
171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172 | similar laws prohibiting or restricting circumvention of such
173 | measures.
174 |
175 | When you convey a covered work, you waive any legal power to forbid
176 | circumvention of technological measures to the extent such circumvention
177 | is effected by exercising rights under this License with respect to
178 | the covered work, and you disclaim any intention to limit operation or
179 | modification of the work as a means of enforcing, against the work's
180 | users, your or third parties' legal rights to forbid circumvention of
181 | technological measures.
182 |
183 | 4. Conveying Verbatim Copies.
184 |
185 | You may convey verbatim copies of the Program's source code as you
186 | receive it, in any medium, provided that you conspicuously and
187 | appropriately publish on each copy an appropriate copyright notice;
188 | keep intact all notices stating that this License and any
189 | non-permissive terms added in accord with section 7 apply to the code;
190 | keep intact all notices of the absence of any warranty; and give all
191 | recipients a copy of this License along with the Program.
192 |
193 | You may charge any price or no price for each copy that you convey,
194 | and you may offer support or warranty protection for a fee.
195 |
196 | 5. Conveying Modified Source Versions.
197 |
198 | You may convey a work based on the Program, or the modifications to
199 | produce it from the Program, in the form of source code under the
200 | terms of section 4, provided that you also meet all of these conditions:
201 |
202 | a) The work must carry prominent notices stating that you modified
203 | it, and giving a relevant date.
204 |
205 | b) The work must carry prominent notices stating that it is
206 | released under this License and any conditions added under section
207 | 7. This requirement modifies the requirement in section 4 to
208 | "keep intact all notices".
209 |
210 | c) You must license the entire work, as a whole, under this
211 | License to anyone who comes into possession of a copy. This
212 | License will therefore apply, along with any applicable section 7
213 | additional terms, to the whole of the work, and all its parts,
214 | regardless of how they are packaged. This License gives no
215 | permission to license the work in any other way, but it does not
216 | invalidate such permission if you have separately received it.
217 |
218 | d) If the work has interactive user interfaces, each must display
219 | Appropriate Legal Notices; however, if the Program has interactive
220 | interfaces that do not display Appropriate Legal Notices, your
221 | work need not make them do so.
222 |
223 | A compilation of a covered work with other separate and independent
224 | works, which are not by their nature extensions of the covered work,
225 | and which are not combined with it such as to form a larger program,
226 | in or on a volume of a storage or distribution medium, is called an
227 | "aggregate" if the compilation and its resulting copyright are not
228 | used to limit the access or legal rights of the compilation's users
229 | beyond what the individual works permit. Inclusion of a covered work
230 | in an aggregate does not cause this License to apply to the other
231 | parts of the aggregate.
232 |
233 | 6. Conveying Non-Source Forms.
234 |
235 | You may convey a covered work in object code form under the terms
236 | of sections 4 and 5, provided that you also convey the
237 | machine-readable Corresponding Source under the terms of this License,
238 | in one of these ways:
239 |
240 | a) Convey the object code in, or embodied in, a physical product
241 | (including a physical distribution medium), accompanied by the
242 | Corresponding Source fixed on a durable physical medium
243 | customarily used for software interchange.
244 |
245 | b) Convey the object code in, or embodied in, a physical product
246 | (including a physical distribution medium), accompanied by a
247 | written offer, valid for at least three years and valid for as
248 | long as you offer spare parts or customer support for that product
249 | model, to give anyone who possesses the object code either (1) a
250 | copy of the Corresponding Source for all the software in the
251 | product that is covered by this License, on a durable physical
252 | medium customarily used for software interchange, for a price no
253 | more than your reasonable cost of physically performing this
254 | conveying of source, or (2) access to copy the
255 | Corresponding Source from a network server at no charge.
256 |
257 | c) Convey individual copies of the object code with a copy of the
258 | written offer to provide the Corresponding Source. This
259 | alternative is allowed only occasionally and noncommercially, and
260 | only if you received the object code with such an offer, in accord
261 | with subsection 6b.
262 |
263 | d) Convey the object code by offering access from a designated
264 | place (gratis or for a charge), and offer equivalent access to the
265 | Corresponding Source in the same way through the same place at no
266 | further charge. You need not require recipients to copy the
267 | Corresponding Source along with the object code. If the place to
268 | copy the object code is a network server, the Corresponding Source
269 | may be on a different server (operated by you or a third party)
270 | that supports equivalent copying facilities, provided you maintain
271 | clear directions next to the object code saying where to find the
272 | Corresponding Source. Regardless of what server hosts the
273 | Corresponding Source, you remain obligated to ensure that it is
274 | available for as long as needed to satisfy these requirements.
275 |
276 | e) Convey the object code using peer-to-peer transmission, provided
277 | you inform other peers where the object code and Corresponding
278 | Source of the work are being offered to the general public at no
279 | charge under subsection 6d.
280 |
281 | A separable portion of the object code, whose source code is excluded
282 | from the Corresponding Source as a System Library, need not be
283 | included in conveying the object code work.
284 |
285 | A "User Product" is either (1) a "consumer product", which means any
286 | tangible personal property which is normally used for personal, family,
287 | or household purposes, or (2) anything designed or sold for incorporation
288 | into a dwelling. In determining whether a product is a consumer product,
289 | doubtful cases shall be resolved in favor of coverage. For a particular
290 | product received by a particular user, "normally used" refers to a
291 | typical or common use of that class of product, regardless of the status
292 | of the particular user or of the way in which the particular user
293 | actually uses, or expects or is expected to use, the product. A product
294 | is a consumer product regardless of whether the product has substantial
295 | commercial, industrial or non-consumer uses, unless such uses represent
296 | the only significant mode of use of the product.
297 |
298 | "Installation Information" for a User Product means any methods,
299 | procedures, authorization keys, or other information required to install
300 | and execute modified versions of a covered work in that User Product from
301 | a modified version of its Corresponding Source. The information must
302 | suffice to ensure that the continued functioning of the modified object
303 | code is in no case prevented or interfered with solely because
304 | modification has been made.
305 |
306 | If you convey an object code work under this section in, or with, or
307 | specifically for use in, a User Product, and the conveying occurs as
308 | part of a transaction in which the right of possession and use of the
309 | User Product is transferred to the recipient in perpetuity or for a
310 | fixed term (regardless of how the transaction is characterized), the
311 | Corresponding Source conveyed under this section must be accompanied
312 | by the Installation Information. But this requirement does not apply
313 | if neither you nor any third party retains the ability to install
314 | modified object code on the User Product (for example, the work has
315 | been installed in ROM).
316 |
317 | The requirement to provide Installation Information does not include a
318 | requirement to continue to provide support service, warranty, or updates
319 | for a work that has been modified or installed by the recipient, or for
320 | the User Product in which it has been modified or installed. Access to a
321 | network may be denied when the modification itself materially and
322 | adversely affects the operation of the network or violates the rules and
323 | protocols for communication across the network.
324 |
325 | Corresponding Source conveyed, and Installation Information provided,
326 | in accord with this section must be in a format that is publicly
327 | documented (and with an implementation available to the public in
328 | source code form), and must require no special password or key for
329 | unpacking, reading or copying.
330 |
331 | 7. Additional Terms.
332 |
333 | "Additional permissions" are terms that supplement the terms of this
334 | License by making exceptions from one or more of its conditions.
335 | Additional permissions that are applicable to the entire Program shall
336 | be treated as though they were included in this License, to the extent
337 | that they are valid under applicable law. If additional permissions
338 | apply only to part of the Program, that part may be used separately
339 | under those permissions, but the entire Program remains governed by
340 | this License without regard to the additional permissions.
341 |
342 | When you convey a copy of a covered work, you may at your option
343 | remove any additional permissions from that copy, or from any part of
344 | it. (Additional permissions may be written to require their own
345 | removal in certain cases when you modify the work.) You may place
346 | additional permissions on material, added by you to a covered work,
347 | for which you have or can give appropriate copyright permission.
348 |
349 | Notwithstanding any other provision of this License, for material you
350 | add to a covered work, you may (if authorized by the copyright holders of
351 | that material) supplement the terms of this License with terms:
352 |
353 | a) Disclaiming warranty or limiting liability differently from the
354 | terms of sections 15 and 16 of this License; or
355 |
356 | b) Requiring preservation of specified reasonable legal notices or
357 | author attributions in that material or in the Appropriate Legal
358 | Notices displayed by works containing it; or
359 |
360 | c) Prohibiting misrepresentation of the origin of that material, or
361 | requiring that modified versions of such material be marked in
362 | reasonable ways as different from the original version; or
363 |
364 | d) Limiting the use for publicity purposes of names of licensors or
365 | authors of the material; or
366 |
367 | e) Declining to grant rights under trademark law for use of some
368 | trade names, trademarks, or service marks; or
369 |
370 | f) Requiring indemnification of licensors and authors of that
371 | material by anyone who conveys the material (or modified versions of
372 | it) with contractual assumptions of liability to the recipient, for
373 | any liability that these contractual assumptions directly impose on
374 | those licensors and authors.
375 |
376 | All other non-permissive additional terms are considered "further
377 | restrictions" within the meaning of section 10. If the Program as you
378 | received it, or any part of it, contains a notice stating that it is
379 | governed by this License along with a term that is a further
380 | restriction, you may remove that term. If a license document contains
381 | a further restriction but permits relicensing or conveying under this
382 | License, you may add to a covered work material governed by the terms
383 | of that license document, provided that the further restriction does
384 | not survive such relicensing or conveying.
385 |
386 | If you add terms to a covered work in accord with this section, you
387 | must place, in the relevant source files, a statement of the
388 | additional terms that apply to those files, or a notice indicating
389 | where to find the applicable terms.
390 |
391 | Additional terms, permissive or non-permissive, may be stated in the
392 | form of a separately written license, or stated as exceptions;
393 | the above requirements apply either way.
394 |
395 | 8. Termination.
396 |
397 | You may not propagate or modify a covered work except as expressly
398 | provided under this License. Any attempt otherwise to propagate or
399 | modify it is void, and will automatically terminate your rights under
400 | this License (including any patent licenses granted under the third
401 | paragraph of section 11).
402 |
403 | However, if you cease all violation of this License, then your
404 | license from a particular copyright holder is reinstated (a)
405 | provisionally, unless and until the copyright holder explicitly and
406 | finally terminates your license, and (b) permanently, if the copyright
407 | holder fails to notify you of the violation by some reasonable means
408 | prior to 60 days after the cessation.
409 |
410 | Moreover, your license from a particular copyright holder is
411 | reinstated permanently if the copyright holder notifies you of the
412 | violation by some reasonable means, this is the first time you have
413 | received notice of violation of this License (for any work) from that
414 | copyright holder, and you cure the violation prior to 30 days after
415 | your receipt of the notice.
416 |
417 | Termination of your rights under this section does not terminate the
418 | licenses of parties who have received copies or rights from you under
419 | this License. If your rights have been terminated and not permanently
420 | reinstated, you do not qualify to receive new licenses for the same
421 | material under section 10.
422 |
423 | 9. Acceptance Not Required for Having Copies.
424 |
425 | You are not required to accept this License in order to receive or
426 | run a copy of the Program. Ancillary propagation of a covered work
427 | occurring solely as a consequence of using peer-to-peer transmission
428 | to receive a copy likewise does not require acceptance. However,
429 | nothing other than this License grants you permission to propagate or
430 | modify any covered work. These actions infringe copyright if you do
431 | not accept this License. Therefore, by modifying or propagating a
432 | covered work, you indicate your acceptance of this License to do so.
433 |
434 | 10. Automatic Licensing of Downstream Recipients.
435 |
436 | Each time you convey a covered work, the recipient automatically
437 | receives a license from the original licensors, to run, modify and
438 | propagate that work, subject to this License. You are not responsible
439 | for enforcing compliance by third parties with this License.
440 |
441 | An "entity transaction" is a transaction transferring control of an
442 | organization, or substantially all assets of one, or subdividing an
443 | organization, or merging organizations. If propagation of a covered
444 | work results from an entity transaction, each party to that
445 | transaction who receives a copy of the work also receives whatever
446 | licenses to the work the party's predecessor in interest had or could
447 | give under the previous paragraph, plus a right to possession of the
448 | Corresponding Source of the work from the predecessor in interest, if
449 | the predecessor has it or can get it with reasonable efforts.
450 |
451 | You may not impose any further restrictions on the exercise of the
452 | rights granted or affirmed under this License. For example, you may
453 | not impose a license fee, royalty, or other charge for exercise of
454 | rights granted under this License, and you may not initiate litigation
455 | (including a cross-claim or counterclaim in a lawsuit) alleging that
456 | any patent claim is infringed by making, using, selling, offering for
457 | sale, or importing the Program or any portion of it.
458 |
459 | 11. Patents.
460 |
461 | A "contributor" is a copyright holder who authorizes use under this
462 | License of the Program or a work on which the Program is based. The
463 | work thus licensed is called the contributor's "contributor version".
464 |
465 | A contributor's "essential patent claims" are all patent claims
466 | owned or controlled by the contributor, whether already acquired or
467 | hereafter acquired, that would be infringed by some manner, permitted
468 | by this License, of making, using, or selling its contributor version,
469 | but do not include claims that would be infringed only as a
470 | consequence of further modification of the contributor version. For
471 | purposes of this definition, "control" includes the right to grant
472 | patent sublicenses in a manner consistent with the requirements of
473 | this License.
474 |
475 | Each contributor grants you a non-exclusive, worldwide, royalty-free
476 | patent license under the contributor's essential patent claims, to
477 | make, use, sell, offer for sale, import and otherwise run, modify and
478 | propagate the contents of its contributor version.
479 |
480 | In the following three paragraphs, a "patent license" is any express
481 | agreement or commitment, however denominated, not to enforce a patent
482 | (such as an express permission to practice a patent or covenant not to
483 | sue for patent infringement). To "grant" such a patent license to a
484 | party means to make such an agreement or commitment not to enforce a
485 | patent against the party.
486 |
487 | If you convey a covered work, knowingly relying on a patent license,
488 | and the Corresponding Source of the work is not available for anyone
489 | to copy, free of charge and under the terms of this License, through a
490 | publicly available network server or other readily accessible means,
491 | then you must either (1) cause the Corresponding Source to be so
492 | available, or (2) arrange to deprive yourself of the benefit of the
493 | patent license for this particular work, or (3) arrange, in a manner
494 | consistent with the requirements of this License, to extend the patent
495 | license to downstream recipients. "Knowingly relying" means you have
496 | actual knowledge that, but for the patent license, your conveying the
497 | covered work in a country, or your recipient's use of the covered work
498 | in a country, would infringe one or more identifiable patents in that
499 | country that you have reason to believe are valid.
500 |
501 | If, pursuant to or in connection with a single transaction or
502 | arrangement, you convey, or propagate by procuring conveyance of, a
503 | covered work, and grant a patent license to some of the parties
504 | receiving the covered work authorizing them to use, propagate, modify
505 | or convey a specific copy of the covered work, then the patent license
506 | you grant is automatically extended to all recipients of the covered
507 | work and works based on it.
508 |
509 | A patent license is "discriminatory" if it does not include within
510 | the scope of its coverage, prohibits the exercise of, or is
511 | conditioned on the non-exercise of one or more of the rights that are
512 | specifically granted under this License. You may not convey a covered
513 | work if you are a party to an arrangement with a third party that is
514 | in the business of distributing software, under which you make payment
515 | to the third party based on the extent of your activity of conveying
516 | the work, and under which the third party grants, to any of the
517 | parties who would receive the covered work from you, a discriminatory
518 | patent license (a) in connection with copies of the covered work
519 | conveyed by you (or copies made from those copies), or (b) primarily
520 | for and in connection with specific products or compilations that
521 | contain the covered work, unless you entered into that arrangement,
522 | or that patent license was granted, prior to 28 March 2007.
523 |
524 | Nothing in this License shall be construed as excluding or limiting
525 | any implied license or other defenses to infringement that may
526 | otherwise be available to you under applicable patent law.
527 |
528 | 12. No Surrender of Others' Freedom.
529 |
530 | If conditions are imposed on you (whether by court order, agreement or
531 | otherwise) that contradict the conditions of this License, they do not
532 | excuse you from the conditions of this License. If you cannot convey a
533 | covered work so as to satisfy simultaneously your obligations under this
534 | License and any other pertinent obligations, then as a consequence you may
535 | not convey it at all. For example, if you agree to terms that obligate you
536 | to collect a royalty for further conveying from those to whom you convey
537 | the Program, the only way you could satisfy both those terms and this
538 | License would be to refrain entirely from conveying the Program.
539 |
540 | 13. Remote Network Interaction; Use with the GNU General Public License.
541 |
542 | Notwithstanding any other provision of this License, if you modify the
543 | Program, your modified version must prominently offer all users
544 | interacting with it remotely through a computer network (if your version
545 | supports such interaction) an opportunity to receive the Corresponding
546 | Source of your version by providing access to the Corresponding Source
547 | from a network server at no charge, through some standard or customary
548 | means of facilitating copying of software. This Corresponding Source
549 | shall include the Corresponding Source for any work covered by version 3
550 | of the GNU General Public License that is incorporated pursuant to the
551 | following paragraph.
552 |
553 | Notwithstanding any other provision of this License, you have
554 | permission to link or combine any covered work with a work licensed
555 | under version 3 of the GNU General Public License into a single
556 | combined work, and to convey the resulting work. The terms of this
557 | License will continue to apply to the part which is the covered work,
558 | but the work with which it is combined will remain governed by version
559 | 3 of the GNU General Public License.
560 |
561 | 14. Revised Versions of this License.
562 |
563 | The Free Software Foundation may publish revised and/or new versions of
564 | the GNU Affero General Public License from time to time. Such new versions
565 | will be similar in spirit to the present version, but may differ in detail to
566 | address new problems or concerns.
567 |
568 | Each version is given a distinguishing version number. If the
569 | Program specifies that a certain numbered version of the GNU Affero General
570 | Public License "or any later version" applies to it, you have the
571 | option of following the terms and conditions either of that numbered
572 | version or of any later version published by the Free Software
573 | Foundation. If the Program does not specify a version number of the
574 | GNU Affero General Public License, you may choose any version ever published
575 | by the Free Software Foundation.
576 |
577 | If the Program specifies that a proxy can decide which future
578 | versions of the GNU Affero General Public License can be used, that proxy's
579 | public statement of acceptance of a version permanently authorizes you
580 | to choose that version for the Program.
581 |
582 | Later license versions may give you additional or different
583 | permissions. However, no additional obligations are imposed on any
584 | author or copyright holder as a result of your choosing to follow a
585 | later version.
586 |
587 | 15. Disclaimer of Warranty.
588 |
589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597 |
598 | 16. Limitation of Liability.
599 |
600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608 | SUCH DAMAGES.
609 |
610 | 17. Interpretation of Sections 15 and 16.
611 |
612 | If the disclaimer of warranty and limitation of liability provided
613 | above cannot be given local legal effect according to their terms,
614 | reviewing courts shall apply local law that most closely approximates
615 | an absolute waiver of all civil liability in connection with the
616 | Program, unless a warranty or assumption of liability accompanies a
617 | copy of the Program in return for a fee.
618 |
619 | END OF TERMS AND CONDITIONS
620 |
621 | How to Apply These Terms to Your New Programs
622 |
623 | If you develop a new program, and you want it to be of the greatest
624 | possible use to the public, the best way to achieve this is to make it
625 | free software which everyone can redistribute and change under these terms.
626 |
627 | To do so, attach the following notices to the program. It is safest
628 | to attach them to the start of each source file to most effectively
629 | state the exclusion of warranty; and each file should have at least
630 | the "copyright" line and a pointer to where the full notice is found.
631 |
632 |
633 | Copyright (C)
634 |
635 | This program is free software: you can redistribute it and/or modify
636 | it under the terms of the GNU Affero General Public License as published
637 | by the Free Software Foundation, either version 3 of the License, or
638 | (at your option) any later version.
639 |
640 | This program is distributed in the hope that it will be useful,
641 | but WITHOUT ANY WARRANTY; without even the implied warranty of
642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643 | GNU Affero General Public License for more details.
644 |
645 | You should have received a copy of the GNU Affero General Public License
646 | along with this program. If not, see .
647 |
648 | Also add information on how to contact you by electronic and paper mail.
649 |
650 | If your software can interact with users remotely through a computer
651 | network, you should also make sure that it provides a way for users to
652 | get its source. For example, if your program is a web application, its
653 | interface could display a "Source" link that leads users to an archive
654 | of the code. There are many ways you could offer source, and different
655 | solutions will be better for different programs; see section 13 for the
656 | specific requirements.
657 |
658 | You should also get your employer (if you work as a programmer) or school,
659 | if any, to sign a "copyright disclaimer" for the program, if necessary.
660 | For more information on this, and how to apply and follow the GNU AGPL, see
661 | .
662 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | 这个项目作为 2019-2020 第二学期数据结构课程设计大作业选题,由我的同学 [@8421BCD](https://github.com/8421BCD) 、 [@HoralG](https://github.com/HoralG) 和我 [@Singularity0909](https://github.com/Singularity0909/) 共同完成,是一款基于 NoneBot 的功能型 QQ 聊天机器人核心,具有智能闲聊、过滤有害信息、提供天气预报查询服务等常用功能,目前以机器人方天宇 (QQ: `2737676753`) 作为表现层。
4 |
5 | [NoneBot](https://nonebot.cqp.moe/) 是一套基于 [CoolQ](https://cqp.cc/) 的 Python 异步 QQ 机器人框架,它会对 QQ 机器人收到的消息进行解析和处理,并以插件化的形式分发给消息所对应的命令处理器和自然语言处理器来完成具体的功能。
6 |
7 | ## 配置运行
8 |
9 | 本项目基于 NoneBot ,因此在尝试运行本项目前请先查阅文档了解 NoneBot 的基本使用方法。
10 |
11 | ```bash
12 | # 克隆项目
13 | git clone https://github.com/Singularity0909/awesome-bot.git && cd awesome-bot
14 |
15 | # 创建虚拟环境
16 | python -m venv venv
17 | .\venv\Scripts\activate # Windows
18 | source ./venv/bin/activate # Linux/macOS
19 |
20 | # 安装依赖
21 | pip install -r requirements.txt
22 |
23 | # 运行
24 | python bot.py
25 | ```
26 |
27 | ## 注意事项
28 |
29 | - 安装 `pyahocorasick` 时可能报错,需要先[安装依赖组件](https://sn9.us/file/1445568-239446865)。
30 |
31 | - 2020.08.15 更新:换用 [go-cqhttp](https://github.com/Mrs4s/go-cqhttp/),请将主程序及配置文件放置在项目根目录下。
32 |
33 | - 将项目根目录下的 `config.py.sample` 重命名为 `config.py` 并完成以下配置。
34 |
35 | ```python
36 | # config.py
37 | from nonebot.default_config import *
38 |
39 | HOST = '127.0.0.1' # 监听 IP,默认为 127.0.0.1
40 | PORT = 8080 # 监听端口,默认为 8080
41 | SUPERUSERS = {} # 超级用户的 QQ 账号
42 | NICKNAME = {'', '', ''} # 机器人的昵称
43 | COMMAND_START = {'', '/', '$'} # 命令的起始字符,默认为空字符、/ 或 $
44 | API_ROOT = 'http://127.0.0.1:5700' # 调用 CQHTTP API 所指定的 IP 和端口,注意要与 CQHTTP 配置一致,默认为 127.0.0.1:5700
45 | APP_ID = '' # 调用腾讯 AI 功能的 APPID
46 | APP_KEY = '' # 调用腾讯 AI 功能的 APPKEY
47 | IMG_DIR = r'' # 图片消息文件存放路径,例如 data/images
48 | BAYES = False # 是否开启贝叶斯文本分类模式进行垃圾文本信息过滤
49 | ```
50 |
51 | ## 功能模块
52 |
53 | ### 垃圾文本信息过滤
54 |
55 | 此功能仅限群聊且无需 @,如需自动撤回违规信息请为机器人开启管理员权限。
56 |
57 | 检测过程包含两种模式:AC 自动机 (Aho-Corasick automaton) 和朴素贝叶斯文本分类 (Naive Bayesian Classifier)。
58 |
59 | 有关 AC 自动机的实现可以参考我的一篇[博文](https://www.macrohard.cn/archives/22/),敏感词库可自行在 [patterns.txt](/awesome/data/patterns.txt) 中配置。
60 |
61 | 朴素贝叶斯文本分类部分的工作由 [@8421BCD](https://github.com/8421BCD) 完成,目前非法完整句识别情况如下。
62 |
63 | [参考文章](https://zhuanlan.zhihu.com/p/25835417) [项目仓库](https://github.com/8421BCD/Naive-Bayes-Classifier)
64 |
65 | 
66 |
67 | [**测试效果**](https://oss.macrohard.cn/img/screenshot/20200511120735.gif)
68 |
69 | ### 色情暴恐图片信息过滤
70 |
71 | 此功能仅限群聊且无需 @,如需自动撤回违规信息请为机器人开启管理员权限。
72 |
73 | 依托腾讯领先的 DeepEye 图片鉴黄技术,准确快速输出每张目标图片属于“正常”、“性感”、“色情”的概率,有效帮助用户鉴别色情图片。该技术大幅提升了色情内容的打击覆盖面和打击效率,成倍地解放甄别人力,助力网络环境更健康。
74 |
75 | 腾讯暴恐图片识别基于腾讯领先的深度学习引擎,对用户上传的图片进行自动甄别,暴恐识别算法会返回“疑似暴恐”的字段,对血腥、暴力等图片进行自动打击,用AI捍卫互联网安全,助力建立安全、健康的互联网环境。
76 |
77 | 获取详情可访问[此处](https://ai.qq.com/product/terror.shtml),如需使用请在 `config.py` 中填写腾讯 AI 的 APPID 及 APPKEY 。
78 |
79 | [**测试效果**](https://oss.macrohard.cn/img/screenshot/20200512192229.gif)
80 |
81 | ### 智能闲聊
82 |
83 | 此功能在私聊和群聊中均可使用,在群聊中需要 @ 或以机器人昵称开头发送信息。
84 |
85 | 腾讯闲聊服务基于 AI Lab 领先的 NLP 引擎能力、数据运算能力和千亿级互联网语料数据的支持,同时集成了广泛的知识问答能力,可实现上百种自定义属性配置,以及男、女不同的语言风格及说话方式,从而让聊天变得更睿智、简单和有趣。
86 |
87 | 获取详情可访问[此处](https://ai.qq.com/product/nlpchat.shtml),如需使用请在 `config.py` 中填写腾讯 AI 的 APPID 及 APPKEY 。
88 |
89 | [**测试效果**](https://oss.macrohard.cn/img/screenshot/20200512123951.gif)
90 |
91 | ### 复读机
92 |
93 | 此功能仅限群聊且无需 @ 。
94 |
95 | [**测试效果**](https://oss.macrohard.cn/img/screenshot/20200512125109.gif)
96 |
97 | ### 天气预报
98 |
99 | 此功能在私聊和群聊中均可使用,在群聊中无需 @ 。
100 |
101 | 命令关键词:【weather / 天气 / 查天气 / 天气预报】+ 空格 + 城市名,若关键词不在开头则调用自然语言处理。
102 |
103 | [**测试效果**](https://oss.macrohard.cn/img/screenshot/20200512130754.gif)
104 |
105 | ### 翻译
106 |
107 | 此功能在私聊和群聊中均可使用,在群聊中无需 @ 。
108 |
109 | 命令关键词:【translate / 翻译 / 翻译一下】+ 空格 + 需要翻译的文本,若文本是中文则翻译结果为英文,否则翻译结果均为中文。
110 |
111 | [**测试效果**](https://oss.macrohard.cn/img/screenshot/20200512131804.gif)
112 |
113 | ### 剪切板
114 |
115 | 此功能在私聊和群聊中均可使用,在群聊中无需 @ 。
116 |
117 | 命令关键词:【pastebin / 剪切板 / 贴代码 / 粘贴代码】,随后分别发送代码语言及内容。
118 |
119 | 目前语法仅支持纯文本、C/C++、Java、Python、Bash、Markdown、JSON、Go 。
120 |
121 | 文本共享服务及其 API 由 [@Lucien](https://github.com/LucienShui) 提供。
122 |
123 | [**测试效果**](https://oss.macrohard.cn/img/screenshot/20200512133136.gif)
124 |
125 | ### 知乎日报
126 |
127 | 此功能在私聊和群聊中均可使用,在群聊中无需 @ 。
128 |
129 | 命令关键词:【zhihu / 知乎 / 知乎日报】。
130 |
131 | [**测试效果**](https://oss.macrohard.cn/img/screenshot/20200512133646.gif)
132 |
133 | ### 狗屁不通生成器
134 |
135 | 此功能在私聊和群聊中均可使用,在群聊中无需 @ 。
136 |
137 | 命令关键词:【bullshit / 狗屁不通 / 狗屁不通生成器】+ 空格 + 主题。
138 |
139 | 核心功能引用自 [@meng ke](https://github.com/menzi11) 的项目 [BullshitGenerator](https://github.com/menzi11/BullshitGenerator) 。
140 |
141 | [**测试效果**](https://oss.macrohard.cn/img/screenshot/20200512134418.gif)
142 |
143 | ### 每日一句
144 |
145 | 此功能在私聊和群聊中均可使用,在群聊中无需 @ 。
146 |
147 | 命令关键词:【daily / 每日一句】。
148 |
149 | 内容来源:[爱词霸](http://news.iciba.com/views/dailysentence/) 。
150 |
151 | [**测试效果**](https://oss.macrohard.cn/img/screenshot/20200512134926.gif)
152 |
153 | ### 一言
154 |
155 | 此功能在私聊和群聊中均可使用,在群聊中无需 @ 。
156 |
157 | 命令关键词:【hitokoto / 一言】。
158 |
159 | 内容来源:[一言](https://hitokoto.cn/) 。
160 |
161 | [**测试效果**](https://oss.macrohard.cn/img/screenshot/20200512135229.gif)
162 |
163 | ### 笑话
164 |
165 | 此功能在私聊和群聊中均可使用,在群聊中无需 @ 。
166 |
167 | 命令关键词:【joke / 笑话 / 讲个笑话 / 来个笑话】。
168 |
169 | 内容来源:[RollToolsApi](https://www.mxnzp.com) 。
170 |
171 | [**测试效果**](https://oss.macrohard.cn/img/screenshot/20200512135837.gif)
172 |
173 | ### 土味情话
174 |
175 | 此功能在私聊和群聊中均可使用,在群聊中无需 @ 。
176 |
177 | 命令关键词:【lovelive / 土味情话】。
178 |
179 | 内容来源:[渣男:说话的艺术](https://lovelive.tools/) 。
180 |
181 | [**测试效果**](https://oss.macrohard.cn/img/screenshot/20200512135827.gif)
182 |
--------------------------------------------------------------------------------
/awesome/__init__.py:
--------------------------------------------------------------------------------
1 | import random
2 | import re
3 | import base64
4 | from dataclasses import dataclass
5 | from typing import Dict
6 | import requests
7 | import hashlib
8 | from io import BytesIO
9 | from PIL import Image
10 |
11 |
12 | import nonebot
13 | import nonebot.permission as perm
14 | from nonebot import on_natural_language, NLPSession, IntentCommand
15 | from awesome.utils.ac import AC
16 | from awesome.utils.bayes import Bayes
17 | from awesome.utils.ai import AI
18 |
19 |
20 | ac_filter = AC()
21 | ac_filter.build()
22 | bayes_filter = Bayes()
23 | bayes_filter.build()
24 |
25 |
26 | @dataclass
27 | class Record:
28 | last_msg: str
29 | last_user_id: int
30 | repeat_count: int = 0
31 |
32 |
33 | records: Dict[str, Record] = {}
34 |
35 |
36 | def parse(msg):
37 | reg = re.findall('\\[CQ:image,file=.*?,url=(.*?)\\]', msg)
38 | return len(reg) > 0, reg
39 |
40 |
41 | def compress(file):
42 | r = requests.get(file)
43 | o_size = int(r.headers.get('Content-Length')) / 1024
44 | ext = r.headers.get('Content-Type').split('/')[-1]
45 | img_bin = r.content
46 | im = Image.open(BytesIO(img_bin))
47 | md5 = hashlib.md5(img_bin).hexdigest()
48 | while o_size > 500:
49 | width, height = im.size
50 | im = im.resize((int(width * 0.5), int(height * 0.5)), Image.ANTIALIAS)
51 | im.save(f'{nonebot.get_bot().config.IMG_DIR}/{md5}.{ext}')
52 | with open(f'{nonebot.get_bot().config.IMG_DIR}/{md5}.{ext}', 'rb') as f:
53 | img_bin = f.read()
54 | o_size = len(img_bin) / 1024
55 | im = Image.open(BytesIO(img_bin))
56 | return base64.b64encode(img_bin).decode('utf-8')
57 |
58 |
59 | @on_natural_language(only_to_me=False, permission=perm.GROUP)
60 | async def _(session: NLPSession):
61 | group_id = session.event.group_id
62 | user_id = session.event.user_id
63 | msg = session.msg
64 | bot = nonebot.get_bot()
65 | has_img, files = parse(msg)
66 | illegal = 0
67 | if has_img:
68 | for file in files:
69 | illegal = await AI.img_request(img=compress(file))
70 | if illegal:
71 | break
72 | if illegal:
73 | try:
74 | await bot.delete_msg(**session.event)
75 | except:
76 | pass
77 | type = '色情' if illegal == 1 else '暴恐'
78 | return IntentCommand(90.0, 'img_filter', args={'user_id': user_id, 'type': type})
79 | record = records.get(group_id)
80 | ac_match = ac_filter.trie.iter(msg)
81 | bayes_match = bayes_filter.check(msg) if bot.config.BAYES else None
82 | if len(list(ac_match)) or bayes_match:
83 | try:
84 | await bot.delete_msg(**session.event)
85 | except:
86 | pass
87 | return IntentCommand(90.0, 'text_filter', current_arg=str(user_id))
88 | if record is None or msg != record.last_msg:
89 | record = Record(msg, user_id, repeat_count=1)
90 | records[group_id] = record
91 | return
92 | if record.last_user_id == user_id:
93 | return
94 | record.last_user_id = user_id
95 | record.repeat_count += 1
96 | if record.repeat_count == 2:
97 | return IntentCommand(
98 | 90.0,
99 | 'repeater',
100 | args={'delay': random.randint(5, 20) / 10, 'message': msg}
101 | )
102 |
--------------------------------------------------------------------------------
/awesome/data/baidu_stopwords.txt:
--------------------------------------------------------------------------------
1 | --
2 | ?
3 | “
4 | ”
5 | 》
6 | --
7 | able
8 | about
9 | above
10 | according
11 | accordingly
12 | across
13 | actually
14 | after
15 | afterwards
16 | again
17 | against
18 | ain't
19 | all
20 | allow
21 | allows
22 | almost
23 | alone
24 | along
25 | already
26 | also
27 | although
28 | always
29 | am
30 | among
31 | amongst
32 | an
33 | and
34 | another
35 | any
36 | anybody
37 | anyhow
38 | anyone
39 | anything
40 | anyway
41 | anyways
42 | anywhere
43 | apart
44 | appear
45 | appreciate
46 | appropriate
47 | are
48 | aren't
49 | around
50 | as
51 | a's
52 | aside
53 | ask
54 | asking
55 | associated
56 | at
57 | available
58 | away
59 | awfully
60 | be
61 | became
62 | because
63 | become
64 | becomes
65 | becoming
66 | been
67 | before
68 | beforehand
69 | behind
70 | being
71 | believe
72 | below
73 | beside
74 | besides
75 | best
76 | better
77 | between
78 | beyond
79 | both
80 | brief
81 | but
82 | by
83 | came
84 | can
85 | cannot
86 | cant
87 | can't
88 | cause
89 | causes
90 | certain
91 | certainly
92 | changes
93 | clearly
94 | c'mon
95 | co
96 | com
97 | come
98 | comes
99 | concerning
100 | consequently
101 | consider
102 | considering
103 | contain
104 | containing
105 | contains
106 | corresponding
107 | could
108 | couldn't
109 | course
110 | c's
111 | currently
112 | definitely
113 | described
114 | despite
115 | did
116 | didn't
117 | different
118 | do
119 | does
120 | doesn't
121 | doing
122 | done
123 | don't
124 | down
125 | downwards
126 | during
127 | each
128 | edu
129 | eg
130 | eight
131 | either
132 | else
133 | elsewhere
134 | enough
135 | entirely
136 | especially
137 | et
138 | etc
139 | even
140 | ever
141 | every
142 | everybody
143 | everyone
144 | everything
145 | everywhere
146 | ex
147 | exactly
148 | example
149 | except
150 | far
151 | few
152 | fifth
153 | first
154 | five
155 | followed
156 | following
157 | follows
158 | for
159 | former
160 | formerly
161 | forth
162 | four
163 | from
164 | further
165 | furthermore
166 | get
167 | gets
168 | getting
169 | given
170 | gives
171 | go
172 | goes
173 | going
174 | gone
175 | got
176 | gotten
177 | greetings
178 | had
179 | hadn't
180 | happens
181 | hardly
182 | has
183 | hasn't
184 | have
185 | haven't
186 | having
187 | he
188 | hello
189 | help
190 | hence
191 | her
192 | here
193 | hereafter
194 | hereby
195 | herein
196 | here's
197 | hereupon
198 | hers
199 | herself
200 | he's
201 | hi
202 | him
203 | himself
204 | his
205 | hither
206 | hopefully
207 | how
208 | howbeit
209 | however
210 | i'd
211 | ie
212 | if
213 | ignored
214 | i'll
215 | i'm
216 | immediate
217 | in
218 | inasmuch
219 | inc
220 | indeed
221 | indicate
222 | indicated
223 | indicates
224 | inner
225 | insofar
226 | instead
227 | into
228 | inward
229 | is
230 | isn't
231 | it
232 | it'd
233 | it'll
234 | its
235 | it's
236 | itself
237 | i've
238 | just
239 | keep
240 | keeps
241 | kept
242 | know
243 | known
244 | knows
245 | last
246 | lately
247 | later
248 | latter
249 | latterly
250 | least
251 | less
252 | lest
253 | let
254 | let's
255 | like
256 | liked
257 | likely
258 | little
259 | look
260 | looking
261 | looks
262 | ltd
263 | mainly
264 | many
265 | may
266 | maybe
267 | me
268 | mean
269 | meanwhile
270 | merely
271 | might
272 | more
273 | moreover
274 | most
275 | mostly
276 | much
277 | must
278 | my
279 | myself
280 | name
281 | namely
282 | nd
283 | near
284 | nearly
285 | necessary
286 | need
287 | needs
288 | neither
289 | never
290 | nevertheless
291 | new
292 | next
293 | nine
294 | no
295 | nobody
296 | non
297 | none
298 | noone
299 | nor
300 | normally
301 | not
302 | nothing
303 | novel
304 | now
305 | nowhere
306 | obviously
307 | of
308 | off
309 | often
310 | oh
311 | ok
312 | okay
313 | old
314 | on
315 | once
316 | one
317 | ones
318 | only
319 | onto
320 | or
321 | other
322 | others
323 | otherwise
324 | ought
325 | our
326 | ours
327 | ourselves
328 | out
329 | outside
330 | over
331 | overall
332 | own
333 | particular
334 | particularly
335 | per
336 | perhaps
337 | placed
338 | please
339 | plus
340 | possible
341 | presumably
342 | probably
343 | provides
344 | que
345 | quite
346 | qv
347 | rather
348 | rd
349 | re
350 | really
351 | reasonably
352 | regarding
353 | regardless
354 | regards
355 | relatively
356 | respectively
357 | right
358 | said
359 | same
360 | saw
361 | say
362 | saying
363 | says
364 | second
365 | secondly
366 | see
367 | seeing
368 | seem
369 | seemed
370 | seeming
371 | seems
372 | seen
373 | self
374 | selves
375 | sensible
376 | sent
377 | serious
378 | seriously
379 | seven
380 | several
381 | shall
382 | she
383 | should
384 | shouldn't
385 | since
386 | six
387 | so
388 | some
389 | somebody
390 | somehow
391 | someone
392 | something
393 | sometime
394 | sometimes
395 | somewhat
396 | somewhere
397 | soon
398 | sorry
399 | specified
400 | specify
401 | specifying
402 | still
403 | sub
404 | such
405 | sup
406 | sure
407 | take
408 | taken
409 | tell
410 | tends
411 | th
412 | than
413 | thank
414 | thanks
415 | thanx
416 | that
417 | thats
418 | that's
419 | the
420 | their
421 | theirs
422 | them
423 | themselves
424 | then
425 | thence
426 | there
427 | thereafter
428 | thereby
429 | therefore
430 | therein
431 | theres
432 | there's
433 | thereupon
434 | these
435 | they
436 | they'd
437 | they'll
438 | they're
439 | they've
440 | think
441 | third
442 | this
443 | thorough
444 | thoroughly
445 | those
446 | though
447 | three
448 | through
449 | throughout
450 | thru
451 | thus
452 | to
453 | together
454 | too
455 | took
456 | toward
457 | towards
458 | tried
459 | tries
460 | truly
461 | try
462 | trying
463 | t's
464 | twice
465 | two
466 | un
467 | under
468 | unfortunately
469 | unless
470 | unlikely
471 | until
472 | unto
473 | up
474 | upon
475 | us
476 | use
477 | used
478 | useful
479 | uses
480 | using
481 | usually
482 | value
483 | various
484 | very
485 | via
486 | viz
487 | vs
488 | want
489 | wants
490 | was
491 | wasn't
492 | way
493 | we
494 | we'd
495 | welcome
496 | well
497 | we'll
498 | went
499 | were
500 | we're
501 | weren't
502 | we've
503 | what
504 | whatever
505 | what's
506 | when
507 | whence
508 | whenever
509 | where
510 | whereafter
511 | whereas
512 | whereby
513 | wherein
514 | where's
515 | whereupon
516 | wherever
517 | whether
518 | which
519 | while
520 | whither
521 | who
522 | whoever
523 | whole
524 | whom
525 | who's
526 | whose
527 | why
528 | will
529 | willing
530 | wish
531 | with
532 | within
533 | without
534 | wonder
535 | won't
536 | would
537 | wouldn't
538 | yes
539 | yet
540 | you
541 | you'd
542 | you'll
543 | your
544 | you're
545 | yours
546 | yourself
547 | yourselves
548 | you've
549 | zero
550 | zt
551 | ZT
552 | zz
553 | ZZ
554 | 一
555 | 一下
556 | 一些
557 | 一切
558 | 一则
559 | 一天
560 | 一定
561 | 一方面
562 | 一旦
563 | 一时
564 | 一来
565 | 一样
566 | 一次
567 | 一片
568 | 一直
569 | 一致
570 | 一般
571 | 一起
572 | 一边
573 | 一面
574 | 万一
575 | 上下
576 | 上升
577 | 上去
578 | 上来
579 | 上述
580 | 上面
581 | 下列
582 | 下去
583 | 下来
584 | 下面
585 | 不一
586 | 不久
587 | 不仅
588 | 不会
589 | 不但
590 | 不光
591 | 不单
592 | 不变
593 | 不只
594 | 不可
595 | 不同
596 | 不够
597 | 不如
598 | 不得
599 | 不怕
600 | 不惟
601 | 不成
602 | 不拘
603 | 不敢
604 | 不断
605 | 不是
606 | 不比
607 | 不然
608 | 不特
609 | 不独
610 | 不管
611 | 不能
612 | 不要
613 | 不论
614 | 不足
615 | 不过
616 | 不问
617 | 与
618 | 与其
619 | 与否
620 | 与此同时
621 | 专门
622 | 且
623 | 两者
624 | 严格
625 | 严重
626 | 个
627 | 个人
628 | 个别
629 | 中小
630 | 中间
631 | 丰富
632 | 临
633 | 为
634 | 为主
635 | 为了
636 | 为什么
637 | 为什麽
638 | 为何
639 | 为着
640 | 主张
641 | 主要
642 | 举行
643 | 乃
644 | 乃至
645 | 么
646 | 之
647 | 之一
648 | 之前
649 | 之后
650 | 之後
651 | 之所以
652 | 之类
653 | 乌乎
654 | 乎
655 | 乘
656 | 也
657 | 也好
658 | 也是
659 | 也罢
660 | 了
661 | 了解
662 | 争取
663 | 于
664 | 于是
665 | 于是乎
666 | 云云
667 | 互相
668 | 产生
669 | 人们
670 | 人家
671 | 什么
672 | 什么样
673 | 什麽
674 | 今后
675 | 今天
676 | 今年
677 | 今後
678 | 仍然
679 | 从
680 | 从事
681 | 从而
682 | 他
683 | 他人
684 | 他们
685 | 他的
686 | 代替
687 | 以
688 | 以上
689 | 以下
690 | 以为
691 | 以便
692 | 以免
693 | 以前
694 | 以及
695 | 以后
696 | 以外
697 | 以後
698 | 以来
699 | 以至
700 | 以至于
701 | 以致
702 | 们
703 | 任
704 | 任何
705 | 任凭
706 | 任务
707 | 企图
708 | 伟大
709 | 似乎
710 | 似的
711 | 但
712 | 但是
713 | 何
714 | 何况
715 | 何处
716 | 何时
717 | 作为
718 | 你
719 | 你们
720 | 你的
721 | 使得
722 | 使用
723 | 例如
724 | 依
725 | 依照
726 | 依靠
727 | 促进
728 | 保持
729 | 俺
730 | 俺们
731 | 倘
732 | 倘使
733 | 倘或
734 | 倘然
735 | 倘若
736 | 假使
737 | 假如
738 | 假若
739 | 做到
740 | 像
741 | 允许
742 | 充分
743 | 先后
744 | 先後
745 | 先生
746 | 全部
747 | 全面
748 | 兮
749 | 共同
750 | 关于
751 | 其
752 | 其一
753 | 其中
754 | 其二
755 | 其他
756 | 其余
757 | 其它
758 | 其实
759 | 其次
760 | 具体
761 | 具体地说
762 | 具体说来
763 | 具有
764 | 再者
765 | 再说
766 | 冒
767 | 冲
768 | 决定
769 | 况且
770 | 准备
771 | 几
772 | 几乎
773 | 几时
774 | 凭
775 | 凭借
776 | 出去
777 | 出来
778 | 出现
779 | 分别
780 | 则
781 | 别
782 | 别的
783 | 别说
784 | 到
785 | 前后
786 | 前者
787 | 前进
788 | 前面
789 | 加之
790 | 加以
791 | 加入
792 | 加强
793 | 十分
794 | 即
795 | 即令
796 | 即使
797 | 即便
798 | 即或
799 | 即若
800 | 却不
801 | 原来
802 | 又
803 | 及
804 | 及其
805 | 及时
806 | 及至
807 | 双方
808 | 反之
809 | 反应
810 | 反映
811 | 反过来
812 | 反过来说
813 | 取得
814 | 受到
815 | 变成
816 | 另
817 | 另一方面
818 | 另外
819 | 只是
820 | 只有
821 | 只要
822 | 只限
823 | 叫
824 | 叫做
825 | 召开
826 | 叮咚
827 | 可
828 | 可以
829 | 可是
830 | 可能
831 | 可见
832 | 各
833 | 各个
834 | 各人
835 | 各位
836 | 各地
837 | 各种
838 | 各级
839 | 各自
840 | 合理
841 | 同
842 | 同一
843 | 同时
844 | 同样
845 | 后来
846 | 后面
847 | 向
848 | 向着
849 | 吓
850 | 吗
851 | 否则
852 | 吧
853 | 吧哒
854 | 吱
855 | 呀
856 | 呃
857 | 呕
858 | 呗
859 | 呜
860 | 呜呼
861 | 呢
862 | 周围
863 | 呵
864 | 呸
865 | 呼哧
866 | 咋
867 | 和
868 | 咚
869 | 咦
870 | 咱
871 | 咱们
872 | 咳
873 | 哇
874 | 哈
875 | 哈哈
876 | 哉
877 | 哎
878 | 哎呀
879 | 哎哟
880 | 哗
881 | 哟
882 | 哦
883 | 哩
884 | 哪
885 | 哪个
886 | 哪些
887 | 哪儿
888 | 哪天
889 | 哪年
890 | 哪怕
891 | 哪样
892 | 哪边
893 | 哪里
894 | 哼
895 | 哼唷
896 | 唉
897 | 啊
898 | 啐
899 | 啥
900 | 啦
901 | 啪达
902 | 喂
903 | 喏
904 | 喔唷
905 | 嗡嗡
906 | 嗬
907 | 嗯
908 | 嗳
909 | 嘎
910 | 嘎登
911 | 嘘
912 | 嘛
913 | 嘻
914 | 嘿
915 | 因
916 | 因为
917 | 因此
918 | 因而
919 | 固然
920 | 在
921 | 在下
922 | 地
923 | 坚决
924 | 坚持
925 | 基本
926 | 处理
927 | 复杂
928 | 多
929 | 多少
930 | 多数
931 | 多次
932 | 大力
933 | 大多数
934 | 大大
935 | 大家
936 | 大批
937 | 大约
938 | 大量
939 | 失去
940 | 她
941 | 她们
942 | 她的
943 | 好的
944 | 好象
945 | 如
946 | 如上所述
947 | 如下
948 | 如何
949 | 如其
950 | 如果
951 | 如此
952 | 如若
953 | 存在
954 | 宁
955 | 宁可
956 | 宁愿
957 | 宁肯
958 | 它
959 | 它们
960 | 它们的
961 | 它的
962 | 安全
963 | 完全
964 | 完成
965 | 实现
966 | 实际
967 | 宣布
968 | 容易
969 | 密切
970 | 对
971 | 对于
972 | 对应
973 | 将
974 | 少数
975 | 尔后
976 | 尚且
977 | 尤其
978 | 就
979 | 就是
980 | 就是说
981 | 尽
982 | 尽管
983 | 属于
984 | 岂但
985 | 左右
986 | 巨大
987 | 巩固
988 | 己
989 | 已经
990 | 帮助
991 | 常常
992 | 并
993 | 并不
994 | 并不是
995 | 并且
996 | 并没有
997 | 广大
998 | 广泛
999 | 应当
1000 | 应用
1001 | 应该
1002 | 开外
1003 | 开始
1004 | 开展
1005 | 引起
1006 | 强烈
1007 | 强调
1008 | 归
1009 | 当
1010 | 当前
1011 | 当时
1012 | 当然
1013 | 当着
1014 | 形成
1015 | 彻底
1016 | 彼
1017 | 彼此
1018 | 往
1019 | 往往
1020 | 待
1021 | 後来
1022 | 後面
1023 | 得
1024 | 得出
1025 | 得到
1026 | 心里
1027 | 必然
1028 | 必要
1029 | 必须
1030 | 怎
1031 | 怎么
1032 | 怎么办
1033 | 怎么样
1034 | 怎样
1035 | 怎麽
1036 | 总之
1037 | 总是
1038 | 总的来看
1039 | 总的来说
1040 | 总的说来
1041 | 总结
1042 | 总而言之
1043 | 恰恰相反
1044 | 您
1045 | 意思
1046 | 愿意
1047 | 慢说
1048 | 成为
1049 | 我
1050 | 我们
1051 | 我的
1052 | 或
1053 | 或是
1054 | 或者
1055 | 战斗
1056 | 所
1057 | 所以
1058 | 所有
1059 | 所谓
1060 | 打
1061 | 扩大
1062 | 把
1063 | 抑或
1064 | 拿
1065 | 按
1066 | 按照
1067 | 换句话说
1068 | 换言之
1069 | 据
1070 | 掌握
1071 | 接着
1072 | 接著
1073 | 故
1074 | 故此
1075 | 整个
1076 | 方便
1077 | 方面
1078 | 旁人
1079 | 无宁
1080 | 无法
1081 | 无论
1082 | 既
1083 | 既是
1084 | 既然
1085 | 时候
1086 | 明显
1087 | 明确
1088 | 是
1089 | 是否
1090 | 是的
1091 | 显然
1092 | 显著
1093 | 普通
1094 | 普遍
1095 | 更加
1096 | 曾经
1097 | 替
1098 | 最后
1099 | 最大
1100 | 最好
1101 | 最後
1102 | 最近
1103 | 最高
1104 | 有
1105 | 有些
1106 | 有关
1107 | 有利
1108 | 有力
1109 | 有所
1110 | 有效
1111 | 有时
1112 | 有点
1113 | 有的
1114 | 有着
1115 | 有著
1116 | 望
1117 | 朝
1118 | 朝着
1119 | 本
1120 | 本着
1121 | 来
1122 | 来着
1123 | 极了
1124 | 构成
1125 | 果然
1126 | 果真
1127 | 某
1128 | 某个
1129 | 某些
1130 | 根据
1131 | 根本
1132 | 欢迎
1133 | 正在
1134 | 正如
1135 | 正常
1136 | 此
1137 | 此外
1138 | 此时
1139 | 此间
1140 | 毋宁
1141 | 每
1142 | 每个
1143 | 每天
1144 | 每年
1145 | 每当
1146 | 比
1147 | 比如
1148 | 比方
1149 | 比较
1150 | 毫不
1151 | 没有
1152 | 沿
1153 | 沿着
1154 | 注意
1155 | 深入
1156 | 清楚
1157 | 满足
1158 | 漫说
1159 | 焉
1160 | 然则
1161 | 然后
1162 | 然後
1163 | 然而
1164 | 照
1165 | 照着
1166 | 特别是
1167 | 特殊
1168 | 特点
1169 | 现代
1170 | 现在
1171 | 甚么
1172 | 甚而
1173 | 甚至
1174 | 用
1175 | 由
1176 | 由于
1177 | 由此可见
1178 | 的
1179 | 的话
1180 | 目前
1181 | 直到
1182 | 直接
1183 | 相似
1184 | 相信
1185 | 相反
1186 | 相同
1187 | 相对
1188 | 相对而言
1189 | 相应
1190 | 相当
1191 | 相等
1192 | 省得
1193 | 看出
1194 | 看到
1195 | 看来
1196 | 看看
1197 | 看见
1198 | 真是
1199 | 真正
1200 | 着
1201 | 着呢
1202 | 矣
1203 | 知道
1204 | 确定
1205 | 离
1206 | 积极
1207 | 移动
1208 | 突出
1209 | 突然
1210 | 立即
1211 | 第
1212 | 等
1213 | 等等
1214 | 管
1215 | 紧接着
1216 | 纵
1217 | 纵令
1218 | 纵使
1219 | 纵然
1220 | 练习
1221 | 组成
1222 | 经
1223 | 经常
1224 | 经过
1225 | 结合
1226 | 结果
1227 | 给
1228 | 绝对
1229 | 继续
1230 | 继而
1231 | 维持
1232 | 综上所述
1233 | 罢了
1234 | 考虑
1235 | 者
1236 | 而
1237 | 而且
1238 | 而况
1239 | 而外
1240 | 而已
1241 | 而是
1242 | 而言
1243 | 联系
1244 | 能
1245 | 能否
1246 | 能够
1247 | 腾
1248 | 自
1249 | 自个儿
1250 | 自从
1251 | 自各儿
1252 | 自家
1253 | 自己
1254 | 自身
1255 | 至
1256 | 至于
1257 | 良好
1258 | 若
1259 | 若是
1260 | 若非
1261 | 范围
1262 | 莫若
1263 | 获得
1264 | 虽
1265 | 虽则
1266 | 虽然
1267 | 虽说
1268 | 行为
1269 | 行动
1270 | 表明
1271 | 表示
1272 | 被
1273 | 要
1274 | 要不
1275 | 要不是
1276 | 要不然
1277 | 要么
1278 | 要是
1279 | 要求
1280 | 规定
1281 | 觉得
1282 | 认为
1283 | 认真
1284 | 认识
1285 | 让
1286 | 许多
1287 | 论
1288 | 设使
1289 | 设若
1290 | 该
1291 | 说明
1292 | 诸位
1293 | 谁
1294 | 谁知
1295 | 赶
1296 | 起
1297 | 起来
1298 | 起见
1299 | 趁
1300 | 趁着
1301 | 越是
1302 | 跟
1303 | 转动
1304 | 转变
1305 | 转贴
1306 | 较
1307 | 较之
1308 | 边
1309 | 达到
1310 | 迅速
1311 | 过
1312 | 过去
1313 | 过来
1314 | 运用
1315 | 还是
1316 | 还有
1317 | 这
1318 | 这个
1319 | 这么
1320 | 这么些
1321 | 这么样
1322 | 这么点儿
1323 | 这些
1324 | 这会儿
1325 | 这儿
1326 | 这就是说
1327 | 这时
1328 | 这样
1329 | 这点
1330 | 这种
1331 | 这边
1332 | 这里
1333 | 这麽
1334 | 进入
1335 | 进步
1336 | 进而
1337 | 进行
1338 | 连
1339 | 连同
1340 | 适应
1341 | 适当
1342 | 适用
1343 | 逐步
1344 | 逐渐
1345 | 通常
1346 | 通过
1347 | 造成
1348 | 遇到
1349 | 遭到
1350 | 避免
1351 | 那
1352 | 那个
1353 | 那么
1354 | 那么些
1355 | 那么样
1356 | 那些
1357 | 那会儿
1358 | 那儿
1359 | 那时
1360 | 那样
1361 | 那边
1362 | 那里
1363 | 那麽
1364 | 部分
1365 | 鄙人
1366 | 采取
1367 | 里面
1368 | 重大
1369 | 重新
1370 | 重要
1371 | 鉴于
1372 | 问题
1373 | 防止
1374 | 阿
1375 | 附近
1376 | 限制
1377 | 除
1378 | 除了
1379 | 除此之外
1380 | 除非
1381 | 随
1382 | 随着
1383 | 随著
1384 | 集中
1385 | 需要
1386 | 非但
1387 | 非常
1388 | 非徒
1389 | 靠
1390 | 顺
1391 | 顺着
1392 | 首先
1393 | 高兴
1394 | 是不是
1395 | 说说
1396 |
1397 |
--------------------------------------------------------------------------------
/awesome/data/cn_stopwords.txt:
--------------------------------------------------------------------------------
1 | $
2 | 0
3 | 1
4 | 2
5 | 3
6 | 4
7 | 5
8 | 6
9 | 7
10 | 8
11 | 9
12 | ?
13 | _
14 | “
15 | ”
16 | 、
17 | 。
18 | 《
19 | 》
20 | 一
21 | 一些
22 | 一何
23 | 一切
24 | 一则
25 | 一方面
26 | 一旦
27 | 一来
28 | 一样
29 | 一般
30 | 一转眼
31 | 万一
32 | 上
33 | 上下
34 | 下
35 | 不
36 | 不仅
37 | 不但
38 | 不光
39 | 不单
40 | 不只
41 | 不外乎
42 | 不如
43 | 不妨
44 | 不尽
45 | 不尽然
46 | 不得
47 | 不怕
48 | 不惟
49 | 不成
50 | 不拘
51 | 不料
52 | 不是
53 | 不比
54 | 不然
55 | 不特
56 | 不独
57 | 不管
58 | 不至于
59 | 不若
60 | 不论
61 | 不过
62 | 不问
63 | 与
64 | 与其
65 | 与其说
66 | 与否
67 | 与此同时
68 | 且
69 | 且不说
70 | 且说
71 | 两者
72 | 个
73 | 个别
74 | 临
75 | 为
76 | 为了
77 | 为什么
78 | 为何
79 | 为止
80 | 为此
81 | 为着
82 | 乃
83 | 乃至
84 | 乃至于
85 | 么
86 | 之
87 | 之一
88 | 之所以
89 | 之类
90 | 乌乎
91 | 乎
92 | 乘
93 | 也
94 | 也好
95 | 也罢
96 | 了
97 | 二来
98 | 于
99 | 于是
100 | 于是乎
101 | 云云
102 | 云尔
103 | 些
104 | 亦
105 | 人
106 | 人们
107 | 人家
108 | 什么
109 | 什么样
110 | 今
111 | 介于
112 | 仍
113 | 仍旧
114 | 从
115 | 从此
116 | 从而
117 | 他
118 | 他人
119 | 他们
120 | 以
121 | 以上
122 | 以为
123 | 以便
124 | 以免
125 | 以及
126 | 以故
127 | 以期
128 | 以来
129 | 以至
130 | 以至于
131 | 以致
132 | 们
133 | 任
134 | 任何
135 | 任凭
136 | 似的
137 | 但
138 | 但凡
139 | 但是
140 | 何
141 | 何以
142 | 何况
143 | 何处
144 | 何时
145 | 余外
146 | 作为
147 | 你
148 | 你们
149 | 使
150 | 使得
151 | 例如
152 | 依
153 | 依据
154 | 依照
155 | 便于
156 | 俺
157 | 俺们
158 | 倘
159 | 倘使
160 | 倘或
161 | 倘然
162 | 倘若
163 | 借
164 | 假使
165 | 假如
166 | 假若
167 | 傥然
168 | 像
169 | 儿
170 | 先不先
171 | 光是
172 | 全体
173 | 全部
174 | 兮
175 | 关于
176 | 其
177 | 其一
178 | 其中
179 | 其二
180 | 其他
181 | 其余
182 | 其它
183 | 其次
184 | 具体地说
185 | 具体说来
186 | 兼之
187 | 内
188 | 再
189 | 再其次
190 | 再则
191 | 再有
192 | 再者
193 | 再者说
194 | 再说
195 | 冒
196 | 冲
197 | 况且
198 | 几
199 | 几时
200 | 凡
201 | 凡是
202 | 凭
203 | 凭借
204 | 出于
205 | 出来
206 | 分别
207 | 则
208 | 则甚
209 | 别
210 | 别人
211 | 别处
212 | 别是
213 | 别的
214 | 别管
215 | 别说
216 | 到
217 | 前后
218 | 前此
219 | 前者
220 | 加之
221 | 加以
222 | 即
223 | 即令
224 | 即使
225 | 即便
226 | 即如
227 | 即或
228 | 即若
229 | 却
230 | 去
231 | 又
232 | 又及
233 | 及
234 | 及其
235 | 及至
236 | 反之
237 | 反而
238 | 反过来
239 | 反过来说
240 | 受到
241 | 另
242 | 另一方面
243 | 另外
244 | 另悉
245 | 只
246 | 只当
247 | 只怕
248 | 只是
249 | 只有
250 | 只消
251 | 只要
252 | 只限
253 | 叫
254 | 叮咚
255 | 可
256 | 可以
257 | 可是
258 | 可见
259 | 各
260 | 各个
261 | 各位
262 | 各种
263 | 各自
264 | 同
265 | 同时
266 | 后
267 | 后者
268 | 向
269 | 向使
270 | 向着
271 | 吓
272 | 吗
273 | 否则
274 | 吧
275 | 吧哒
276 | 吱
277 | 呀
278 | 呃
279 | 呕
280 | 呗
281 | 呜
282 | 呜呼
283 | 呢
284 | 呵
285 | 呵呵
286 | 呸
287 | 呼哧
288 | 咋
289 | 和
290 | 咚
291 | 咦
292 | 咧
293 | 咱
294 | 咱们
295 | 咳
296 | 哇
297 | 哈
298 | 哈哈
299 | 哉
300 | 哎
301 | 哎呀
302 | 哎哟
303 | 哗
304 | 哟
305 | 哦
306 | 哩
307 | 哪
308 | 哪个
309 | 哪些
310 | 哪儿
311 | 哪天
312 | 哪年
313 | 哪怕
314 | 哪样
315 | 哪边
316 | 哪里
317 | 哼
318 | 哼唷
319 | 唉
320 | 唯有
321 | 啊
322 | 啐
323 | 啥
324 | 啦
325 | 啪达
326 | 啷当
327 | 喂
328 | 喏
329 | 喔唷
330 | 喽
331 | 嗡
332 | 嗡嗡
333 | 嗬
334 | 嗯
335 | 嗳
336 | 嘎
337 | 嘎登
338 | 嘘
339 | 嘛
340 | 嘻
341 | 嘿
342 | 嘿嘿
343 | 因
344 | 因为
345 | 因了
346 | 因此
347 | 因着
348 | 因而
349 | 固然
350 | 在
351 | 在下
352 | 在于
353 | 地
354 | 基于
355 | 处在
356 | 多
357 | 多么
358 | 多少
359 | 大
360 | 大家
361 | 她
362 | 她们
363 | 好
364 | 如
365 | 如上
366 | 如上所述
367 | 如下
368 | 如何
369 | 如其
370 | 如同
371 | 如是
372 | 如果
373 | 如此
374 | 如若
375 | 始而
376 | 孰料
377 | 孰知
378 | 宁
379 | 宁可
380 | 宁愿
381 | 宁肯
382 | 它
383 | 它们
384 | 对
385 | 对于
386 | 对待
387 | 对方
388 | 对比
389 | 将
390 | 小
391 | 尔
392 | 尔后
393 | 尔尔
394 | 尚且
395 | 就
396 | 就是
397 | 就是了
398 | 就是说
399 | 就算
400 | 就要
401 | 尽
402 | 尽管
403 | 尽管如此
404 | 岂但
405 | 己
406 | 已
407 | 已矣
408 | 巴
409 | 巴巴
410 | 并
411 | 并且
412 | 并非
413 | 庶乎
414 | 庶几
415 | 开外
416 | 开始
417 | 归
418 | 归齐
419 | 当
420 | 当地
421 | 当然
422 | 当着
423 | 彼
424 | 彼时
425 | 彼此
426 | 往
427 | 待
428 | 很
429 | 得
430 | 得了
431 | 怎
432 | 怎么
433 | 怎么办
434 | 怎么样
435 | 怎奈
436 | 怎样
437 | 总之
438 | 总的来看
439 | 总的来说
440 | 总的说来
441 | 总而言之
442 | 恰恰相反
443 | 您
444 | 惟其
445 | 慢说
446 | 我
447 | 我们
448 | 或
449 | 或则
450 | 或是
451 | 或曰
452 | 或者
453 | 截至
454 | 所
455 | 所以
456 | 所在
457 | 所幸
458 | 所有
459 | 才
460 | 才能
461 | 打
462 | 打从
463 | 把
464 | 抑或
465 | 拿
466 | 按
467 | 按照
468 | 换句话说
469 | 换言之
470 | 据
471 | 据此
472 | 接着
473 | 故
474 | 故此
475 | 故而
476 | 旁人
477 | 无
478 | 无宁
479 | 无论
480 | 既
481 | 既往
482 | 既是
483 | 既然
484 | 时候
485 | 是
486 | 是以
487 | 是的
488 | 曾
489 | 替
490 | 替代
491 | 最
492 | 有
493 | 有些
494 | 有关
495 | 有及
496 | 有时
497 | 有的
498 | 望
499 | 朝
500 | 朝着
501 | 本
502 | 本人
503 | 本地
504 | 本着
505 | 本身
506 | 来
507 | 来着
508 | 来自
509 | 来说
510 | 极了
511 | 果然
512 | 果真
513 | 某
514 | 某个
515 | 某些
516 | 某某
517 | 根据
518 | 欤
519 | 正值
520 | 正如
521 | 正巧
522 | 正是
523 | 此
524 | 此地
525 | 此处
526 | 此外
527 | 此时
528 | 此次
529 | 此间
530 | 毋宁
531 | 每
532 | 每当
533 | 比
534 | 比及
535 | 比如
536 | 比方
537 | 没奈何
538 | 沿
539 | 沿着
540 | 漫说
541 | 焉
542 | 然则
543 | 然后
544 | 然而
545 | 照
546 | 照着
547 | 犹且
548 | 犹自
549 | 甚且
550 | 甚么
551 | 甚或
552 | 甚而
553 | 甚至
554 | 甚至于
555 | 用
556 | 用来
557 | 由
558 | 由于
559 | 由是
560 | 由此
561 | 由此可见
562 | 的
563 | 的确
564 | 的话
565 | 直到
566 | 相对而言
567 | 省得
568 | 看
569 | 眨眼
570 | 着
571 | 着呢
572 | 矣
573 | 矣乎
574 | 矣哉
575 | 离
576 | 竟而
577 | 第
578 | 等
579 | 等到
580 | 等等
581 | 简言之
582 | 管
583 | 类如
584 | 紧接着
585 | 纵
586 | 纵令
587 | 纵使
588 | 纵然
589 | 经
590 | 经过
591 | 结果
592 | 给
593 | 继之
594 | 继后
595 | 继而
596 | 综上所述
597 | 罢了
598 | 者
599 | 而
600 | 而且
601 | 而况
602 | 而后
603 | 而外
604 | 而已
605 | 而是
606 | 而言
607 | 能
608 | 能否
609 | 腾
610 | 自
611 | 自个儿
612 | 自从
613 | 自各儿
614 | 自后
615 | 自家
616 | 自己
617 | 自打
618 | 自身
619 | 至
620 | 至于
621 | 至今
622 | 至若
623 | 致
624 | 般的
625 | 若
626 | 若夫
627 | 若是
628 | 若果
629 | 若非
630 | 莫不然
631 | 莫如
632 | 莫若
633 | 虽
634 | 虽则
635 | 虽然
636 | 虽说
637 | 被
638 | 要
639 | 要不
640 | 要不是
641 | 要不然
642 | 要么
643 | 要是
644 | 譬喻
645 | 譬如
646 | 让
647 | 许多
648 | 论
649 | 设使
650 | 设或
651 | 设若
652 | 诚如
653 | 诚然
654 | 该
655 | 说来
656 | 诸
657 | 诸位
658 | 诸如
659 | 谁
660 | 谁人
661 | 谁料
662 | 谁知
663 | 贼死
664 | 赖以
665 | 赶
666 | 起
667 | 起见
668 | 趁
669 | 趁着
670 | 越是
671 | 距
672 | 跟
673 | 较
674 | 较之
675 | 边
676 | 过
677 | 还
678 | 还是
679 | 还有
680 | 还要
681 | 这
682 | 这一来
683 | 这个
684 | 这么
685 | 这么些
686 | 这么样
687 | 这么点儿
688 | 这些
689 | 这会儿
690 | 这儿
691 | 这就是说
692 | 这时
693 | 这样
694 | 这次
695 | 这般
696 | 这边
697 | 这里
698 | 进而
699 | 连
700 | 连同
701 | 逐步
702 | 通过
703 | 遵循
704 | 遵照
705 | 那
706 | 那个
707 | 那么
708 | 那么些
709 | 那么样
710 | 那些
711 | 那会儿
712 | 那儿
713 | 那时
714 | 那样
715 | 那般
716 | 那边
717 | 那里
718 | 都
719 | 鄙人
720 | 鉴于
721 | 针对
722 | 阿
723 | 除
724 | 除了
725 | 除外
726 | 除开
727 | 除此之外
728 | 除非
729 | 随
730 | 随后
731 | 随时
732 | 随着
733 | 难道说
734 | 非但
735 | 非徒
736 | 非特
737 | 非独
738 | 靠
739 | 顺
740 | 顺着
741 | 首先
742 | !
743 | ,
744 | :
745 | ;
746 | ?
747 |
--------------------------------------------------------------------------------
/awesome/data/patterns.txt:
--------------------------------------------------------------------------------
1 | 傻逼
2 | 草泥马
3 | sb
4 | SB
5 | nmsl
--------------------------------------------------------------------------------
/awesome/data/words.txt:
--------------------------------------------------------------------------------
1 | 爱液 100
2 | 按摩棒 100
3 | 爆草 100
4 | 包二奶 100
5 | 暴干 100
6 | 暴奸 100
7 | 暴乳 100
8 | 爆乳 100
9 | 暴淫 100
10 | 被操 100
11 | 被插 100
12 | 被干 100
13 | 逼奸 100
14 | 苍井空 100
15 | 插暴 100
16 | 操逼 100
17 | 操烂 100
18 | 肏你 100
19 | 肏死 100
20 | 操死 100
21 | 操我 100
22 | 厕奴 100
23 | 插比 100
24 | 插b 100
25 | 插逼 100
26 | 插进 100
27 | 插你 100
28 | 插我 100
29 | 插阴 100
30 | 潮吹 100
31 | 潮喷 100
32 | 成人电影 100
33 | 成人论坛 100
34 | 成人色情 100
35 | 成人网站 100
36 | 成人文学 100
37 | 成人小说 100
38 | 艳情小说 100
39 | 成人游戏 100
40 | 吃精 100
41 | 抽插 100
42 | 春药 100
43 | 大乳 100
44 | 荡妇 100
45 | 荡女 100
46 | 盗撮 100
47 | 发浪 100
48 | 放尿 100
49 | 肥逼 100
50 | 粉穴 100
51 | 风月大陆 100
52 | 干死你 100
53 | 干穴 100
54 | 肛交 100
55 | 肛门 100
56 | 龟头 100
57 | 裹本 100
58 | 国产av 100
59 | 好嫩 100
60 | 豪乳 100
61 | 后穴 100
62 | 虎骑 100
63 | 换妻俱乐部 100
64 | 黄片 100
65 | 鸡吧 100
66 | 鸡巴 100
67 | 鸡奸 100
68 | 妓女 100
69 | 奸情 100
70 | 叫床 100
71 | 脚交 100
72 | 精液 100
73 | 巨屌 100
74 | 菊花洞 100
75 | 菊门 100
76 | 巨奶 100
77 | 巨乳 100
78 | 菊穴 100
79 | 开苞 100
80 | 口爆 100
81 | 口活 100
82 | 口交 100
83 | 口射 100
84 | 口淫 100
85 | 裤袜 100
86 | 狂操 100
87 | 狂插 100
88 | 浪逼 100
89 | 浪妇 100
90 | 浪叫 100
91 | 浪女 100
92 | 狼友 100
93 | 聊性 100
94 | 凌辱 100
95 | 漏乳 100
96 | 乱交 100
97 | 乱伦 100
98 | 轮暴 100
99 | 轮操 100
100 | 轮奸 100
101 | 裸陪 100
102 | 买春 100
103 | 美逼 100
104 | 美少妇 100
105 | 美乳 100
106 | 美腿 100
107 | 美穴 100
108 | 美幼 100
109 | 秘唇 100
110 | 迷奸 100
111 | 密穴 100
112 | 蜜穴 100
113 | 蜜液 100
114 | 摸奶 100
115 | 摸胸 100
116 | 母奸 100
117 | 奈美 100
118 | 奶子 100
119 | 男奴 100
120 | 内射 100
121 | 嫩逼 100
122 | 嫩女 100
123 | 嫩穴 100
124 | 捏弄 100
125 | 女优 100
126 | 炮友 100
127 | 砲友 100
128 | 喷精 100
129 | 屁眼 100
130 | 前凸后翘 100
131 | 强暴 100
132 | 强奸处女 100
133 | 情趣用品 100
134 | 情色 100
135 | 拳交 100
136 | 全裸 100
137 | 群交 100
138 | 人妻 100
139 | 人兽 100
140 | 日逼 100
141 | 日烂 100
142 | 肉棒 100
143 | 肉逼 100
144 | 肉唇 100
145 | 肉洞 100
146 | 肉缝 100
147 | 肉棍 100
148 | 肉茎 100
149 | 肉具 100
150 | 揉乳 100
151 | 肉穴 100
152 | 肉欲 100
153 | 乳爆 100
154 | 乳房 100
155 | 乳沟 100
156 | 乳交 100
157 | 乳头 100
158 | 骚逼 100
159 | 骚比 100
160 | 骚女 100
161 | 骚水 100
162 | 骚穴 100
163 | 色逼 100
164 | 色界 100
165 | 色猫 100
166 | 色盟 100
167 | 色情网站 100
168 | 色区 100
169 | 色色 100
170 | 色诱 100
171 | 色欲 100
172 | 色b 100
173 | 少年阿宾 100
174 | 射爽 100
175 | 射颜 100
176 | 食精 100
177 | 释欲 100
178 | 兽奸 100
179 | 兽交 100
180 | 手淫 100
181 | 兽欲 100
182 | 熟妇 100
183 | 熟母 100
184 | 熟女 100
185 | 爽片 100
186 | 双臀 100
187 | 死逼 100
188 | 丝袜 100
189 | 丝诱 100
190 | 松岛枫 100
191 | 酥痒 100
192 | 汤加丽 100
193 | 套弄 100
194 | 体奸 100
195 | 体位 100
196 | 舔脚 100
197 | 舔阴 100
198 | 调教 100
199 | 偷欢 100
200 | 推油 100
201 | 脱内裤 100
202 | 文做 100
203 | 舞女 100
204 | 无修正 100
205 | 吸精 100
206 | 夏川纯 100
207 | 相奸 100
208 | 小逼 100
209 | 校鸡 100
210 | 小穴 100
211 | 性感妖娆 100
212 | 性感诱惑 100
213 | 性虎 100
214 | 性饥渴 100
215 | 性技巧 100
216 | 性交 100
217 | 性奴 100
218 | 性虐 100
219 | 性息 100
220 | 性欲 100
221 | 胸推 100
222 | 穴口 100
223 | 穴图 100
224 | 亚情 100
225 | 颜射 100
226 | 阳具 100
227 | 杨思敏 100
228 | 要射了 100
229 | 夜勤病栋 100
230 | 一本道 100
231 | 一夜欢 100
232 | 一夜情 100
233 | 一ye情 100
234 | 阴部 100
235 | 淫虫 100
236 | 阴唇 100
237 | 淫荡 100
238 | 阴道 100
239 | 淫电影 100
240 | 阴阜 100
241 | 淫妇 100
242 | 淫河 100
243 | 阴核 100
244 | 阴户 100
245 | 淫贱 100
246 | 淫叫 100
247 | 淫教师 100
248 | 阴茎 100
249 | 阴精 100
250 | 淫浪 100
251 | 淫媚 100
252 | 淫糜 100
253 | 淫魔 100
254 | 淫母 100
255 | 淫女 100
256 | 淫虐 100
257 | 淫妻 100
258 | 淫情 100
259 | 淫色 100
260 | 淫声浪语 100
261 | 淫兽学园 100
262 | 淫书 100
263 | 淫术炼金士 100
264 | 淫水 100
265 | 淫娃 100
266 | 淫威 100
267 | 淫亵 100
268 | 淫样 100
269 | 淫液 100
270 | 淫照 100
271 | 阴b 100
272 | 应召 100
273 | 幼交 100
274 | 欲火 100
275 | 欲女 100
276 | 玉乳 100
277 | 玉穴 100
278 | 援交 100
279 | 原味内衣 100
280 | 援助交际 100
281 | 招鸡 100
282 | 招妓 100
283 | 抓胸 100
284 | 自慰 100
285 | 作爱 100
286 | a片 100
287 | fuck 100
288 | gay片 100
289 | g点 100
290 | h动画 100
291 | h动漫 100
292 | 失身粉 100
293 | 淫荡自慰器 100
294 | 你大爷 100
295 | 他妈的 100
296 | 你妈的 100
297 | 你他妈 100
298 | 傻逼 100
299 | 狗逼 100
300 | 草逼 100
301 | 妈逼 100
302 | 骚逼 100
303 | 操你 100
304 | 麻痹 100
305 | 滚犊子 100
306 | 草你妈 100
307 | 傻屌 100
308 | 你妈 100
309 | 滚逼 100
310 | 妹逼 100
311 | 狗逼 100
312 | 狗比 100
313 | 我操 100
314 | 我草 100
315 | nmsl 100
316 | wrnm 100
317 | wcnm 100
318 |
--------------------------------------------------------------------------------
/awesome/plugins/bullshit/.gitignore:
--------------------------------------------------------------------------------
1 | __pycache__
--------------------------------------------------------------------------------
/awesome/plugins/bullshit/__init__.py:
--------------------------------------------------------------------------------
1 | from awesome.plugins.bullshit.generator import 狗屁不通
2 | from nonebot import on_command, CommandSession
3 |
4 |
5 | @on_command('bullshit', aliases=('狗屁不通', '狗屁不通生成器'), only_to_me=False)
6 | async def bullshit(session: CommandSession):
7 | theme = session.get('theme', prompt='你想得到什么主题的内容呢?')
8 | bullshit_send = await get_bullshit(theme)
9 | await session.send(bullshit_send)
10 |
11 |
12 | @bullshit.args_parser
13 | async def _(session: CommandSession):
14 | user_id = session.event.user_id
15 | stripped_arg = session.current_arg_text.strip()
16 | if session.is_first_run:
17 | if stripped_arg:
18 | session.state['theme'] = stripped_arg
19 | return
20 | if not stripped_arg:
21 | session.pause('主题不能为空呢,请重新输入')
22 | session.state[session.current_key] = stripped_arg
23 |
24 |
25 | async def get_bullshit(theme):
26 | return ' ' + 狗屁不通(theme)
27 |
--------------------------------------------------------------------------------
/awesome/plugins/bullshit/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "学生会退会",
3 | "famous": [
4 | "爱迪生a,天才是百分之一的勤奋加百分之九十九的汗水。b",
5 | "查尔斯·史a,一个人几乎可以在任何他怀有无限热忱的事情上成功。b",
6 | "培根说过,深窥自己的心,而后发觉一切的奇迹在你自己。b",
7 | "歌德曾经a,流水在碰到底处时才会释放活力。b",
8 | "莎士比亚a,那脑袋里的智慧,就像打火石里的火花一样,不去打它是不肯出来的。b",
9 | "戴尔·卡耐基a,多数人都拥有自己不了解的能力和机会,都有可能做到未曾梦想的事情。b",
10 | "白哲特a,坚强的信念能赢得强者的心,并使他们变得更坚强。b",
11 | "伏尔泰a, 不经巨大的困难,不会有伟大的事业。b",
12 | "富勒曾经a, 苦难磨炼一些人,也毁灭另一些人。b",
13 | "文森特·皮尔a, 改变你的想法,你就改变了自己的世界。b",
14 | "拿破仑·希尔a, 不要等待,时机永远不会恰到好处。b",
15 | "塞涅卡a, 生命如同寓言,其价值不在与长短,而在与内容。b",
16 | "奥普拉·温弗瑞a, 你相信什么,你就成为什么样的人。b",
17 | "吕凯特a, 生命不可能有两次,但许多人连一次也不善于度过。b",
18 | "莎士比亚a, 人的一生是短的,但如果卑劣地过这一生,就太长了。b",
19 | "笛卡儿a, 我的努力求学没有得到别的好处,只不过是愈来愈发觉自己的无知。b",
20 | "左拉a, 生活的道路一旦选定,就要勇敢地走到底,决不回头。b",
21 | "米歇潘a, 生命是一条艰险的峡谷,只有勇敢的人才能通过。b",
22 | "吉姆·罗恩a, 要么你主宰生活,要么你被生活主宰。b",
23 | "日本谚语a, 不幸可能成为通向幸福的桥梁。b",
24 | "海贝尔a, 人生就是学校。在那里,与其说好的教师是幸福,不如说好的教师是不幸。b",
25 | "杰纳勒尔·乔治·S·巴顿a, 接受挑战,就可以享受胜利的喜悦。b",
26 | "德谟克利特a, 节制使快乐增加并使享受加强。b",
27 | "裴斯泰洛齐a, 今天应做的事没有做,明天再早也是耽误了。b",
28 | "歌德a, 决定一个人的一生,以及整个命运的,只是一瞬之间。b",
29 | "卡耐基a, 一个不注意小事情的人,永远不会成就大事业。b",
30 | "卢梭a, 浪费时间是一桩大罪过。b",
31 | "康德a, 既然我已经踏上这条道路,那么,任何东西都不应妨碍我沿着这条路走下去。b",
32 | "克劳斯·莫瑟爵士a, 教育需要花费钱,而无知也是一样。b",
33 | "伏尔泰a, 坚持意志伟大的事业需要始终不渝的精神。b",
34 | "亚伯拉罕·林肯a, 你活了多少岁不算什么,重要的是你是如何度过这些岁月的。b",
35 | "韩非a, 内外相应,言行相称。b",
36 | "富兰克林a, 你热爱生命吗?那么别浪费时间,因为时间是组成生命的材料。b",
37 | "马尔顿a, 坚强的信心,能使平凡的人做出惊人的事业。b",
38 | "笛卡儿a, 读一切好书,就是和许多高尚的人谈话。b",
39 | "塞涅卡a, 真正的人生,只有在经过艰难卓绝的斗争之后才能实现。b",
40 | "易卜生a, 伟大的事业,需要决心,能力,组织和责任感。b",
41 | "歌德a, 没有人事先了解自己到底有多大的力量,直到他试过以后才知道。b",
42 | "达尔文a, 敢于浪费哪怕一个钟头时间的人,说明他还不懂得珍惜生命的全部价值。b",
43 | "佚名a, 感激每一个新的挑战,因为它会锻造你的意志和品格。b",
44 | "奥斯特洛夫斯基a, 共同的事业,共同的斗争,可以使人们产生忍受一切的力量。 b",
45 | "苏轼a, 古之立大事者,不惟有超世之才,亦必有坚忍不拔之志。b",
46 | "王阳明a, 故立志者,为学之心也;为学者,立志之事也。b",
47 | "歌德a, 读一本好书,就如同和一个高尚的人在交谈。b",
48 | "乌申斯基a, 学习是劳动,是充满思想的劳动。b",
49 | "别林斯基a, 好的书籍是最贵重的珍宝。b",
50 | "富兰克林a, 读书是易事,思索是难事,但两者缺一,便全无用处。b",
51 | "鲁巴金a, 读书是在别人思想的帮助下,建立起自己的思想。b",
52 | "培根a, 合理安排时间,就等于节约时间。b",
53 | "屠格涅夫a, 你想成为幸福的人吗?但愿你首先学会吃得起苦。b",
54 | "莎士比亚a, 抛弃时间的人,时间也抛弃他。b",
55 | "叔本华a, 普通人只想到如何度过时间,有才能的人设法利用时间。b",
56 | "博a, 一次失败,只是证明我们成功的决心还够坚强。 维b",
57 | "拉罗什夫科a, 取得成就时坚持不懈,要比遭到失败时顽强不屈更重要。b",
58 | "莎士比亚a, 人的一生是短的,但如果卑劣地过这一生,就太长了。b",
59 | "俾斯麦a, 失败是坚忍的最后考验。b",
60 | "池田大作a, 不要回避苦恼和困难,挺起身来向它挑战,进而克服它。b",
61 | "莎士比亚a, 那脑袋里的智慧,就像打火石里的火花一样,不去打它是不肯出来的。b",
62 | "希腊a, 最困难的事情就是认识自己。b",
63 | "黑塞a, 有勇气承担命运这才是英雄好汉。b",
64 | "非洲a, 最灵繁的人也看不见自己的背脊。b",
65 | "培根a, 阅读使人充实,会谈使人敏捷,写作使人精确。b",
66 | "斯宾诺莎a, 最大的骄傲于最大的自卑都表示心灵的最软弱无力。b",
67 | "西班牙a, 自知之明是最难得的知识。b",
68 | "塞内加a, 勇气通往天堂,怯懦通往地狱。b",
69 | "赫尔普斯a, 有时候读书是一种巧妙地避开思考的方法。b",
70 | "笛卡儿a, 阅读一切好书如同和过去最杰出的人谈话。b",
71 | "邓拓a, 越是没有本领的就越加自命不凡。b",
72 | "爱尔兰a, 越是无能的人,越喜欢挑剔别人的错儿。b",
73 | "老子a, 知人者智,自知者明。胜人者有力,自胜者强。b",
74 | "歌德a, 意志坚强的人能把世界放在手中像泥块一样任意揉捏。b",
75 | "迈克尔·F·斯特利a, 最具挑战性的挑战莫过于提升自我。b",
76 | "爱迪生a, 失败也是我需要的,它和成功对我一样有价值。b",
77 | "罗素·贝克a, 一个人即使已登上顶峰,也仍要自强不息。b",
78 | "马云a, 最大的挑战和突破在于用人,而用人最大的突破在于信任人。b",
79 | "雷锋a, 自己活着,就是为了使别人过得更美好。b",
80 | "布尔沃a, 要掌握书,莫被书掌握;要为生而读,莫为读而生。b",
81 | "培根a, 要知道对好事的称颂过于夸大,也会招来人们的反感轻蔑和嫉妒。b",
82 | "莫扎特a, 谁和我一样用功,谁就会和我一样成功。b",
83 | "马克思a, 一切节省,归根到底都归结为时间的节省。b",
84 | "莎士比亚a, 意志命运往往背道而驰,决心到最后会全部推倒。b",
85 | "卡莱尔a, 过去一切时代的精华尽在书中。b",
86 | "培根a, 深窥自己的心,而后发觉一切的奇迹在你自己。b",
87 | "罗曼·罗兰a, 只有把抱怨环境的心情,化为上进的力量,才是成功的保证。b",
88 | "孔子a, 知之者不如好之者,好之者不如乐之者。b",
89 | "达·芬奇a, 大胆和坚定的决心能够抵得上武器的精良。b",
90 | "叔本华a, 意志是一个强壮的盲人,倚靠在明眼的跛子肩上。b",
91 | "黑格尔a, 只有永远躺在泥坑里的人,才不会再掉进坑里。b",
92 | "普列姆昌德a, 希望的灯一旦熄灭,生活刹那间变成了一片黑暗。b",
93 | "维龙a, 要成功不需要什么特别的才能,只要把你能做的小事做得好就行了。b",
94 | "郭沫若a, 形成天才的决定因素应该是勤奋。b",
95 | "洛克a, 学到很多东西的诀窍,就是一下子不要学很多。b",
96 | "西班牙a, 自己的鞋子,自己知道紧在哪里。b",
97 | "拉罗什福科a, 我们唯一不会改正的缺点是软弱。b",
98 | "亚伯拉罕·林肯a, 我这个人走得很慢,但是我从不后退。b",
99 | "美华纳a, 勿问成功的秘诀为何,且尽全力做你应该做的事吧。b",
100 | "俾斯麦a, 对于不屈不挠的人来说,没有失败这回事。b",
101 | "阿卜·日·法拉兹a, 学问是异常珍贵的东西,从任何源泉吸收都不可耻。b",
102 | "白哲特a, 坚强的信念能赢得强者的心,并使他们变得更坚强。 b",
103 | "查尔斯·史考伯a, 一个人几乎可以在任何他怀有无限热忱的事情上成功。 b",
104 | "贝多芬a, 卓越的人一大优点是:在不利与艰难的遭遇里百折不饶。b",
105 | "莎士比亚a, 本来无望的事,大胆尝试,往往能成功。b",
106 | "卡耐基a, 我们若已接受最坏的,就再没有什么损失。b",
107 | "德国a, 只有在人群中间,才能认识自己。b",
108 | "史美尔斯a, 书籍把我们引入最美好的社会,使我们认识各个时代的伟大智者。b",
109 | "冯学峰a, 当一个人用工作去迎接光明,光明很快就会来照耀着他。b",
110 | "吉格·金克拉a, 如果你能做梦,你就能实现它。b"
111 | ],
112 | "bosh": [
113 | "现在, 解决x的问题, 是非常非常重要的. 所以, ",
114 | "我们不得不面对一个非常尴尬的事实, 那就是, ",
115 | "x的发生, 到底需要如何做到, 不x的发生, 又会如何产生. ",
116 | "而这些并不是完全重要, 更加重要的问题是, ",
117 | "x, 到底应该如何实现. ",
118 | "带着这些问题, 我们来审视一下x. ",
119 | "所谓x, 关键是x需要如何写. ",
120 | "我们一般认为, 抓住了问题的关键, 其他一切则会迎刃而解.",
121 | "问题的关键究竟为何? ",
122 | "x因何而发生?",
123 | "每个人都不得不面对这些问题. 在面对这种问题时, ",
124 | "一般来讲, 我们都必须务必慎重的考虑考虑. ",
125 | "要想清楚, x, 到底是一种怎么样的存在. ",
126 | "了解清楚x到底是一种怎么样的存在, 是解决一切问题的关键.",
127 | "就我个人来说, x对我的意义, 不能不说非常重大. ",
128 | "本人也是经过了深思熟虑,在每个日日夜夜思考这个问题. ",
129 | "x, 发生了会如何, 不发生又会如何. ",
130 | "在这种困难的抉择下, 本人思来想去, 寝食难安.",
131 | "生活中, 若x出现了, 我们就不得不考虑它出现了的事实. ",
132 | "这种事实对本人来说意义重大, 相信对这个世界也是有一定意义的.",
133 | "我们都知道, 只要有意义, 那么就必须慎重考虑.",
134 | "既然如此, ",
135 | "那么, ",
136 | "我认为, ",
137 | "一般来说, ",
138 | "总结的来说, ",
139 | "既然如何, ",
140 | "经过上述讨论, ",
141 | "这样看来, ",
142 | "从这个角度来看, ",
143 | "我们不妨可以这样来想: ",
144 | "这是不可避免的. ",
145 | "可是,即使是这样,x的出现仍然代表了一定的意义. ",
146 | "x似乎是一种巧合,但如果我们从一个更大的角度看待问题,这似乎是一种不可避免的事实. ",
147 | "在这种不可避免的冲突下,我们必须解决这个问题. ",
148 | "对我个人而言,x不仅仅是一个重大的事件,还可能会改变我的人生. "
149 | ],
150 | "after": [
151 | "这不禁令我深思. ",
152 | "带着这句话, 我们还要更加慎重的审视这个问题: ",
153 | "这启发了我. ",
154 | "我希望诸位也能好好地体会这句话. ",
155 | "这句话语虽然很短, 但令我浮想联翩. ",
156 | "这句话看似简单,但其中的阴郁不禁让人深思. ",
157 | "这句话把我们带到了一个新的维度去思考这个问题: ",
158 | "这似乎解答了我的疑惑. "
159 | ],
160 | "before": [
161 | "曾经说过",
162 | "在不经意间这样说过",
163 | "说过一句著名的话",
164 | "曾经提到过",
165 | "说过一句富有哲理的话"
166 | ]
167 | }
--------------------------------------------------------------------------------
/awesome/plugins/bullshit/generator.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | # -*- coding: UTF-8 -*-
3 |
4 | import random
5 |
6 | from awesome.plugins.bullshit import readJSON
7 |
8 | data = readJSON.读JSON文件("awesome/plugins/bullshit/data.json")
9 | 名人名言 = data["famous"] # a 代表前面垫话,b代表后面垫话
10 | 前面垫话 = data["before"] # 在名人名言前面弄点废话
11 | 后面垫话 = data['after'] # 在名人名言后面弄点废话
12 | 废话 = data['bosh'] # 代表文章主要废话来源
13 |
14 | xx = "学生会退会"
15 |
16 | 重复度 = 2
17 |
18 |
19 | def 洗牌遍历(列表):
20 | global 重复度
21 | 池 = list(列表) * 重复度
22 | while True:
23 | random.shuffle(池)
24 | for 元素 in 池:
25 | yield 元素
26 |
27 |
28 | 下一句废话 = 洗牌遍历(废话)
29 | 下一句名人名言 = 洗牌遍历(名人名言)
30 |
31 |
32 | def 来点名人名言():
33 | global 下一句名人名言
34 | xx = next(下一句名人名言)
35 | xx = xx.replace("a", random.choice(前面垫话))
36 | xx = xx.replace("b", random.choice(后面垫话))
37 | return xx
38 |
39 |
40 | def 另起一段():
41 | xx = ". "
42 | xx += "\r\n"
43 | xx += " "
44 | return xx
45 |
46 |
47 | def 狗屁不通(theme):
48 | tmp = str()
49 | while (len(tmp) < 500):
50 | 分支 = random.randint(0, 100)
51 | if 分支 < 5:
52 | tmp += 另起一段()
53 | elif 分支 < 20:
54 | tmp += 来点名人名言()
55 | else:
56 | tmp += next(下一句废话)
57 | tmp = tmp.replace("x", theme)
58 | return tmp
59 |
--------------------------------------------------------------------------------
/awesome/plugins/bullshit/readJSON.js:
--------------------------------------------------------------------------------
1 | /*
2 | * @Author: Admin
3 | * @Date: 2019-11-01 16:52:52
4 | * @Last Modified by: jingyuexing
5 | * @Last Modified time: 2019-11-01 17:36:11
6 | */
7 |
8 | const fs = require("fs")
9 |
10 | function 读JSON文件(fileName = '') {
11 | var strList = fileName.split(".");
12 | var string;
13 | if (strList[strList.length - 1].toLowerCase() == "json") {
14 | string = fs.readFileSync(fileName);
15 | }
16 | return JSON.parse(string.toString())
17 |
18 | }
19 |
20 | module.exports = {
21 | 读JSON文件: 读JSON文件
22 | }
--------------------------------------------------------------------------------
/awesome/plugins/bullshit/readJSON.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # @Author: Admin
3 | # @Date: 2019-11-01 16:52:34
4 | # @Last Modified by: Admin
5 | # @Last Modified time: 2019-11-01 18:18:14
6 | def 读JSON文件(fileName=""):
7 | import json
8 | if fileName != '':
9 | strList = fileName.split(".")
10 | if strList[len(strList) - 1].lower() == "json":
11 | with open(fileName, mode='r', encoding="utf-8") as file:
12 | return json.loads(file.read())
13 |
--------------------------------------------------------------------------------
/awesome/plugins/chat.py:
--------------------------------------------------------------------------------
1 | from aiocqhttp.message import escape
2 | from nonebot import on_command, CommandSession
3 | from nonebot import on_natural_language, NLPSession, IntentCommand
4 | from nonebot.helpers import render_expression
5 |
6 | from awesome.utils.ai import AI
7 |
8 | EXPR_DONT_UNDERSTAND = (
9 | '我现在还不太明白你在说什么呢,但没关系,以后的我会变得更强呢!',
10 | '我有点看不懂你的意思呀,可以跟我聊些简单的话题嘛',
11 | '其实我不太明白你的意思……',
12 | '抱歉哦,我现在的能力还不能够明白你在说什么,但我会加油的~',
13 | '唔……等会再告诉你'
14 | )
15 |
16 |
17 | @on_command('chat')
18 | async def chat(session: CommandSession):
19 | message = session.state.get('message')
20 | if message.strip() == '':
21 | return
22 | reply = await AI.text_request(text=message)
23 | if reply:
24 | await session.send(escape(reply), at_sender=True)
25 | else:
26 | await session.send(render_expression(EXPR_DONT_UNDERSTAND), at_sender=True)
27 |
28 |
29 | @on_natural_language
30 | async def _(session: NLPSession):
31 | return IntentCommand(80.0, 'chat', args={'message': session.msg_text})
32 |
--------------------------------------------------------------------------------
/awesome/plugins/daily.py:
--------------------------------------------------------------------------------
1 | import requests
2 | from nonebot import on_command, CommandSession
3 |
4 |
5 | @on_command('daily', aliases=('每日一句'), only_to_me=False)
6 | async def daily(session: CommandSession):
7 | daily_send = await get_daily()
8 | await session.send(daily_send[0])
9 | await session.send(daily_send[1])
10 |
11 |
12 | async def get_daily():
13 | url = 'http://open.iciba.com/dsapi/'
14 | res = requests.get(url)
15 | content_e = res.json()['content']
16 | content_c = res.json()['note']
17 | return [content_c, content_e]
18 |
--------------------------------------------------------------------------------
/awesome/plugins/hitokoto.py:
--------------------------------------------------------------------------------
1 | import requests
2 | from nonebot import on_command, CommandSession
3 |
4 |
5 | @on_command('hitokoto', aliases=('一言'), only_to_me=False)
6 | async def hitokoto(session: CommandSession):
7 | hitokoto_send = await get_hitokoto()
8 | await session.send(hitokoto_send, at_sender=True)
9 |
10 |
11 | async def get_hitokoto():
12 | url = 'https://v1.hitokoto.cn'
13 | res = requests.get(url)
14 | info_content = res.json()['hitokoto']
15 | info_from = res.json()['from']
16 | return info_content + ' —— ' + info_from
17 |
--------------------------------------------------------------------------------
/awesome/plugins/img_filter.py:
--------------------------------------------------------------------------------
1 | from nonebot import on_command, CommandSession
2 |
3 |
4 | @on_command('img_filter')
5 | async def img_filter(session: CommandSession):
6 | user_id = session.args.get('user_id')
7 | type = session.args.get('type')
8 | await session.send('[CQ:at,qq=' + str(user_id) + '] 图片违规: ' + type)
9 |
--------------------------------------------------------------------------------
/awesome/plugins/joke.py:
--------------------------------------------------------------------------------
1 | import requests
2 | from nonebot import on_command, CommandSession
3 |
4 |
5 | @on_command('joke', aliases=('笑话', '讲个笑话', '来个笑话'), only_to_me=False)
6 | async def joke(session: CommandSession):
7 | joke_send = await get_joke()
8 | await session.send(joke_send, at_sender=True)
9 |
10 |
11 | async def get_joke():
12 | url = 'https://www.mxnzp.com/api/jokes/list/random'
13 | header = {'app_id': 'lbeqhqhnhgo22otp', 'app_secret': 'OFpUMnhWOEhoVWNkM3dOaVV2dnhQQT09'}
14 | res = requests.get(url, headers=header)
15 | print(res)
16 | return res.json()['data'][0]['content']
17 |
--------------------------------------------------------------------------------
/awesome/plugins/lovelive.py:
--------------------------------------------------------------------------------
1 | import requests
2 | from nonebot import on_command, CommandSession
3 |
4 |
5 | @on_command('lovelive', aliases=('土味情话'), only_to_me=False)
6 | async def lovelive(session: CommandSession):
7 | lovelive_send = await get_lovelive()
8 | await session.send(lovelive_send, at_sender=True)
9 |
10 |
11 | async def get_lovelive():
12 | url = 'https://api.lovelive.tools/api/SweetNothings'
13 | return requests.get(url).text
14 |
--------------------------------------------------------------------------------
/awesome/plugins/pastebin.py:
--------------------------------------------------------------------------------
1 | import json
2 | import requests
3 | from nonebot import on_command, CommandSession
4 |
5 |
6 | @on_command('pastebin', aliases=('贴代码', '粘贴代码', '剪切板'), only_to_me=False)
7 | async def pastebin(session: CommandSession):
8 | lang = session.get('lang', prompt='你想粘贴什么语言的代码呢?')
9 | code = session.get('code', prompt='你想粘贴什么代码呢?')
10 | paste_send = await paste(code, lang)
11 | if not paste_send:
12 | paste_send = '服务暂不可用'
13 | await session.send(paste_send, at_sender=True)
14 |
15 |
16 | @pastebin.args_parser
17 | async def _(session: CommandSession):
18 | if session.current_key == 'lang':
19 | stripped_arg = session.current_arg_text.strip()
20 | if session.is_first_run:
21 | if stripped_arg:
22 | session.state['lang'] = stripped_arg
23 | return
24 | if not stripped_arg:
25 | session.pause('要粘贴的代码语言不能为空呢,请重新输入')
26 | elif not stripped_arg in ['plain', 'cpp', 'java', 'python', 'bash', 'markdown', 'json', 'go']:
27 | session.pause('目前只支持 plain, cpp, java, python, bash, markdown, json, go 哦,请重新输入')
28 | session.state['lang'] = stripped_arg
29 | if session.current_key == 'code':
30 | stripped_arg = session.current_arg_text.strip()
31 | if session.is_first_run:
32 | if stripped_arg:
33 | session.state['code'] = stripped_arg
34 | return
35 | if not stripped_arg:
36 | session.pause('要粘贴的代码不能为空呢,请重新输入')
37 | session.state['code'] = stripped_arg
38 |
39 |
40 | async def paste(code, lang):
41 | url1 = 'https://api.pasteme.cn/'
42 | url2 = 'https://pasteme.cn/'
43 | params = {'lang': lang, 'content': code}
44 | r = requests.post(url1, json=params)
45 | status = r.json().get('status')
46 | return url2 + str(r.json().get('key')) if status == 201 else None
47 |
--------------------------------------------------------------------------------
/awesome/plugins/repeater.py:
--------------------------------------------------------------------------------
1 | import asyncio
2 |
3 | from nonebot import on_command, CommandSession
4 | from nonebot.command import call_command
5 |
6 |
7 | @on_command('repeater')
8 | async def repeater(session: CommandSession):
9 | try:
10 | delay = float(session.state.get('delay', 1))
11 | except ValueError:
12 | delay = 1
13 | delay = min(delay, 10)
14 | delay = max(delay, 0.1)
15 | await asyncio.sleep(delay)
16 | await call_command(session.bot, session.ctx, 'echo',
17 | current_arg=session.current_arg,
18 | args=session.state)
19 |
--------------------------------------------------------------------------------
/awesome/plugins/text_filter.py:
--------------------------------------------------------------------------------
1 | from nonebot import on_command, CommandSession
2 |
3 |
4 | @on_command('text_filter')
5 | async def text_filter(session: CommandSession):
6 | user_id = session.current_arg
7 | await session.send('[CQ:at,qq=' + user_id + '] 言语违规')
8 |
--------------------------------------------------------------------------------
/awesome/plugins/translate.py:
--------------------------------------------------------------------------------
1 | import time
2 |
3 | import requests
4 | from nonebot import on_command, CommandSession
5 |
6 |
7 | @on_command('translate', aliases=('翻译', '翻译一下'), only_to_me=False)
8 | async def translate(session: CommandSession):
9 | user_id = session.event.user_id
10 | origin_text = session.get('text', prompt='你想翻译什么内容呢?')
11 | translate_send = await get_translation(origin_text)
12 | await session.send(translate_send, at_sender=True)
13 |
14 |
15 | @translate.args_parser
16 | async def _(session: CommandSession):
17 | stripped_arg = session.current_arg_text.strip()
18 | if session.is_first_run:
19 | if stripped_arg:
20 | session.state['text'] = stripped_arg
21 | return
22 | if not stripped_arg:
23 | session.pause('要翻译的文本不能为空呢,请重新输入')
24 | session.state[session.current_key] = stripped_arg
25 |
26 |
27 | async def get_translation(source_text):
28 | url1 = 'https://www.mxnzp.com/api/convert/translate?content='
29 | source_lan = 'auto'
30 | target_lan = 'en'
31 | url2 = source_text + '&from=' + source_lan + '&to=' + target_lan
32 | url3 = '&app_id=lbeqhqhnhgo22otp&app_secret=OFpUMnhWOEhoVWNkM3dOaVV2dnhQQT09'
33 | res = requests.get(url1 + url2 + url3)
34 | time.sleep(0.8)
35 | source_lan = res.json()['data']['originLanguage']
36 | if source_lan == 'zh':
37 | target_lan = 'en'
38 | else:
39 | target_lan = 'zh'
40 | url2 = source_text + '&from=' + source_lan + '&to=' + target_lan
41 | res = requests.get(url1 + url2 + url3)
42 | return res.json()['data']['result']
43 |
--------------------------------------------------------------------------------
/awesome/plugins/weather.py:
--------------------------------------------------------------------------------
1 | from jieba import posseg
2 | from nonebot import on_command, CommandSession
3 | from nonebot import on_natural_language, NLPSession, IntentCommand
4 | import http.client
5 | import json
6 | import urllib
7 |
8 | import requests
9 | from bs4 import BeautifulSoup
10 |
11 |
12 | @on_command('weather', aliases=('天气', '天气预报', '查天气'))
13 | async def weather(session: CommandSession):
14 | city = session.get('city', prompt='你想查询哪个城市的天气呢?')
15 | weather_report = await get_weather(city)
16 | await session.send(weather_report, at_sender=True)
17 |
18 |
19 | @weather.args_parser
20 | async def _(session: CommandSession):
21 | stripped_arg = session.current_arg_text.strip()
22 | if session.is_first_run:
23 | if stripped_arg:
24 | session.state['city'] = stripped_arg
25 | return
26 | if not stripped_arg:
27 | session.pause('要查询的城市名称不能为空呢,请重新输入')
28 | session.state[session.current_key] = stripped_arg
29 |
30 |
31 | @on_natural_language(keywords={'天气'}, only_to_me=False)
32 | async def _(session: NLPSession):
33 | stripped_msg = session.msg_text.strip()
34 | words = posseg.lcut(stripped_msg)
35 | city = None
36 | for word in words:
37 | if word.flag == 'ns':
38 | city = word.word
39 | break
40 | return IntentCommand(70.0, 'weather', current_arg=city or '')
41 |
42 |
43 | async def get_weather(city_name):
44 | city_code = get_city_code(city_name)
45 | weather_info = get_info(city_code)
46 | if weather_info:
47 | res = city_name + '的天气预报如下\n'
48 | for each in weather_info:
49 | res += '\n' + each[0] + ' ' + each[1] + ' '
50 | if each[2]:
51 | res += each[2] + '/'
52 | res += each[3]
53 | return res
54 | else:
55 | return '查询失败'
56 |
57 |
58 | def get_info(city_code):
59 | try:
60 | url = 'http://www.weather.com.cn/weather/' + city_code + '.shtml'
61 | r = requests.get(url)
62 | r.encoding = 'utf-8'
63 | soup = BeautifulSoup(r.text, 'html.parser')
64 | div = soup.find('div', {'id': '7d'})
65 | li = div.find('ul').find_all('li')
66 | week_info = []
67 | for each in li:
68 | day_info = []
69 | day_info.append(each.find('h1').string)
70 | p = each.find_all('p')
71 | day_info.append(p[0].string)
72 | if p[1].find('span') is None:
73 | temp_high = None
74 | else:
75 | temp_high = p[1].find('span').string
76 | temp_low = p[1].find('i').string
77 | day_info.append(temp_high)
78 | day_info.append(temp_low)
79 | week_info.append(day_info)
80 | return week_info
81 | except:
82 | return None
83 |
84 |
85 | def get_city_code(city_name):
86 | try:
87 | parameter = urllib.parse.urlencode({'cityname': city_name})
88 | conn = http.client.HTTPConnection('toy1.weather.com.cn', 80, timeout=5)
89 | conn.request('GET', '/search?' + parameter)
90 | r = conn.getresponse()
91 | data = r.read().decode()[1: -1]
92 | json_data = json.loads(data)
93 | code = json_data[0]['ref'].split('~')[0]
94 | return code
95 | except:
96 | return None
97 |
--------------------------------------------------------------------------------
/awesome/plugins/zhihu.py:
--------------------------------------------------------------------------------
1 | import aiohttp
2 | from nonebot import on_command, CommandSession
3 |
4 |
5 | @on_command('zhihu', aliases=('知乎', '知乎日报'), only_to_me=False)
6 | async def news(session: CommandSession):
7 | STORY_URL_FORMAT = 'https://daily.zhihu.com/story/{}'
8 | async with aiohttp.request('GET', 'https://news-at.zhihu.com/api/4/news/latest', headers={
9 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36'}) as resp:
10 | data = await resp.json()
11 | stories = data.get('stories')
12 | if not stories:
13 | await session.send('暂时没有数据,或者服务无法访问')
14 | return
15 | reply = ''
16 | for story in stories:
17 | url = STORY_URL_FORMAT.format(story['id'])
18 | title = story.get('title', '未知内容')
19 | reply += f'\n{title}\n{url}\n'
20 | await session.send(reply.strip())
21 |
--------------------------------------------------------------------------------
/awesome/utils/ac.py:
--------------------------------------------------------------------------------
1 | import ahocorasick
2 |
3 |
4 | class AC:
5 | patterns = []
6 | trie = None
7 |
8 | @classmethod
9 | def build(cls):
10 | with open('awesome/data/patterns.txt', 'r', encoding='utf-8') as f:
11 | while True:
12 | pattern = f.readline()
13 | if not pattern:
14 | break
15 | cls.patterns.append(pattern.strip('\n'))
16 |
17 | cls.trie = ahocorasick.Automaton()
18 | for index, word in enumerate(cls.patterns):
19 | cls.trie.add_word(word, (index, word))
20 | cls.trie.make_automaton()
21 |
--------------------------------------------------------------------------------
/awesome/utils/ai.py:
--------------------------------------------------------------------------------
1 | import hashlib
2 | import string
3 | import time
4 | from random import randint
5 | from urllib.parse import urlencode
6 |
7 | import requests
8 | import httpx
9 | import nonebot
10 |
11 |
12 | class AI(object):
13 | url_textchat = 'https://api.ai.qq.com/fcgi-bin/nlp/nlp_textchat'
14 | url_img_porn = 'https://api.ai.qq.com/fcgi-bin/vision/vision_porn'
15 | url_img_terrorism = 'https://api.ai.qq.com/fcgi-bin/image/image_terrorism'
16 | app_id = nonebot.get_bot().config.APP_ID
17 | app_key = nonebot.get_bot().config.APP_KEY
18 | nonce_str_example = 'fa577ce340859f9fe'
19 | ct = lambda: time.time()
20 |
21 | @classmethod
22 | def get_nonce_str(self):
23 | nonce_str = ''
24 | len_str = string.digits + string.ascii_letters
25 | for i in range(len(self.nonce_str_example)):
26 | nonce_str += len_str[randint(0, len(len_str) - 1)]
27 | return nonce_str
28 |
29 | @classmethod
30 | def sign(self, req_data):
31 | new_list = sorted(req_data.items())
32 | encode_list = urlencode(new_list)
33 | req_data = encode_list + "&" + "app_key" + "=" + self.app_key
34 | md5 = hashlib.md5()
35 | md5.update(req_data.encode('utf-8'))
36 | data = md5.hexdigest()
37 | return data.upper()
38 |
39 | @classmethod
40 | async def text_request(self, text):
41 | req_data = {
42 | 'app_id': self.app_id,
43 | 'time_stamp': int(self.ct()),
44 | 'nonce_str': self.get_nonce_str(),
45 | 'session': 10000,
46 | 'question': text,
47 | }
48 | req_data['sign'] = self.sign(req_data)
49 | req_data = sorted(req_data.items())
50 | requests = httpx.AsyncClient()
51 | result = await requests.get(self.url_textchat, params=req_data)
52 | await requests.aclose()
53 | result = result.json()
54 | print(result)
55 | if result['ret'] == 0:
56 | return result['data']['answer']
57 | return None
58 |
59 | @classmethod
60 | async def img_request(self, img):
61 | req_data = {
62 | 'app_id': self.app_id,
63 | 'time_stamp': int(self.ct()),
64 | 'nonce_str': self.get_nonce_str(),
65 | 'image': img,
66 | }
67 | req_data['sign'] = self.sign(req_data)
68 | req_data = sorted(req_data.items())
69 | result = requests.post(self.url_img_porn, data=req_data).json()
70 | print(result)
71 | if result['ret'] == 0:
72 | for tag in result['data']['tag_list']:
73 | if tag.get('tag_name') == 'porn' and tag.get('tag_confidence') > 83:
74 | return 1
75 | result = requests.post(self.url_img_terrorism, data=req_data).json()
76 | print(result)
77 | tag_list = ['terrorists', 'knife', 'guns', 'blood', 'fire']
78 | if result['ret'] == 0:
79 | for tag in result['data']['tag_list']:
80 | if tag.get('tag_name') in tag_list and tag.get('tag_confidence') >= 83:
81 | return 2
82 | return 0
83 |
--------------------------------------------------------------------------------
/awesome/utils/bayes.py:
--------------------------------------------------------------------------------
1 | from numpy import *
2 | import numpy as np
3 | import re
4 | import sklearn
5 | from sklearn.metrics import recall_score
6 | from sklearn.metrics import precision_score
7 | from sklearn.metrics import classification_report
8 | from sklearn.metrics import accuracy_score
9 | from nltk.corpus import stopwords as pw
10 | import nltk
11 | import jieba
12 |
13 |
14 | class Bayes:
15 | vocabList = None
16 | p0V, p1V, pSpam = None, None, None
17 |
18 | @classmethod
19 | def textParse(self, bigString):
20 | seg_list = jieba.cut(bigString, cut_all=False)
21 | return [tok for tok in seg_list if len(tok) >= 2]
22 |
23 | @classmethod
24 | def stopwordslist(self):
25 | stopwords = [line.strip() for line in open(
26 | 'awesome/data/baidu_stopwords.txt', encoding='utf-8').readlines()]
27 | return stopwords
28 |
29 | @classmethod
30 | def createVocabList(self, dataSet):
31 | vocabSet = set([])
32 | vocabs = []
33 | for document in dataSet:
34 | vocabSet = vocabSet | set(document)
35 | cacheStopWords = self.stopwordslist()
36 | for vocab in list(vocabSet):
37 | if vocab not in cacheStopWords and not vocab.isdigit():
38 | vocabs.append(vocab)
39 | return list(vocabs)
40 |
41 | @classmethod
42 | def bagOfWords2VecMN(self, vocabList, inputSet):
43 | returnVec = [0] * len(vocabList)
44 | for word in inputSet:
45 | if word in vocabList:
46 | returnVec[vocabList.index(word)] = 1
47 | return returnVec
48 |
49 | @classmethod
50 | def trainNB(self, trainMatrix, trainCategory):
51 | numTrainDocs = len(trainMatrix)
52 | numWords = len(trainMatrix[0])
53 | pSpam = 0.5
54 | p0Num = ones(numWords)
55 | p1Num = ones(numWords)
56 | p0Denom = 2.0
57 | p1Denom = 2.0
58 | for i in range(numTrainDocs):
59 | if trainCategory[i] == 1:
60 | p1Num += trainMatrix[i]
61 | p1Denom += sum(trainMatrix[i])
62 | else:
63 | p0Num += trainMatrix[i]
64 | p0Denom += sum(trainMatrix[i])
65 | p1Vect = log(p1Num / p1Denom)
66 | p0Vect = log(p0Num / p0Denom)
67 | return p0Vect, p1Vect, pSpam
68 |
69 | @classmethod
70 | def classifyNB(self, vec2Classify, p0Vec, p1Vec, pClass1):
71 | p1 = sum(vec2Classify * p1Vec) + log(pClass1)
72 | p0 = sum(vec2Classify * p0Vec) + log(1 - pClass1)
73 | if pow(10, p1) / (pow(10, p1) + pow(10, p0)) > 0.5:
74 | return 1
75 | else:
76 | return 0
77 | @classmethod
78 | def build(self):
79 | dataPath = r'awesome/data/dataset.txt'
80 | jieba.load_userdict(
81 | 'awesome/data/words.txt')
82 | with open(dataPath, encoding='utf-8') as f:
83 | txt_list = f.readlines()
84 | data, classVec, spam_data = [], [], []
85 | for txt in txt_list:
86 | txt_list_2 = txt.strip('\n').split('\t')
87 | if txt_list_2[0] == '0':
88 | data.append(txt_list_2[-1])
89 | classVec.append(0)
90 | elif txt_list_2[0] == '1':
91 | data.append(txt_list_2[-1])
92 | classVec.append(1)
93 | spam_data.append(txt_list_2[-1])
94 |
95 | data_parse, spam_parse, trainMat, trainClasses, trainSet = [], [], [], [], []
96 | for t in data:
97 | data_parse.append(self.textParse(t))
98 | for t in spam_data:
99 | spam_parse.append(self.textParse(t))
100 | self.vocabList = self.createVocabList(spam_parse)
101 | trainSet_ini = np.array((range(4000)))
102 | randIndex = 0
103 | trainSet.append(trainSet_ini[:2000])
104 | for docIndex in trainSet[0]:
105 | trainMat.append(self.bagOfWords2VecMN(
106 | self.vocabList, data_parse[docIndex]))
107 | trainClasses.append(classVec[docIndex])
108 | self.p0V, self.p1V, self.pSpam = self.trainNB(
109 | array(trainMat), array(trainClasses))
110 |
111 | @classmethod
112 | def check(self, sentence):
113 | wordVector = self.bagOfWords2VecMN(
114 | self.vocabList, self.textParse(sentence))
115 | return self.classifyNB(array(wordVector), self.p0V, self.p1V, self.pSpam) == 1 and len(sentence) >= 2
--------------------------------------------------------------------------------
/bot.py:
--------------------------------------------------------------------------------
1 | from os import path
2 |
3 | import config
4 | import nonebot
5 |
6 | if __name__ == '__main__':
7 | nonebot.init(config)
8 | nonebot.load_builtin_plugins()
9 | nonebot.load_plugins(
10 | path.join(path.dirname(__file__), 'awesome', 'plugins'),
11 | 'awesome.plugins'
12 | )
13 | nonebot.run()
14 |
--------------------------------------------------------------------------------
/config.py.sample:
--------------------------------------------------------------------------------
1 | from nonebot.default_config import *
2 |
3 | HOST = '127.0.0.1'
4 | PORT = 8080
5 | SUPERUSERS = {}
6 | NICKNAME = {'', '', ''}
7 | COMMAND_START = {'', '/', '$'}
8 | API_ROOT = 'http://127.0.0.1:5700'
9 | APP_ID = ''
10 | APP_KEY = ''
11 | IMG_DIR = r''
12 | BAYES = False
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | wheel
2 | nltk
3 | nonebot
4 | jieba
5 | aiohttp
6 | aiocqhttp
7 | requests
8 | numpy
9 | pyahocorasick
10 | httpx
11 | beautifulsoup4
12 | pillow
13 | scikit_learn
14 |
--------------------------------------------------------------------------------