dos to unix
This commit is contained in:
parent
38a6f12994
commit
79ebcb936c
51 changed files with 2381 additions and 2381 deletions
24
.github/FUNDING.yml
vendored
24
.github/FUNDING.yml
vendored
|
@ -1,12 +1,12 @@
|
||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: [night0721, ThunderE75] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
github: [night0721, ThunderE75] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||||
patreon: # Replace with a single Patreon username
|
patreon: # Replace with a single Patreon username
|
||||||
open_collective: # Replace with a single Open Collective username
|
open_collective: # Replace with a single Open Collective username
|
||||||
ko_fi: cathteam
|
ko_fi: cathteam
|
||||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
liberapay: # Replace with a single Liberapay username
|
liberapay: # Replace with a single Liberapay username
|
||||||
issuehunt: # Replace with a single IssueHunt username
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
otechie: # Replace with a single Otechie username
|
otechie: # Replace with a single Otechie username
|
||||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
|
|
66
.github/workflows/npm-publish.yml
vendored
66
.github/workflows/npm-publish.yml
vendored
|
@ -1,33 +1,33 @@
|
||||||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
||||||
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
||||||
|
|
||||||
name: Node.js Package
|
name: Node.js Package
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [created]
|
types: [created]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm test
|
- run: npm test
|
||||||
|
|
||||||
publish-npm:
|
publish-npm:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
registry-url: https://registry.npmjs.org/
|
registry-url: https://registry.npmjs.org/
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm publish
|
- run: npm publish
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
||||||
|
|
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -1,5 +1,5 @@
|
||||||
dist/
|
dist/
|
||||||
node_modules/
|
node_modules/
|
||||||
package-lock.json
|
package-lock.json
|
||||||
test.js
|
test.js
|
||||||
docs/
|
docs/
|
20
.npmignore
20
.npmignore
|
@ -1,11 +1,11 @@
|
||||||
src
|
src
|
||||||
tsconfig.json
|
tsconfig.json
|
||||||
node_modules
|
node_modules
|
||||||
package-lock.json
|
package-lock.json
|
||||||
.gitignore
|
.gitignore
|
||||||
LICENSE
|
LICENSE
|
||||||
.github
|
.github
|
||||||
docs
|
docs
|
||||||
test.js
|
test.js
|
||||||
vercel.json
|
vercel.json
|
||||||
README.md
|
README.md
|
858
LICENSE
858
LICENSE
|
@ -1,429 +1,429 @@
|
||||||
Attribution-NonCommercial-ShareAlike 4.0 International
|
Attribution-NonCommercial-ShareAlike 4.0 International
|
||||||
|
|
||||||
=======================================================================
|
=======================================================================
|
||||||
|
|
||||||
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
||||||
does not provide legal services or legal advice. Distribution of
|
does not provide legal services or legal advice. Distribution of
|
||||||
Creative Commons public licenses does not create a lawyer-client or
|
Creative Commons public licenses does not create a lawyer-client or
|
||||||
other relationship. Creative Commons makes its licenses and related
|
other relationship. Creative Commons makes its licenses and related
|
||||||
information available on an "as-is" basis. Creative Commons gives no
|
information available on an "as-is" basis. Creative Commons gives no
|
||||||
warranties regarding its licenses, any material licensed under their
|
warranties regarding its licenses, any material licensed under their
|
||||||
terms and conditions, or any related information. Creative Commons
|
terms and conditions, or any related information. Creative Commons
|
||||||
disclaims all liability for damages resulting from their use to the
|
disclaims all liability for damages resulting from their use to the
|
||||||
fullest extent possible.
|
fullest extent possible.
|
||||||
|
|
||||||
Using Creative Commons Public Licenses
|
Using Creative Commons Public Licenses
|
||||||
|
|
||||||
Creative Commons public licenses provide a standard set of terms and
|
Creative Commons public licenses provide a standard set of terms and
|
||||||
conditions that creators and other rights holders may use to share
|
conditions that creators and other rights holders may use to share
|
||||||
original works of authorship and other material subject to copyright
|
original works of authorship and other material subject to copyright
|
||||||
and certain other rights specified in the public license below. The
|
and certain other rights specified in the public license below. The
|
||||||
following considerations are for informational purposes only, are not
|
following considerations are for informational purposes only, are not
|
||||||
exhaustive, and do not form part of our licenses.
|
exhaustive, and do not form part of our licenses.
|
||||||
|
|
||||||
Considerations for licensors: Our public licenses are
|
Considerations for licensors: Our public licenses are
|
||||||
intended for use by those authorized to give the public
|
intended for use by those authorized to give the public
|
||||||
permission to use material in ways otherwise restricted by
|
permission to use material in ways otherwise restricted by
|
||||||
copyright and certain other rights. Our licenses are
|
copyright and certain other rights. Our licenses are
|
||||||
irrevocable. Licensors should read and understand the terms
|
irrevocable. Licensors should read and understand the terms
|
||||||
and conditions of the license they choose before applying it.
|
and conditions of the license they choose before applying it.
|
||||||
Licensors should also secure all rights necessary before
|
Licensors should also secure all rights necessary before
|
||||||
applying our licenses so that the public can reuse the
|
applying our licenses so that the public can reuse the
|
||||||
material as expected. Licensors should clearly mark any
|
material as expected. Licensors should clearly mark any
|
||||||
material not subject to the license. This includes other CC-
|
material not subject to the license. This includes other CC-
|
||||||
licensed material, or material used under an exception or
|
licensed material, or material used under an exception or
|
||||||
limitation to copyright. More considerations for licensors:
|
limitation to copyright. More considerations for licensors:
|
||||||
wiki.creativecommons.org/Considerations_for_licensors
|
wiki.creativecommons.org/Considerations_for_licensors
|
||||||
|
|
||||||
Considerations for the public: By using one of our public
|
Considerations for the public: By using one of our public
|
||||||
licenses, a licensor grants the public permission to use the
|
licenses, a licensor grants the public permission to use the
|
||||||
licensed material under specified terms and conditions. If
|
licensed material under specified terms and conditions. If
|
||||||
the licensor's permission is not necessary for any reason--for
|
the licensor's permission is not necessary for any reason--for
|
||||||
example, because of any applicable exception or limitation to
|
example, because of any applicable exception or limitation to
|
||||||
copyright--then that use is not regulated by the license. Our
|
copyright--then that use is not regulated by the license. Our
|
||||||
licenses grant only permissions under copyright and certain
|
licenses grant only permissions under copyright and certain
|
||||||
other rights that a licensor has authority to grant. Use of
|
other rights that a licensor has authority to grant. Use of
|
||||||
the licensed material may still be restricted for other
|
the licensed material may still be restricted for other
|
||||||
reasons, including because others have copyright or other
|
reasons, including because others have copyright or other
|
||||||
rights in the material. A licensor may make special requests,
|
rights in the material. A licensor may make special requests,
|
||||||
such as asking that all changes be marked or described.
|
such as asking that all changes be marked or described.
|
||||||
Although not required by our licenses, you are encouraged to
|
Although not required by our licenses, you are encouraged to
|
||||||
respect those requests where reasonable. More_considerations
|
respect those requests where reasonable. More_considerations
|
||||||
for the public:
|
for the public:
|
||||||
wiki.creativecommons.org/Considerations_for_licensees
|
wiki.creativecommons.org/Considerations_for_licensees
|
||||||
|
|
||||||
=======================================================================
|
=======================================================================
|
||||||
|
|
||||||
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
|
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
|
||||||
Public License
|
Public License
|
||||||
|
|
||||||
By exercising the Licensed Rights (defined below), You accept and agree
|
By exercising the Licensed Rights (defined below), You accept and agree
|
||||||
to be bound by the terms and conditions of this Creative Commons
|
to be bound by the terms and conditions of this Creative Commons
|
||||||
Attribution-NonCommercial-ShareAlike 4.0 International Public License
|
Attribution-NonCommercial-ShareAlike 4.0 International Public License
|
||||||
("Public License"). To the extent this Public License may be
|
("Public License"). To the extent this Public License may be
|
||||||
interpreted as a contract, You are granted the Licensed Rights in
|
interpreted as a contract, You are granted the Licensed Rights in
|
||||||
consideration of Your acceptance of these terms and conditions, and the
|
consideration of Your acceptance of these terms and conditions, and the
|
||||||
Licensor grants You such rights in consideration of benefits the
|
Licensor grants You such rights in consideration of benefits the
|
||||||
Licensor receives from making the Licensed Material available under
|
Licensor receives from making the Licensed Material available under
|
||||||
these terms and conditions.
|
these terms and conditions.
|
||||||
|
|
||||||
Section 1 -- Definitions.
|
Section 1 -- Definitions.
|
||||||
|
|
||||||
a. Adapted Material means material subject to Copyright and Similar
|
a. Adapted Material means material subject to Copyright and Similar
|
||||||
Rights that is derived from or based upon the Licensed Material
|
Rights that is derived from or based upon the Licensed Material
|
||||||
and in which the Licensed Material is translated, altered,
|
and in which the Licensed Material is translated, altered,
|
||||||
arranged, transformed, or otherwise modified in a manner requiring
|
arranged, transformed, or otherwise modified in a manner requiring
|
||||||
permission under the Copyright and Similar Rights held by the
|
permission under the Copyright and Similar Rights held by the
|
||||||
Licensor. For purposes of this Public License, where the Licensed
|
Licensor. For purposes of this Public License, where the Licensed
|
||||||
Material is a musical work, performance, or sound recording,
|
Material is a musical work, performance, or sound recording,
|
||||||
Adapted Material is always produced where the Licensed Material is
|
Adapted Material is always produced where the Licensed Material is
|
||||||
synched in timed relation with a moving image.
|
synched in timed relation with a moving image.
|
||||||
|
|
||||||
b. Adapter's License means the license You apply to Your Copyright
|
b. Adapter's License means the license You apply to Your Copyright
|
||||||
and Similar Rights in Your contributions to Adapted Material in
|
and Similar Rights in Your contributions to Adapted Material in
|
||||||
accordance with the terms and conditions of this Public License.
|
accordance with the terms and conditions of this Public License.
|
||||||
|
|
||||||
c. BY-NC-SA Compatible License means a license listed at
|
c. BY-NC-SA Compatible License means a license listed at
|
||||||
creativecommons.org/compatiblelicenses, approved by Creative
|
creativecommons.org/compatiblelicenses, approved by Creative
|
||||||
Commons as essentially the equivalent of this Public License.
|
Commons as essentially the equivalent of this Public License.
|
||||||
|
|
||||||
d. Copyright and Similar Rights means copyright and/or similar rights
|
d. Copyright and Similar Rights means copyright and/or similar rights
|
||||||
closely related to copyright including, without limitation,
|
closely related to copyright including, without limitation,
|
||||||
performance, broadcast, sound recording, and Sui Generis Database
|
performance, broadcast, sound recording, and Sui Generis Database
|
||||||
Rights, without regard to how the rights are labeled or
|
Rights, without regard to how the rights are labeled or
|
||||||
categorized. For purposes of this Public License, the rights
|
categorized. For purposes of this Public License, the rights
|
||||||
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
||||||
Rights.
|
Rights.
|
||||||
|
|
||||||
e. Effective Technological Measures means those measures that, in the
|
e. Effective Technological Measures means those measures that, in the
|
||||||
absence of proper authority, may not be circumvented under laws
|
absence of proper authority, may not be circumvented under laws
|
||||||
fulfilling obligations under Article 11 of the WIPO Copyright
|
fulfilling obligations under Article 11 of the WIPO Copyright
|
||||||
Treaty adopted on December 20, 1996, and/or similar international
|
Treaty adopted on December 20, 1996, and/or similar international
|
||||||
agreements.
|
agreements.
|
||||||
|
|
||||||
f. Exceptions and Limitations means fair use, fair dealing, and/or
|
f. Exceptions and Limitations means fair use, fair dealing, and/or
|
||||||
any other exception or limitation to Copyright and Similar Rights
|
any other exception or limitation to Copyright and Similar Rights
|
||||||
that applies to Your use of the Licensed Material.
|
that applies to Your use of the Licensed Material.
|
||||||
|
|
||||||
g. License Elements means the license attributes listed in the name
|
g. License Elements means the license attributes listed in the name
|
||||||
of a Creative Commons Public License. The License Elements of this
|
of a Creative Commons Public License. The License Elements of this
|
||||||
Public License are Attribution, NonCommercial, and ShareAlike.
|
Public License are Attribution, NonCommercial, and ShareAlike.
|
||||||
|
|
||||||
h. Licensed Material means the artistic or literary work, database,
|
h. Licensed Material means the artistic or literary work, database,
|
||||||
or other material to which the Licensor applied this Public
|
or other material to which the Licensor applied this Public
|
||||||
License.
|
License.
|
||||||
|
|
||||||
i. Licensed Rights means the rights granted to You subject to the
|
i. Licensed Rights means the rights granted to You subject to the
|
||||||
terms and conditions of this Public License, which are limited to
|
terms and conditions of this Public License, which are limited to
|
||||||
all Copyright and Similar Rights that apply to Your use of the
|
all Copyright and Similar Rights that apply to Your use of the
|
||||||
Licensed Material and that the Licensor has authority to license.
|
Licensed Material and that the Licensor has authority to license.
|
||||||
|
|
||||||
j. Licensor means the individual(s) or entity(ies) granting rights
|
j. Licensor means the individual(s) or entity(ies) granting rights
|
||||||
under this Public License.
|
under this Public License.
|
||||||
|
|
||||||
k. NonCommercial means not primarily intended for or directed towards
|
k. NonCommercial means not primarily intended for or directed towards
|
||||||
commercial advantage or monetary compensation. For purposes of
|
commercial advantage or monetary compensation. For purposes of
|
||||||
this Public License, the exchange of the Licensed Material for
|
this Public License, the exchange of the Licensed Material for
|
||||||
other material subject to Copyright and Similar Rights by digital
|
other material subject to Copyright and Similar Rights by digital
|
||||||
file-sharing or similar means is NonCommercial provided there is
|
file-sharing or similar means is NonCommercial provided there is
|
||||||
no payment of monetary compensation in connection with the
|
no payment of monetary compensation in connection with the
|
||||||
exchange.
|
exchange.
|
||||||
|
|
||||||
l. Share means to provide material to the public by any means or
|
l. Share means to provide material to the public by any means or
|
||||||
process that requires permission under the Licensed Rights, such
|
process that requires permission under the Licensed Rights, such
|
||||||
as reproduction, public display, public performance, distribution,
|
as reproduction, public display, public performance, distribution,
|
||||||
dissemination, communication, or importation, and to make material
|
dissemination, communication, or importation, and to make material
|
||||||
available to the public including in ways that members of the
|
available to the public including in ways that members of the
|
||||||
public may access the material from a place and at a time
|
public may access the material from a place and at a time
|
||||||
individually chosen by them.
|
individually chosen by them.
|
||||||
|
|
||||||
m. Sui Generis Database Rights means rights other than copyright
|
m. Sui Generis Database Rights means rights other than copyright
|
||||||
resulting from Directive 96/9/EC of the European Parliament and of
|
resulting from Directive 96/9/EC of the European Parliament and of
|
||||||
the Council of 11 March 1996 on the legal protection of databases,
|
the Council of 11 March 1996 on the legal protection of databases,
|
||||||
as amended and/or succeeded, as well as other essentially
|
as amended and/or succeeded, as well as other essentially
|
||||||
equivalent rights anywhere in the world.
|
equivalent rights anywhere in the world.
|
||||||
|
|
||||||
n. You means the individual or entity exercising the Licensed Rights
|
n. You means the individual or entity exercising the Licensed Rights
|
||||||
under this Public License. Your has a corresponding meaning.
|
under this Public License. Your has a corresponding meaning.
|
||||||
|
|
||||||
Section 2 -- Scope.
|
Section 2 -- Scope.
|
||||||
|
|
||||||
a. License grant.
|
a. License grant.
|
||||||
|
|
||||||
1. Subject to the terms and conditions of this Public License,
|
1. Subject to the terms and conditions of this Public License,
|
||||||
the Licensor hereby grants You a worldwide, royalty-free,
|
the Licensor hereby grants You a worldwide, royalty-free,
|
||||||
non-sublicensable, non-exclusive, irrevocable license to
|
non-sublicensable, non-exclusive, irrevocable license to
|
||||||
exercise the Licensed Rights in the Licensed Material to:
|
exercise the Licensed Rights in the Licensed Material to:
|
||||||
|
|
||||||
a. reproduce and Share the Licensed Material, in whole or
|
a. reproduce and Share the Licensed Material, in whole or
|
||||||
in part, for NonCommercial purposes only; and
|
in part, for NonCommercial purposes only; and
|
||||||
|
|
||||||
b. produce, reproduce, and Share Adapted Material for
|
b. produce, reproduce, and Share Adapted Material for
|
||||||
NonCommercial purposes only.
|
NonCommercial purposes only.
|
||||||
|
|
||||||
2. Exceptions and Limitations. For the avoidance of doubt, where
|
2. Exceptions and Limitations. For the avoidance of doubt, where
|
||||||
Exceptions and Limitations apply to Your use, this Public
|
Exceptions and Limitations apply to Your use, this Public
|
||||||
License does not apply, and You do not need to comply with
|
License does not apply, and You do not need to comply with
|
||||||
its terms and conditions.
|
its terms and conditions.
|
||||||
|
|
||||||
3. Term. The term of this Public License is specified in Section
|
3. Term. The term of this Public License is specified in Section
|
||||||
6(a).
|
6(a).
|
||||||
|
|
||||||
4. Media and formats; technical modifications allowed. The
|
4. Media and formats; technical modifications allowed. The
|
||||||
Licensor authorizes You to exercise the Licensed Rights in
|
Licensor authorizes You to exercise the Licensed Rights in
|
||||||
all media and formats whether now known or hereafter created,
|
all media and formats whether now known or hereafter created,
|
||||||
and to make technical modifications necessary to do so. The
|
and to make technical modifications necessary to do so. The
|
||||||
Licensor waives and/or agrees not to assert any right or
|
Licensor waives and/or agrees not to assert any right or
|
||||||
authority to forbid You from making technical modifications
|
authority to forbid You from making technical modifications
|
||||||
necessary to exercise the Licensed Rights, including
|
necessary to exercise the Licensed Rights, including
|
||||||
technical modifications necessary to circumvent Effective
|
technical modifications necessary to circumvent Effective
|
||||||
Technological Measures. For purposes of this Public License,
|
Technological Measures. For purposes of this Public License,
|
||||||
simply making modifications authorized by this Section 2(a)
|
simply making modifications authorized by this Section 2(a)
|
||||||
(4) never produces Adapted Material.
|
(4) never produces Adapted Material.
|
||||||
|
|
||||||
5. Downstream recipients.
|
5. Downstream recipients.
|
||||||
|
|
||||||
a. Offer from the Licensor -- Licensed Material. Every
|
a. Offer from the Licensor -- Licensed Material. Every
|
||||||
recipient of the Licensed Material automatically
|
recipient of the Licensed Material automatically
|
||||||
receives an offer from the Licensor to exercise the
|
receives an offer from the Licensor to exercise the
|
||||||
Licensed Rights under the terms and conditions of this
|
Licensed Rights under the terms and conditions of this
|
||||||
Public License.
|
Public License.
|
||||||
|
|
||||||
b. Additional offer from the Licensor -- Adapted Material.
|
b. Additional offer from the Licensor -- Adapted Material.
|
||||||
Every recipient of Adapted Material from You
|
Every recipient of Adapted Material from You
|
||||||
automatically receives an offer from the Licensor to
|
automatically receives an offer from the Licensor to
|
||||||
exercise the Licensed Rights in the Adapted Material
|
exercise the Licensed Rights in the Adapted Material
|
||||||
under the conditions of the Adapter's License You apply.
|
under the conditions of the Adapter's License You apply.
|
||||||
|
|
||||||
c. No downstream restrictions. You may not offer or impose
|
c. No downstream restrictions. You may not offer or impose
|
||||||
any additional or different terms or conditions on, or
|
any additional or different terms or conditions on, or
|
||||||
apply any Effective Technological Measures to, the
|
apply any Effective Technological Measures to, the
|
||||||
Licensed Material if doing so restricts exercise of the
|
Licensed Material if doing so restricts exercise of the
|
||||||
Licensed Rights by any recipient of the Licensed
|
Licensed Rights by any recipient of the Licensed
|
||||||
Material.
|
Material.
|
||||||
|
|
||||||
6. No endorsement. Nothing in this Public License constitutes or
|
6. No endorsement. Nothing in this Public License constitutes or
|
||||||
may be construed as permission to assert or imply that You
|
may be construed as permission to assert or imply that You
|
||||||
are, or that Your use of the Licensed Material is, connected
|
are, or that Your use of the Licensed Material is, connected
|
||||||
with, or sponsored, endorsed, or granted official status by,
|
with, or sponsored, endorsed, or granted official status by,
|
||||||
the Licensor or others designated to receive attribution as
|
the Licensor or others designated to receive attribution as
|
||||||
provided in Section 3(a)(1)(A)(i).
|
provided in Section 3(a)(1)(A)(i).
|
||||||
|
|
||||||
b. Other rights.
|
b. Other rights.
|
||||||
|
|
||||||
1. Moral rights, such as the right of integrity, are not
|
1. Moral rights, such as the right of integrity, are not
|
||||||
licensed under this Public License, nor are publicity,
|
licensed under this Public License, nor are publicity,
|
||||||
privacy, and/or other similar personality rights; however, to
|
privacy, and/or other similar personality rights; however, to
|
||||||
the extent possible, the Licensor waives and/or agrees not to
|
the extent possible, the Licensor waives and/or agrees not to
|
||||||
assert any such rights held by the Licensor to the limited
|
assert any such rights held by the Licensor to the limited
|
||||||
extent necessary to allow You to exercise the Licensed
|
extent necessary to allow You to exercise the Licensed
|
||||||
Rights, but not otherwise.
|
Rights, but not otherwise.
|
||||||
|
|
||||||
2. Patent and trademark rights are not licensed under this
|
2. Patent and trademark rights are not licensed under this
|
||||||
Public License.
|
Public License.
|
||||||
|
|
||||||
3. To the extent possible, the Licensor waives any right to
|
3. To the extent possible, the Licensor waives any right to
|
||||||
collect royalties from You for the exercise of the Licensed
|
collect royalties from You for the exercise of the Licensed
|
||||||
Rights, whether directly or through a collecting society
|
Rights, whether directly or through a collecting society
|
||||||
under any voluntary or waivable statutory or compulsory
|
under any voluntary or waivable statutory or compulsory
|
||||||
licensing scheme. In all other cases the Licensor expressly
|
licensing scheme. In all other cases the Licensor expressly
|
||||||
reserves any right to collect such royalties, including when
|
reserves any right to collect such royalties, including when
|
||||||
the Licensed Material is used other than for NonCommercial
|
the Licensed Material is used other than for NonCommercial
|
||||||
purposes.
|
purposes.
|
||||||
|
|
||||||
Section 3 -- License Conditions.
|
Section 3 -- License Conditions.
|
||||||
|
|
||||||
Your exercise of the Licensed Rights is expressly made subject to the
|
Your exercise of the Licensed Rights is expressly made subject to the
|
||||||
following conditions.
|
following conditions.
|
||||||
|
|
||||||
a. Attribution.
|
a. Attribution.
|
||||||
|
|
||||||
1. If You Share the Licensed Material (including in modified
|
1. If You Share the Licensed Material (including in modified
|
||||||
form), You must:
|
form), You must:
|
||||||
|
|
||||||
a. retain the following if it is supplied by the Licensor
|
a. retain the following if it is supplied by the Licensor
|
||||||
with the Licensed Material:
|
with the Licensed Material:
|
||||||
|
|
||||||
i. identification of the creator(s) of the Licensed
|
i. identification of the creator(s) of the Licensed
|
||||||
Material and any others designated to receive
|
Material and any others designated to receive
|
||||||
attribution, in any reasonable manner requested by
|
attribution, in any reasonable manner requested by
|
||||||
the Licensor (including by pseudonym if
|
the Licensor (including by pseudonym if
|
||||||
designated);
|
designated);
|
||||||
|
|
||||||
ii. a copyright notice;
|
ii. a copyright notice;
|
||||||
|
|
||||||
iii. a notice that refers to this Public License;
|
iii. a notice that refers to this Public License;
|
||||||
|
|
||||||
iv. a notice that refers to the disclaimer of
|
iv. a notice that refers to the disclaimer of
|
||||||
warranties;
|
warranties;
|
||||||
|
|
||||||
v. a URI or hyperlink to the Licensed Material to the
|
v. a URI or hyperlink to the Licensed Material to the
|
||||||
extent reasonably practicable;
|
extent reasonably practicable;
|
||||||
|
|
||||||
b. indicate if You modified the Licensed Material and
|
b. indicate if You modified the Licensed Material and
|
||||||
retain an indication of any previous modifications; and
|
retain an indication of any previous modifications; and
|
||||||
|
|
||||||
c. indicate the Licensed Material is licensed under this
|
c. indicate the Licensed Material is licensed under this
|
||||||
Public License, and include the text of, or the URI or
|
Public License, and include the text of, or the URI or
|
||||||
hyperlink to, this Public License.
|
hyperlink to, this Public License.
|
||||||
|
|
||||||
2. You may satisfy the conditions in Section 3(a)(1) in any
|
2. You may satisfy the conditions in Section 3(a)(1) in any
|
||||||
reasonable manner based on the medium, means, and context in
|
reasonable manner based on the medium, means, and context in
|
||||||
which You Share the Licensed Material. For example, it may be
|
which You Share the Licensed Material. For example, it may be
|
||||||
reasonable to satisfy the conditions by providing a URI or
|
reasonable to satisfy the conditions by providing a URI or
|
||||||
hyperlink to a resource that includes the required
|
hyperlink to a resource that includes the required
|
||||||
information.
|
information.
|
||||||
3. If requested by the Licensor, You must remove any of the
|
3. If requested by the Licensor, You must remove any of the
|
||||||
information required by Section 3(a)(1)(A) to the extent
|
information required by Section 3(a)(1)(A) to the extent
|
||||||
reasonably practicable.
|
reasonably practicable.
|
||||||
|
|
||||||
b. ShareAlike.
|
b. ShareAlike.
|
||||||
|
|
||||||
In addition to the conditions in Section 3(a), if You Share
|
In addition to the conditions in Section 3(a), if You Share
|
||||||
Adapted Material You produce, the following conditions also apply.
|
Adapted Material You produce, the following conditions also apply.
|
||||||
|
|
||||||
1. The Adapter's License You apply must be a Creative Commons
|
1. The Adapter's License You apply must be a Creative Commons
|
||||||
license with the same License Elements, this version or
|
license with the same License Elements, this version or
|
||||||
later, or a BY-NC-SA Compatible License.
|
later, or a BY-NC-SA Compatible License.
|
||||||
|
|
||||||
2. You must include the text of, or the URI or hyperlink to, the
|
2. You must include the text of, or the URI or hyperlink to, the
|
||||||
Adapter's License You apply. You may satisfy this condition
|
Adapter's License You apply. You may satisfy this condition
|
||||||
in any reasonable manner based on the medium, means, and
|
in any reasonable manner based on the medium, means, and
|
||||||
context in which You Share Adapted Material.
|
context in which You Share Adapted Material.
|
||||||
|
|
||||||
3. You may not offer or impose any additional or different terms
|
3. You may not offer or impose any additional or different terms
|
||||||
or conditions on, or apply any Effective Technological
|
or conditions on, or apply any Effective Technological
|
||||||
Measures to, Adapted Material that restrict exercise of the
|
Measures to, Adapted Material that restrict exercise of the
|
||||||
rights granted under the Adapter's License You apply.
|
rights granted under the Adapter's License You apply.
|
||||||
|
|
||||||
Section 4 -- Sui Generis Database Rights.
|
Section 4 -- Sui Generis Database Rights.
|
||||||
|
|
||||||
Where the Licensed Rights include Sui Generis Database Rights that
|
Where the Licensed Rights include Sui Generis Database Rights that
|
||||||
apply to Your use of the Licensed Material:
|
apply to Your use of the Licensed Material:
|
||||||
|
|
||||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
||||||
to extract, reuse, reproduce, and Share all or a substantial
|
to extract, reuse, reproduce, and Share all or a substantial
|
||||||
portion of the contents of the database for NonCommercial purposes
|
portion of the contents of the database for NonCommercial purposes
|
||||||
only;
|
only;
|
||||||
|
|
||||||
b. if You include all or a substantial portion of the database
|
b. if You include all or a substantial portion of the database
|
||||||
contents in a database in which You have Sui Generis Database
|
contents in a database in which You have Sui Generis Database
|
||||||
Rights, then the database in which You have Sui Generis Database
|
Rights, then the database in which You have Sui Generis Database
|
||||||
Rights (but not its individual contents) is Adapted Material,
|
Rights (but not its individual contents) is Adapted Material,
|
||||||
including for purposes of Section 3(b); and
|
including for purposes of Section 3(b); and
|
||||||
|
|
||||||
c. You must comply with the conditions in Section 3(a) if You Share
|
c. You must comply with the conditions in Section 3(a) if You Share
|
||||||
all or a substantial portion of the contents of the database.
|
all or a substantial portion of the contents of the database.
|
||||||
|
|
||||||
For the avoidance of doubt, this Section 4 supplements and does not
|
For the avoidance of doubt, this Section 4 supplements and does not
|
||||||
replace Your obligations under this Public License where the Licensed
|
replace Your obligations under this Public License where the Licensed
|
||||||
Rights include other Copyright and Similar Rights.
|
Rights include other Copyright and Similar Rights.
|
||||||
|
|
||||||
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
||||||
|
|
||||||
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
||||||
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
||||||
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
||||||
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
||||||
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
||||||
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||||
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||||
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
||||||
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
||||||
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
||||||
|
|
||||||
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
||||||
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
||||||
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
||||||
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
||||||
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
||||||
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
||||||
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
||||||
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
||||||
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
||||||
|
|
||||||
c. The disclaimer of warranties and limitation of liability provided
|
c. The disclaimer of warranties and limitation of liability provided
|
||||||
above shall be interpreted in a manner that, to the extent
|
above shall be interpreted in a manner that, to the extent
|
||||||
possible, most closely approximates an absolute disclaimer and
|
possible, most closely approximates an absolute disclaimer and
|
||||||
waiver of all liability.
|
waiver of all liability.
|
||||||
|
|
||||||
Section 6 -- Term and Termination.
|
Section 6 -- Term and Termination.
|
||||||
|
|
||||||
a. This Public License applies for the term of the Copyright and
|
a. This Public License applies for the term of the Copyright and
|
||||||
Similar Rights licensed here. However, if You fail to comply with
|
Similar Rights licensed here. However, if You fail to comply with
|
||||||
this Public License, then Your rights under this Public License
|
this Public License, then Your rights under this Public License
|
||||||
terminate automatically.
|
terminate automatically.
|
||||||
|
|
||||||
b. Where Your right to use the Licensed Material has terminated under
|
b. Where Your right to use the Licensed Material has terminated under
|
||||||
Section 6(a), it reinstates:
|
Section 6(a), it reinstates:
|
||||||
|
|
||||||
1. automatically as of the date the violation is cured, provided
|
1. automatically as of the date the violation is cured, provided
|
||||||
it is cured within 30 days of Your discovery of the
|
it is cured within 30 days of Your discovery of the
|
||||||
violation; or
|
violation; or
|
||||||
|
|
||||||
2. upon express reinstatement by the Licensor.
|
2. upon express reinstatement by the Licensor.
|
||||||
|
|
||||||
For the avoidance of doubt, this Section 6(b) does not affect any
|
For the avoidance of doubt, this Section 6(b) does not affect any
|
||||||
right the Licensor may have to seek remedies for Your violations
|
right the Licensor may have to seek remedies for Your violations
|
||||||
of this Public License.
|
of this Public License.
|
||||||
|
|
||||||
c. For the avoidance of doubt, the Licensor may also offer the
|
c. For the avoidance of doubt, the Licensor may also offer the
|
||||||
Licensed Material under separate terms or conditions or stop
|
Licensed Material under separate terms or conditions or stop
|
||||||
distributing the Licensed Material at any time; however, doing so
|
distributing the Licensed Material at any time; however, doing so
|
||||||
will not terminate this Public License.
|
will not terminate this Public License.
|
||||||
|
|
||||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
||||||
License.
|
License.
|
||||||
|
|
||||||
Section 7 -- Other Terms and Conditions.
|
Section 7 -- Other Terms and Conditions.
|
||||||
|
|
||||||
a. The Licensor shall not be bound by any additional or different
|
a. The Licensor shall not be bound by any additional or different
|
||||||
terms or conditions communicated by You unless expressly agreed.
|
terms or conditions communicated by You unless expressly agreed.
|
||||||
|
|
||||||
b. Any arrangements, understandings, or agreements regarding the
|
b. Any arrangements, understandings, or agreements regarding the
|
||||||
Licensed Material not stated herein are separate from and
|
Licensed Material not stated herein are separate from and
|
||||||
independent of the terms and conditions of this Public License.
|
independent of the terms and conditions of this Public License.
|
||||||
|
|
||||||
Section 8 -- Interpretation.
|
Section 8 -- Interpretation.
|
||||||
|
|
||||||
a. For the avoidance of doubt, this Public License does not, and
|
a. For the avoidance of doubt, this Public License does not, and
|
||||||
shall not be interpreted to, reduce, limit, restrict, or impose
|
shall not be interpreted to, reduce, limit, restrict, or impose
|
||||||
conditions on any use of the Licensed Material that could lawfully
|
conditions on any use of the Licensed Material that could lawfully
|
||||||
be made without permission under this Public License.
|
be made without permission under this Public License.
|
||||||
|
|
||||||
b. To the extent possible, if any provision of this Public License is
|
b. To the extent possible, if any provision of this Public License is
|
||||||
deemed unenforceable, it shall be automatically reformed to the
|
deemed unenforceable, it shall be automatically reformed to the
|
||||||
minimum extent necessary to make it enforceable. If the provision
|
minimum extent necessary to make it enforceable. If the provision
|
||||||
cannot be reformed, it shall be severed from this Public License
|
cannot be reformed, it shall be severed from this Public License
|
||||||
without affecting the enforceability of the remaining terms and
|
without affecting the enforceability of the remaining terms and
|
||||||
conditions.
|
conditions.
|
||||||
|
|
||||||
c. No term or condition of this Public License will be waived and no
|
c. No term or condition of this Public License will be waived and no
|
||||||
failure to comply consented to unless expressly agreed to by the
|
failure to comply consented to unless expressly agreed to by the
|
||||||
Licensor.
|
Licensor.
|
||||||
|
|
||||||
d. Nothing in this Public License constitutes or may be interpreted
|
d. Nothing in this Public License constitutes or may be interpreted
|
||||||
as a limitation upon, or waiver of, any privileges and immunities
|
as a limitation upon, or waiver of, any privileges and immunities
|
||||||
that apply to the Licensor or You, including from the legal
|
that apply to the Licensor or You, including from the legal
|
||||||
processes of any jurisdiction or authority.
|
processes of any jurisdiction or authority.
|
||||||
|
|
||||||
=======================================================================
|
=======================================================================
|
||||||
|
|
||||||
Creative Commons is not a party to its public
|
Creative Commons is not a party to its public
|
||||||
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
||||||
its public licenses to material it publishes and in those instances
|
its public licenses to material it publishes and in those instances
|
||||||
will be considered the “Licensor.” The text of the Creative Commons
|
will be considered the “Licensor.” The text of the Creative Commons
|
||||||
public licenses is dedicated to the public domain under the CC0 Public
|
public licenses is dedicated to the public domain under the CC0 Public
|
||||||
Domain Dedication. Except for the limited purpose of indicating that
|
Domain Dedication. Except for the limited purpose of indicating that
|
||||||
material is shared under a Creative Commons public license or as
|
material is shared under a Creative Commons public license or as
|
||||||
otherwise permitted by the Creative Commons policies published at
|
otherwise permitted by the Creative Commons policies published at
|
||||||
creativecommons.org/policies, Creative Commons does not authorize the
|
creativecommons.org/policies, Creative Commons does not authorize the
|
||||||
use of the trademark "Creative Commons" or any other trademark or logo
|
use of the trademark "Creative Commons" or any other trademark or logo
|
||||||
of Creative Commons without its prior written consent including,
|
of Creative Commons without its prior written consent including,
|
||||||
without limitation, in connection with any unauthorized modifications
|
without limitation, in connection with any unauthorized modifications
|
||||||
to any of its public licenses or any other arrangements,
|
to any of its public licenses or any other arrangements,
|
||||||
understandings, or agreements concerning use of licensed material. For
|
understandings, or agreements concerning use of licensed material. For
|
||||||
the avoidance of doubt, this paragraph does not form part of the
|
the avoidance of doubt, this paragraph does not form part of the
|
||||||
public licenses.
|
public licenses.
|
||||||
|
|
||||||
Creative Commons may be contacted at creativecommons.org.
|
Creative Commons may be contacted at creativecommons.org.
|
||||||
|
|
122
README.md
122
README.md
|
@ -1,61 +1,61 @@
|
||||||
<h1 align="center"> CATH </h1>
|
<h1 align="center"> CATH </h1>
|
||||||
|
|
||||||
<!-- header -->
|
<!-- header -->
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src = "https://media.discordapp.net/attachments/842014909264953354/867806346593042483/Cath-temp-banner.png?width=1244&height=415">
|
<img src = "https://media.discordapp.net/attachments/842014909264953354/867806346593042483/Cath-temp-banner.png?width=1244&height=415">
|
||||||
<br>
|
<br>
|
||||||
<a href="https://npmjs.org/package/cath" target="_blank"><img alt='Version' src="https://img.shields.io/github/package-json/v/night0721/cath?style=for-the-badge&color=555555&labelColor=02023a"></a> <a href="https://npmjs.org/package/cath" target="_blank"><img alt='Download' src="https://img.shields.io/npm/dt/cath?style=for-the-badge&color=02023a"></a>
|
<a href="https://npmjs.org/package/cath" target="_blank"><img alt='Version' src="https://img.shields.io/github/package-json/v/night0721/cath?style=for-the-badge&color=555555&labelColor=02023a"></a> <a href="https://npmjs.org/package/cath" target="_blank"><img alt='Download' src="https://img.shields.io/npm/dt/cath?style=for-the-badge&color=02023a"></a>
|
||||||
<a href="https://github.com/night0721/cath/blob/main/LICENSE" target="_blank"><img alt='Package' src="https://img.shields.io/npm/l/cath?color=02023a&style=for-the-badge"></a>
|
<a href="https://github.com/night0721/cath/blob/main/LICENSE" target="_blank"><img alt='Package' src="https://img.shields.io/npm/l/cath?color=02023a&style=for-the-badge"></a>
|
||||||
<a href="https://github.com/night0721/cath" target="_blank"><img alt='Repo Stars' src="https://img.shields.io/github/stars/night0721/cath?logo=github&color=555555&labelColor=02023a&style=for-the-badge"></a>
|
<a href="https://github.com/night0721/cath" target="_blank"><img alt='Repo Stars' src="https://img.shields.io/github/stars/night0721/cath?logo=github&color=555555&labelColor=02023a&style=for-the-badge"></a>
|
||||||
<a href="https://ko-fi.com/I2I35XISJ" target="_blank"><img alt='Kofi' src="https://img.shields.io/static/v1?label=Support%20Us&message=KO.FI&color=ff5e5b&logo=kofi&logoColor=white&style=for-the-badge&scale=1.4"></a>
|
<a href="https://ko-fi.com/I2I35XISJ" target="_blank"><img alt='Kofi' src="https://img.shields.io/static/v1?label=Support%20Us&message=KO.FI&color=ff5e5b&logo=kofi&logoColor=white&style=for-the-badge&scale=1.4"></a>
|
||||||
<br>
|
<br>
|
||||||
<a href="https://rebrand.ly/cathSupport"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner2" alt="Support Server" /></a>
|
<a href="https://rebrand.ly/cathSupport"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner2" alt="Support Server" /></a>
|
||||||
<br>
|
<br>
|
||||||
<a href="https://npmjs.org/package/cath" target="_blank"><img alt='Node Package' src="https://nodei.co/npm/cath.png"></a>
|
<a href="https://npmjs.org/package/cath" target="_blank"><img alt='Node Package' src="https://nodei.co/npm/cath.png"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
**Cath** is a powerful [Node.js](https://nodejs.org) module that can easily interact and get data from the Cath API
|
**Cath** is a powerful [Node.js](https://nodejs.org) module that can easily interact and get data from the Cath API
|
||||||
If you like this package, feel free to <img src = "https://discord.com/assets/141d49436743034a59dec6bd5618675d.svg" width = "16"> **Star** and **fork** this repository.<br><br>
|
If you like this package, feel free to <img src = "https://discord.com/assets/141d49436743034a59dec6bd5618675d.svg" width = "16"> **Star** and **fork** this repository.<br><br>
|
||||||
|
|
||||||
# Install the package ✔
|
# Install the package ✔
|
||||||
|
|
||||||
Download from npm
|
Download from npm
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
npm install cath
|
npm install cath
|
||||||
```
|
```
|
||||||
|
|
||||||
Download from yarn
|
Download from yarn
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
yarn add cath
|
yarn add cath
|
||||||
```
|
```
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### Launch of the module
|
### Launch of the module
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const cath = require("cath");
|
const cath = require("cath");
|
||||||
|
|
||||||
const reddit_data = await cath.getreddit("meme");
|
const reddit_data = await cath.getreddit("meme");
|
||||||
console.log(reddit_data); // returns an object
|
console.log(reddit_data); // returns an object
|
||||||
|
|
||||||
const answer = await cath.random8ball();
|
const answer = await cath.random8ball();
|
||||||
console.log(answer); // a random answer from 8ball
|
console.log(answer); // a random answer from 8ball
|
||||||
```
|
```
|
||||||
|
|
||||||
# Support, Feature Request & Bug Reports
|
# Support, Feature Request & Bug Reports
|
||||||
|
|
||||||
## <img src = "https://cdn.discordapp.com/emojis/867093614403256350.png?v=1" width = 18> Support & Feature Request
|
## <img src = "https://cdn.discordapp.com/emojis/867093614403256350.png?v=1" width = 18> Support & Feature Request
|
||||||
|
|
||||||
Join the official [Support Server](https://discord.gg/SbQHChmGcp) on Discord & we will be happy to assist you. <br>
|
Join the official [Support Server](https://discord.gg/SbQHChmGcp) on Discord & we will be happy to assist you. <br>
|
||||||
To Request new features contact us on Discord using the support server.
|
To Request new features contact us on Discord using the support server.
|
||||||
|
|
||||||
## <img src = "https://cdn.discordapp.com/emojis/867093601962950666.png?v=1" width = "18"> Report Bugs
|
## <img src = "https://cdn.discordapp.com/emojis/867093601962950666.png?v=1" width = "18"> Report Bugs
|
||||||
|
|
||||||
You can report bugs or issues by opening a issue in this repository. Alternatevely you can also contact us on Discord using the support server.
|
You can report bugs or issues by opening a issue in this repository. Alternatevely you can also contact us on Discord using the support server.
|
||||||
|
|
||||||
<p align = "center">
|
<p align = "center">
|
||||||
<a href="https://rebrand.ly/cathSupport" target="_blank"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner1"></a>
|
<a href="https://rebrand.ly/cathSupport" target="_blank"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner1"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
export interface CODMClientOptions {
|
export interface CODMClientOptions {
|
||||||
/**
|
/**
|
||||||
* Authorisation key for the API
|
* Authorisation key for the API
|
||||||
*/
|
*/
|
||||||
key: string;
|
key: string;
|
||||||
}
|
}
|
||||||
export interface PerkData {
|
export interface PerkData {
|
||||||
name: string;
|
name: string;
|
||||||
perk: string;
|
perk: string;
|
||||||
effects: string;
|
effects: string;
|
||||||
type: string;
|
type: string;
|
||||||
}
|
}
|
||||||
export interface ScorestreakData {
|
export interface ScorestreakData {
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
special: string;
|
special: string;
|
||||||
cost: number;
|
cost: number;
|
||||||
type: string;
|
type: string;
|
||||||
manual: boolean;
|
manual: boolean;
|
||||||
preview: string;
|
preview: string;
|
||||||
preview_video: string;
|
preview_video: string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,47 +1,47 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
import { config } from "../";
|
import { config } from "../";
|
||||||
import { PerkData, ScorestreakData } from "./codmclient.interface";
|
import { PerkData, ScorestreakData } from "./codmclient.interface";
|
||||||
/**
|
/**
|
||||||
* @name APIClient
|
* @name APIClient
|
||||||
* @kind constructor
|
* @kind constructor
|
||||||
* @param {String} key Authorization Key for API (Only for CODM commands)
|
* @param {String} key Authorization Key for API (Only for CODM commands)
|
||||||
*/
|
*/
|
||||||
export class CODMClient {
|
export class CODMClient {
|
||||||
constructor(public key: string) {
|
constructor(public key: string) {
|
||||||
if (!key) throw new CathError("Missing 'key' property");
|
if (!key) throw new CathError("Missing 'key' property");
|
||||||
if (key && typeof key !== "string")
|
if (key && typeof key !== "string")
|
||||||
throw new CathError("API key must be a string");
|
throw new CathError("API key must be a string");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Sends a CODM perk object
|
* Sends a CODM perk object
|
||||||
* @return {Promise<PerkData>}
|
* @return {Promise<PerkData>}
|
||||||
* @param {String} name
|
* @param {String} name
|
||||||
*/
|
*/
|
||||||
public async getperk(name: string): Promise<PerkData> {
|
public async getperk(name: string): Promise<PerkData> {
|
||||||
const data = await axios
|
const data = await axios
|
||||||
.get(`${config.api}/api/v1/codm/perk?name=${name}`, {
|
.get(`${config.api}/api/v1/codm/perk?name=${name}`, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: this.key,
|
Authorization: this.key,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(res => res.data)
|
.then(res => res.data)
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
throw new CathError(`Unauthorized to use`);
|
throw new CathError(`Unauthorized to use`);
|
||||||
});
|
});
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
public async getscorestreak(name: string): Promise<ScorestreakData> {
|
public async getscorestreak(name: string): Promise<ScorestreakData> {
|
||||||
const data = await axios
|
const data = await axios
|
||||||
.get(`${config.api}/api/v1/codm/scorestreak?name=${name}`, {
|
.get(`${config.api}/api/v1/codm/scorestreak?name=${name}`, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: this.key,
|
Authorization: this.key,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(res => res.data)
|
.then(res => res.data)
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
throw new CathError(`Unauthorized to use`);
|
throw new CathError(`Unauthorized to use`);
|
||||||
});
|
});
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
export {
|
export {
|
||||||
CODMClientOptions,
|
CODMClientOptions,
|
||||||
PerkData,
|
PerkData,
|
||||||
ScorestreakData,
|
ScorestreakData,
|
||||||
} from "./codmclient.interface";
|
} from "./codmclient.interface";
|
||||||
export { CODMClient } from "./codmclient";
|
export { CODMClient } from "./codmclient";
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export interface CodeData {
|
export interface CodeData {
|
||||||
id: string;
|
id: string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +1,32 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { config } from "../";
|
import { config } from "../";
|
||||||
import { CodeData } from "./codeclient.interface";
|
import { CodeData } from "./codeclient.interface";
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
/**
|
/**
|
||||||
* @name CodeClient
|
* @name CodeClient
|
||||||
* @kind constructor
|
* @kind constructor
|
||||||
*/
|
*/
|
||||||
export class CodeClient {
|
export class CodeClient {
|
||||||
constructor() {}
|
constructor() {}
|
||||||
/**
|
/**
|
||||||
* Sends the link of the code
|
* Sends the link of the code
|
||||||
* @return {Promise<CodeData>}
|
* @return {Promise<CodeData>}
|
||||||
* @param {String} key
|
* @param {String} key
|
||||||
* @param {String} code
|
* @param {String} code
|
||||||
*/
|
*/
|
||||||
public async createBin(key: String, code: String): Promise<CodeData> {
|
public async createBin(key: String, code: String): Promise<CodeData> {
|
||||||
if (!key) throw new CathError("Missing 'key' property");
|
if (!key) throw new CathError("Missing 'key' property");
|
||||||
if (!code) throw new CathError("Missing 'code' property");
|
if (!code) throw new CathError("Missing 'code' property");
|
||||||
const data = await axios
|
const data = await axios
|
||||||
.post(config.code, {
|
.post(config.code, {
|
||||||
key,
|
key,
|
||||||
value: code,
|
value: code,
|
||||||
})
|
})
|
||||||
.then(res => res.data);
|
.then(res => res.data);
|
||||||
if (data?.url) {
|
if (data?.url) {
|
||||||
return data?.url;
|
return data?.url;
|
||||||
} else {
|
} else {
|
||||||
throw new CathError(`Code already exist`);
|
throw new CathError(`Code already exist`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
export { CodeData } from "./codeclient.interface";
|
export { CodeData } from "./codeclient.interface";
|
||||||
export { CodeClient } from "./codeclient";
|
export { CodeClient } from "./codeclient";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
export class CathError extends Error {
|
export class CathError extends Error {
|
||||||
constructor(err: string) {
|
constructor(err: string) {
|
||||||
super(err);
|
super(err);
|
||||||
console.log(`Cath Error: ${err}`);
|
console.log(`Cath Error: ${err}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,60 +1,60 @@
|
||||||
import { Client } from "discord.js";
|
import { Client } from "discord.js";
|
||||||
export interface GiveawaySchema {
|
export interface GiveawaySchema {
|
||||||
Guild: string;
|
Guild: string;
|
||||||
Channel: string;
|
Channel: string;
|
||||||
Message: string;
|
Message: string;
|
||||||
HostBy: string;
|
HostBy: string;
|
||||||
End: number;
|
End: number;
|
||||||
Start: number;
|
Start: number;
|
||||||
Award: string;
|
Award: string;
|
||||||
Winners: number;
|
Winners: number;
|
||||||
Ended: boolean;
|
Ended: boolean;
|
||||||
Invites: number;
|
Invites: number;
|
||||||
Requirements: { Enabled: boolean; Roles?: [string] };
|
Requirements: { Enabled: boolean; Roles?: [string] };
|
||||||
Clickers: [string];
|
Clickers: [string];
|
||||||
}
|
}
|
||||||
export interface InviteSchema {
|
export interface InviteSchema {
|
||||||
User: string;
|
User: string;
|
||||||
Invites: [
|
Invites: [
|
||||||
object: {
|
object: {
|
||||||
Guild: string;
|
Guild: string;
|
||||||
Invite: string;
|
Invite: string;
|
||||||
Invited: string;
|
Invited: string;
|
||||||
Inviter: string;
|
Inviter: string;
|
||||||
Uses: number;
|
Uses: number;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
export interface GiveawaysClientOptions {
|
export interface GiveawaysClientOptions {
|
||||||
/**
|
/**
|
||||||
* Discord Client
|
* Discord Client
|
||||||
*/
|
*/
|
||||||
client: Client;
|
client: Client;
|
||||||
/**
|
/**
|
||||||
* Connection URI for the MongoDB
|
* Connection URI for the MongoDB
|
||||||
*/
|
*/
|
||||||
MongooseConnectionURI: string;
|
MongooseConnectionURI: string;
|
||||||
/**
|
/**
|
||||||
* Customizable messages for the giveaway embed
|
* Customizable messages for the giveaway embed
|
||||||
*/
|
*/
|
||||||
GiveawayMessages: DefaultGiveawayMessages;
|
GiveawayMessages: DefaultGiveawayMessages;
|
||||||
}
|
}
|
||||||
export interface DefaultGiveawayMessages {
|
export interface DefaultGiveawayMessages {
|
||||||
dmWinner: true;
|
dmWinner: true;
|
||||||
giveaway: "🎉🎉 **GIVEAWAY!** 🎉🎉";
|
giveaway: "🎉🎉 **GIVEAWAY!** 🎉🎉";
|
||||||
giveawayDescription: "🎁 Award: **{award}**\n🎊 Hosted by: {hostedBy}\n⏲️ Winner(s): `{winners}` \n🙏 Entrants: {totalParticipants} \n\n**Requirements:** {requirements}\n**Required Invites:** {invites}";
|
giveawayDescription: "🎁 Award: **{award}**\n🎊 Hosted by: {hostedBy}\n⏲️ Winner(s): `{winners}` \n🙏 Entrants: {totalParticipants} \n\n**Requirements:** {requirements}\n**Required Invites:** {invites}";
|
||||||
giveawayFooterImage: "https://emoji.gg/assets/emoji/3461-giveaway.gif";
|
giveawayFooterImage: "https://emoji.gg/assets/emoji/3461-giveaway.gif";
|
||||||
winMessage: "congratulations {winners}! You have won **{prize}** from total `{totalParticipants}` entrants!";
|
winMessage: "congratulations {winners}! You have won **{prize}** from total `{totalParticipants}` entrants!";
|
||||||
rerolledMessage: "Rerolled! {winner} is the new winner of the giveaway!"; // only {winner} placeholder
|
rerolledMessage: "Rerolled! {winner} is the new winner of the giveaway!"; // only {winner} placeholder
|
||||||
toParticipate: "**Click the `Enter` button to enter the giveaway!**";
|
toParticipate: "**Click the `Enter` button to enter the giveaway!**";
|
||||||
newParticipant: "You have successfully entered for this giveaway! There are total `{totalParticipants}` entrants"; // no placeholders | ephemeral
|
newParticipant: "You have successfully entered for this giveaway! There are total `{totalParticipants}` entrants"; // no placeholders | ephemeral
|
||||||
alreadyParticipated: "**You have already participated in this giveaway!**"; // no placeholders | ephemeral
|
alreadyParticipated: "**You have already participated in this giveaway!**"; // no placeholders | ephemeral
|
||||||
noParticipants: "There isn't enough entrant in this giveaway!"; // no placeholders
|
noParticipants: "There isn't enough entrant in this giveaway!"; // no placeholders
|
||||||
dmMessage: "You have won a giveaway in **{guildName}**!\nPrize: [{prize}]({giveawayURL})";
|
dmMessage: "You have won a giveaway in **{guildName}**!\nPrize: [{prize}]({giveawayURL})";
|
||||||
noWinner: "There isn't any winner in this giveaway due to not enough entrants"; // no {winner} placerholder
|
noWinner: "There isn't any winner in this giveaway due to not enough entrants"; // no {winner} placerholder
|
||||||
alreadyEnded: "The giveaway had already ended!"; // no {winner} placeholder
|
alreadyEnded: "The giveaway had already ended!"; // no {winner} placeholder
|
||||||
noWeeklyExp: "you dont have the required minimum weekly xp to join this giveaway";
|
noWeeklyExp: "you dont have the required minimum weekly xp to join this giveaway";
|
||||||
noLevel: "You dont have the minimum required level to join this giveaway";
|
noLevel: "You dont have the minimum required level to join this giveaway";
|
||||||
nonoRole: "You don't the required role(s)\n{requiredRoles} role(s) to join the giveaway";
|
nonoRole: "You don't the required role(s)\n{requiredRoles} role(s) to join the giveaway";
|
||||||
editParticipants: true;
|
editParticipants: true;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
||||||
export { GiveawaysClient } from "./giveaway";
|
export { GiveawaysClient } from "./giveaway";
|
||||||
export {
|
export {
|
||||||
GiveawaySchema,
|
GiveawaySchema,
|
||||||
GiveawaysClientOptions,
|
GiveawaysClientOptions,
|
||||||
DefaultGiveawayMessages,
|
DefaultGiveawayMessages,
|
||||||
} from "./giveaway.interface";
|
} from "./giveaway.interface";
|
||||||
|
|
|
@ -1,67 +1,67 @@
|
||||||
import { config } from "../";
|
import { config } from "../";
|
||||||
/**
|
/**
|
||||||
* @name ImageClient
|
* @name ImageClient
|
||||||
* @kind constructor
|
* @kind constructor
|
||||||
*/
|
*/
|
||||||
export class ImageClient {
|
export class ImageClient {
|
||||||
constructor() {}
|
constructor() {}
|
||||||
private endpoint(end: string, ava: string, ava1?: string, ava2?: string) {
|
private endpoint(end: string, ava: string, ava1?: string, ava2?: string) {
|
||||||
if (ava && ava1 && !ava2)
|
if (ava && ava1 && !ava2)
|
||||||
return `${config.api}/api/v1/image/${end}?image=${ava}&image2=${ava1}`;
|
return `${config.api}/api/v1/image/${end}?image=${ava}&image2=${ava1}`;
|
||||||
else if (ava && ava1 && ava2)
|
else if (ava && ava1 && ava2)
|
||||||
return `${config.api}/api/v1/image/${end}?image=${ava}&image2=${ava1}&image3=${ava2}`;
|
return `${config.api}/api/v1/image/${end}?image=${ava}&image2=${ava1}&image3=${ava2}`;
|
||||||
else return `${config.api}/api/v1/image/${end}?image=${ava}`;
|
else return `${config.api}/api/v1/image/${end}?image=${ava}`;
|
||||||
}
|
}
|
||||||
public busted(AvatarURL: string) {
|
public busted(AvatarURL: string) {
|
||||||
return this.endpoint("busted", AvatarURL);
|
return this.endpoint("busted", AvatarURL);
|
||||||
}
|
}
|
||||||
public communism(AvatarURL: string) {
|
public communism(AvatarURL: string) {
|
||||||
return this.endpoint("communism", AvatarURL);
|
return this.endpoint("communism", AvatarURL);
|
||||||
}
|
}
|
||||||
public gun(AvatarURL: string) {
|
public gun(AvatarURL: string) {
|
||||||
return this.endpoint("gun", AvatarURL);
|
return this.endpoint("gun", AvatarURL);
|
||||||
}
|
}
|
||||||
public mask(AvatarURL: string) {
|
public mask(AvatarURL: string) {
|
||||||
return this.endpoint("mask", AvatarURL);
|
return this.endpoint("mask", AvatarURL);
|
||||||
}
|
}
|
||||||
public whodidthis(AvatarURL: string) {
|
public whodidthis(AvatarURL: string) {
|
||||||
return this.endpoint("whodidthis", AvatarURL);
|
return this.endpoint("whodidthis", AvatarURL);
|
||||||
}
|
}
|
||||||
public pray(AvatarURL: string) {
|
public pray(AvatarURL: string) {
|
||||||
return this.endpoint("pray", AvatarURL);
|
return this.endpoint("pray", AvatarURL);
|
||||||
}
|
}
|
||||||
public pressplay(AvatarURL: string) {
|
public pressplay(AvatarURL: string) {
|
||||||
return this.endpoint("pressplay", AvatarURL);
|
return this.endpoint("pressplay", AvatarURL);
|
||||||
}
|
}
|
||||||
public vr(AvatarURL: string) {
|
public vr(AvatarURL: string) {
|
||||||
return this.endpoint("vr", AvatarURL);
|
return this.endpoint("vr", AvatarURL);
|
||||||
}
|
}
|
||||||
public rifleshoot(AvatarURL: string) {
|
public rifleshoot(AvatarURL: string) {
|
||||||
return this.endpoint("rifleshoot", AvatarURL);
|
return this.endpoint("rifleshoot", AvatarURL);
|
||||||
}
|
}
|
||||||
public bestmeme(AvatarURL: string) {
|
public bestmeme(AvatarURL: string) {
|
||||||
return this.endpoint("bestmeme", AvatarURL);
|
return this.endpoint("bestmeme", AvatarURL);
|
||||||
}
|
}
|
||||||
public robert(AvatarURL: string) {
|
public robert(AvatarURL: string) {
|
||||||
return this.endpoint("robert", AvatarURL);
|
return this.endpoint("robert", AvatarURL);
|
||||||
}
|
}
|
||||||
public saveonlyone(
|
public saveonlyone(
|
||||||
AvatarURL1: string,
|
AvatarURL1: string,
|
||||||
AvatarURL2: string,
|
AvatarURL2: string,
|
||||||
AvatarURL3: string
|
AvatarURL3: string
|
||||||
) {
|
) {
|
||||||
return this.endpoint("saveonlyone", AvatarURL1, AvatarURL2, AvatarURL3);
|
return this.endpoint("saveonlyone", AvatarURL1, AvatarURL2, AvatarURL3);
|
||||||
}
|
}
|
||||||
public alone(AvatarURL: string) {
|
public alone(AvatarURL: string) {
|
||||||
return this.endpoint("alone", AvatarURL);
|
return this.endpoint("alone", AvatarURL);
|
||||||
}
|
}
|
||||||
public toilet(AvatarURL: string) {
|
public toilet(AvatarURL: string) {
|
||||||
return this.endpoint("toilet", AvatarURL);
|
return this.endpoint("toilet", AvatarURL);
|
||||||
}
|
}
|
||||||
public moment(AvatarURL: string) {
|
public moment(AvatarURL: string) {
|
||||||
return this.endpoint("moment", AvatarURL);
|
return this.endpoint("moment", AvatarURL);
|
||||||
}
|
}
|
||||||
public awesome(AvatarURL: string) {
|
public awesome(AvatarURL: string) {
|
||||||
return this.endpoint("awesome", AvatarURL);
|
return this.endpoint("awesome", AvatarURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
export { ImageClient } from "./image";
|
export { ImageClient } from "./image";
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
export { URLClient } from "./urlclient";
|
export { URLClient } from "./urlclient";
|
||||||
export { URLData } from "./urlclient.interface";
|
export { URLData } from "./urlclient.interface";
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export interface URLData {
|
export interface URLData {
|
||||||
url: String;
|
url: String;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,33 +1,33 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { config } from "../";
|
import { config } from "../";
|
||||||
import { URLData } from "./urlclient.interface";
|
import { URLData } from "./urlclient.interface";
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
/**
|
/**
|
||||||
* @name URLClient
|
* @name URLClient
|
||||||
* @kind constructor
|
* @kind constructor
|
||||||
*/
|
*/
|
||||||
export class URLClient {
|
export class URLClient {
|
||||||
constructor() {}
|
constructor() {}
|
||||||
/**
|
/**
|
||||||
* Sends the link of the URL
|
* Sends the link of the URL
|
||||||
* @return {Promise<URLData>}
|
* @return {Promise<URLData>}
|
||||||
* @param {String} shortName
|
* @param {String} shortName
|
||||||
* @param {String} targetURL
|
* @param {String} targetURL
|
||||||
*/
|
*/
|
||||||
public async createShortURL(
|
public async createShortURL(
|
||||||
shortName: string,
|
shortName: string,
|
||||||
targetURL: string
|
targetURL: string
|
||||||
): Promise<URLData> {
|
): Promise<URLData> {
|
||||||
if (!shortName) throw new CathError("Missing 'shortName' property");
|
if (!shortName) throw new CathError("Missing 'shortName' property");
|
||||||
if (!targetURL) throw new CathError("Missing 'targetURL' property");
|
if (!targetURL) throw new CathError("Missing 'targetURL' property");
|
||||||
const data = await axios
|
const data = await axios
|
||||||
.post(`${config.url}`, {
|
.post(`${config.url}`, {
|
||||||
shortUrl: shortName,
|
shortUrl: shortName,
|
||||||
fullUrl: targetURL,
|
fullUrl: targetURL,
|
||||||
})
|
})
|
||||||
.then(res => res.data);
|
.then(res => res.data);
|
||||||
if (data?.name) {
|
if (data?.name) {
|
||||||
return data?.name;
|
return data?.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
const config: ConfigURLS = {
|
const config: ConfigURLS = {
|
||||||
api: "https://api.night0721.me",
|
api: "https://api.night0721.me",
|
||||||
code: "https://cdn.night0721.me/api/paste",
|
code: "https://cdn.night0721.me/api/paste",
|
||||||
url: "https://cdn.night0721.me/api/url",
|
url: "https://cdn.night0721.me/api/url",
|
||||||
};
|
};
|
||||||
|
|
||||||
interface ConfigURLS {
|
interface ConfigURLS {
|
||||||
api: string;
|
api: string;
|
||||||
code: string;
|
code: string;
|
||||||
url: string;
|
url: string;
|
||||||
}
|
}
|
||||||
export { config, ConfigURLS };
|
export { config, ConfigURLS };
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { config } from "../";
|
import { config } from "../";
|
||||||
/**
|
/**
|
||||||
* Sends a 8ball response
|
* Sends a 8ball response
|
||||||
*/
|
*/
|
||||||
export async function random8ball(): Promise<string> {
|
export async function random8ball(): Promise<string> {
|
||||||
const data = await axios
|
const data = await axios
|
||||||
.get(`${config.api}/api/v1/fun/8ball`)
|
.get(`${config.api}/api/v1/fun/8ball`)
|
||||||
.then(res => res.data);
|
.then(res => res.data);
|
||||||
return data.answer;
|
return data.answer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
/**
|
/**
|
||||||
* Returns a string(00:00:00)
|
* Returns a string(00:00:00)
|
||||||
*/
|
*/
|
||||||
export function HHMMSS(str: string) {
|
export function HHMMSS(str: string) {
|
||||||
if (!str) throw new CathError("Missing 'str'");
|
if (!str) throw new CathError("Missing 'str'");
|
||||||
var sec_num = parseInt(str, 10);
|
var sec_num = parseInt(str, 10);
|
||||||
var hours = Math.floor(sec_num / 3600);
|
var hours = Math.floor(sec_num / 3600);
|
||||||
var minutes = Math.floor((sec_num - hours * 3600) / 60);
|
var minutes = Math.floor((sec_num - hours * 3600) / 60);
|
||||||
var seconds = sec_num - hours * 3600 - minutes * 60;
|
var seconds = sec_num - hours * 3600 - minutes * 60;
|
||||||
if (hours < 10) {
|
if (hours < 10) {
|
||||||
hours = 0 + hours;
|
hours = 0 + hours;
|
||||||
}
|
}
|
||||||
if (minutes < 10) {
|
if (minutes < 10) {
|
||||||
minutes = 0 + minutes;
|
minutes = 0 + minutes;
|
||||||
}
|
}
|
||||||
if (seconds < 10) {
|
if (seconds < 10) {
|
||||||
seconds = 0 + seconds;
|
seconds = 0 + seconds;
|
||||||
}
|
}
|
||||||
return hours + ":" + minutes + ":" + seconds;
|
return hours + ":" + minutes + ":" + seconds;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/**
|
/**
|
||||||
* Returns true/false
|
* Returns true/false
|
||||||
*/
|
*/
|
||||||
export function bool() {
|
export function bool() {
|
||||||
const arr = [true, false];
|
const arr = [true, false];
|
||||||
const num = arr[Math.floor(Math.random() * arr.length)];
|
const num = arr[Math.floor(Math.random() * arr.length)];
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
/**
|
/**
|
||||||
* Returns a string without " ` " or " @ "
|
* Returns a string without " ` " or " @ "
|
||||||
*/
|
*/
|
||||||
export function cleanText(text: string): string {
|
export function cleanText(text: string): string {
|
||||||
if (typeof text === "string") {
|
if (typeof text === "string") {
|
||||||
return text
|
return text
|
||||||
.replace(/`/g, "`" + String.fromCharCode(8203))
|
.replace(/`/g, "`" + String.fromCharCode(8203))
|
||||||
.replace(/@/g, "@" + String.fromCharCode(8203));
|
.replace(/@/g, "@" + String.fromCharCode(8203));
|
||||||
} else {
|
} else {
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
import { Message } from "discord.js";
|
import { Message } from "discord.js";
|
||||||
export async function confirmation(
|
export async function confirmation(
|
||||||
message: Message,
|
message: Message,
|
||||||
author,
|
author,
|
||||||
validReactions = [],
|
validReactions = [],
|
||||||
time = 60000
|
time = 60000
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
for (const reaction of validReactions) await message.react(reaction);
|
for (const reaction of validReactions) await message.react(reaction);
|
||||||
const filter = (reaction, user) =>
|
const filter = (reaction, user) =>
|
||||||
validReactions.includes(reaction.emoji.name) && user.id === author.id;
|
validReactions.includes(reaction.emoji.name) && user.id === author.id;
|
||||||
|
|
||||||
return message
|
return message
|
||||||
.awaitReactions({ filter, max: 1, time: time })
|
.awaitReactions({ filter, max: 1, time: time })
|
||||||
.then(collected => collected.first() && collected.first().emoji.name);
|
.then(collected => collected.first() && collected.first().emoji.name);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
|
|
||||||
export function daysAgo(date: Date) {
|
export function daysAgo(date: Date) {
|
||||||
if (!date) throw new CathError("Missing 'date'");
|
if (!date) throw new CathError("Missing 'date'");
|
||||||
let now = new Date();
|
let now = new Date();
|
||||||
let diff = now.getTime() - date.getTime();
|
let diff = now.getTime() - date.getTime();
|
||||||
let days = Math.floor(diff / 86400000);
|
let days = Math.floor(diff / 86400000);
|
||||||
return days + (days == 1 ? " day" : " days") + " ago";
|
return days + (days == 1 ? " day" : " days") + " ago";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,80 +1,80 @@
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
/**
|
/**
|
||||||
* Start a Discord Activity session
|
* Start a Discord Activity session
|
||||||
* @example
|
* @example
|
||||||
* const Cath = require("cath")
|
* const Cath = require("cath")
|
||||||
* const client = new Client()
|
* const client = new Client()
|
||||||
* const d = await Cath.DiscordActivity({
|
* const d = await Cath.DiscordActivity({
|
||||||
application: "youtube",
|
application: "youtube",
|
||||||
channel_id: "901542111005012099",
|
channel_id: "901542111005012099",
|
||||||
token: client.token,
|
token: client.token,
|
||||||
});
|
});
|
||||||
message.channel.send({ content: d });
|
message.channel.send({ content: d });
|
||||||
*/
|
*/
|
||||||
export async function DiscordActivity(options: DiscordActivityOptions) {
|
export async function DiscordActivity(options: DiscordActivityOptions) {
|
||||||
const all = {
|
const all = {
|
||||||
youtube: "880218394199220334",
|
youtube: "880218394199220334",
|
||||||
youtubedev: "880218832743055411",
|
youtubedev: "880218832743055411",
|
||||||
poker: "755827207812677713",
|
poker: "755827207812677713",
|
||||||
betrayal: "773336526917861400",
|
betrayal: "773336526917861400",
|
||||||
fishing: "814288819477020702",
|
fishing: "814288819477020702",
|
||||||
chess: "832012774040141894",
|
chess: "832012774040141894",
|
||||||
chessdev: "832012586023256104",
|
chessdev: "832012586023256104",
|
||||||
lettertile: "879863686565621790",
|
lettertile: "879863686565621790",
|
||||||
wordsnack: "879863976006127627",
|
wordsnack: "879863976006127627",
|
||||||
doodlecrew: "878067389634314250",
|
doodlecrew: "878067389634314250",
|
||||||
awkword: "879863881349087252",
|
awkword: "879863881349087252",
|
||||||
spellcast: "852509694341283871",
|
spellcast: "852509694341283871",
|
||||||
};
|
};
|
||||||
if (!all[options.application]) {
|
if (!all[options.application]) {
|
||||||
throw new CathError(
|
throw new CathError(
|
||||||
"Application ID is not valid, if you want to see the list of applications, check the docs at https://cath.js.org/interfaces/Applications.html"
|
"Application ID is not valid, if you want to see the list of applications, check the docs at https://cath.js.org/interfaces/Applications.html"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!options.token) {
|
if (!options.token) {
|
||||||
throw new CathError("Missing 'token'");
|
throw new CathError("Missing 'token'");
|
||||||
}
|
}
|
||||||
if (!options.channel_id) {
|
if (!options.channel_id) {
|
||||||
throw new CathError("Missing 'Channel ID'");
|
throw new CathError("Missing 'Channel ID'");
|
||||||
}
|
}
|
||||||
const data = await axios
|
const data = await axios
|
||||||
.post(
|
.post(
|
||||||
`https://discord.com/api/v9/channels/${options.channel_id}/invites`,
|
`https://discord.com/api/v9/channels/${options.channel_id}/invites`,
|
||||||
{
|
{
|
||||||
max_age: 86400,
|
max_age: 86400,
|
||||||
max_uses: 0,
|
max_uses: 0,
|
||||||
target_application_id: all[options.application],
|
target_application_id: all[options.application],
|
||||||
target_type: 2,
|
target_type: 2,
|
||||||
temporary: false,
|
temporary: false,
|
||||||
validate: null,
|
validate: null,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bot ${options.token}`,
|
Authorization: `Bot ${options.token}`,
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(res => res.data);
|
.then(res => res.data);
|
||||||
return `https://discord.com/invite/${data.code}`;
|
return `https://discord.com/invite/${data.code}`;
|
||||||
}
|
}
|
||||||
export interface DiscordActivityOptions {
|
export interface DiscordActivityOptions {
|
||||||
application: string;
|
application: string;
|
||||||
token: string;
|
token: string;
|
||||||
channel_id: string;
|
channel_id: string;
|
||||||
}
|
}
|
||||||
export interface Applications {
|
export interface Applications {
|
||||||
youtube: "880218394199220334";
|
youtube: "880218394199220334";
|
||||||
youtubedev: "880218832743055411";
|
youtubedev: "880218832743055411";
|
||||||
poker: "755827207812677713";
|
poker: "755827207812677713";
|
||||||
betrayal: "773336526917861400";
|
betrayal: "773336526917861400";
|
||||||
fishing: "814288819477020702";
|
fishing: "814288819477020702";
|
||||||
chess: "832012774040141894";
|
chess: "832012774040141894";
|
||||||
chessdev: "832012586023256104";
|
chessdev: "832012586023256104";
|
||||||
lettertile: "879863686565621790";
|
lettertile: "879863686565621790";
|
||||||
wordsnack: "879863976006127627";
|
wordsnack: "879863976006127627";
|
||||||
doodlecrew: "878067389634314250";
|
doodlecrew: "878067389634314250";
|
||||||
awkword: "879863881349087252";
|
awkword: "879863881349087252";
|
||||||
spellcast: "852509694341283871";
|
spellcast: "852509694341283871";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
import { config } from "../";
|
import { config } from "../";
|
||||||
/**
|
/**
|
||||||
* Dobulestruck words
|
* Dobulestruck words
|
||||||
*/
|
*/
|
||||||
export async function doublestruck(word: string): Promise<string> {
|
export async function doublestruck(word: string): Promise<string> {
|
||||||
if (!word) {
|
if (!word) {
|
||||||
throw new CathError("Missing 'word'");
|
throw new CathError("Missing 'word'");
|
||||||
}
|
}
|
||||||
const data = await axios
|
const data = await axios
|
||||||
.get(`${config.api}/api/v1/fun/doublestruck?text=${word}`)
|
.get(`${config.api}/api/v1/fun/doublestruck?text=${word}`)
|
||||||
.then(res => res.data);
|
.then(res => res.data);
|
||||||
console.log(data);
|
console.log(data);
|
||||||
return data.text;
|
return data.text;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,34 +1,34 @@
|
||||||
/**
|
/**
|
||||||
* Emoji-ify a string
|
* Emoji-ify a string
|
||||||
*/
|
*/
|
||||||
export function emojify(str: string): string {
|
export function emojify(str: string): string {
|
||||||
const s = {
|
const s = {
|
||||||
0: ":zero:",
|
0: ":zero:",
|
||||||
1: ":one:",
|
1: ":one:",
|
||||||
2: ":two:",
|
2: ":two:",
|
||||||
3: ":three:",
|
3: ":three:",
|
||||||
4: ":four:",
|
4: ":four:",
|
||||||
5: ":five:",
|
5: ":five:",
|
||||||
6: ":six:",
|
6: ":six:",
|
||||||
7: ":seven:",
|
7: ":seven:",
|
||||||
8: ":eight:",
|
8: ":eight:",
|
||||||
9: ":nine:",
|
9: ":nine:",
|
||||||
"#": ":hash:",
|
"#": ":hash:",
|
||||||
"*": ":asterisk:",
|
"*": ":asterisk:",
|
||||||
"!": ":grey_exclamation:",
|
"!": ":grey_exclamation:",
|
||||||
"?": ":grey_question:",
|
"?": ":grey_question:",
|
||||||
" ": " ",
|
" ": " ",
|
||||||
};
|
};
|
||||||
let ar = str
|
let ar = str
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.split("")
|
.split("")
|
||||||
.map(l => {
|
.map(l => {
|
||||||
if (/[a-z]/g.test(l)) {
|
if (/[a-z]/g.test(l)) {
|
||||||
return `:regional_indicator_${l}:`;
|
return `:regional_indicator_${l}:`;
|
||||||
} else if (s[l]) {
|
} else if (s[l]) {
|
||||||
return `${s[l]}`;
|
return `${s[l]}`;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.join("");
|
.join("");
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit the first letter of the string to uppercase
|
* Edit the first letter of the string to uppercase
|
||||||
*/
|
*/
|
||||||
export function formatUpper(str: string) {
|
export function formatUpper(str: string) {
|
||||||
if (!str) throw new CathError("Missing 'str'");
|
if (!str) throw new CathError("Missing 'str'");
|
||||||
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
import { config } from "../";
|
import { config } from "../";
|
||||||
/**
|
/**
|
||||||
* Sends a 8ball response
|
* Sends a 8ball response
|
||||||
*/
|
*/
|
||||||
export async function fractur(word: string): Promise<string> {
|
export async function fractur(word: string): Promise<string> {
|
||||||
if (!word) {
|
if (!word) {
|
||||||
throw new CathError("Missing 'word'");
|
throw new CathError("Missing 'word'");
|
||||||
}
|
}
|
||||||
const data = await axios
|
const data = await axios
|
||||||
.get(`${config.api}/api/v1/fun/fractur?text=${word}`)
|
.get(`${config.api}/api/v1/fun/fractur?text=${word}`)
|
||||||
.then(res => res.data);
|
.then(res => res.data);
|
||||||
console.log(data);
|
console.log(data);
|
||||||
return data.text;
|
return data.text;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +1,35 @@
|
||||||
/**
|
/**
|
||||||
* Generate a random password
|
* Generate a random password
|
||||||
* @param length The length of the password
|
* @param length The length of the password
|
||||||
* @param options The options for the password
|
* @param options The options for the password
|
||||||
*/
|
*/
|
||||||
export function generatePassword(
|
export function generatePassword(
|
||||||
length: number,
|
length: number,
|
||||||
options: GeneratePasswordOptions
|
options: GeneratePasswordOptions
|
||||||
) {
|
) {
|
||||||
const upper = options.upper || false;
|
const upper = options.upper || false;
|
||||||
const lower = options.lower || false;
|
const lower = options.lower || false;
|
||||||
const numbers = options.numbers || false;
|
const numbers = options.numbers || false;
|
||||||
const special = options.special || false;
|
const special = options.special || false;
|
||||||
const upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
const upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
const lowerChars = "abcdefghijklmnopqrstuvwxyz";
|
const lowerChars = "abcdefghijklmnopqrstuvwxyz";
|
||||||
const numberChars = "0123456789";
|
const numberChars = "0123456789";
|
||||||
const specialChars = "!@#$%^&*()_+-=[]{}|;':\",./<>?";
|
const specialChars = "!@#$%^&*()_+-=[]{}|;':\",./<>?";
|
||||||
let password = "";
|
let password = "";
|
||||||
let chars = "";
|
let chars = "";
|
||||||
if (upper) chars += upperChars;
|
if (upper) chars += upperChars;
|
||||||
if (lower) chars += lowerChars;
|
if (lower) chars += lowerChars;
|
||||||
if (numbers) chars += numberChars;
|
if (numbers) chars += numberChars;
|
||||||
if (special) chars += specialChars;
|
if (special) chars += specialChars;
|
||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
password += chars.charAt(Math.floor(Math.random() * chars.length));
|
password += chars.charAt(Math.floor(Math.random() * chars.length));
|
||||||
}
|
}
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GeneratePasswordOptions {
|
export interface GeneratePasswordOptions {
|
||||||
upper: boolean;
|
upper: boolean;
|
||||||
lower: boolean;
|
lower: boolean;
|
||||||
numbers: boolean;
|
numbers: boolean;
|
||||||
special: boolean;
|
special: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
const axios = require("axios");
|
const axios = require("axios");
|
||||||
/**
|
/**
|
||||||
* @name getLilaseDownloads
|
* @name getLilaseDownloads
|
||||||
* @description Get the number of downloads
|
* @description Get the number of downloads
|
||||||
*/
|
*/
|
||||||
export async function getLilaseDownloads(): Promise<number> {
|
export async function getLilaseDownloads(): Promise<number> {
|
||||||
const { data } = await axios.get(
|
const { data } = await axios.get(
|
||||||
"https://api.github.com/repos/night0721/Lilase/releases"
|
"https://api.github.com/repos/night0721/Lilase/releases"
|
||||||
);
|
);
|
||||||
let sum = 0;
|
let sum = 0;
|
||||||
data.forEach(release => {
|
data.forEach(release => {
|
||||||
sum += release.assets[0].download_count;
|
sum += release.assets[0].download_count;
|
||||||
});
|
});
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,138 +1,138 @@
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
var s = 1000;
|
var s = 1000;
|
||||||
var m = s * 60;
|
var m = s * 60;
|
||||||
var h = m * 60;
|
var h = m * 60;
|
||||||
var d = h * 24;
|
var d = h * 24;
|
||||||
var mn = d * 30;
|
var mn = d * 30;
|
||||||
var w = d * 7;
|
var w = d * 7;
|
||||||
var y = d * 365.25;
|
var y = d * 365.25;
|
||||||
export function parseString(val: string) {
|
export function parseString(val: string) {
|
||||||
var type = typeof val;
|
var type = typeof val;
|
||||||
if (type === "string" && val.length > 0) {
|
if (type === "string" && val.length > 0) {
|
||||||
return parse(val);
|
return parse(val);
|
||||||
}
|
}
|
||||||
throw new CathError("Missing 'val' or type of 'val' isn't a string");
|
throw new CathError("Missing 'val' or type of 'val' isn't a string");
|
||||||
}
|
}
|
||||||
export function parseMS(val: number, options?: msOptions) {
|
export function parseMS(val: number, options?: msOptions) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
if (isFinite(val)) {
|
if (isFinite(val)) {
|
||||||
return options?.long ? fmtLong(val) : fmtShort(val);
|
return options?.long ? fmtLong(val) : fmtShort(val);
|
||||||
}
|
}
|
||||||
throw new CathError("Missing 'val' or type of 'val' isn't a number");
|
throw new CathError("Missing 'val' or type of 'val' isn't a number");
|
||||||
}
|
}
|
||||||
function parse(str) {
|
function parse(str) {
|
||||||
str = String(str);
|
str = String(str);
|
||||||
if (str.length > 100) {
|
if (str.length > 100) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var match =
|
var match =
|
||||||
/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|months?|mths|mn|years?|yrs?|y)?$/i.exec(
|
/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|months?|mths|mn|years?|yrs?|y)?$/i.exec(
|
||||||
str
|
str
|
||||||
);
|
);
|
||||||
if (!match) {
|
if (!match) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var n = parseFloat(match[1]);
|
var n = parseFloat(match[1]);
|
||||||
var type = (match[2] || "ms").toLowerCase();
|
var type = (match[2] || "ms").toLowerCase();
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "years":
|
case "years":
|
||||||
case "year":
|
case "year":
|
||||||
case "yrs":
|
case "yrs":
|
||||||
case "yr":
|
case "yr":
|
||||||
case "y":
|
case "y":
|
||||||
return n * y;
|
return n * y;
|
||||||
case "month":
|
case "month":
|
||||||
case "months":
|
case "months":
|
||||||
case "mth":
|
case "mth":
|
||||||
case "mths":
|
case "mths":
|
||||||
return n * mn;
|
return n * mn;
|
||||||
case "weeks":
|
case "weeks":
|
||||||
case "week":
|
case "week":
|
||||||
case "w":
|
case "w":
|
||||||
return n * w;
|
return n * w;
|
||||||
case "days":
|
case "days":
|
||||||
case "day":
|
case "day":
|
||||||
case "d":
|
case "d":
|
||||||
return n * d;
|
return n * d;
|
||||||
case "hours":
|
case "hours":
|
||||||
case "hour":
|
case "hour":
|
||||||
case "hrs":
|
case "hrs":
|
||||||
case "hr":
|
case "hr":
|
||||||
case "h":
|
case "h":
|
||||||
return n * h;
|
return n * h;
|
||||||
case "minutes":
|
case "minutes":
|
||||||
case "minute":
|
case "minute":
|
||||||
case "mins":
|
case "mins":
|
||||||
case "min":
|
case "min":
|
||||||
case "m":
|
case "m":
|
||||||
return n * m;
|
return n * m;
|
||||||
case "seconds":
|
case "seconds":
|
||||||
case "second":
|
case "second":
|
||||||
case "secs":
|
case "secs":
|
||||||
case "sec":
|
case "sec":
|
||||||
case "s":
|
case "s":
|
||||||
return n * s;
|
return n * s;
|
||||||
case "milliseconds":
|
case "milliseconds":
|
||||||
case "millisecond":
|
case "millisecond":
|
||||||
case "msecs":
|
case "msecs":
|
||||||
case "msec":
|
case "msec":
|
||||||
case "ms":
|
case "ms":
|
||||||
return n;
|
return n;
|
||||||
default:
|
default:
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function fmtShort(ms: number): string {
|
function fmtShort(ms: number): string {
|
||||||
var msAbs = Math.abs(ms);
|
var msAbs = Math.abs(ms);
|
||||||
if (msAbs >= mn) {
|
if (msAbs >= mn) {
|
||||||
return Math.round(ms / mn) + "mo";
|
return Math.round(ms / mn) + "mo";
|
||||||
}
|
}
|
||||||
if (msAbs >= w) {
|
if (msAbs >= w) {
|
||||||
return Math.round(ms / w) + "w";
|
return Math.round(ms / w) + "w";
|
||||||
}
|
}
|
||||||
if (msAbs >= d) {
|
if (msAbs >= d) {
|
||||||
return Math.round(ms / d) + "d";
|
return Math.round(ms / d) + "d";
|
||||||
}
|
}
|
||||||
if (msAbs >= h) {
|
if (msAbs >= h) {
|
||||||
return Math.round(ms / h) + "h";
|
return Math.round(ms / h) + "h";
|
||||||
}
|
}
|
||||||
if (msAbs >= m) {
|
if (msAbs >= m) {
|
||||||
return Math.round(ms / m) + "m";
|
return Math.round(ms / m) + "m";
|
||||||
}
|
}
|
||||||
if (msAbs >= s) {
|
if (msAbs >= s) {
|
||||||
return Math.round(ms / s) + "s";
|
return Math.round(ms / s) + "s";
|
||||||
}
|
}
|
||||||
return ms + "ms";
|
return ms + "ms";
|
||||||
}
|
}
|
||||||
|
|
||||||
function fmtLong(ms: number) {
|
function fmtLong(ms: number) {
|
||||||
var msAbs = Math.abs(ms);
|
var msAbs = Math.abs(ms);
|
||||||
if (msAbs >= mn) {
|
if (msAbs >= mn) {
|
||||||
return plural(ms, msAbs, mn, "month");
|
return plural(ms, msAbs, mn, "month");
|
||||||
}
|
}
|
||||||
if (msAbs >= w) {
|
if (msAbs >= w) {
|
||||||
return plural(ms, msAbs, w, "week");
|
return plural(ms, msAbs, w, "week");
|
||||||
}
|
}
|
||||||
if (msAbs >= d) {
|
if (msAbs >= d) {
|
||||||
return plural(ms, msAbs, d, "day");
|
return plural(ms, msAbs, d, "day");
|
||||||
}
|
}
|
||||||
if (msAbs >= h) {
|
if (msAbs >= h) {
|
||||||
return plural(ms, msAbs, h, "hour");
|
return plural(ms, msAbs, h, "hour");
|
||||||
}
|
}
|
||||||
if (msAbs >= m) {
|
if (msAbs >= m) {
|
||||||
return plural(ms, msAbs, m, "minute");
|
return plural(ms, msAbs, m, "minute");
|
||||||
}
|
}
|
||||||
if (msAbs >= s) {
|
if (msAbs >= s) {
|
||||||
return plural(ms, msAbs, s, "second");
|
return plural(ms, msAbs, s, "second");
|
||||||
}
|
}
|
||||||
return ms + " ms";
|
return ms + " ms";
|
||||||
}
|
}
|
||||||
function plural(ms: number, msAbs: number, n: number, name: string) {
|
function plural(ms: number, msAbs: number, n: number, name: string) {
|
||||||
var isPlural = msAbs >= n * 1.5;
|
var isPlural = msAbs >= n * 1.5;
|
||||||
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
||||||
}
|
}
|
||||||
export interface msOptions {
|
export interface msOptions {
|
||||||
long?: boolean;
|
long?: boolean;
|
||||||
short?: boolean;
|
short?: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,42 +1,42 @@
|
||||||
/**
|
/**
|
||||||
* Obama!
|
* Obama!
|
||||||
*/
|
*/
|
||||||
export function obama() {
|
export function obama() {
|
||||||
const o = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠛⠛⠛⠉⠉⠉⠋⠛⠛⠛⠻⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
const o = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠛⠛⠛⠉⠉⠉⠋⠛⠛⠛⠻⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
||||||
const b = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠛⠉⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠉⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
const b = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠛⠉⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠉⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
||||||
const a = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
const a = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
||||||
const m = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠏⠄⠄⠄⠄⠄⠄⠄⠂⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⠹⣿⣿⣿⣿⣿⣿⣿";
|
const m = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠏⠄⠄⠄⠄⠄⠄⠄⠂⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⠹⣿⣿⣿⣿⣿⣿⣿";
|
||||||
const a2 = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠠⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠘⢻⣿⣿⣿⣿⣿";
|
const a2 = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠠⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠘⢻⣿⣿⣿⣿⣿";
|
||||||
const aa = "⣿⣿⣿⣿⣿⣿⣿⣿⠃⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢀⠄⢠⠄⠄⡀⠄⠄⢀⠂⠄⠄⠄⠄⠄⠄⠄⠄⠄⡁⠄⠄⢛⣿⣿⣿⣿";
|
const aa = "⣿⣿⣿⣿⣿⣿⣿⣿⠃⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢀⠄⢠⠄⠄⡀⠄⠄⢀⠂⠄⠄⠄⠄⠄⠄⠄⠄⠄⡁⠄⠄⢛⣿⣿⣿⣿";
|
||||||
const ab = "⣿⣿⣿⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠐⡈⢔⠸⣐⢕⢕⢵⢰⢱⢰⢐⢤⡡⡢⣕⢄⢢⢠⠄⠄⠄⠄⠄⠄⠙⣿⣿⣿";
|
const ab = "⣿⣿⣿⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠐⡈⢔⠸⣐⢕⢕⢵⢰⢱⢰⢐⢤⡡⡢⣕⢄⢢⢠⠄⠄⠄⠄⠄⠄⠙⣿⣿⣿";
|
||||||
const ac = "⣿⣿⣿⣿⣿⣿⣿⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⡁⠂⠅⢕⠌⡎⡎⣎⢎⢮⢮⣳⡳⣝⢮⢺⢜⢕⢕⢍⢎⠪⡐⠄⠁⠄⠸⣿⣿";
|
const ac = "⣿⣿⣿⣿⣿⣿⣿⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⡁⠂⠅⢕⠌⡎⡎⣎⢎⢮⢮⣳⡳⣝⢮⢺⢜⢕⢕⢍⢎⠪⡐⠄⠁⠄⠸⣿⣿";
|
||||||
const ad = "⣿⣿⣿⣿⣿⣿⠏⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠐⠄⠄⢅⠣⡡⡣⣣⡳⡵⣝⡮⣗⣗⡯⣗⣟⡮⡮⣳⣣⣳⢱⢱⠱⣐⠄⠂⠄⢿⣿";
|
const ad = "⣿⣿⣿⣿⣿⣿⠏⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠐⠄⠄⢅⠣⡡⡣⣣⡳⡵⣝⡮⣗⣗⡯⣗⣟⡮⡮⣳⣣⣳⢱⢱⠱⣐⠄⠂⠄⢿⣿";
|
||||||
const ae = "⣿⣿⣿⣿⣿⣿⠄⠄⠄⠄⠄⠄⠄⠂⠄⠄⠄⠄⠄⠄⢂⢈⠢⡱⡱⡝⣮⣿⣟⣿⣽⣷⣿⣯⣿⣷⣿⣿⣿⣾⣯⣗⡕⡇⡇⠄⠂⡀⢹⣿";
|
const ae = "⣿⣿⣿⣿⣿⣿⠄⠄⠄⠄⠄⠄⠄⠂⠄⠄⠄⠄⠄⠄⢂⢈⠢⡱⡱⡝⣮⣿⣟⣿⣽⣷⣿⣯⣿⣷⣿⣿⣿⣾⣯⣗⡕⡇⡇⠄⠂⡀⢹⣿";
|
||||||
const af = "⣿⣿⣿⣿⣿⡟⠄⠄⠄⠄⠄⠄⠂⠄⠄⠄⠄⠄⠄⠐⢀⢂⢕⢸⢨⢪⢳⡫⣟⣿⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡺⡮⡣⡣⠠⢂⠒⢸⣿";
|
const af = "⣿⣿⣿⣿⣿⡟⠄⠄⠄⠄⠄⠄⠂⠄⠄⠄⠄⠄⠄⠐⢀⢂⢕⢸⢨⢪⢳⡫⣟⣿⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡺⡮⡣⡣⠠⢂⠒⢸⣿";
|
||||||
const ag = "⣿⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠠⠐⠄⡂⠆⡇⣗⣝⢮⢾⣻⣞⣿⣿⣿⣿⣿⣿⣿⣿⢿⣽⣯⡯⣺⢸⢘⠨⠔⡅⢨⣿";
|
const ag = "⣿⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠠⠐⠄⡂⠆⡇⣗⣝⢮⢾⣻⣞⣿⣿⣿⣿⣿⣿⣿⣿⢿⣽⣯⡯⣺⢸⢘⠨⠔⡅⢨⣿";
|
||||||
const ah = "⣿⣿⠋⠉⠙⠃⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠁⠄⠄⠄⡂⡪⡪⡪⡮⡮⡯⣻⣽⣾⣿⣿⣿⣟⣿⣿⣿⣽⣿⣿⡯⣯⡺⡸⡰⡱⢐⡅⣼⣿";
|
const ah = "⣿⣿⠋⠉⠙⠃⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠁⠄⠄⠄⡂⡪⡪⡪⡮⡮⡯⣻⣽⣾⣿⣿⣿⣟⣿⣿⣿⣽⣿⣿⡯⣯⡺⡸⡰⡱⢐⡅⣼⣿";
|
||||||
const ai = "⣿⠡⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠠⠈⠆⠱⠑⠝⠜⠕⡝⡝⣞⢯⢿⣿⣿⡿⣟⣿⣿⣿⡿⡿⣽⣷⣽⡸⡨⡪⣂⠊⣿⣿";
|
const ai = "⣿⠡⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠠⠈⠆⠱⠑⠝⠜⠕⡝⡝⣞⢯⢿⣿⣿⡿⣟⣿⣿⣿⡿⡿⣽⣷⣽⡸⡨⡪⣂⠊⣿⣿";
|
||||||
const aj = "⣿⠡⠄⡨⣢⠐⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠐⠍⡓⣗⡽⣝⠽⠍⠅⠑⠁⠉⠘⠘⠘⠵⡑⢜⢀⢀⢉⢽";
|
const aj = "⣿⠡⠄⡨⣢⠐⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠐⠍⡓⣗⡽⣝⠽⠍⠅⠑⠁⠉⠘⠘⠘⠵⡑⢜⢀⢀⢉⢽";
|
||||||
const ak = "⣿⠁⠠⢱⢘⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⠈⠱⣁⠜⡘⠌⠄⠄⡪⣳⣟⡮⢅⠤⠠⠄⠄⣀⣀⡀⡀⠄⠈⡂⢲⡪⡠⣿";
|
const ak = "⣿⠁⠠⢱⢘⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⠈⠱⣁⠜⡘⠌⠄⠄⡪⣳⣟⡮⢅⠤⠠⠄⠄⣀⣀⡀⡀⠄⠈⡂⢲⡪⡠⣿";
|
||||||
const al = "⣿⡇⠨⣺⢐⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⡀⠄⠄⠄⠤⡠⡢⢒⠦⠠⠄⠄⠄⡸⢽⣟⢮⠢⡂⡐⠄⡈⡀⠤⡀⠄⠑⢄⠨⢸⡺⣐⣿";
|
const al = "⣿⡇⠨⣺⢐⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⡀⠄⠄⠄⠤⡠⡢⢒⠦⠠⠄⠄⠄⡸⢽⣟⢮⠢⡂⡐⠄⡈⡀⠤⡀⠄⠑⢄⠨⢸⡺⣐⣿";
|
||||||
const am = "⣿⣿⠈⠕⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⡂⡪⡐⡥⢤⣰⣰⣰⡴⡮⠢⠂⠄⠄⡊⢮⢺⢕⢵⢥⡬⣌⣒⡚⣔⢚⢌⢨⢚⠌⣾⡪⣾⣿";
|
const am = "⣿⣿⠈⠕⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⡂⡪⡐⡥⢤⣰⣰⣰⡴⡮⠢⠂⠄⠄⡊⢮⢺⢕⢵⢥⡬⣌⣒⡚⣔⢚⢌⢨⢚⠌⣾⡪⣾⣿";
|
||||||
const an = "⣿⣿⣆⠄⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⡑⢕⢕⡯⡷⣕⢧⢓⢭⠨⡀⠄⡂⠨⡨⣪⡳⣝⢝⡽⣻⣻⣞⢽⣲⢳⢱⢡⠱⠨⣟⢺⣿⣿";
|
const an = "⣿⣿⣆⠄⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⡑⢕⢕⡯⡷⣕⢧⢓⢭⠨⡀⠄⡂⠨⡨⣪⡳⣝⢝⡽⣻⣻⣞⢽⣲⢳⢱⢡⠱⠨⣟⢺⣿⣿";
|
||||||
const ao = "⣿⣿⣿⡆⠄⡅⠇⡄⠄⠄⠄⠄⠄⠄⠄⠐⠨⢪⢹⢽⢽⣺⢝⠉⠁⠁⠄⠄⠄⢌⢎⡖⡯⡎⡗⢝⠜⣶⣯⣻⢮⡻⣟⣳⡕⠅⣷⣿⣿⣿";
|
const ao = "⣿⣿⣿⡆⠄⡅⠇⡄⠄⠄⠄⠄⠄⠄⠄⠐⠨⢪⢹⢽⢽⣺⢝⠉⠁⠁⠄⠄⠄⢌⢎⡖⡯⡎⡗⢝⠜⣶⣯⣻⢮⡻⣟⣳⡕⠅⣷⣿⣿⣿";
|
||||||
const ap = "⣿⣿⣿⣿⣶⣶⣿⣷⠄⠄⠄⠄⠄⠄⠄⠄⠈⠔⡑⠕⠝⠄⡀⠄⠄⠊⢆⠂⠨⡪⣺⣮⣿⡾⡜⣜⡜⣄⠙⢞⣿⢿⡿⣗⢝⢸⣾⣿⣿⣿";
|
const ap = "⣿⣿⣿⣿⣶⣶⣿⣷⠄⠄⠄⠄⠄⠄⠄⠄⠈⠔⡑⠕⠝⠄⡀⠄⠄⠊⢆⠂⠨⡪⣺⣮⣿⡾⡜⣜⡜⣄⠙⢞⣿⢿⡿⣗⢝⢸⣾⣿⣿⣿";
|
||||||
const aq = "⣿⣿⣿⣿⣿⣿⣿⣿⠄⠄⠄⠄⠄⡀⠄⠄⠄⠄⢀⠄⠠⠄⠠⠄⠄⠄⠄⠄⠄⠊⠺⡹⠳⡙⡜⡓⡭⡺⡀⠄⠣⡻⡹⡸⠨⣣⣿⣿⣿⣿";
|
const aq = "⣿⣿⣿⣿⣿⣿⣿⣿⠄⠄⠄⠄⠄⡀⠄⠄⠄⠄⢀⠄⠠⠄⠠⠄⠄⠄⠄⠄⠄⠊⠺⡹⠳⡙⡜⡓⡭⡺⡀⠄⠣⡻⡹⡸⠨⣣⣿⣿⣿⣿";
|
||||||
const ar = "⣿⣿⣿⣿⣿⣿⣿⣿⠄⠄⠄⠄⠄⠠⠄⠄⣂⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢄⠤⡤⡄⡆⡯⡢⡣⡣⡓⢕⠽⣄⠄⠨⡂⢌⣼⣿⣿⣿⣿⣿";
|
const ar = "⣿⣿⣿⣿⣿⣿⣿⣿⠄⠄⠄⠄⠄⠠⠄⠄⣂⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢄⠤⡤⡄⡆⡯⡢⡣⡣⡓⢕⠽⣄⠄⠨⡂⢌⣼⣿⣿⣿⣿⣿";
|
||||||
const a_ = "⣿⣿⣿⣿⣿⣿⣿⣿⡆⠄⠄⠄⠄⠈⠆⠄⠸⡂⠄⠄⠄⢀⠄⢀⠈⠄⠂⠁⠙⠝⠼⠭⠣⠣⠣⠑⠌⠢⠣⡣⡠⡘⣰⣱⣿⣿⣿⣿⣿⣿";
|
const a_ = "⣿⣿⣿⣿⣿⣿⣿⣿⡆⠄⠄⠄⠄⠈⠆⠄⠸⡂⠄⠄⠄⢀⠄⢀⠈⠄⠂⠁⠙⠝⠼⠭⠣⠣⠣⠑⠌⠢⠣⡣⡠⡘⣰⣱⣿⣿⣿⣿⣿⣿";
|
||||||
const at = "⣿⣿⣿⣿⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⢑⠄⠈⡱⠄⢘⠄⡀⠨⢐⣧⣳⣷⣶⣦⣤⣴⣶⣶⣶⡶⠄⡠⡢⡕⣜⠎⡮⣣⣿⣿⣿⣿⣿⣿⣿";
|
const at = "⣿⣿⣿⣿⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⢑⠄⠈⡱⠄⢘⠄⡀⠨⢐⣧⣳⣷⣶⣦⣤⣴⣶⣶⣶⡶⠄⡠⡢⡕⣜⠎⡮⣣⣿⣿⣿⣿⣿⣿⣿";
|
||||||
const au = "⣿⣿⣿⣿⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⠄⠢⠄⠨⠄⠄⠣⡀⠄⢀⢀⢙⠃⡿⢿⠿⡿⡿⢟⢋⢔⡱⣝⢜⡜⡪⡪⣵⣿⣿⣿⣿⣿⣿⣿⣿";
|
const au = "⣿⣿⣿⣿⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⠄⠢⠄⠨⠄⠄⠣⡀⠄⢀⢀⢙⠃⡿⢿⠿⡿⡿⢟⢋⢔⡱⣝⢜⡜⡪⡪⣵⣿⣿⣿⣿⣿⣿⣿⣿";
|
||||||
const av = "⣿⣿⣿⣿⣿⣿⣿⣿⡁⠄⠄⠄⠄⠄⠄⠄⠅⠄⠡⠄⠄⠡⢀⢂⠢⡡⠡⠣⡑⣏⢯⡻⡳⣹⡺⡪⢎⠎⡆⢣⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
const av = "⣿⣿⣿⣿⣿⣿⣿⣿⡁⠄⠄⠄⠄⠄⠄⠄⠅⠄⠡⠄⠄⠡⢀⢂⠢⡡⠡⠣⡑⣏⢯⡻⡳⣹⡺⡪⢎⠎⡆⢣⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
||||||
const aw = "⣿⣿⣿⣿⣿⣿⣿⣿⣇⠄⠄⠄⠄⠄⠄⠄⠐⠄⠄⠁⠄⢈⠄⢂⠕⡕⡝⢕⢎⢎⢮⢎⢯⢺⢸⢬⠣⢃⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
const aw = "⣿⣿⣿⣿⣿⣿⣿⣿⣇⠄⠄⠄⠄⠄⠄⠄⠐⠄⠄⠁⠄⢈⠄⢂⠕⡕⡝⢕⢎⢎⢮⢎⢯⢺⢸⢬⠣⢃⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
||||||
const ax = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠠⠨⡐⠌⢆⢇⢧⢭⣣⡳⣵⢫⣳⢱⠱⢑⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
const ax = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠠⠨⡐⠌⢆⢇⢧⢭⣣⡳⣵⢫⣳⢱⠱⢑⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
||||||
const ay = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣆⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠁⡊⢌⢢⢡⢣⢪⡺⡪⡎⡎⡎⡚⣨⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
const ay = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣆⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠁⡊⢌⢢⢡⢣⢪⡺⡪⡎⡎⡎⡚⣨⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
||||||
const az = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠕⡅⢗⢕⡳⡭⣳⢕⠕⡱⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
const az = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠕⡅⢗⢕⡳⡭⣳⢕⠕⡱⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
||||||
const ba = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠌⠄⠑⠩⢈⢂⣱⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
const ba = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠌⠄⠑⠩⢈⢂⣱⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
||||||
const bb = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⡀⢄⠄⣀⠄⡀⣀⢠⢄⣖⣖⣞⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
const bb = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⡀⢄⠄⣀⠄⡀⣀⢠⢄⣖⣖⣞⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
||||||
const bc = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣱⡐⡕⡕⡽⣝⣟⣮⣾⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
const bc = "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣱⡐⡕⡕⡽⣝⣟⣮⣾⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿";
|
||||||
console.log(
|
console.log(
|
||||||
`${o}\n${b}\n${a}\n${m}\n${a2}\n${aa}\n${ab}\n${ac}\n${ad}\n${ae}\n${af}\n${ag}\n${ah}\n${ai}\n${aj}\n${ak}\n${al}\n${am}\n${an}\n${ao}\n${ap}\n${aq}\n${ar}\n${a_}\n${at}\n${au}\n${av}\n${aw}\n${ax}\n${ay}\n${az}\n${ba}\n${bb}\n${bc}`
|
`${o}\n${b}\n${a}\n${m}\n${a2}\n${aa}\n${ab}\n${ac}\n${ad}\n${ae}\n${af}\n${ag}\n${ah}\n${ai}\n${aj}\n${ak}\n${al}\n${am}\n${an}\n${ao}\n${ap}\n${aq}\n${ar}\n${a_}\n${at}\n${au}\n${av}\n${aw}\n${ax}\n${ay}\n${az}\n${ba}\n${bb}\n${bc}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,52 +1,52 @@
|
||||||
import { Message, MessageEmbed, User } from "discord.js";
|
import { Message, MessageEmbed, User } from "discord.js";
|
||||||
export class Pagination {
|
export class Pagination {
|
||||||
constructor() {}
|
constructor() {}
|
||||||
public chunk(arr, size: number) {
|
public chunk(arr, size: number) {
|
||||||
const temp = [];
|
const temp = [];
|
||||||
for (let i = 0; i < arr.length; i += size) {
|
for (let i = 0; i < arr.length; i += size) {
|
||||||
temp.push(arr.slice(i, i + size));
|
temp.push(arr.slice(i, i + size));
|
||||||
}
|
}
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
paginationEmojis = ["◀", "⛔", "▶"];
|
paginationEmojis = ["◀", "⛔", "▶"];
|
||||||
|
|
||||||
public async pagination(
|
public async pagination(
|
||||||
msg: Message,
|
msg: Message,
|
||||||
author: User,
|
author: User,
|
||||||
contents: MessageEmbed,
|
contents: MessageEmbed,
|
||||||
init = true,
|
init = true,
|
||||||
currPage = 0
|
currPage = 0
|
||||||
) {
|
) {
|
||||||
if (init) for (const emoji of this.paginationEmojis) await msg.react(emoji);
|
if (init) for (const emoji of this.paginationEmojis) await msg.react(emoji);
|
||||||
const filter = (reaction, user) => {
|
const filter = (reaction, user) => {
|
||||||
return (
|
return (
|
||||||
this.paginationEmojis.includes(reaction.emoji.name) &&
|
this.paginationEmojis.includes(reaction.emoji.name) &&
|
||||||
user.id === author.id
|
user.id === author.id
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
const collector = msg.createReactionCollector({
|
const collector = msg.createReactionCollector({
|
||||||
filter,
|
filter,
|
||||||
max: 1,
|
max: 1,
|
||||||
time: 90000,
|
time: 90000,
|
||||||
});
|
});
|
||||||
collector
|
collector
|
||||||
.on("collect", reaction => {
|
.on("collect", reaction => {
|
||||||
reaction.users.remove(author);
|
reaction.users.remove(author);
|
||||||
const emoji = reaction.emoji.name;
|
const emoji = reaction.emoji.name;
|
||||||
if (emoji === this.paginationEmojis[0]) currPage--;
|
if (emoji === this.paginationEmojis[0]) currPage--;
|
||||||
if (emoji === this.paginationEmojis[1]) return collector.stop();
|
if (emoji === this.paginationEmojis[1]) return collector.stop();
|
||||||
if (emoji === this.paginationEmojis[2]) currPage++;
|
if (emoji === this.paginationEmojis[2]) currPage++;
|
||||||
currPage =
|
currPage =
|
||||||
((currPage % contents.length) + contents.length) % contents.length;
|
((currPage % contents.length) + contents.length) % contents.length;
|
||||||
const embed = msg.embeds[0]
|
const embed = msg.embeds[0]
|
||||||
.setDescription(contents[currPage])
|
.setDescription(contents[currPage])
|
||||||
.setFooter(`Page ${currPage + 1} of ${contents.length}`);
|
.setFooter(`Page ${currPage + 1} of ${contents.length}`);
|
||||||
msg.edit({ embeds: [embed] });
|
msg.edit({ embeds: [embed] });
|
||||||
this.pagination(msg, author, contents, false, currPage);
|
this.pagination(msg, author, contents, false, currPage);
|
||||||
})
|
})
|
||||||
.on("end", (_, reason) => {
|
.on("end", (_, reason) => {
|
||||||
if (["time", "user"].includes(reason)) msg.reactions.removeAll();
|
if (["time", "user"].includes(reason)) msg.reactions.removeAll();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
/**
|
/**
|
||||||
* Returns a random number in range
|
* Returns a random number in range
|
||||||
*/
|
*/
|
||||||
export function randint(max: number, min: number) {
|
export function randint(max: number, min: number) {
|
||||||
if (!max || !min) throw new CathError("Missing number");
|
if (!max || !min) throw new CathError("Missing number");
|
||||||
return Math.floor(Math.random() * (max - (min ? min : 0))) + (min ? min : 0);
|
return Math.floor(Math.random() * (max - (min ? min : 0))) + (min ? min : 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
/**
|
/**
|
||||||
* Returns a random ID/String
|
* Returns a random ID/String
|
||||||
*/
|
*/
|
||||||
export function randomID(length: number) {
|
export function randomID(length: number) {
|
||||||
if (!length) throw new CathError("Missing 'length'");
|
if (!length) throw new CathError("Missing 'length'");
|
||||||
var result = "";
|
var result = "";
|
||||||
var c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
var c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||||
for (var i = 0; i < length; i++) {
|
for (var i = 0; i < length; i++) {
|
||||||
result += c.charAt(Math.floor(Math.random() * c.length));
|
result += c.charAt(Math.floor(Math.random() * c.length));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
/**
|
/**
|
||||||
* Sends an embed of reddit
|
* Sends an embed of reddit
|
||||||
*/
|
*/
|
||||||
export async function getreddit(sub: string): Promise<RedditObject> {
|
export async function getreddit(sub: string): Promise<RedditObject> {
|
||||||
if (!sub) throw new CathError("Missing Subreddit");
|
if (!sub) throw new CathError("Missing Subreddit");
|
||||||
const content = await axios
|
const content = await axios
|
||||||
.get(`https://www.reddit.com/r/${sub}/random/.json`)
|
.get(`https://www.reddit.com/r/${sub}/random/.json`)
|
||||||
.then(res => res.data);
|
.then(res => res.data);
|
||||||
let permalink = content[0].data.children[0].data.permalink;
|
let permalink = content[0].data.children[0].data.permalink;
|
||||||
let memeURL = `https://reddit.com${permalink}`;
|
let memeURL = `https://reddit.com${permalink}`;
|
||||||
let memeImage = content[0].data.children[0].data.url;
|
let memeImage = content[0].data.children[0].data.url;
|
||||||
let memeTitle = content[0].data.children[0].data.title;
|
let memeTitle = content[0].data.children[0].data.title;
|
||||||
let memeUpvotes = content[0].data.children[0].data.ups;
|
let memeUpvotes = content[0].data.children[0].data.ups;
|
||||||
let memeDownvotes = content[0].data.children[0].data.downs;
|
let memeDownvotes = content[0].data.children[0].data.downs;
|
||||||
let memeNumComments = content[0].data.children[0].data.num_comments;
|
let memeNumComments = content[0].data.children[0].data.num_comments;
|
||||||
const obj: RedditObject = {
|
const obj: RedditObject = {
|
||||||
title: memeTitle,
|
title: memeTitle,
|
||||||
url: memeURL,
|
url: memeURL,
|
||||||
image: memeImage,
|
image: memeImage,
|
||||||
footer: ` 👍 ${memeUpvotes} 💬 ${memeNumComments}`,
|
footer: ` 👍 ${memeUpvotes} 💬 ${memeNumComments}`,
|
||||||
};
|
};
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
export interface RedditObject {
|
export interface RedditObject {
|
||||||
title: String;
|
title: String;
|
||||||
url: String;
|
url: String;
|
||||||
image: String;
|
image: String;
|
||||||
footer: String;
|
footer: String;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
* Rounds a number to a specified number of decimal places.
|
* Rounds a number to a specified number of decimal places.
|
||||||
*/
|
*/
|
||||||
export function round(value: number, decimals: number) {
|
export function round(value: number, decimals: number) {
|
||||||
return Number(Math.round(Number(value + "e" + decimals)) + "e-" + decimals);
|
return Number(Math.round(Number(value + "e" + decimals)) + "e-" + decimals);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
/**
|
/**
|
||||||
* Select a random element of the array
|
* Select a random element of the array
|
||||||
*/
|
*/
|
||||||
export function selectRandom(array = []): any {
|
export function selectRandom(array = []): any {
|
||||||
if (!array) throw new CathError("Missing 'array'");
|
if (!array) throw new CathError("Missing 'array'");
|
||||||
if (!array.length) throw new CathError("array length can't be 0");
|
if (!array.length) throw new CathError("array length can't be 0");
|
||||||
return array[Math.floor(Math.random() * array.length)];
|
return array[Math.floor(Math.random() * array.length)];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
export function sleep(ms: number) {
|
export function sleep(ms: number) {
|
||||||
if (!ms) throw new CathError("Missing 'ms'");
|
if (!ms) throw new CathError("Missing 'ms'");
|
||||||
let start = new Date().getTime();
|
let start = new Date().getTime();
|
||||||
let end = start;
|
let end = start;
|
||||||
while (end < start + ms) {
|
while (end < start + ms) {
|
||||||
end = new Date().getTime();
|
end = new Date().getTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
import { config } from "../";
|
import { config } from "../";
|
||||||
/**
|
/**
|
||||||
* Sends a superscript-ed word
|
* Sends a superscript-ed word
|
||||||
*/
|
*/
|
||||||
export async function superscript(word: string): Promise<string> {
|
export async function superscript(word: string): Promise<string> {
|
||||||
if (!word) {
|
if (!word) {
|
||||||
throw new CathError("Missing 'word'");
|
throw new CathError("Missing 'word'");
|
||||||
}
|
}
|
||||||
const data = await axios
|
const data = await axios
|
||||||
.get(`${config.api}/api/v1/fun/superscript?text=${word}`)
|
.get(`${config.api}/api/v1/fun/superscript?text=${word}`)
|
||||||
.then(res => res.data);
|
.then(res => res.data);
|
||||||
console.log(data);
|
console.log(data);
|
||||||
return data.text;
|
return data.text;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
export function timer(timestamp: number) {
|
export function timer(timestamp: number) {
|
||||||
if (!timestamp) throw new CathError("Missing 'timestamp");
|
if (!timestamp) throw new CathError("Missing 'timestamp");
|
||||||
const timeLeft = timestamp;
|
const timeLeft = timestamp;
|
||||||
const days = Math.floor(timeLeft / 86400000);
|
const days = Math.floor(timeLeft / 86400000);
|
||||||
const hours = Math.floor(timeLeft / 3600000) - days * 24;
|
const hours = Math.floor(timeLeft / 3600000) - days * 24;
|
||||||
const minutes = Math.floor(timeLeft / 60000) - days * 1440 - hours * 60;
|
const minutes = Math.floor(timeLeft / 60000) - days * 1440 - hours * 60;
|
||||||
const seconds =
|
const seconds =
|
||||||
Math.floor(timeLeft / 1000) - days * 86400 - hours * 3600 - minutes * 60;
|
Math.floor(timeLeft / 1000) - days * 86400 - hours * 3600 - minutes * 60;
|
||||||
const mseconds = timeLeft / 1000 - days * 86400 - hours * 3600 - minutes * 60;
|
const mseconds = timeLeft / 1000 - days * 86400 - hours * 3600 - minutes * 60;
|
||||||
let string = "";
|
let string = "";
|
||||||
if (days) string = string + `${days} ${days == 1 ? "day " : "days "}`;
|
if (days) string = string + `${days} ${days == 1 ? "day " : "days "}`;
|
||||||
if (hours) string = string + `${hours} ${hours == 1 ? "hour " : "hours "}`;
|
if (hours) string = string + `${hours} ${hours == 1 ? "hour " : "hours "}`;
|
||||||
if (minutes)
|
if (minutes)
|
||||||
string = string + `${minutes} ${minutes == 1 ? "minute " : "minutes "}`;
|
string = string + `${minutes} ${minutes == 1 ? "minute " : "minutes "}`;
|
||||||
if (seconds)
|
if (seconds)
|
||||||
string = string + `${seconds} ${seconds == 1 ? "second " : "seconds "}`;
|
string = string + `${seconds} ${seconds == 1 ? "second " : "seconds "}`;
|
||||||
if (!string.length) string = `${mseconds.toFixed(1)} second`;
|
if (!string.length) string = `${mseconds.toFixed(1)} second`;
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import { CathError } from "../Error/CathError";
|
import { CathError } from "../Error/CathError";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trim an array from 10th elemnt
|
* Trim an array from 10th elemnt
|
||||||
*/
|
*/
|
||||||
export function trimArray(arr = []) {
|
export function trimArray(arr = []) {
|
||||||
if (!arr) throw new CathError("Missing 'arr'");
|
if (!arr) throw new CathError("Missing 'arr'");
|
||||||
if (arr.length > 10) {
|
if (arr.length > 10) {
|
||||||
const length = arr.length - 10;
|
const length = arr.length - 10;
|
||||||
arr = arr.slice(0, 10);
|
arr = arr.slice(0, 10);
|
||||||
arr.push(`\n${length} more...`);
|
arr.push(`\n${length} more...`);
|
||||||
}
|
}
|
||||||
return arr.join(" **|** ");
|
return arr.join(" **|** ");
|
||||||
}
|
}
|
||||||
|
|
98
src/index.d.ts
vendored
98
src/index.d.ts
vendored
|
@ -1,49 +1,49 @@
|
||||||
export { CODMClient, CODMClientOptions, PerkData } from "./CODMClient";
|
export { CODMClient, CODMClientOptions, PerkData } from "./CODMClient";
|
||||||
export {
|
export {
|
||||||
StarboardClient,
|
StarboardClient,
|
||||||
StarboardClientOptions,
|
StarboardClientOptions,
|
||||||
StarboardGuild,
|
StarboardGuild,
|
||||||
StarboardGuildOptions,
|
StarboardGuildOptions,
|
||||||
starMessageData,
|
starMessageData,
|
||||||
} from "./StarboardClient";
|
} from "./StarboardClient";
|
||||||
export { CodeClient, CodeData } from "./CodeClient";
|
export { CodeClient, CodeData } from "./CodeClient";
|
||||||
export { URLClient, URLData } from "./URLClient";
|
export { URLClient, URLData } from "./URLClient";
|
||||||
export {
|
export {
|
||||||
GiveawaysClient,
|
GiveawaysClient,
|
||||||
GiveawaySchema,
|
GiveawaySchema,
|
||||||
GiveawaysClientOptions,
|
GiveawaysClientOptions,
|
||||||
DefaultGiveawayMessages,
|
DefaultGiveawayMessages,
|
||||||
} from "./GiveawaysClient";
|
} from "./GiveawaysClient";
|
||||||
export { ImageClient } from "./ImageClient/index";
|
export { ImageClient } from "./ImageClient/index";
|
||||||
export { random8ball } from "./functions/8ball";
|
export { random8ball } from "./functions/8ball";
|
||||||
export { getreddit, RedditObject } from "./functions/reddit";
|
export { getreddit, RedditObject } from "./functions/reddit";
|
||||||
export { Pagination } from "./functions/pagination";
|
export { Pagination } from "./functions/pagination";
|
||||||
export { bool } from "./functions/bool";
|
export { bool } from "./functions/bool";
|
||||||
export { randint } from "./functions/randint";
|
export { randint } from "./functions/randint";
|
||||||
export { timer } from "./functions/timer";
|
export { timer } from "./functions/timer";
|
||||||
export { selectRandom } from "./functions/selectRandom";
|
export { selectRandom } from "./functions/selectRandom";
|
||||||
export { parseMS, parseString } from "./functions/ms";
|
export { parseMS, parseString } from "./functions/ms";
|
||||||
export { confirmation } from "./functions/confirmation";
|
export { confirmation } from "./functions/confirmation";
|
||||||
export { HHMMSS } from "./functions/HHMMSS";
|
export { HHMMSS } from "./functions/HHMMSS";
|
||||||
export { formatUpper } from "./functions/formatUpper";
|
export { formatUpper } from "./functions/formatUpper";
|
||||||
export { cleanText } from "./functions/cleanText";
|
export { cleanText } from "./functions/cleanText";
|
||||||
export { daysAgo } from "./functions/daysAgo";
|
export { daysAgo } from "./functions/daysAgo";
|
||||||
export { sleep } from "./functions/sleep";
|
export { sleep } from "./functions/sleep";
|
||||||
export { trimArray } from "./functions/trimArray";
|
export { trimArray } from "./functions/trimArray";
|
||||||
export { randomID } from "./functions/randomID";
|
export { randomID } from "./functions/randomID";
|
||||||
export {
|
export {
|
||||||
DiscordActivity,
|
DiscordActivity,
|
||||||
DiscordActivityOptions,
|
DiscordActivityOptions,
|
||||||
Applications,
|
Applications,
|
||||||
} from "./functions/discord-activity";
|
} from "./functions/discord-activity";
|
||||||
export { superscript } from "./functions/superscript";
|
export { superscript } from "./functions/superscript";
|
||||||
export { doublestruck } from "./functions/doublestruck";
|
export { doublestruck } from "./functions/doublestruck";
|
||||||
export { fractur } from "./functions/fractur";
|
export { fractur } from "./functions/fractur";
|
||||||
export { round } from "./functions/round";
|
export { round } from "./functions/round";
|
||||||
export {
|
export {
|
||||||
generatePassword,
|
generatePassword,
|
||||||
GeneratePasswordOptions,
|
GeneratePasswordOptions,
|
||||||
} from "./functions/generatePassword";
|
} from "./functions/generatePassword";
|
||||||
export { getLilaseDownloads } from "./functions/getLilaseDownloads";
|
export { getLilaseDownloads } from "./functions/getLilaseDownloads";
|
||||||
export { emojify } from "./functions/emojify";
|
export { emojify } from "./functions/emojify";
|
||||||
export { obama } from "./functions/obama";
|
export { obama } from "./functions/obama";
|
||||||
|
|
110
src/index.ts
110
src/index.ts
|
@ -1,55 +1,55 @@
|
||||||
export {
|
export {
|
||||||
CODMClient,
|
CODMClient,
|
||||||
CODMClientOptions,
|
CODMClientOptions,
|
||||||
PerkData,
|
PerkData,
|
||||||
ScorestreakData,
|
ScorestreakData,
|
||||||
} from "./CODMClient";
|
} from "./CODMClient";
|
||||||
export {
|
export {
|
||||||
StarboardClient,
|
StarboardClient,
|
||||||
StarboardClientOptions,
|
StarboardClientOptions,
|
||||||
StarboardGuild,
|
StarboardGuild,
|
||||||
StarboardGuildOptions,
|
StarboardGuildOptions,
|
||||||
starMessageData,
|
starMessageData,
|
||||||
} from "./StarboardClient";
|
} from "./StarboardClient";
|
||||||
export { CodeClient, CodeData } from "./CodeClient";
|
export { CodeClient, CodeData } from "./CodeClient";
|
||||||
export { URLClient, URLData } from "./URLClient";
|
export { URLClient, URLData } from "./URLClient";
|
||||||
export {
|
export {
|
||||||
GiveawaysClient,
|
GiveawaysClient,
|
||||||
GiveawaySchema,
|
GiveawaySchema,
|
||||||
GiveawaysClientOptions,
|
GiveawaysClientOptions,
|
||||||
DefaultGiveawayMessages,
|
DefaultGiveawayMessages,
|
||||||
} from "./GiveawaysClient";
|
} from "./GiveawaysClient";
|
||||||
export { ImageClient } from "./ImageClient/index";
|
export { ImageClient } from "./ImageClient/index";
|
||||||
export { random8ball } from "./functions/8ball";
|
export { random8ball } from "./functions/8ball";
|
||||||
export { getreddit, RedditObject } from "./functions/reddit";
|
export { getreddit, RedditObject } from "./functions/reddit";
|
||||||
export { Pagination } from "./functions/pagination";
|
export { Pagination } from "./functions/pagination";
|
||||||
export { bool } from "./functions/bool";
|
export { bool } from "./functions/bool";
|
||||||
export { randint } from "./functions/randint";
|
export { randint } from "./functions/randint";
|
||||||
export { timer } from "./functions/timer";
|
export { timer } from "./functions/timer";
|
||||||
export { selectRandom } from "./functions/selectRandom";
|
export { selectRandom } from "./functions/selectRandom";
|
||||||
export { parseMS, parseString } from "./functions/ms";
|
export { parseMS, parseString } from "./functions/ms";
|
||||||
export { confirmation } from "./functions/confirmation";
|
export { confirmation } from "./functions/confirmation";
|
||||||
export { HHMMSS } from "./functions/HHMMSS";
|
export { HHMMSS } from "./functions/HHMMSS";
|
||||||
export { formatUpper } from "./functions/formatUpper";
|
export { formatUpper } from "./functions/formatUpper";
|
||||||
export {
|
export {
|
||||||
DiscordActivity,
|
DiscordActivity,
|
||||||
DiscordActivityOptions,
|
DiscordActivityOptions,
|
||||||
Applications,
|
Applications,
|
||||||
} from "./functions/discord-activity";
|
} from "./functions/discord-activity";
|
||||||
export { cleanText } from "./functions/cleanText";
|
export { cleanText } from "./functions/cleanText";
|
||||||
export { daysAgo } from "./functions/daysAgo";
|
export { daysAgo } from "./functions/daysAgo";
|
||||||
export { sleep } from "./functions/sleep";
|
export { sleep } from "./functions/sleep";
|
||||||
export { trimArray } from "./functions/trimArray";
|
export { trimArray } from "./functions/trimArray";
|
||||||
export { superscript } from "./functions/superscript";
|
export { superscript } from "./functions/superscript";
|
||||||
export { doublestruck } from "./functions/doublestruck";
|
export { doublestruck } from "./functions/doublestruck";
|
||||||
export { fractur } from "./functions/fractur";
|
export { fractur } from "./functions/fractur";
|
||||||
export { randomID } from "./functions/randomID";
|
export { randomID } from "./functions/randomID";
|
||||||
export { round } from "./functions/round";
|
export { round } from "./functions/round";
|
||||||
export {
|
export {
|
||||||
generatePassword,
|
generatePassword,
|
||||||
GeneratePasswordOptions,
|
GeneratePasswordOptions,
|
||||||
} from "./functions/generatePassword";
|
} from "./functions/generatePassword";
|
||||||
export { getLilaseDownloads } from "./functions/getLilaseDownloads";
|
export { getLilaseDownloads } from "./functions/getLilaseDownloads";
|
||||||
export { emojify } from "./functions/emojify";
|
export { emojify } from "./functions/emojify";
|
||||||
export { obama } from "./functions/obama";
|
export { obama } from "./functions/obama";
|
||||||
export { ConfigURLS, config } from "./config";
|
export { ConfigURLS, config } from "./config";
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"lib": ["ESNext"],
|
"lib": ["ESNext"],
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"skipDefaultLibCheck": true,
|
"skipDefaultLibCheck": true,
|
||||||
"resolveJsonModule": true
|
"resolveJsonModule": true
|
||||||
},
|
},
|
||||||
"include": ["./src"],
|
"include": ["./src"],
|
||||||
"exclude": ["./node_modules"]
|
"exclude": ["./node_modules"]
|
||||||
}
|
}
|
||||||
|
|
14
vercel.json
14
vercel.json
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"git": {
|
"git": {
|
||||||
"deploymentEnabled": {
|
"deploymentEnabled": {
|
||||||
"main": false
|
"main": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue