mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b7a7eeecd3 | ||
![]() |
d66d42cb5d |
354
LICENSE
354
LICENSE
@@ -1,339 +1,25 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
MIT Without Public Social Media Promotion License
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
Copyright (c) 2024 LLOneBot
|
||||
|
||||
Preamble
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
You may use this software in accordance with the above terms, but you are not
|
||||
allowed to promote this project or your projects based on this project on any
|
||||
public social media.
|
||||
|
343
NapCatQQ-LICENSE
343
NapCatQQ-LICENSE
@@ -1,343 +0,0 @@
|
||||
GNU GENERAL PUBLIC Without Social media promotion LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
d)You may use this software in accordance with the above terms,
|
||||
but you are not allowed to promote this project or your projects
|
||||
based on this project on any public social media.
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
@@ -23,13 +23,9 @@ TG 群:<https://t.me/+nLZEnpne-pQ1OWFl>
|
||||
|
||||
[](https://starchart.cc/LLOneBot/LLOneBot)
|
||||
|
||||
## 贡献者
|
||||
|
||||
[](https://github.com/LOneBot/LLOneBot/graphs/contributors)
|
||||
|
||||
## 鸣谢
|
||||
|
||||
- [NapCatQQ](https://github.com/NapNeko/NapCatQQ),依照开源协议参考了其部分代码
|
||||
- [NapCatQQ](https://github.com/NapNeko/NapCatQQ)
|
||||
- [LiteLoaderQQNT](https://liteloaderqqnt.github.io/guide/install.html)
|
||||
- [Chronocat](https://github.com/chrononeko/chronocat)
|
||||
- [koishi-plugin-adapter-onebot](https://github.com/koishijs/koishi-plugin-adapter-onebot)
|
||||
|
@@ -39,7 +39,7 @@ const config: ElectronViteConfig = {
|
||||
...external.map(genCpModule),
|
||||
{ src: './manifest.json', dest: 'dist' },
|
||||
{ src: './icon.webp', dest: 'dist' },
|
||||
// { src: './src/ntqqapi/native/napcat-protocol-packet/Moehoo/*', dest: 'dist/main/Moehoo' },
|
||||
{ src: './src/ntqqapi/native/napcat-protocol-packet/Moehoo/*', dest: 'dist/main/Moehoo' },
|
||||
],
|
||||
}),
|
||||
],
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"name": "LLOneBot",
|
||||
"slug": "LLOneBot",
|
||||
"description": "实现 OneBot 11 和 Satori 协议,用于 QQ 机器人开发",
|
||||
"version": "4.4.0",
|
||||
"version": "4.3.2",
|
||||
"icon": "./icon.webp",
|
||||
"authors": [
|
||||
{
|
||||
|
@@ -12,7 +12,7 @@
|
||||
"deploy-win": "cmd /c \"xcopy /C /S /Y dist\\* %LITELOADERQQNT_PROFILE%\\plugins\\LLOneBot\\\"",
|
||||
"format": "prettier -cw .",
|
||||
"check": "tsc",
|
||||
"compile:proto": "pbjs --no-create --no-convert --no-delimited --no-verify -t static-module -w es6 -p src/ntqqapi/proto -o src/ntqqapi/proto/compiled.js profileLikeTip.proto groupNotify.proto message.proto richMedia.proto && pbts -o src/ntqqapi/proto/compiled.d.ts src/ntqqapi/proto/compiled.js"
|
||||
"compile:proto": "pbjs --no-create --no-convert --no-delimited --no-verify -t static-module -w es6 -p src/ntqqapi/proto -o src/ntqqapi/proto/compiled.js profileLikeTip.proto groupNotify.proto message.proto richMedia.proto oidb.proto && pbts -o src/ntqqapi/proto/compiled.d.ts src/ntqqapi/proto/compiled.js"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
@@ -42,7 +42,7 @@
|
||||
"electron-vite": "^2.3.0",
|
||||
"protobufjs-cli": "^1.1.3",
|
||||
"typescript": "^5.6.3",
|
||||
"vite": "^5.4.10",
|
||||
"vite": "^5.4.11",
|
||||
"vite-plugin-cp": "^4.0.8"
|
||||
},
|
||||
"packageManager": "yarn@4.5.1"
|
||||
|
@@ -17,6 +17,11 @@ export function getBuildVersion(): number {
|
||||
return +globalThis.LiteLoader.package.qqnt.buildVersion
|
||||
}
|
||||
|
||||
/** QQ Full Version */
|
||||
export function getFullVersion(): string {
|
||||
return globalThis.LiteLoader.versions.qqnt
|
||||
}
|
||||
|
||||
/** 在保证老对象已有的属性不变化的情况下将新对象的属性复制到老对象 */
|
||||
export function mergeNewProperties(newObj: Dict, oldObj: Dict) {
|
||||
Object.keys(newObj).forEach((key) => {
|
||||
|
@@ -284,4 +284,8 @@ export class NTQQMsgApi extends Service {
|
||||
async fetchUnitedCommendConfig(groups: string[]) {
|
||||
return await invoke('nodeIKernelUnitedConfigService/fetchUnitedCommendConfig', [{ groups }])
|
||||
}
|
||||
|
||||
async sendSsoCmdReqByContend(ssoCmd: string, content: string) {
|
||||
return await invoke('nodeIKernelMsgService/sendSsoCmdReqByContend', [{ ssoCmd, content }])
|
||||
}
|
||||
}
|
||||
|
@@ -20,6 +20,7 @@ import { selfInfo } from '../common/globalVars'
|
||||
import { version } from '../version'
|
||||
import { invoke } from './ntcall'
|
||||
import { Native } from './native/crychic'
|
||||
import { initWrapperSession, NTQQPacketApi } from './native/napcat-protocol-packet'
|
||||
|
||||
declare module 'cordis' {
|
||||
interface Context {
|
||||
@@ -40,10 +41,14 @@ class Core extends Service {
|
||||
static inject = ['ntMsgApi', 'ntFriendApi', 'ntGroupApi', 'store']
|
||||
public startTime = 0
|
||||
public native
|
||||
public packet!: NTQQPacketApi
|
||||
|
||||
constructor(protected ctx: Context, public config: Core.Config) {
|
||||
super(ctx, 'app', true)
|
||||
this.native = new Native(ctx)
|
||||
initWrapperSession().then(session => {
|
||||
this.packet = new NTQQPacketApi(session)
|
||||
})
|
||||
}
|
||||
|
||||
public start() {
|
||||
|
86
src/ntqqapi/helper/offset.json
Normal file
86
src/ntqqapi/helper/offset.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"3.2.12-28418-x64": {
|
||||
"recv": "A0723E0",
|
||||
"send": "A06EAE0"
|
||||
},
|
||||
"9.9.15-28418-x64": {
|
||||
"recv": "37A9004",
|
||||
"send": "37A4BD0"
|
||||
},
|
||||
"6.9.56-28418-x64": {
|
||||
"send": "4471360",
|
||||
"recv": "4473BCC"
|
||||
},
|
||||
"6.9.56-28418-arm64": {
|
||||
"send": "3FBDBF8",
|
||||
"recv": "3FC0410"
|
||||
},
|
||||
"9.9.15-28498-x64": {
|
||||
"recv": "37A9004",
|
||||
"send": "37A4BD0"
|
||||
},
|
||||
"9.9.16-28788-x64": {
|
||||
"send": "38076D0",
|
||||
"recv": "380BB04"
|
||||
},
|
||||
"3.2.13-28788-x64": {
|
||||
"send": "A0CEC20",
|
||||
"recv": "A0D2520"
|
||||
},
|
||||
"3.2.13-28788-arm64": {
|
||||
"send": "6E91018",
|
||||
"recv": "6E94850"
|
||||
},
|
||||
"9.9.16-28971-x64": {
|
||||
"send": "38079F0",
|
||||
"recv": "380BE24"
|
||||
},
|
||||
"3.2.13-28971-x64": {
|
||||
"send": "A0CEF60",
|
||||
"recv": "A0D2860"
|
||||
},
|
||||
"3.2.12-28971-arm64": {
|
||||
"send": "6E91318",
|
||||
"recv": "6E94B50"
|
||||
},
|
||||
"6.9.58-28971-x64": {
|
||||
"send": "449ACA0",
|
||||
"recv": "449D50C"
|
||||
},
|
||||
"6.9.58-28971-arm64": {
|
||||
"send": "3FE0DB0",
|
||||
"recv": "3FE35C8"
|
||||
},
|
||||
"9.9.16-29271-x64": {
|
||||
"send": "3833510",
|
||||
"recv": "3837944"
|
||||
},
|
||||
"3.2.13-29271-x64": {
|
||||
"send": "A11E680",
|
||||
"recv": "A121F80"
|
||||
},
|
||||
"3.2.13-29271-arm64": {
|
||||
"send": "6ECA098",
|
||||
"recv": "6ECD8D0"
|
||||
},
|
||||
"9.9.16-29456-x64": {
|
||||
"send": "3835CD0",
|
||||
"recv": "383A104"
|
||||
},
|
||||
"3.2.13-29456-x64": {
|
||||
"send": "A11E820",
|
||||
"recv": "A122120"
|
||||
},
|
||||
"3.2.13-29456-arm64": {
|
||||
"send": "6ECA130",
|
||||
"recv": "6ECD968"
|
||||
},
|
||||
"6.9.59-29456-x64": {
|
||||
"send": "44C57A0",
|
||||
"recv": "44C800C"
|
||||
},
|
||||
"6.9.59-29456-arm64": {
|
||||
"send": "4005FE8",
|
||||
"recv": "4008800"
|
||||
}
|
||||
}
|
BIN
src/ntqqapi/native/moehoo/external/MoeHoo.darwin.arm64.node
vendored
Normal file
BIN
src/ntqqapi/native/moehoo/external/MoeHoo.darwin.arm64.node
vendored
Normal file
Binary file not shown.
BIN
src/ntqqapi/native/moehoo/external/MoeHoo.linux.arm64.node
vendored
Normal file
BIN
src/ntqqapi/native/moehoo/external/MoeHoo.linux.arm64.node
vendored
Normal file
Binary file not shown.
BIN
src/ntqqapi/native/moehoo/external/MoeHoo.linux.x64.node
vendored
Normal file
BIN
src/ntqqapi/native/moehoo/external/MoeHoo.linux.x64.node
vendored
Normal file
Binary file not shown.
BIN
src/ntqqapi/native/moehoo/external/MoeHoo.win32.x64.node
vendored
Normal file
BIN
src/ntqqapi/native/moehoo/external/MoeHoo.win32.x64.node
vendored
Normal file
Binary file not shown.
138
src/ntqqapi/native/moehoo/index.ts
Normal file
138
src/ntqqapi/native/moehoo/index.ts
Normal file
@@ -0,0 +1,138 @@
|
||||
import { Context } from 'cordis'
|
||||
import { arch } from 'node:os'
|
||||
import { getFullVersion, getBuildVersion } from '@/common/utils/misc'
|
||||
import { selfInfo, TEMP_DIR } from '@/common/globalVars'
|
||||
import { Dict } from 'cosmokit'
|
||||
import { copyFile } from 'node:fs/promises'
|
||||
import { createHash } from 'node:crypto'
|
||||
import { Oidb } from '@/ntqqapi/proto/compiled'
|
||||
import path from 'node:path'
|
||||
import offset from '@/ntqqapi/helper/offset.json'
|
||||
|
||||
interface Offset {
|
||||
[key: string]: {
|
||||
recv: string
|
||||
send: string
|
||||
}
|
||||
}
|
||||
|
||||
export class Native {
|
||||
available = false
|
||||
moehoo?: Dict
|
||||
|
||||
constructor(private ctx: Context) {
|
||||
ctx.on('ready', async () => {
|
||||
this.init()
|
||||
})
|
||||
}
|
||||
|
||||
private async init() {
|
||||
const key = getFullVersion() + '-' + arch()
|
||||
const currOffset = (offset as Offset)[key]
|
||||
if (!currOffset) {
|
||||
return
|
||||
}
|
||||
const platform = process.platform + '.' + process.arch
|
||||
try {
|
||||
const fileName = 'MoeHoo.' + platform + '.node' // todo: 需要加入版本号或者hash,不然多开QQ时会导致copyFile失败从而无法进行在线更新
|
||||
const src = path.join(__dirname, 'Moehoo', fileName)
|
||||
const dest = path.join(TEMP_DIR, fileName)
|
||||
try {
|
||||
await copyFile(src, dest)
|
||||
} catch (e) {
|
||||
// resource busy or locked?
|
||||
this.ctx.logger.warn(e)
|
||||
}
|
||||
this.moehoo = require(dest)
|
||||
this.moehoo!.InitHook(currOffset.send, currOffset.recv, () => {
|
||||
})
|
||||
this.available = true
|
||||
} catch (e) {
|
||||
this.ctx.logger.warn('moehoo 加载失败', e)
|
||||
}
|
||||
}
|
||||
|
||||
private async sendPacket(cmd: string, data: string) {
|
||||
const traceId = `${Date.now()}${data}`.slice(0, data.length / 2)
|
||||
const traceIdMd5 = createHash('md5').update(traceId).digest('hex')
|
||||
this.moehoo!.SendPacket(cmd, data, traceIdMd5)
|
||||
const res = await this.ctx.ntMsgApi.sendSsoCmdReqByContend(cmd, traceId)
|
||||
if (res.result !== 0) {
|
||||
throw new Error(res.errMsg)
|
||||
}
|
||||
}
|
||||
|
||||
private check() {
|
||||
if (this.available) {
|
||||
return
|
||||
}
|
||||
const minVersion = 28418
|
||||
const maxVersion = 29456
|
||||
const currVersion = getBuildVersion()
|
||||
if (currVersion < minVersion || currVersion > maxVersion) {
|
||||
throw new Error(`当前 QQ 版本 ${getBuildVersion()} 不支持,可尝试其他版本 ${minVersion}—${maxVersion}`)
|
||||
} else {
|
||||
throw new Error('packet backend 当前不可用')
|
||||
}
|
||||
}
|
||||
|
||||
async groupPoke(groupCode: number, uin: number) {
|
||||
this.check()
|
||||
const data = Oidb.Oidb_0xED3_1.encode({
|
||||
uin,
|
||||
groupCode
|
||||
}).finish()
|
||||
const req = buildOidbRequest(0xED3, 1, data)
|
||||
await this.sendPacket(req.cmd, req.data)
|
||||
}
|
||||
|
||||
async friendPoke(uin: number) {
|
||||
this.check()
|
||||
const data = Oidb.Oidb_0xED3_1.encode({
|
||||
uin,
|
||||
friendUin: uin
|
||||
}).finish()
|
||||
const req = buildOidbRequest(0xED3, 1, data)
|
||||
await this.sendPacket(req.cmd, req.data)
|
||||
}
|
||||
|
||||
async groupSign(groupCode: string) {
|
||||
this.check()
|
||||
const data = Oidb.Oidb_0xEB7_1.encode({
|
||||
body: {
|
||||
uin: selfInfo.uin,
|
||||
groupCode
|
||||
}
|
||||
}).finish()
|
||||
const req = buildOidbRequest(0xEB7, 1, data)
|
||||
await this.sendPacket(req.cmd, req.data)
|
||||
}
|
||||
|
||||
async setGroupSpecialTitle(groupCode: number, uid: string, title: string) {
|
||||
this.check()
|
||||
const data = Oidb.Oidb_0X8FC_2.encode({
|
||||
groupCode,
|
||||
body: {
|
||||
targetUid: uid,
|
||||
specialTitle: title,
|
||||
expiredTime: -1,
|
||||
uinName: title
|
||||
}
|
||||
}).finish()
|
||||
const req = buildOidbRequest(0X8FC, 2, data, false)
|
||||
await this.sendPacket(req.cmd, req.data)
|
||||
}
|
||||
}
|
||||
|
||||
function buildOidbRequest(cmd: number, subCmd: number, body: Uint8Array, reserved = true) {
|
||||
const data = Oidb.Base.encode({
|
||||
command: cmd,
|
||||
subCommand: subCmd,
|
||||
body,
|
||||
isReserved: reserved ? 1 : 0
|
||||
}).finish()
|
||||
return {
|
||||
cmd: `OidbSvcTrpcTcp.0x${cmd.toString(16).toUpperCase()}_${subCmd}`,
|
||||
data: Buffer.from(data).toString('hex')
|
||||
}
|
||||
}
|
35
src/ntqqapi/native/moehoo/version.ts
Normal file
35
src/ntqqapi/native/moehoo/version.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import os from 'os'
|
||||
import offset from '@/ntqqapi/helper/offset.json'
|
||||
import { getFullVersion } from '@/common/utils'
|
||||
|
||||
function getSupportVersions() {
|
||||
let fullVersionStart: string = ''
|
||||
switch (os.platform()) {
|
||||
case 'linux':
|
||||
fullVersionStart = '3'
|
||||
break
|
||||
case 'darwin':
|
||||
fullVersionStart = '6'
|
||||
break
|
||||
case 'win32':
|
||||
fullVersionStart = '9'
|
||||
break
|
||||
}
|
||||
const supportVersions: string[] = []
|
||||
for (const offsetKey in offset) {
|
||||
if (offsetKey.startsWith(fullVersionStart) && offsetKey.endsWith(os.arch())) {
|
||||
supportVersions.push(offsetKey)
|
||||
}
|
||||
}
|
||||
return supportVersions
|
||||
}
|
||||
|
||||
export function checkSupportVersion(){
|
||||
// 检查当前 QQ 版本是否支持,不支持则抛出异常
|
||||
const qqFullVersion = getFullVersion() // todo: 去除llqqnt依赖
|
||||
const _ = offset[qqFullVersion + '-' + os.arch()]
|
||||
if (!_) {
|
||||
const supportVersion = getSupportVersions()
|
||||
throw new Error('当前 QQ 版本不支持, 只支持: ' + supportVersion.join(', '))
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17
src/ntqqapi/native/napcat-protocol-packet/index.d.ts
vendored
Normal file
17
src/ntqqapi/native/napcat-protocol-packet/index.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { WrapperSession } from './wrapper-session/types';
|
||||
export { initWrapperSession } from './wrapper-session';
|
||||
export declare function checkSupportVersion(): void;
|
||||
export declare class NTQQPacketApi {
|
||||
private qqVersion;
|
||||
private readonly packetClient;
|
||||
private readonly packer;
|
||||
private logger;
|
||||
private readonly wrapperSession;
|
||||
constructor(wrapperSession: WrapperSession);
|
||||
private InitSendPacket;
|
||||
private sendPacket;
|
||||
private sendOidbPacket;
|
||||
sendPokePacket(peer: number, group?: number): Promise<void>;
|
||||
sendGroupSignPacket(selfUin: string, groupCode: string): Promise<void>;
|
||||
sendSetSpecialTittlePacket(groupCode: string, uid: string, tittle: string): Promise<void>;
|
||||
}
|
3067
src/ntqqapi/native/napcat-protocol-packet/index.mjs
Normal file
3067
src/ntqqapi/native/napcat-protocol-packet/index.mjs
Normal file
File diff suppressed because one or more lines are too long
1
src/ntqqapi/native/napcat-protocol-packet/wrapper-session/index.d.ts
vendored
Normal file
1
src/ntqqapi/native/napcat-protocol-packet/wrapper-session/index.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function initWrapperSession(): Promise<any>;
|
6
src/ntqqapi/native/napcat-protocol-packet/wrapper-session/types.d.ts
vendored
Normal file
6
src/ntqqapi/native/napcat-protocol-packet/wrapper-session/types.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export interface MsgService {
|
||||
sendSsoCmdReqByContend: (cmd: string, trace_id: string) => Promise<unknown>;
|
||||
}
|
||||
export type WrapperSession = {
|
||||
getMsgService(): MsgService;
|
||||
};
|
364
src/ntqqapi/proto/compiled.d.ts
vendored
364
src/ntqqapi/proto/compiled.d.ts
vendored
@@ -2186,3 +2186,367 @@ export namespace RichMedia {
|
||||
public static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
}
|
||||
}
|
||||
|
||||
/** Namespace Oidb. */
|
||||
export namespace Oidb {
|
||||
|
||||
/** Properties of a Base. */
|
||||
interface IBase {
|
||||
|
||||
/** Base command */
|
||||
command?: (number|null);
|
||||
|
||||
/** Base subCommand */
|
||||
subCommand?: (number|null);
|
||||
|
||||
/** Base errorCode */
|
||||
errorCode?: (number|null);
|
||||
|
||||
/** Base body */
|
||||
body?: (Uint8Array|null);
|
||||
|
||||
/** Base errorMsg */
|
||||
errorMsg?: (string|null);
|
||||
|
||||
/** Base isReserved */
|
||||
isReserved?: (number|null);
|
||||
}
|
||||
|
||||
/** Represents a Base. */
|
||||
class Base implements IBase {
|
||||
|
||||
/**
|
||||
* Constructs a new Base.
|
||||
* @param [properties] Properties to set
|
||||
*/
|
||||
constructor(properties?: Oidb.IBase);
|
||||
|
||||
/** Base command. */
|
||||
public command: number;
|
||||
|
||||
/** Base subCommand. */
|
||||
public subCommand: number;
|
||||
|
||||
/** Base errorCode. */
|
||||
public errorCode: number;
|
||||
|
||||
/** Base body. */
|
||||
public body: Uint8Array;
|
||||
|
||||
/** Base errorMsg. */
|
||||
public errorMsg?: (string|null);
|
||||
|
||||
/** Base isReserved. */
|
||||
public isReserved: number;
|
||||
|
||||
/**
|
||||
* Encodes the specified Base message. Does not implicitly {@link Oidb.Base.verify|verify} messages.
|
||||
* @param message Base message or plain object to encode
|
||||
* @param [writer] Writer to encode to
|
||||
* @returns Writer
|
||||
*/
|
||||
public static encode(message: Oidb.IBase, writer?: $protobuf.Writer): $protobuf.Writer;
|
||||
|
||||
/**
|
||||
* Decodes a Base message from the specified reader or buffer.
|
||||
* @param reader Reader or buffer to decode from
|
||||
* @param [length] Message length if known beforehand
|
||||
* @returns Base
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Oidb.Base;
|
||||
|
||||
/**
|
||||
* Gets the default type url for Base
|
||||
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
||||
* @returns The default type url
|
||||
*/
|
||||
public static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
}
|
||||
|
||||
/** Properties of an Oidb_0xED3_1. */
|
||||
interface IOidb_0xED3_1 {
|
||||
|
||||
/** Oidb_0xED3_1 uin */
|
||||
uin?: (number|null);
|
||||
|
||||
/** Oidb_0xED3_1 groupCode */
|
||||
groupCode?: (number|null);
|
||||
|
||||
/** Oidb_0xED3_1 friendUin */
|
||||
friendUin?: (number|null);
|
||||
|
||||
/** Oidb_0xED3_1 ext */
|
||||
ext?: (number|null);
|
||||
}
|
||||
|
||||
/** Represents an Oidb_0xED3_1. */
|
||||
class Oidb_0xED3_1 implements IOidb_0xED3_1 {
|
||||
|
||||
/**
|
||||
* Constructs a new Oidb_0xED3_1.
|
||||
* @param [properties] Properties to set
|
||||
*/
|
||||
constructor(properties?: Oidb.IOidb_0xED3_1);
|
||||
|
||||
/** Oidb_0xED3_1 uin. */
|
||||
public uin: number;
|
||||
|
||||
/** Oidb_0xED3_1 groupCode. */
|
||||
public groupCode: number;
|
||||
|
||||
/** Oidb_0xED3_1 friendUin. */
|
||||
public friendUin: number;
|
||||
|
||||
/** Oidb_0xED3_1 ext. */
|
||||
public ext?: (number|null);
|
||||
|
||||
/**
|
||||
* Encodes the specified Oidb_0xED3_1 message. Does not implicitly {@link Oidb.Oidb_0xED3_1.verify|verify} messages.
|
||||
* @param message Oidb_0xED3_1 message or plain object to encode
|
||||
* @param [writer] Writer to encode to
|
||||
* @returns Writer
|
||||
*/
|
||||
public static encode(message: Oidb.IOidb_0xED3_1, writer?: $protobuf.Writer): $protobuf.Writer;
|
||||
|
||||
/**
|
||||
* Decodes an Oidb_0xED3_1 message from the specified reader or buffer.
|
||||
* @param reader Reader or buffer to decode from
|
||||
* @param [length] Message length if known beforehand
|
||||
* @returns Oidb_0xED3_1
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Oidb.Oidb_0xED3_1;
|
||||
|
||||
/**
|
||||
* Gets the default type url for Oidb_0xED3_1
|
||||
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
||||
* @returns The default type url
|
||||
*/
|
||||
public static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
}
|
||||
|
||||
/** Properties of an Oidb_0xEB7_1. */
|
||||
interface IOidb_0xEB7_1 {
|
||||
|
||||
/** Oidb_0xEB7_1 body */
|
||||
body?: (Oidb.IOidb_0xEB7_1_Body|null);
|
||||
}
|
||||
|
||||
/** Represents an Oidb_0xEB7_1. */
|
||||
class Oidb_0xEB7_1 implements IOidb_0xEB7_1 {
|
||||
|
||||
/**
|
||||
* Constructs a new Oidb_0xEB7_1.
|
||||
* @param [properties] Properties to set
|
||||
*/
|
||||
constructor(properties?: Oidb.IOidb_0xEB7_1);
|
||||
|
||||
/** Oidb_0xEB7_1 body. */
|
||||
public body?: (Oidb.IOidb_0xEB7_1_Body|null);
|
||||
|
||||
/**
|
||||
* Encodes the specified Oidb_0xEB7_1 message. Does not implicitly {@link Oidb.Oidb_0xEB7_1.verify|verify} messages.
|
||||
* @param message Oidb_0xEB7_1 message or plain object to encode
|
||||
* @param [writer] Writer to encode to
|
||||
* @returns Writer
|
||||
*/
|
||||
public static encode(message: Oidb.IOidb_0xEB7_1, writer?: $protobuf.Writer): $protobuf.Writer;
|
||||
|
||||
/**
|
||||
* Decodes an Oidb_0xEB7_1 message from the specified reader or buffer.
|
||||
* @param reader Reader or buffer to decode from
|
||||
* @param [length] Message length if known beforehand
|
||||
* @returns Oidb_0xEB7_1
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Oidb.Oidb_0xEB7_1;
|
||||
|
||||
/**
|
||||
* Gets the default type url for Oidb_0xEB7_1
|
||||
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
||||
* @returns The default type url
|
||||
*/
|
||||
public static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
}
|
||||
|
||||
/** Properties of an Oidb_0xEB7_1_Body. */
|
||||
interface IOidb_0xEB7_1_Body {
|
||||
|
||||
/** Oidb_0xEB7_1_Body uin */
|
||||
uin?: (string|null);
|
||||
|
||||
/** Oidb_0xEB7_1_Body groupCode */
|
||||
groupCode?: (string|null);
|
||||
|
||||
/** Oidb_0xEB7_1_Body version */
|
||||
version?: (string|null);
|
||||
}
|
||||
|
||||
/** Represents an Oidb_0xEB7_1_Body. */
|
||||
class Oidb_0xEB7_1_Body implements IOidb_0xEB7_1_Body {
|
||||
|
||||
/**
|
||||
* Constructs a new Oidb_0xEB7_1_Body.
|
||||
* @param [properties] Properties to set
|
||||
*/
|
||||
constructor(properties?: Oidb.IOidb_0xEB7_1_Body);
|
||||
|
||||
/** Oidb_0xEB7_1_Body uin. */
|
||||
public uin: string;
|
||||
|
||||
/** Oidb_0xEB7_1_Body groupCode. */
|
||||
public groupCode: string;
|
||||
|
||||
/** Oidb_0xEB7_1_Body version. */
|
||||
public version: string;
|
||||
|
||||
/**
|
||||
* Encodes the specified Oidb_0xEB7_1_Body message. Does not implicitly {@link Oidb.Oidb_0xEB7_1_Body.verify|verify} messages.
|
||||
* @param message Oidb_0xEB7_1_Body message or plain object to encode
|
||||
* @param [writer] Writer to encode to
|
||||
* @returns Writer
|
||||
*/
|
||||
public static encode(message: Oidb.IOidb_0xEB7_1_Body, writer?: $protobuf.Writer): $protobuf.Writer;
|
||||
|
||||
/**
|
||||
* Decodes an Oidb_0xEB7_1_Body message from the specified reader or buffer.
|
||||
* @param reader Reader or buffer to decode from
|
||||
* @param [length] Message length if known beforehand
|
||||
* @returns Oidb_0xEB7_1_Body
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Oidb.Oidb_0xEB7_1_Body;
|
||||
|
||||
/**
|
||||
* Gets the default type url for Oidb_0xEB7_1_Body
|
||||
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
||||
* @returns The default type url
|
||||
*/
|
||||
public static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
}
|
||||
|
||||
/** Properties of an Oidb_0X8FC_2. */
|
||||
interface IOidb_0X8FC_2 {
|
||||
|
||||
/** Oidb_0X8FC_2 groupCode */
|
||||
groupCode?: (number|null);
|
||||
|
||||
/** Oidb_0X8FC_2 body */
|
||||
body?: (Oidb.IOidb_0X8FC_2_Body|null);
|
||||
}
|
||||
|
||||
/** Represents an Oidb_0X8FC_2. */
|
||||
class Oidb_0X8FC_2 implements IOidb_0X8FC_2 {
|
||||
|
||||
/**
|
||||
* Constructs a new Oidb_0X8FC_2.
|
||||
* @param [properties] Properties to set
|
||||
*/
|
||||
constructor(properties?: Oidb.IOidb_0X8FC_2);
|
||||
|
||||
/** Oidb_0X8FC_2 groupCode. */
|
||||
public groupCode: number;
|
||||
|
||||
/** Oidb_0X8FC_2 body. */
|
||||
public body?: (Oidb.IOidb_0X8FC_2_Body|null);
|
||||
|
||||
/**
|
||||
* Encodes the specified Oidb_0X8FC_2 message. Does not implicitly {@link Oidb.Oidb_0X8FC_2.verify|verify} messages.
|
||||
* @param message Oidb_0X8FC_2 message or plain object to encode
|
||||
* @param [writer] Writer to encode to
|
||||
* @returns Writer
|
||||
*/
|
||||
public static encode(message: Oidb.IOidb_0X8FC_2, writer?: $protobuf.Writer): $protobuf.Writer;
|
||||
|
||||
/**
|
||||
* Decodes an Oidb_0X8FC_2 message from the specified reader or buffer.
|
||||
* @param reader Reader or buffer to decode from
|
||||
* @param [length] Message length if known beforehand
|
||||
* @returns Oidb_0X8FC_2
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Oidb.Oidb_0X8FC_2;
|
||||
|
||||
/**
|
||||
* Gets the default type url for Oidb_0X8FC_2
|
||||
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
||||
* @returns The default type url
|
||||
*/
|
||||
public static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
}
|
||||
|
||||
/** Properties of an Oidb_0X8FC_2_Body. */
|
||||
interface IOidb_0X8FC_2_Body {
|
||||
|
||||
/** Oidb_0X8FC_2_Body targetUid */
|
||||
targetUid?: (string|null);
|
||||
|
||||
/** Oidb_0X8FC_2_Body specialTitle */
|
||||
specialTitle?: (string|null);
|
||||
|
||||
/** Oidb_0X8FC_2_Body expiredTime */
|
||||
expiredTime?: (number|null);
|
||||
|
||||
/** Oidb_0X8FC_2_Body uinName */
|
||||
uinName?: (string|null);
|
||||
|
||||
/** Oidb_0X8FC_2_Body targetName */
|
||||
targetName?: (string|null);
|
||||
}
|
||||
|
||||
/** Represents an Oidb_0X8FC_2_Body. */
|
||||
class Oidb_0X8FC_2_Body implements IOidb_0X8FC_2_Body {
|
||||
|
||||
/**
|
||||
* Constructs a new Oidb_0X8FC_2_Body.
|
||||
* @param [properties] Properties to set
|
||||
*/
|
||||
constructor(properties?: Oidb.IOidb_0X8FC_2_Body);
|
||||
|
||||
/** Oidb_0X8FC_2_Body targetUid. */
|
||||
public targetUid: string;
|
||||
|
||||
/** Oidb_0X8FC_2_Body specialTitle. */
|
||||
public specialTitle: string;
|
||||
|
||||
/** Oidb_0X8FC_2_Body expiredTime. */
|
||||
public expiredTime: number;
|
||||
|
||||
/** Oidb_0X8FC_2_Body uinName. */
|
||||
public uinName: string;
|
||||
|
||||
/** Oidb_0X8FC_2_Body targetName. */
|
||||
public targetName: string;
|
||||
|
||||
/**
|
||||
* Encodes the specified Oidb_0X8FC_2_Body message. Does not implicitly {@link Oidb.Oidb_0X8FC_2_Body.verify|verify} messages.
|
||||
* @param message Oidb_0X8FC_2_Body message or plain object to encode
|
||||
* @param [writer] Writer to encode to
|
||||
* @returns Writer
|
||||
*/
|
||||
public static encode(message: Oidb.IOidb_0X8FC_2_Body, writer?: $protobuf.Writer): $protobuf.Writer;
|
||||
|
||||
/**
|
||||
* Decodes an Oidb_0X8FC_2_Body message from the specified reader or buffer.
|
||||
* @param reader Reader or buffer to decode from
|
||||
* @param [length] Message length if known beforehand
|
||||
* @returns Oidb_0X8FC_2_Body
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Oidb.Oidb_0X8FC_2_Body;
|
||||
|
||||
/**
|
||||
* Gets the default type url for Oidb_0X8FC_2_Body
|
||||
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
||||
* @returns The default type url
|
||||
*/
|
||||
public static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
}
|
||||
}
|
||||
|
@@ -5421,4 +5421,841 @@ export const RichMedia = $root.RichMedia = (() => {
|
||||
return RichMedia;
|
||||
})();
|
||||
|
||||
export const Oidb = $root.Oidb = (() => {
|
||||
|
||||
/**
|
||||
* Namespace Oidb.
|
||||
* @exports Oidb
|
||||
* @namespace
|
||||
*/
|
||||
const Oidb = {};
|
||||
|
||||
Oidb.Base = (function() {
|
||||
|
||||
/**
|
||||
* Properties of a Base.
|
||||
* @memberof Oidb
|
||||
* @interface IBase
|
||||
* @property {number|null} [command] Base command
|
||||
* @property {number|null} [subCommand] Base subCommand
|
||||
* @property {number|null} [errorCode] Base errorCode
|
||||
* @property {Uint8Array|null} [body] Base body
|
||||
* @property {string|null} [errorMsg] Base errorMsg
|
||||
* @property {number|null} [isReserved] Base isReserved
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new Base.
|
||||
* @memberof Oidb
|
||||
* @classdesc Represents a Base.
|
||||
* @implements IBase
|
||||
* @constructor
|
||||
* @param {Oidb.IBase=} [properties] Properties to set
|
||||
*/
|
||||
function Base(properties) {
|
||||
if (properties)
|
||||
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
||||
if (properties[keys[i]] != null)
|
||||
this[keys[i]] = properties[keys[i]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Base command.
|
||||
* @member {number} command
|
||||
* @memberof Oidb.Base
|
||||
* @instance
|
||||
*/
|
||||
Base.prototype.command = 0;
|
||||
|
||||
/**
|
||||
* Base subCommand.
|
||||
* @member {number} subCommand
|
||||
* @memberof Oidb.Base
|
||||
* @instance
|
||||
*/
|
||||
Base.prototype.subCommand = 0;
|
||||
|
||||
/**
|
||||
* Base errorCode.
|
||||
* @member {number} errorCode
|
||||
* @memberof Oidb.Base
|
||||
* @instance
|
||||
*/
|
||||
Base.prototype.errorCode = 0;
|
||||
|
||||
/**
|
||||
* Base body.
|
||||
* @member {Uint8Array} body
|
||||
* @memberof Oidb.Base
|
||||
* @instance
|
||||
*/
|
||||
Base.prototype.body = $util.newBuffer([]);
|
||||
|
||||
/**
|
||||
* Base errorMsg.
|
||||
* @member {string|null|undefined} errorMsg
|
||||
* @memberof Oidb.Base
|
||||
* @instance
|
||||
*/
|
||||
Base.prototype.errorMsg = null;
|
||||
|
||||
/**
|
||||
* Base isReserved.
|
||||
* @member {number} isReserved
|
||||
* @memberof Oidb.Base
|
||||
* @instance
|
||||
*/
|
||||
Base.prototype.isReserved = 0;
|
||||
|
||||
// OneOf field names bound to virtual getters and setters
|
||||
let $oneOfFields;
|
||||
|
||||
// Virtual OneOf for proto3 optional field
|
||||
Object.defineProperty(Base.prototype, "_errorMsg", {
|
||||
get: $util.oneOfGetter($oneOfFields = ["errorMsg"]),
|
||||
set: $util.oneOfSetter($oneOfFields)
|
||||
});
|
||||
|
||||
/**
|
||||
* Encodes the specified Base message. Does not implicitly {@link Oidb.Base.verify|verify} messages.
|
||||
* @function encode
|
||||
* @memberof Oidb.Base
|
||||
* @static
|
||||
* @param {Oidb.IBase} message Base message or plain object to encode
|
||||
* @param {$protobuf.Writer} [writer] Writer to encode to
|
||||
* @returns {$protobuf.Writer} Writer
|
||||
*/
|
||||
Base.encode = function encode(message, writer) {
|
||||
if (!writer)
|
||||
writer = $Writer.create();
|
||||
if (message.command != null && Object.hasOwnProperty.call(message, "command"))
|
||||
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.command);
|
||||
if (message.subCommand != null && Object.hasOwnProperty.call(message, "subCommand"))
|
||||
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.subCommand);
|
||||
if (message.errorCode != null && Object.hasOwnProperty.call(message, "errorCode"))
|
||||
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.errorCode);
|
||||
if (message.body != null && Object.hasOwnProperty.call(message, "body"))
|
||||
writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.body);
|
||||
if (message.errorMsg != null && Object.hasOwnProperty.call(message, "errorMsg"))
|
||||
writer.uint32(/* id 5, wireType 2 =*/42).string(message.errorMsg);
|
||||
if (message.isReserved != null && Object.hasOwnProperty.call(message, "isReserved"))
|
||||
writer.uint32(/* id 12, wireType 0 =*/96).uint32(message.isReserved);
|
||||
return writer;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes a Base message from the specified reader or buffer.
|
||||
* @function decode
|
||||
* @memberof Oidb.Base
|
||||
* @static
|
||||
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
||||
* @param {number} [length] Message length if known beforehand
|
||||
* @returns {Oidb.Base} Base
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
Base.decode = function decode(reader, length) {
|
||||
if (!(reader instanceof $Reader))
|
||||
reader = $Reader.create(reader);
|
||||
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Oidb.Base();
|
||||
while (reader.pos < end) {
|
||||
let tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
message.command = reader.uint32();
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
message.subCommand = reader.uint32();
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
message.errorCode = reader.uint32();
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
message.body = reader.bytes();
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
message.errorMsg = reader.string();
|
||||
break;
|
||||
}
|
||||
case 12: {
|
||||
message.isReserved = reader.uint32();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the default type url for Base
|
||||
* @function getTypeUrl
|
||||
* @memberof Oidb.Base
|
||||
* @static
|
||||
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
||||
* @returns {string} The default type url
|
||||
*/
|
||||
Base.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
||||
if (typeUrlPrefix === undefined) {
|
||||
typeUrlPrefix = "type.googleapis.com";
|
||||
}
|
||||
return typeUrlPrefix + "/Oidb.Base";
|
||||
};
|
||||
|
||||
return Base;
|
||||
})();
|
||||
|
||||
Oidb.Oidb_0xED3_1 = (function() {
|
||||
|
||||
/**
|
||||
* Properties of an Oidb_0xED3_1.
|
||||
* @memberof Oidb
|
||||
* @interface IOidb_0xED3_1
|
||||
* @property {number|null} [uin] Oidb_0xED3_1 uin
|
||||
* @property {number|null} [groupCode] Oidb_0xED3_1 groupCode
|
||||
* @property {number|null} [friendUin] Oidb_0xED3_1 friendUin
|
||||
* @property {number|null} [ext] Oidb_0xED3_1 ext
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new Oidb_0xED3_1.
|
||||
* @memberof Oidb
|
||||
* @classdesc Represents an Oidb_0xED3_1.
|
||||
* @implements IOidb_0xED3_1
|
||||
* @constructor
|
||||
* @param {Oidb.IOidb_0xED3_1=} [properties] Properties to set
|
||||
*/
|
||||
function Oidb_0xED3_1(properties) {
|
||||
if (properties)
|
||||
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
||||
if (properties[keys[i]] != null)
|
||||
this[keys[i]] = properties[keys[i]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Oidb_0xED3_1 uin.
|
||||
* @member {number} uin
|
||||
* @memberof Oidb.Oidb_0xED3_1
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0xED3_1.prototype.uin = 0;
|
||||
|
||||
/**
|
||||
* Oidb_0xED3_1 groupCode.
|
||||
* @member {number} groupCode
|
||||
* @memberof Oidb.Oidb_0xED3_1
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0xED3_1.prototype.groupCode = 0;
|
||||
|
||||
/**
|
||||
* Oidb_0xED3_1 friendUin.
|
||||
* @member {number} friendUin
|
||||
* @memberof Oidb.Oidb_0xED3_1
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0xED3_1.prototype.friendUin = 0;
|
||||
|
||||
/**
|
||||
* Oidb_0xED3_1 ext.
|
||||
* @member {number|null|undefined} ext
|
||||
* @memberof Oidb.Oidb_0xED3_1
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0xED3_1.prototype.ext = null;
|
||||
|
||||
// OneOf field names bound to virtual getters and setters
|
||||
let $oneOfFields;
|
||||
|
||||
// Virtual OneOf for proto3 optional field
|
||||
Object.defineProperty(Oidb_0xED3_1.prototype, "_ext", {
|
||||
get: $util.oneOfGetter($oneOfFields = ["ext"]),
|
||||
set: $util.oneOfSetter($oneOfFields)
|
||||
});
|
||||
|
||||
/**
|
||||
* Encodes the specified Oidb_0xED3_1 message. Does not implicitly {@link Oidb.Oidb_0xED3_1.verify|verify} messages.
|
||||
* @function encode
|
||||
* @memberof Oidb.Oidb_0xED3_1
|
||||
* @static
|
||||
* @param {Oidb.IOidb_0xED3_1} message Oidb_0xED3_1 message or plain object to encode
|
||||
* @param {$protobuf.Writer} [writer] Writer to encode to
|
||||
* @returns {$protobuf.Writer} Writer
|
||||
*/
|
||||
Oidb_0xED3_1.encode = function encode(message, writer) {
|
||||
if (!writer)
|
||||
writer = $Writer.create();
|
||||
if (message.uin != null && Object.hasOwnProperty.call(message, "uin"))
|
||||
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.uin);
|
||||
if (message.groupCode != null && Object.hasOwnProperty.call(message, "groupCode"))
|
||||
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupCode);
|
||||
if (message.friendUin != null && Object.hasOwnProperty.call(message, "friendUin"))
|
||||
writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.friendUin);
|
||||
if (message.ext != null && Object.hasOwnProperty.call(message, "ext"))
|
||||
writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.ext);
|
||||
return writer;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes an Oidb_0xED3_1 message from the specified reader or buffer.
|
||||
* @function decode
|
||||
* @memberof Oidb.Oidb_0xED3_1
|
||||
* @static
|
||||
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
||||
* @param {number} [length] Message length if known beforehand
|
||||
* @returns {Oidb.Oidb_0xED3_1} Oidb_0xED3_1
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
Oidb_0xED3_1.decode = function decode(reader, length) {
|
||||
if (!(reader instanceof $Reader))
|
||||
reader = $Reader.create(reader);
|
||||
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Oidb.Oidb_0xED3_1();
|
||||
while (reader.pos < end) {
|
||||
let tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
message.uin = reader.uint32();
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
message.groupCode = reader.uint32();
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
message.friendUin = reader.uint32();
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
message.ext = reader.uint32();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the default type url for Oidb_0xED3_1
|
||||
* @function getTypeUrl
|
||||
* @memberof Oidb.Oidb_0xED3_1
|
||||
* @static
|
||||
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
||||
* @returns {string} The default type url
|
||||
*/
|
||||
Oidb_0xED3_1.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
||||
if (typeUrlPrefix === undefined) {
|
||||
typeUrlPrefix = "type.googleapis.com";
|
||||
}
|
||||
return typeUrlPrefix + "/Oidb.Oidb_0xED3_1";
|
||||
};
|
||||
|
||||
return Oidb_0xED3_1;
|
||||
})();
|
||||
|
||||
Oidb.Oidb_0xEB7_1 = (function() {
|
||||
|
||||
/**
|
||||
* Properties of an Oidb_0xEB7_1.
|
||||
* @memberof Oidb
|
||||
* @interface IOidb_0xEB7_1
|
||||
* @property {Oidb.IOidb_0xEB7_1_Body|null} [body] Oidb_0xEB7_1 body
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new Oidb_0xEB7_1.
|
||||
* @memberof Oidb
|
||||
* @classdesc Represents an Oidb_0xEB7_1.
|
||||
* @implements IOidb_0xEB7_1
|
||||
* @constructor
|
||||
* @param {Oidb.IOidb_0xEB7_1=} [properties] Properties to set
|
||||
*/
|
||||
function Oidb_0xEB7_1(properties) {
|
||||
if (properties)
|
||||
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
||||
if (properties[keys[i]] != null)
|
||||
this[keys[i]] = properties[keys[i]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Oidb_0xEB7_1 body.
|
||||
* @member {Oidb.IOidb_0xEB7_1_Body|null|undefined} body
|
||||
* @memberof Oidb.Oidb_0xEB7_1
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0xEB7_1.prototype.body = null;
|
||||
|
||||
/**
|
||||
* Encodes the specified Oidb_0xEB7_1 message. Does not implicitly {@link Oidb.Oidb_0xEB7_1.verify|verify} messages.
|
||||
* @function encode
|
||||
* @memberof Oidb.Oidb_0xEB7_1
|
||||
* @static
|
||||
* @param {Oidb.IOidb_0xEB7_1} message Oidb_0xEB7_1 message or plain object to encode
|
||||
* @param {$protobuf.Writer} [writer] Writer to encode to
|
||||
* @returns {$protobuf.Writer} Writer
|
||||
*/
|
||||
Oidb_0xEB7_1.encode = function encode(message, writer) {
|
||||
if (!writer)
|
||||
writer = $Writer.create();
|
||||
if (message.body != null && Object.hasOwnProperty.call(message, "body"))
|
||||
$root.Oidb.Oidb_0xEB7_1_Body.encode(message.body, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
||||
return writer;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes an Oidb_0xEB7_1 message from the specified reader or buffer.
|
||||
* @function decode
|
||||
* @memberof Oidb.Oidb_0xEB7_1
|
||||
* @static
|
||||
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
||||
* @param {number} [length] Message length if known beforehand
|
||||
* @returns {Oidb.Oidb_0xEB7_1} Oidb_0xEB7_1
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
Oidb_0xEB7_1.decode = function decode(reader, length) {
|
||||
if (!(reader instanceof $Reader))
|
||||
reader = $Reader.create(reader);
|
||||
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Oidb.Oidb_0xEB7_1();
|
||||
while (reader.pos < end) {
|
||||
let tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 2: {
|
||||
message.body = $root.Oidb.Oidb_0xEB7_1_Body.decode(reader, reader.uint32());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the default type url for Oidb_0xEB7_1
|
||||
* @function getTypeUrl
|
||||
* @memberof Oidb.Oidb_0xEB7_1
|
||||
* @static
|
||||
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
||||
* @returns {string} The default type url
|
||||
*/
|
||||
Oidb_0xEB7_1.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
||||
if (typeUrlPrefix === undefined) {
|
||||
typeUrlPrefix = "type.googleapis.com";
|
||||
}
|
||||
return typeUrlPrefix + "/Oidb.Oidb_0xEB7_1";
|
||||
};
|
||||
|
||||
return Oidb_0xEB7_1;
|
||||
})();
|
||||
|
||||
Oidb.Oidb_0xEB7_1_Body = (function() {
|
||||
|
||||
/**
|
||||
* Properties of an Oidb_0xEB7_1_Body.
|
||||
* @memberof Oidb
|
||||
* @interface IOidb_0xEB7_1_Body
|
||||
* @property {string|null} [uin] Oidb_0xEB7_1_Body uin
|
||||
* @property {string|null} [groupCode] Oidb_0xEB7_1_Body groupCode
|
||||
* @property {string|null} [version] Oidb_0xEB7_1_Body version
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new Oidb_0xEB7_1_Body.
|
||||
* @memberof Oidb
|
||||
* @classdesc Represents an Oidb_0xEB7_1_Body.
|
||||
* @implements IOidb_0xEB7_1_Body
|
||||
* @constructor
|
||||
* @param {Oidb.IOidb_0xEB7_1_Body=} [properties] Properties to set
|
||||
*/
|
||||
function Oidb_0xEB7_1_Body(properties) {
|
||||
if (properties)
|
||||
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
||||
if (properties[keys[i]] != null)
|
||||
this[keys[i]] = properties[keys[i]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Oidb_0xEB7_1_Body uin.
|
||||
* @member {string} uin
|
||||
* @memberof Oidb.Oidb_0xEB7_1_Body
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0xEB7_1_Body.prototype.uin = "";
|
||||
|
||||
/**
|
||||
* Oidb_0xEB7_1_Body groupCode.
|
||||
* @member {string} groupCode
|
||||
* @memberof Oidb.Oidb_0xEB7_1_Body
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0xEB7_1_Body.prototype.groupCode = "";
|
||||
|
||||
/**
|
||||
* Oidb_0xEB7_1_Body version.
|
||||
* @member {string} version
|
||||
* @memberof Oidb.Oidb_0xEB7_1_Body
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0xEB7_1_Body.prototype.version = "";
|
||||
|
||||
/**
|
||||
* Encodes the specified Oidb_0xEB7_1_Body message. Does not implicitly {@link Oidb.Oidb_0xEB7_1_Body.verify|verify} messages.
|
||||
* @function encode
|
||||
* @memberof Oidb.Oidb_0xEB7_1_Body
|
||||
* @static
|
||||
* @param {Oidb.IOidb_0xEB7_1_Body} message Oidb_0xEB7_1_Body message or plain object to encode
|
||||
* @param {$protobuf.Writer} [writer] Writer to encode to
|
||||
* @returns {$protobuf.Writer} Writer
|
||||
*/
|
||||
Oidb_0xEB7_1_Body.encode = function encode(message, writer) {
|
||||
if (!writer)
|
||||
writer = $Writer.create();
|
||||
if (message.uin != null && Object.hasOwnProperty.call(message, "uin"))
|
||||
writer.uint32(/* id 1, wireType 2 =*/10).string(message.uin);
|
||||
if (message.groupCode != null && Object.hasOwnProperty.call(message, "groupCode"))
|
||||
writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupCode);
|
||||
if (message.version != null && Object.hasOwnProperty.call(message, "version"))
|
||||
writer.uint32(/* id 3, wireType 2 =*/26).string(message.version);
|
||||
return writer;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes an Oidb_0xEB7_1_Body message from the specified reader or buffer.
|
||||
* @function decode
|
||||
* @memberof Oidb.Oidb_0xEB7_1_Body
|
||||
* @static
|
||||
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
||||
* @param {number} [length] Message length if known beforehand
|
||||
* @returns {Oidb.Oidb_0xEB7_1_Body} Oidb_0xEB7_1_Body
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
Oidb_0xEB7_1_Body.decode = function decode(reader, length) {
|
||||
if (!(reader instanceof $Reader))
|
||||
reader = $Reader.create(reader);
|
||||
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Oidb.Oidb_0xEB7_1_Body();
|
||||
while (reader.pos < end) {
|
||||
let tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
message.uin = reader.string();
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
message.groupCode = reader.string();
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
message.version = reader.string();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the default type url for Oidb_0xEB7_1_Body
|
||||
* @function getTypeUrl
|
||||
* @memberof Oidb.Oidb_0xEB7_1_Body
|
||||
* @static
|
||||
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
||||
* @returns {string} The default type url
|
||||
*/
|
||||
Oidb_0xEB7_1_Body.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
||||
if (typeUrlPrefix === undefined) {
|
||||
typeUrlPrefix = "type.googleapis.com";
|
||||
}
|
||||
return typeUrlPrefix + "/Oidb.Oidb_0xEB7_1_Body";
|
||||
};
|
||||
|
||||
return Oidb_0xEB7_1_Body;
|
||||
})();
|
||||
|
||||
Oidb.Oidb_0X8FC_2 = (function() {
|
||||
|
||||
/**
|
||||
* Properties of an Oidb_0X8FC_2.
|
||||
* @memberof Oidb
|
||||
* @interface IOidb_0X8FC_2
|
||||
* @property {number|null} [groupCode] Oidb_0X8FC_2 groupCode
|
||||
* @property {Oidb.IOidb_0X8FC_2_Body|null} [body] Oidb_0X8FC_2 body
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new Oidb_0X8FC_2.
|
||||
* @memberof Oidb
|
||||
* @classdesc Represents an Oidb_0X8FC_2.
|
||||
* @implements IOidb_0X8FC_2
|
||||
* @constructor
|
||||
* @param {Oidb.IOidb_0X8FC_2=} [properties] Properties to set
|
||||
*/
|
||||
function Oidb_0X8FC_2(properties) {
|
||||
if (properties)
|
||||
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
||||
if (properties[keys[i]] != null)
|
||||
this[keys[i]] = properties[keys[i]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Oidb_0X8FC_2 groupCode.
|
||||
* @member {number} groupCode
|
||||
* @memberof Oidb.Oidb_0X8FC_2
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0X8FC_2.prototype.groupCode = 0;
|
||||
|
||||
/**
|
||||
* Oidb_0X8FC_2 body.
|
||||
* @member {Oidb.IOidb_0X8FC_2_Body|null|undefined} body
|
||||
* @memberof Oidb.Oidb_0X8FC_2
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0X8FC_2.prototype.body = null;
|
||||
|
||||
/**
|
||||
* Encodes the specified Oidb_0X8FC_2 message. Does not implicitly {@link Oidb.Oidb_0X8FC_2.verify|verify} messages.
|
||||
* @function encode
|
||||
* @memberof Oidb.Oidb_0X8FC_2
|
||||
* @static
|
||||
* @param {Oidb.IOidb_0X8FC_2} message Oidb_0X8FC_2 message or plain object to encode
|
||||
* @param {$protobuf.Writer} [writer] Writer to encode to
|
||||
* @returns {$protobuf.Writer} Writer
|
||||
*/
|
||||
Oidb_0X8FC_2.encode = function encode(message, writer) {
|
||||
if (!writer)
|
||||
writer = $Writer.create();
|
||||
if (message.groupCode != null && Object.hasOwnProperty.call(message, "groupCode"))
|
||||
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.groupCode);
|
||||
if (message.body != null && Object.hasOwnProperty.call(message, "body"))
|
||||
$root.Oidb.Oidb_0X8FC_2_Body.encode(message.body, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
||||
return writer;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes an Oidb_0X8FC_2 message from the specified reader or buffer.
|
||||
* @function decode
|
||||
* @memberof Oidb.Oidb_0X8FC_2
|
||||
* @static
|
||||
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
||||
* @param {number} [length] Message length if known beforehand
|
||||
* @returns {Oidb.Oidb_0X8FC_2} Oidb_0X8FC_2
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
Oidb_0X8FC_2.decode = function decode(reader, length) {
|
||||
if (!(reader instanceof $Reader))
|
||||
reader = $Reader.create(reader);
|
||||
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Oidb.Oidb_0X8FC_2();
|
||||
while (reader.pos < end) {
|
||||
let tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
message.groupCode = reader.uint32();
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
message.body = $root.Oidb.Oidb_0X8FC_2_Body.decode(reader, reader.uint32());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the default type url for Oidb_0X8FC_2
|
||||
* @function getTypeUrl
|
||||
* @memberof Oidb.Oidb_0X8FC_2
|
||||
* @static
|
||||
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
||||
* @returns {string} The default type url
|
||||
*/
|
||||
Oidb_0X8FC_2.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
||||
if (typeUrlPrefix === undefined) {
|
||||
typeUrlPrefix = "type.googleapis.com";
|
||||
}
|
||||
return typeUrlPrefix + "/Oidb.Oidb_0X8FC_2";
|
||||
};
|
||||
|
||||
return Oidb_0X8FC_2;
|
||||
})();
|
||||
|
||||
Oidb.Oidb_0X8FC_2_Body = (function() {
|
||||
|
||||
/**
|
||||
* Properties of an Oidb_0X8FC_2_Body.
|
||||
* @memberof Oidb
|
||||
* @interface IOidb_0X8FC_2_Body
|
||||
* @property {string|null} [targetUid] Oidb_0X8FC_2_Body targetUid
|
||||
* @property {string|null} [specialTitle] Oidb_0X8FC_2_Body specialTitle
|
||||
* @property {number|null} [expiredTime] Oidb_0X8FC_2_Body expiredTime
|
||||
* @property {string|null} [uinName] Oidb_0X8FC_2_Body uinName
|
||||
* @property {string|null} [targetName] Oidb_0X8FC_2_Body targetName
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new Oidb_0X8FC_2_Body.
|
||||
* @memberof Oidb
|
||||
* @classdesc Represents an Oidb_0X8FC_2_Body.
|
||||
* @implements IOidb_0X8FC_2_Body
|
||||
* @constructor
|
||||
* @param {Oidb.IOidb_0X8FC_2_Body=} [properties] Properties to set
|
||||
*/
|
||||
function Oidb_0X8FC_2_Body(properties) {
|
||||
if (properties)
|
||||
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
||||
if (properties[keys[i]] != null)
|
||||
this[keys[i]] = properties[keys[i]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Oidb_0X8FC_2_Body targetUid.
|
||||
* @member {string} targetUid
|
||||
* @memberof Oidb.Oidb_0X8FC_2_Body
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0X8FC_2_Body.prototype.targetUid = "";
|
||||
|
||||
/**
|
||||
* Oidb_0X8FC_2_Body specialTitle.
|
||||
* @member {string} specialTitle
|
||||
* @memberof Oidb.Oidb_0X8FC_2_Body
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0X8FC_2_Body.prototype.specialTitle = "";
|
||||
|
||||
/**
|
||||
* Oidb_0X8FC_2_Body expiredTime.
|
||||
* @member {number} expiredTime
|
||||
* @memberof Oidb.Oidb_0X8FC_2_Body
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0X8FC_2_Body.prototype.expiredTime = 0;
|
||||
|
||||
/**
|
||||
* Oidb_0X8FC_2_Body uinName.
|
||||
* @member {string} uinName
|
||||
* @memberof Oidb.Oidb_0X8FC_2_Body
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0X8FC_2_Body.prototype.uinName = "";
|
||||
|
||||
/**
|
||||
* Oidb_0X8FC_2_Body targetName.
|
||||
* @member {string} targetName
|
||||
* @memberof Oidb.Oidb_0X8FC_2_Body
|
||||
* @instance
|
||||
*/
|
||||
Oidb_0X8FC_2_Body.prototype.targetName = "";
|
||||
|
||||
/**
|
||||
* Encodes the specified Oidb_0X8FC_2_Body message. Does not implicitly {@link Oidb.Oidb_0X8FC_2_Body.verify|verify} messages.
|
||||
* @function encode
|
||||
* @memberof Oidb.Oidb_0X8FC_2_Body
|
||||
* @static
|
||||
* @param {Oidb.IOidb_0X8FC_2_Body} message Oidb_0X8FC_2_Body message or plain object to encode
|
||||
* @param {$protobuf.Writer} [writer] Writer to encode to
|
||||
* @returns {$protobuf.Writer} Writer
|
||||
*/
|
||||
Oidb_0X8FC_2_Body.encode = function encode(message, writer) {
|
||||
if (!writer)
|
||||
writer = $Writer.create();
|
||||
if (message.targetUid != null && Object.hasOwnProperty.call(message, "targetUid"))
|
||||
writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetUid);
|
||||
if (message.specialTitle != null && Object.hasOwnProperty.call(message, "specialTitle"))
|
||||
writer.uint32(/* id 5, wireType 2 =*/42).string(message.specialTitle);
|
||||
if (message.expiredTime != null && Object.hasOwnProperty.call(message, "expiredTime"))
|
||||
writer.uint32(/* id 6, wireType 0 =*/48).sint32(message.expiredTime);
|
||||
if (message.uinName != null && Object.hasOwnProperty.call(message, "uinName"))
|
||||
writer.uint32(/* id 7, wireType 2 =*/58).string(message.uinName);
|
||||
if (message.targetName != null && Object.hasOwnProperty.call(message, "targetName"))
|
||||
writer.uint32(/* id 8, wireType 2 =*/66).string(message.targetName);
|
||||
return writer;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes an Oidb_0X8FC_2_Body message from the specified reader or buffer.
|
||||
* @function decode
|
||||
* @memberof Oidb.Oidb_0X8FC_2_Body
|
||||
* @static
|
||||
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
||||
* @param {number} [length] Message length if known beforehand
|
||||
* @returns {Oidb.Oidb_0X8FC_2_Body} Oidb_0X8FC_2_Body
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
Oidb_0X8FC_2_Body.decode = function decode(reader, length) {
|
||||
if (!(reader instanceof $Reader))
|
||||
reader = $Reader.create(reader);
|
||||
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Oidb.Oidb_0X8FC_2_Body();
|
||||
while (reader.pos < end) {
|
||||
let tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
message.targetUid = reader.string();
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
message.specialTitle = reader.string();
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
message.expiredTime = reader.sint32();
|
||||
break;
|
||||
}
|
||||
case 7: {
|
||||
message.uinName = reader.string();
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
message.targetName = reader.string();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the default type url for Oidb_0X8FC_2_Body
|
||||
* @function getTypeUrl
|
||||
* @memberof Oidb.Oidb_0X8FC_2_Body
|
||||
* @static
|
||||
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
||||
* @returns {string} The default type url
|
||||
*/
|
||||
Oidb_0X8FC_2_Body.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
||||
if (typeUrlPrefix === undefined) {
|
||||
typeUrlPrefix = "type.googleapis.com";
|
||||
}
|
||||
return typeUrlPrefix + "/Oidb.Oidb_0X8FC_2_Body";
|
||||
};
|
||||
|
||||
return Oidb_0X8FC_2_Body;
|
||||
})();
|
||||
|
||||
return Oidb;
|
||||
})();
|
||||
|
||||
export { $root as default };
|
||||
|
41
src/ntqqapi/proto/oidb.proto
Normal file
41
src/ntqqapi/proto/oidb.proto
Normal file
@@ -0,0 +1,41 @@
|
||||
syntax = "proto3";
|
||||
package Oidb;
|
||||
|
||||
message Base {
|
||||
uint32 command = 1;
|
||||
uint32 subCommand = 2;
|
||||
uint32 errorCode = 3;
|
||||
bytes body = 4;
|
||||
optional string errorMsg = 5;
|
||||
uint32 isReserved = 12;
|
||||
}
|
||||
|
||||
message Oidb_0xED3_1 {
|
||||
uint32 uin = 1;
|
||||
uint32 groupCode = 2;
|
||||
uint32 friendUin = 5;
|
||||
optional uint32 ext = 6;
|
||||
}
|
||||
|
||||
message Oidb_0xEB7_1 {
|
||||
Oidb_0xEB7_1_Body body = 2;
|
||||
}
|
||||
|
||||
message Oidb_0xEB7_1_Body {
|
||||
string uin = 1;
|
||||
string groupCode = 2;
|
||||
string version = 3;
|
||||
}
|
||||
|
||||
message Oidb_0X8FC_2 {
|
||||
uint32 groupCode = 1;
|
||||
Oidb_0X8FC_2_Body body = 3;
|
||||
}
|
||||
|
||||
message Oidb_0X8FC_2_Body {
|
||||
string targetUid = 1;
|
||||
string specialTitle = 5;
|
||||
sint32 expiredTime = 6;
|
||||
string uinName = 7;
|
||||
string targetName = 8;
|
||||
}
|
@@ -13,7 +13,7 @@ export class SendGroupSign extends BaseAction<Payload, null> {
|
||||
})
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
throw new Error('暂未实现群签到功能')
|
||||
await this.ctx.app.packet.sendGroupSignPacket(selfInfo.uin, payload.group_id.toString())
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ export class SetGroupSpecialTitle extends BaseAction<Payload, null> {
|
||||
if (self.role !== GroupMemberRole.Owner){
|
||||
throw new Error(`不是群${payload.group_id}的群主,无法设置群头衔`)
|
||||
}
|
||||
throw new Error('暂未实现设置群头衔功能')
|
||||
await this.ctx.app.packet.sendSetSpecialTittlePacket(payload.group_id.toString(), uid, payload.special_title || "")
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
@@ -15,16 +15,8 @@ class GetGroupInfo extends BaseAction<Payload, OB11Group> {
|
||||
|
||||
protected async _handle(payload: Payload) {
|
||||
const groupCode = payload.group_id.toString()
|
||||
let group = (await this.ctx.ntGroupApi.getGroups()).find(e => e.groupCode === groupCode)
|
||||
const group = (await this.ctx.ntGroupApi.getGroups()).find(e => e.groupCode === groupCode)
|
||||
if (group) {
|
||||
try{
|
||||
const groupAllInfo = await this.ctx.ntGroupApi.getGroupAllInfo(groupCode)
|
||||
this.ctx.logger.info(groupAllInfo)
|
||||
return {...OB11Entities.group(group), ...groupAllInfo}
|
||||
}
|
||||
catch (e) {
|
||||
this.ctx.logger.error('获取群完整详细信息失败', e)
|
||||
}
|
||||
return OB11Entities.group(group)
|
||||
}
|
||||
throw new Error(`群${payload.group_id}不存在`)
|
||||
|
@@ -14,8 +14,7 @@ export class FriendPoke extends BaseAction<Payload, null> {
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
if (!this.ctx.app.native.checkPlatform() || !this.ctx.app.native.checkVersion()) {
|
||||
// await this.ctx.app.packet.sendPokePacket(+payload.user_id)
|
||||
throw new Error('戳一戳暂时只支持Windows QQ 27333 ~ 275970版本')
|
||||
await this.ctx.app.packet.sendPokePacket(+payload.user_id)
|
||||
}
|
||||
else{
|
||||
await this.ctx.app.native.sendFriendPoke(+payload.user_id)
|
||||
|
@@ -16,7 +16,7 @@ export class GroupPoke extends BaseAction<Payload, null> {
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
if (!this.ctx.app.native.checkPlatform() || !this.ctx.app.native.checkVersion()) {
|
||||
throw new Error('戳一戳暂时只支持Windows QQ 27333 ~ 275970版本')
|
||||
await this.ctx.app.packet.sendPokePacket(+payload.user_id, +payload.group_id)
|
||||
}
|
||||
else{
|
||||
await this.ctx.app.native.sendGroupPoke(+payload.group_id, +payload.user_id)
|
||||
|
@@ -1 +1 @@
|
||||
export const version = '4.4.0'
|
||||
export const version = '4.3.2'
|
||||
|
Reference in New Issue
Block a user