Moved to a new repo; Fix small thin preventing startup/message handler fix
Some checks are pending
ptero-push / build (push) Waiting to run
15
.forgejo/workflows/ptero-push.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Workflow that runs on `chris-runner`, tells a pterodactyl server at https://panel.chrischro.me/ to restart server 8f44f1fd-8d29-4553-96f1-05dacfca454f with token stored in PTERO_KEY
|
||||
name: ptero-push
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
build:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Run script
|
||||
run: |
|
||||
curl -X POST -H "Authorization: Bearer ${{ secrets.PTERO_KEY }}" -H "Content-Type: application/json" https://panel.chrischro.me/api/client/servers/8f44f1fd-8d29-4553-96f1-05dacfca454f/power -d '{"signal":"restart"}'
|
136
.gitignore
vendored
Normal file
|
@ -0,0 +1,136 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Snowpack dependency directory (https://snowpack.dev/)
|
||||
web_modules/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional stylelint cache
|
||||
.stylelintcache
|
||||
|
||||
# Microbundle cache
|
||||
.rpt2_cache/
|
||||
.rts2_cache_cjs/
|
||||
.rts2_cache_es/
|
||||
.rts2_cache_umd/
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variable files
|
||||
.env
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.local
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
.parcel-cache
|
||||
|
||||
# Next.js build output
|
||||
.next
|
||||
out
|
||||
|
||||
# Nuxt.js build / generate output
|
||||
.nuxt
|
||||
dist
|
||||
|
||||
# Gatsby files
|
||||
.cache/
|
||||
# Comment in the public line in if your project uses Gatsby and not Next.js
|
||||
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||
# public
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# vuepress v2.x temp and cache directory
|
||||
.temp
|
||||
.cache
|
||||
|
||||
# Docusaurus cache and generated files
|
||||
.docusaurus
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
|
||||
# TernJS port file
|
||||
.tern-port
|
||||
|
||||
# Stores VSCode versions used for testing VSCode extensions
|
||||
.vscode-test
|
||||
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
config.json
|
||||
channels.db
|
||||
private/
|
||||
error/
|
||||
old/
|
||||
package-lock.json
|
1
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
674
LICENSE
Normal file
|
@ -0,0 +1,674 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 2024 <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) 2024 <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
7
PRIVACY.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Privacy Policy
|
||||
|
||||
Just to make this simple, heres a list of whats stored and how it's used
|
||||
- Discord channel/user IDs of subscribed channels/DMs - Should be obvious, in case it's not, we need these to know where to send alerts.
|
||||
- IEM rooms and filters - Should also be obvious, but again, we need to know which rooms you subscribed to
|
||||
|
||||
Other than that, occasional debug logging may be enabled to fix bugs, and any logs gathered from debugging will be erased immidiately.
|
33
README.md
Normal file
|
@ -0,0 +1,33 @@
|
|||
[](https://discord.gg/v7aR9MTau8) [](https://discord.com/oauth2/authorize?client_id=1237621947529957426)
|
||||
|
||||
## Warning
|
||||
This is SUPER tossed together. Might bother cleaning it up later.
|
||||
|
||||
Also If you run this on Windows for Debugging, Sodium might have a few issues installing with MSVS for certain users.
|
||||
|
||||
## What is this?
|
||||
This is meant to be a public Discord bot. It connects via XMPP to Weather.IM and allows server owners to subscribe a channel to any number of weather alerts.
|
||||
|
||||
## Pre-requisites
|
||||
1. Node.js
|
||||
2. NPM
|
||||
3. A Discord bot token
|
||||
|
||||
## How do I use this?
|
||||
1. Clone the repo
|
||||
2. Install the requirements with `npm install`
|
||||
3. Copy `config.example.json` to `config.json` and fill in the values
|
||||
- `token` is your Discord bot token
|
||||
- `owner` is your Discord user ID
|
||||
- `mainGuild` is the ID of the guild you want to use as the main guild (This is used for making the support invite)
|
||||
- `inviteChannel` is the ID of the channel you want to use for the support invite
|
||||
- NTFY config is optional, leave enabled false if you don't want to use it or don't know how.
|
||||
4. Run `node .`
|
||||
5. Profit?
|
||||
|
||||
## TODO
|
||||
- [ ] Clean up the code
|
||||
- [X] Add more error handling
|
||||
- [X] Add more logging
|
||||
- [X] Add more features
|
||||
- [X] Add more documentation
|
5
TERMS.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Terms of Service
|
||||
## This is mostly here to comply with Discord verified bot stuff
|
||||
|
||||
Other than complying with the GPL-3.0 License when contributing/using the code of this project, this bot is NOT to be used as an emergency alerting system, and should NOT be trusted with life/property under any circumstances.
|
||||
Chris Chrome and any other contributors are not to be held liable should this not work in an emergency, as you shouldn't be using it for emergency alerts.
|
36
config.json.template
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"debug": 0,
|
||||
"voice_enabled": true,
|
||||
"priorityColors": {
|
||||
"1": "#00AFFF",
|
||||
"2": "#00FF00",
|
||||
"3": "#FFFF00",
|
||||
"4": "#FFA500",
|
||||
"5": "#FF0000"
|
||||
},
|
||||
"discord": {
|
||||
"token": "YOUR_TOKEN",
|
||||
"owner": "YOUR_ID",
|
||||
"mainGuild": "YOUR_GUILD",
|
||||
"inviteChannel": "INVITE_CHANNEL",
|
||||
"logChannel": "LOG_CHANNEL"
|
||||
},
|
||||
"ntfy": {
|
||||
"enabled": false,
|
||||
"server": "https://your.ntfy.server",
|
||||
"token": "tk_XXXXXXXXXXXXXXXX",
|
||||
"prefix": "iem-",
|
||||
"errors": "iem-errors"
|
||||
},
|
||||
"broadcastify": {
|
||||
"enabled": false,
|
||||
"username": "YOUR_USERNAME",
|
||||
"password": "YOUR_PASSWORD"
|
||||
},
|
||||
|
||||
"uptime-kuma": {
|
||||
"enabled": false,
|
||||
"url": "",
|
||||
"interval": 60
|
||||
}
|
||||
}
|
94
data/blacklist.json
Normal file
|
@ -0,0 +1,94 @@
|
|||
[
|
||||
"rerchat@conference.weather.im",
|
||||
"ncrfcchat@conference.weather.im",
|
||||
"mkx_madison_spotters@conference.weather.im",
|
||||
"zanchat@conference.weather.im",
|
||||
"michiganwxalerts@conference.weather.im",
|
||||
"skywarnstatewidechase@conference.weather.im",
|
||||
"wws44fl@conference.weather.im",
|
||||
"hatchat@conference.weather.im",
|
||||
"crisfield-chat@conference.weather.im",
|
||||
"gstweather@conference.weather.im",
|
||||
"tws_chat@conference.weather.im",
|
||||
"franklin_chat@conference.weather.im",
|
||||
"cnrfcchat@conference.weather.im",
|
||||
"mke-skywarn@conference.weather.im",
|
||||
"tnwxdiscuss@conference.weather.im",
|
||||
"khws@conference.weather.im",
|
||||
"kcichat@conference.weather.im",
|
||||
"kodster@conference.weather.im",
|
||||
"wxst@conference.weather.im",
|
||||
"reddit_weatherlab@conference.weather.im",
|
||||
"nalsw@conference.weather.im",
|
||||
"barnburnerwi@conference.weather.im",
|
||||
"ohiostormspottersteamoss@conference.weather.im",
|
||||
"siawx_chat@conference.weather.im",
|
||||
"n90@conference.weather.im",
|
||||
"nerfcchat@conference.weather.im",
|
||||
"lmrfcchat@conference.weather.im",
|
||||
"mbrfcchat@conference.weather.im",
|
||||
"pitchat@conference.weather.im",
|
||||
"chachat@conference.weather.im",
|
||||
"spcmobile2006@conference.weather.im",
|
||||
"phl@conference.weather.im",
|
||||
"wbkoweatherwatchers@conference.weather.im",
|
||||
"gcwxchat@conference.weather.im",
|
||||
"zzmkxchat@conference.weather.im",
|
||||
"dentcoeas@conference.weather.im",
|
||||
"marfcchat@conference.weather.im",
|
||||
"easwtalk@conference.weather.im",
|
||||
"gccc-nc-skywarn@conference.weather.im",
|
||||
"mseas-weather-discussion@conference.weather.im",
|
||||
"abc3340@conference.weather.im",
|
||||
"awpwxchat@conference.weather.im",
|
||||
"wilchat@conference.weather.im",
|
||||
"okc_chatrooms@conference.weather.im",
|
||||
"kdtxchat@conference.weather.im",
|
||||
"wnpchat@conference.weather.im",
|
||||
"fox6chat@conference.weather.im",
|
||||
"cbrfcchat@conference.weather.im",
|
||||
"wisconsin_storm_spotters@conference.weather.im",
|
||||
"nwrfcchat@conference.weather.im",
|
||||
"wgrfcchat@conference.weather.im",
|
||||
"uswat@conference.weather.im",
|
||||
"iowawx@conference.weather.im",
|
||||
"ohrfcchat@conference.weather.im",
|
||||
"serfcchat@conference.weather.im",
|
||||
"stichat@conference.weather.im",
|
||||
"whntweather@conference.weather.im",
|
||||
"knsw@conference.weather.im",
|
||||
"test@conference.weather.im",
|
||||
"abc3340skywatcher@conference.weather.im",
|
||||
"abrfcchat@conference.weather.im",
|
||||
"bmxspotterchat@conference.weather.im",
|
||||
"aprfcchat@conference.weather.im",
|
||||
"wwsreport@conference.weather.im",
|
||||
"bmxalertchat@conference.weather.im",
|
||||
"twitter@conference.weather.im",
|
||||
"potomac_tracon@conference.weather.im",
|
||||
"detroiteaschat@conference.weather.im",
|
||||
"cwest@conference.weather.im",
|
||||
"sweaseops1@conference.weather.im",
|
||||
"scwx@conference.weather.im",
|
||||
"nwsc@conference.weather.im",
|
||||
"zabchat@conference.weather.im",
|
||||
"ztlchat@conference.weather.im",
|
||||
"zbwchat@conference.weather.im",
|
||||
"zauchat@conference.weather.im",
|
||||
"zobchat@conference.weather.im",
|
||||
"zdvchat@conference.weather.im",
|
||||
"zfwchat@conference.weather.im",
|
||||
"zhuchat@conference.weather.im",
|
||||
"zidchat@conference.weather.im",
|
||||
"zjxchat@conference.weather.im",
|
||||
"zkcchat@conference.weather.im",
|
||||
"zlachat@conference.weather.im",
|
||||
"zmechat@conference.weather.im",
|
||||
"zmachat@conference.weather.im",
|
||||
"zmpchat@conference.weather.im",
|
||||
"zoachat@conference.weather.im",
|
||||
"zlcchat@conference.weather.im",
|
||||
"zsechat@conference.weather.im",
|
||||
"zdcchat@conference.weather.im",
|
||||
"znychat@conference.weather.im"
|
||||
]
|
256
data/commands.json
Normal file
|
@ -0,0 +1,256 @@
|
|||
[
|
||||
{
|
||||
"name": "subscribe",
|
||||
"description": "Subscribe to a weather.im room",
|
||||
"default_member_permissions": 16,
|
||||
"options": [
|
||||
{
|
||||
"name": "room",
|
||||
"description": "The room/WFO you want to subscribe to",
|
||||
"type": 3,
|
||||
"required": true,
|
||||
"autocomplete": false
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"description": "Custom message to send when alert is sent",
|
||||
"type": 3,
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "filter",
|
||||
"description": "Filter for the alert, you can comma separate multiple strings of text",
|
||||
"type": 3,
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "minpriority",
|
||||
"description": "Minimum priority to alert for",
|
||||
"type": 4,
|
||||
"required": false,
|
||||
"choices": [
|
||||
{
|
||||
"name": "Any",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"name": "Minimum",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"name": "Low",
|
||||
"value": 2
|
||||
},
|
||||
{
|
||||
"name": "Normal",
|
||||
"value": 3
|
||||
},
|
||||
{
|
||||
"name": "High",
|
||||
"value": 4
|
||||
},
|
||||
{
|
||||
"name": "Very High",
|
||||
"value": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "filterevt",
|
||||
"description": "Filter for event type, you can comma separate multiple strings of text",
|
||||
"type": 3,
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "unsubscribe",
|
||||
"description": "Unsubscribe from a weather.im room",
|
||||
"default_member_permissions": 16,
|
||||
"options": [
|
||||
{
|
||||
"name": "room",
|
||||
"description": "The room/WFO you want to unsubscribe from",
|
||||
"type": 3,
|
||||
"required": true,
|
||||
"autocomplete": false
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"name": "list",
|
||||
"description": "List all subscribed rooms for this channel",
|
||||
"default_member_permissions": 16
|
||||
},
|
||||
{
|
||||
"name": "about",
|
||||
"description": "About this bot",
|
||||
"integration_types": [0,1],
|
||||
"contexts": [0, 1, 2]
|
||||
},
|
||||
{
|
||||
"name": "rooms",
|
||||
"description": "List all available rooms"
|
||||
},
|
||||
{
|
||||
"name": "setupall",
|
||||
"description": "[BOT OWNER ONLY] Setup channels in a category for all rooms",
|
||||
"default_member_permissions": 0,
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"name": "support",
|
||||
"description": "Get support for the bot",
|
||||
"type": 1,
|
||||
"integration_types": [0,1],
|
||||
"contexts": [0, 1, 2]
|
||||
},
|
||||
{
|
||||
"name": "outlook",
|
||||
"description": "Get day 1-8 storm or fire outlook from the SPC",
|
||||
"type": 1,
|
||||
"integration_types": [0,1],
|
||||
"contexts": [0, 1, 2],
|
||||
"options": [
|
||||
{
|
||||
"name": "day",
|
||||
"description": "Day of outlook",
|
||||
"type": 4,
|
||||
"required": true,
|
||||
"choices": [
|
||||
{
|
||||
"name": "Day 1",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"name": "Day 2",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"name": "Day 3",
|
||||
"value": 2
|
||||
},
|
||||
{
|
||||
"name": "Day 4",
|
||||
"value": 3
|
||||
},
|
||||
{
|
||||
"name": "Day 5",
|
||||
"value": 4
|
||||
},
|
||||
{
|
||||
"name": "Day 6",
|
||||
"value": 5
|
||||
},
|
||||
{
|
||||
"name": "Day 7",
|
||||
"value": 6
|
||||
},
|
||||
{
|
||||
"name": "Day 8",
|
||||
"value": 7
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "type",
|
||||
"description": "Type of outlook",
|
||||
"type": 3,
|
||||
"required": true,
|
||||
"choices": [
|
||||
{
|
||||
"name": "Fire",
|
||||
"value": "fire"
|
||||
},
|
||||
{
|
||||
"name": "Convective",
|
||||
"value": "convective"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "population_overlay",
|
||||
"description": "Whether to add the population overlay",
|
||||
"type": 5,
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "city_overlay",
|
||||
"description": "Whether to add the city name overlay",
|
||||
"type": 5,
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "cwa_overlay",
|
||||
"description": "Whether to add the County Warning Area overlay",
|
||||
"type": 5,
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "rfc_overlay",
|
||||
"description": "Whether to add the River Forecast Center overlay",
|
||||
"type": 5,
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "interstate_overlay",
|
||||
"description": "Whether to add the interstate overlay",
|
||||
"type": 5,
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "county_overlay",
|
||||
"description": "Whether to add the county lines overlay",
|
||||
"type": 5,
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "tribal_overlay",
|
||||
"description": "Whether to add the tribal lands overlay",
|
||||
"type": 5,
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "artcc_overlay",
|
||||
"description": "Whether to add the Air Route Traffic Control Centers overlay",
|
||||
"type": 5,
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "fema_overlay",
|
||||
"description": "Whether to add the FEMA regions overlay",
|
||||
"type": 5,
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "alertmap",
|
||||
"description": "Get a map of active alerts",
|
||||
"type": 1,
|
||||
"integration_types": [0,1],
|
||||
"contexts": [0, 1, 2]
|
||||
},
|
||||
{
|
||||
"name": "forecast",
|
||||
"description": "Get a forecast for a location",
|
||||
"type": 1,
|
||||
"integration_types": [0,1],
|
||||
"contexts": [0, 1, 2],
|
||||
"options": [
|
||||
{
|
||||
"name": "location",
|
||||
"description": "Location to get forecast for (In the United States)",
|
||||
"type": 3,
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "periods",
|
||||
"description": "Number of periods to get forecast for",
|
||||
"type": 4,
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
1530
data/events.json
Normal file
11
data/nwrstreams.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"callsigns": {
|
||||
"WXL46": "https://icecast.sirenarchive.xyz/NWR/WXL46",
|
||||
"WXJ61": "https://icecast.sirenarchive.xyz/NWR/WXJ61",
|
||||
"KZZ57": "https://wxradio.org/IL-Rockford-KZZ57",
|
||||
"KXI41": "https://wxradio.org/IL-CrystalLake-KXI41",
|
||||
"KHB34": "https://wxradio.org/FL-Miami-KHB34",
|
||||
"WNG663": "https://wxradio.org/FL-Princeton-WNG663",
|
||||
"KEC80": "https://wxradio.org/GA-Atlanta-KEC80"
|
||||
}
|
||||
}
|
22
data/outlook.json
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"convective": [
|
||||
"https://www.spc.noaa.gov/products/outlook/day1otlk.gif",
|
||||
"https://www.spc.noaa.gov/products/outlook/day2otlk.gif",
|
||||
"https://www.spc.noaa.gov/products/outlook/day3otlk.gif",
|
||||
"https://www.spc.noaa.gov/products/exper/day4-8/day4prob.gif",
|
||||
"https://www.spc.noaa.gov/products/exper/day4-8/day5prob.gif",
|
||||
"https://www.spc.noaa.gov/products/exper/day4-8/day6prob.gif",
|
||||
"https://www.spc.noaa.gov/products/exper/day4-8/day7prob.gif",
|
||||
"https://www.spc.noaa.gov/products/exper/day4-8/day8prob.gif"
|
||||
],
|
||||
"fire": [
|
||||
"https://www.spc.noaa.gov/products/exper/fire_wx/imgs/day1otlk_fire.gif",
|
||||
"https://www.spc.noaa.gov/products/exper/fire_wx/imgs/day2otlk_fire.gif",
|
||||
"https://www.spc.noaa.gov/products/exper/fire_wx/imgs/day3otlk_fire.gif",
|
||||
"https://www.spc.noaa.gov/products/exper/fire_wx/imgs/day4otlk_fire.gif",
|
||||
"https://www.spc.noaa.gov/products/exper/fire_wx/imgs/day5otlk_fire.gif",
|
||||
"https://www.spc.noaa.gov/products/exper/fire_wx/imgs/day6otlk_fire.gif",
|
||||
"https://www.spc.noaa.gov/products/exper/fire_wx/imgs/day7otlk_fire.gif",
|
||||
"https://www.spc.noaa.gov/products/exper/fire_wx/imgs/day8otlk_fire.gif"
|
||||
]
|
||||
}
|
187
data/satellites.json
Normal file
|
@ -0,0 +1,187 @@
|
|||
{
|
||||
"GOES-16": {
|
||||
"products": {
|
||||
"Full Disk": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/FD/GEOCOLOR/1808x1808.jpg",
|
||||
"Airmass": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/FD/AirMass/1808x1808.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/FD/13/1808x1808.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/FD/10/1808x1808.jpg"
|
||||
},
|
||||
"Floater 1": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/MESO/M1/GEOCOLOR/1000x1000.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/MESO/M1/13/1000x1000.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/MESO/M1/10/1000x1000.jpg"
|
||||
},
|
||||
"Floater 2": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/MESO/M2/GEOCOLOR/1000x1000.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/MESO/M2/13/1000x1000.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/MESO/M2/10/1000x1000.jpg"
|
||||
},
|
||||
"United States": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/CONUS/GEOCOLOR/2500x1500.jpg",
|
||||
"Airmass": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/CONUS/AirMass/2500x1500.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/CONUS/13/2500x1500.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/CONUS/10/2500x1500.jpg"
|
||||
},
|
||||
"Canada": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/can/GEOCOLOR/2250x1125.jpg",
|
||||
"Airmass": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/can/AirMass/2250x1125.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/can/13/2250x1125.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/can/10/2250x1125.jpg"
|
||||
},
|
||||
"Mexico": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/mex/GEOCOLOR/1000x1000.jpg",
|
||||
"Airmass": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/mex/AirMass/1000x1000.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/mex/13/1000x1000.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/mex/10/1000x1000.jpg"
|
||||
},
|
||||
"US East Coast": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/eus/GEOCOLOR/1000x1000.jpg",
|
||||
"Airmass": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/eus/AirMass/1000x1000.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/eus/13/1000x1000.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/eus/10/1000x1000.jpg"
|
||||
},
|
||||
"Gulf of Mexico": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/gm/GEOCOLOR/1000x1000.jpg",
|
||||
"Airmass": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/gm/AirMass/1000x1000.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/gm/13/1000x1000.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/gm/10/1000x1000.jpg"
|
||||
},
|
||||
"Puerto Rico": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/pr/GEOCOLOR/1200x1200.jpg",
|
||||
"Airmass": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/pr/AirMass/1200x1200.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/pr/13/1200x1200.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/pr/10/1200x1200.jpg"
|
||||
}
|
||||
}
|
||||
},
|
||||
"GOES-18": {
|
||||
"products": {
|
||||
"Full Disk": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/FD/GEOCOLOR/1808x1808.jpg",
|
||||
"Airmass": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/FD/AirMass/1808x1808.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/FD/13/1808x1808.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/FD/10/1808x1808.jpg"
|
||||
},
|
||||
"Floater 1": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/MESO/M1/GEOCOLOR/1000x1000.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/MESO/M1/13/1000x1000.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/MESO/M1/10/1000x1000.jpg"
|
||||
},
|
||||
"Floater 2": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/MESO/M2/GEOCOLOR/1000x1000.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/MESO/M2/13/1000x1000.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/MESO/M2/10/1000x1000.jpg"
|
||||
},
|
||||
"US West Coast": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/wus/GEOCOLOR/1000x1000.jpg",
|
||||
"Airmass": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/wus/AirMass/1000x1000.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/wus/13/1000x1000.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/wus/10/1000x1000.jpg"
|
||||
},
|
||||
"Hawaii": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/SECTOR/hi/GEOCOLOR/1200x1200.jpg",
|
||||
"Airmass": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/SECTOR/hi/AirMass/1200x1200.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/SECTOR/hi/13/1200x1200.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/SECTOR/hi/10/1200x1200.jpg"
|
||||
},
|
||||
"Alaska": {
|
||||
"Visible": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/SECTOR/ak/GEOCOLOR/1000x1000.jpg",
|
||||
"Airmass": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/SECTOR/ak/AirMass/1000x1000.jpg",
|
||||
"Infrared": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/SECTOR/ak/13/1000x1000.jpg",
|
||||
"Water Vapor": "https://cdn.star.nesdis.noaa.gov/GOES18/ABI/SECTOR/ak/10/1000x1000.jpg"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Himawari": {
|
||||
"products": {
|
||||
"Full Disk": {
|
||||
"Visible": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/full_disk_ahi_true_color.jpg",
|
||||
"Airmass": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/full_disk_ahi_rgb_airmass.jpg",
|
||||
"Infrared": "https://www.ssec.wisc.edu/data/geo/images/himawari09/latest-himawari09_11_fd.gif",
|
||||
"Water Vapor": "https://www.ssec.wisc.edu/data/geo/images/himawari09/latest-himawari09_10_fd.gif"
|
||||
},
|
||||
"Floater 1": {
|
||||
"Visible": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest/himawari-8/floater_02_geocolor.pngv",
|
||||
"Airmass": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest/himawari-8/floater_02_rgb_airmass.png"
|
||||
},
|
||||
"American Samoa": {
|
||||
"Visible": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/american_samoa_ahi_natural_color.png",
|
||||
"Airmass": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/american_samoa_ahi_rgb_airmass.png"
|
||||
},
|
||||
"Australia": {
|
||||
"Visible": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest/himawari-8/australia_true_color.jpg",
|
||||
"Airmass": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/australia_ahi_rgb_airmass.png"
|
||||
},
|
||||
"New Zealand": {
|
||||
"Visible": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/new_zealand_ahi_natural_color.png",
|
||||
"Airmass": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/new_zealand_ahi_rgb_airmass.png"
|
||||
},
|
||||
"Guam": {
|
||||
"Visible": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/guam_ahi_natural_color.png",
|
||||
"Airmass": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/guam_ahi_rgb_airmass.png"
|
||||
},
|
||||
"Hawaii": {
|
||||
"Visible": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/hawaii_ahi_natural_color.png"
|
||||
},
|
||||
"Japan": {
|
||||
"Visible": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/japan_ahi_natural_color.png",
|
||||
"Airmass": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/japan_ahi_rgb_airmass.png"
|
||||
},
|
||||
"Russia": {
|
||||
"Visible": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest/himawari-8/eastern_russia_true_color.jpg"
|
||||
},
|
||||
"China": {
|
||||
"Visible": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/eastern_china_ahi_natural_color.png",
|
||||
"Airmass": "https://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/eastern_china_ahi_rgb_airmass.png"
|
||||
}
|
||||
}
|
||||
},
|
||||
"EWS-G2": {
|
||||
"products": {
|
||||
"Full Disk": {
|
||||
"Visible": "https://www.ssec.wisc.edu/data/geo/images/ews-g1/latest_ews-g1_01_fd.gif",
|
||||
"Water Vapor": "https://www.ssec.wisc.edu/data/geo/images/ews-g1/latest_ews-g1_03_fd.gif"
|
||||
}
|
||||
}
|
||||
},
|
||||
"FY-2G": {
|
||||
"products": {
|
||||
"Full Disk": {
|
||||
"Visible": "https://www.ssec.wisc.edu/data/geo/images/fy2g/latest_fy2g_01_fd.gif",
|
||||
"Infrared": "https://www.ssec.wisc.edu/data/geo/images/fy2g/latest_fy2g_02_fd.gif",
|
||||
"Water Vapor": "https://www.ssec.wisc.edu/data/geo/images/fy2g/latest_fy2g_04_fd.gif"
|
||||
}
|
||||
}
|
||||
},
|
||||
"GK-2A": {
|
||||
"products": {
|
||||
"Full Disk": {
|
||||
"Infrared": "https://kiwiweather.com/gk-2a/FD_sanchez.jpg"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Meteosat 9": {
|
||||
"products": {
|
||||
"Full Disk": {
|
||||
"Visible": "https://www.ssec.wisc.edu/data/geo/images/met-iodc/latest_met-iodc_01_fd.jpg",
|
||||
"Infrared": "https://www.ssec.wisc.edu/data/geo/images/met-iodc/latest_met-iodc_04_fd.jpg",
|
||||
"Water Vapor": "https://www.ssec.wisc.edu/data/geo/images/met-iodc/latest_met-iodc_06_fd.jpg"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Meteosat 10": {
|
||||
"products": {
|
||||
"Full Disk": {
|
||||
"Visible": "https://www.ssec.wisc.edu/data/geo/images/met-prime/latest_met-prime_01_fd.gif",
|
||||
"Infrared": "https://www.ssec.wisc.edu/data/geo/images/met-prime/latest_met-prime_04_fd.gif",
|
||||
"Water Vapor": "https://www.ssec.wisc.edu/data/geo/images/met-prime/latest_met-prime_06_fd.gif"
|
||||
},
|
||||
"Europe": {
|
||||
"Visible": "https://www.ssec.wisc.edu/data/geo/images/met-prime/latest_met-prime_01_euro.gif",
|
||||
"Infrared": "https://www.ssec.wisc.edu/data/geo/images/met-prime/latest_met-prime_04_euro.gif",
|
||||
"Water Vapor": "https://www.ssec.wisc.edu/data/geo/images/met-prime/latest_met-prime_06_euro.gif"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
594
data/wfos.json
Normal file
|
@ -0,0 +1,594 @@
|
|||
{
|
||||
"iln": {
|
||||
"room": "ilnchat",
|
||||
"location": "Wilmington"
|
||||
},
|
||||
"zhu": {
|
||||
"room": "zhuchat",
|
||||
"location": "Houston"
|
||||
},
|
||||
"zme": {
|
||||
"room": "zmechat",
|
||||
"location": "Memphis"
|
||||
},
|
||||
"ggw": {
|
||||
"room": "ggwchat",
|
||||
"location": "Glasgow"
|
||||
},
|
||||
"sew": {
|
||||
"room": "sewchat",
|
||||
"location": "Seattle"
|
||||
},
|
||||
"ohx": {
|
||||
"room": "ohxchat",
|
||||
"location": "Nashville"
|
||||
},
|
||||
"meg": {
|
||||
"room": "megchat",
|
||||
"location": "Memphis"
|
||||
},
|
||||
"mob": {
|
||||
"room": "mobchat",
|
||||
"location": "Mobile"
|
||||
},
|
||||
"bro": {
|
||||
"room": "brochat",
|
||||
"location": "Brownsville"
|
||||
},
|
||||
"ddc": {
|
||||
"room": "ddcchat",
|
||||
"location": "Dodge_City"
|
||||
},
|
||||
"mfl": {
|
||||
"room": "mflchat",
|
||||
"location": "Miami"
|
||||
},
|
||||
"dvn": {
|
||||
"room": "dvnchat",
|
||||
"location": "Quad_Cities_Ia"
|
||||
},
|
||||
"gjt": {
|
||||
"room": "gjtchat",
|
||||
"location": "Grand_Junction"
|
||||
},
|
||||
"ztl": {
|
||||
"room": "ztlchat",
|
||||
"location": "Atlanta"
|
||||
},
|
||||
"lmk": {
|
||||
"room": "lmkchat",
|
||||
"location": "Louisville"
|
||||
},
|
||||
"fwd": {
|
||||
"room": "fwdchat",
|
||||
"location": "Dallas-Fort_Worth"
|
||||
},
|
||||
"boi": {
|
||||
"room": "boichat",
|
||||
"location": "Boise"
|
||||
},
|
||||
"slc": {
|
||||
"room": "slcchat",
|
||||
"location": "Salt_Lake_City"
|
||||
},
|
||||
"zob": {
|
||||
"room": "zobchat",
|
||||
"location": "Cleveland"
|
||||
},
|
||||
"ama": {
|
||||
"room": "amachat",
|
||||
"location": "Amarillo"
|
||||
},
|
||||
"pqr": {
|
||||
"room": "pqrchat",
|
||||
"location": "Portland"
|
||||
},
|
||||
"zid": {
|
||||
"room": "zidchat",
|
||||
"location": "Indianapolis"
|
||||
},
|
||||
"nhc": {
|
||||
"room": "nhcchat",
|
||||
"location": "National_Hurricane_Center"
|
||||
},
|
||||
"sto": {
|
||||
"room": "stochat",
|
||||
"location": "Sacramento"
|
||||
},
|
||||
"jkl": {
|
||||
"room": "jklchat",
|
||||
"location": "Jackson"
|
||||
},
|
||||
"grr": {
|
||||
"room": "grrchat",
|
||||
"location": "Grand_Rapids"
|
||||
},
|
||||
"hnx": {
|
||||
"room": "hnxchat",
|
||||
"location": "San_Joaquin_Valley-Hanford"
|
||||
},
|
||||
"spc": {
|
||||
"room": "spcchat",
|
||||
"location": "Storm_Prediction_Center"
|
||||
},
|
||||
"lch": {
|
||||
"room": "lchchat",
|
||||
"location": "Lake_Charles"
|
||||
},
|
||||
"zbw": {
|
||||
"room": "zbwchat",
|
||||
"location": "Boston"
|
||||
},
|
||||
"otx": {
|
||||
"room": "otxchat",
|
||||
"location": "Spokane"
|
||||
},
|
||||
"vef": {
|
||||
"room": "vefchat",
|
||||
"location": "Las_Vegas"
|
||||
},
|
||||
"pub": {
|
||||
"room": "pubchat",
|
||||
"location": "Pueblo"
|
||||
},
|
||||
"psr": {
|
||||
"room": "psrchat",
|
||||
"location": "Phoenix"
|
||||
},
|
||||
"sgx": {
|
||||
"room": "sgxchat",
|
||||
"location": "San_Diego"
|
||||
},
|
||||
"pbz": {
|
||||
"room": "pbzchat",
|
||||
"location": "Pittsburgh"
|
||||
},
|
||||
"eka": {
|
||||
"room": "ekachat",
|
||||
"location": "Eureka"
|
||||
},
|
||||
"ilx": {
|
||||
"room": "ilxchat",
|
||||
"location": "Lincoln"
|
||||
},
|
||||
"jsj": {
|
||||
"room": "jsjchat",
|
||||
"location": "San_Juan"
|
||||
},
|
||||
"mlb": {
|
||||
"room": "mlbchat",
|
||||
"location": "Melbourne"
|
||||
},
|
||||
"arx": {
|
||||
"room": "arxchat",
|
||||
"location": "La_Crosse"
|
||||
},
|
||||
"ilm": {
|
||||
"room": "ilmchat",
|
||||
"location": "Wilmington"
|
||||
},
|
||||
"okx": {
|
||||
"room": "okxchat",
|
||||
"location": "New_York"
|
||||
},
|
||||
"bot": {
|
||||
"room": "botstalk",
|
||||
"location": "All_Bots_Talk"
|
||||
},
|
||||
"lkn": {
|
||||
"room": "lknchat",
|
||||
"location": "Elko"
|
||||
},
|
||||
"rah": {
|
||||
"room": "rahchat",
|
||||
"location": "Raleigh"
|
||||
},
|
||||
"afc": {
|
||||
"room": "afcchat",
|
||||
"location": "Anchorage"
|
||||
},
|
||||
"lot": {
|
||||
"room": "lotchat",
|
||||
"location": "Chicago"
|
||||
},
|
||||
"box": {
|
||||
"room": "boxchat",
|
||||
"location": "Boston-Taunton"
|
||||
},
|
||||
"zny": {
|
||||
"room": "znychat",
|
||||
"location": "New_York"
|
||||
},
|
||||
"akq": {
|
||||
"room": "akqchat",
|
||||
"location": "Wakefield"
|
||||
},
|
||||
"zkc": {
|
||||
"room": "zkcchat",
|
||||
"location": "Kansas_City"
|
||||
},
|
||||
"bis": {
|
||||
"room": "bischat",
|
||||
"location": "Bismarck"
|
||||
},
|
||||
"twc": {
|
||||
"room": "twcchat",
|
||||
"location": "Tucson"
|
||||
},
|
||||
"abr": {
|
||||
"room": "abrchat",
|
||||
"location": "Aberdeen"
|
||||
},
|
||||
"pih": {
|
||||
"room": "pihchat",
|
||||
"location": "Pocatello-Idaho_Falls"
|
||||
},
|
||||
"zoa": {
|
||||
"room": "zoachat",
|
||||
"location": "Oakland"
|
||||
},
|
||||
"mtr": {
|
||||
"room": "mtrchat",
|
||||
"location": "San_Francisco"
|
||||
},
|
||||
"sju": {
|
||||
"room": "sjuchat",
|
||||
"location": "San_Juan"
|
||||
},
|
||||
"gid": {
|
||||
"room": "gidchat",
|
||||
"location": "Hastings"
|
||||
},
|
||||
"zmp": {
|
||||
"room": "zmpchat",
|
||||
"location": "Minneapolis"
|
||||
},
|
||||
"phi": {
|
||||
"room": "phichat",
|
||||
"location": "Mount_Holly"
|
||||
},
|
||||
"chs": {
|
||||
"room": "chschat",
|
||||
"location": "Charleston"
|
||||
},
|
||||
"ajk": {
|
||||
"room": "ajkchat",
|
||||
"location": "Juneau"
|
||||
},
|
||||
"bmx": {
|
||||
"room": "bmxchat",
|
||||
"location": "Birmingham"
|
||||
},
|
||||
"lix": {
|
||||
"room": "lixchat",
|
||||
"location": "New_Orleans"
|
||||
},
|
||||
"apx": {
|
||||
"room": "apxchat",
|
||||
"location": "Gaylord"
|
||||
},
|
||||
"hun": {
|
||||
"room": "hunchat",
|
||||
"location": "Huntsville"
|
||||
},
|
||||
"zma": {
|
||||
"room": "zmachat",
|
||||
"location": "Miami"
|
||||
},
|
||||
"dtx": {
|
||||
"room": "dtxchat",
|
||||
"location": "Detroit"
|
||||
},
|
||||
"gum": {
|
||||
"room": "gumchat",
|
||||
"location": "Guam"
|
||||
},
|
||||
"crp": {
|
||||
"room": "crpchat",
|
||||
"location": "Corpus_Christi"
|
||||
},
|
||||
"zjx": {
|
||||
"room": "zjxchat",
|
||||
"location": "Jacksonville"
|
||||
},
|
||||
"shv": {
|
||||
"room": "shvchat",
|
||||
"location": "Shreveport"
|
||||
},
|
||||
"tbw": {
|
||||
"room": "tbwchat",
|
||||
"location": "Tampa_Bay_Area-Ruskin"
|
||||
},
|
||||
"cys": {
|
||||
"room": "cyschat",
|
||||
"location": "Cheyenne"
|
||||
},
|
||||
"hfo": {
|
||||
"room": "hfochat",
|
||||
"location": "Honolulu"
|
||||
},
|
||||
"dmx": {
|
||||
"room": "dmxchat",
|
||||
"location": "Des_Moines"
|
||||
},
|
||||
"zse": {
|
||||
"room": "zsechat",
|
||||
"location": "Seattle"
|
||||
},
|
||||
"rev": {
|
||||
"room": "revchat",
|
||||
"location": "Reno"
|
||||
},
|
||||
"car": {
|
||||
"room": "carchat",
|
||||
"location": "Caribou"
|
||||
},
|
||||
"mso": {
|
||||
"room": "msochat",
|
||||
"location": "Missoula"
|
||||
},
|
||||
"key": {
|
||||
"room": "keychat",
|
||||
"location": "Key_West"
|
||||
},
|
||||
"riw": {
|
||||
"room": "riwchat",
|
||||
"location": "Riverton"
|
||||
},
|
||||
"mhx": {
|
||||
"room": "mhxchat",
|
||||
"location": "Newport-Morehead_City"
|
||||
},
|
||||
"cae": {
|
||||
"room": "caechat",
|
||||
"location": "Columbia"
|
||||
},
|
||||
"ind": {
|
||||
"room": "indchat",
|
||||
"location": "Indianapolis"
|
||||
},
|
||||
"dlh": {
|
||||
"room": "dlhchat",
|
||||
"location": "Duluth"
|
||||
},
|
||||
"unr": {
|
||||
"room": "unrchat",
|
||||
"location": "Rapid_City"
|
||||
},
|
||||
"zab": {
|
||||
"room": "zabchat",
|
||||
"location": "Albuquerque"
|
||||
},
|
||||
"zlc": {
|
||||
"room": "zlcchat",
|
||||
"location": "Salt_Lake_City"
|
||||
},
|
||||
"ffc": {
|
||||
"room": "ffcchat",
|
||||
"location": "Peachtree_City"
|
||||
},
|
||||
"epz": {
|
||||
"room": "epzchat",
|
||||
"location": "El_Paso_Tx-Santa_Teresa"
|
||||
},
|
||||
"tae": {
|
||||
"room": "taechat",
|
||||
"location": "Tallahassee"
|
||||
},
|
||||
"tfx": {
|
||||
"room": "tfxchat",
|
||||
"location": "Great_Falls"
|
||||
},
|
||||
"abq": {
|
||||
"room": "abqchat",
|
||||
"location": "Albuquerque"
|
||||
},
|
||||
"rlx": {
|
||||
"room": "rlxchat",
|
||||
"location": "Charleston"
|
||||
},
|
||||
"oun": {
|
||||
"room": "ounchat",
|
||||
"location": "Norman"
|
||||
},
|
||||
"cle": {
|
||||
"room": "clechat",
|
||||
"location": "Cleveland"
|
||||
},
|
||||
"lox": {
|
||||
"room": "loxchat",
|
||||
"location": "Los_Angeles-Oxnard"
|
||||
},
|
||||
"fsd": {
|
||||
"room": "fsdchat",
|
||||
"location": "Sioux_Falls"
|
||||
},
|
||||
"bgm": {
|
||||
"room": "bgmchat",
|
||||
"location": "Binghamton"
|
||||
},
|
||||
"ewx": {
|
||||
"room": "ewxchat",
|
||||
"location": "Austin-San_Antonio"
|
||||
},
|
||||
"zdv": {
|
||||
"room": "zdvchat",
|
||||
"location": "Denver"
|
||||
},
|
||||
"eax": {
|
||||
"room": "eaxchat",
|
||||
"location": "Kansas_City-Pleasant_Hill"
|
||||
},
|
||||
"iwx": {
|
||||
"room": "iwxchat",
|
||||
"location": "Northern_Indiana"
|
||||
},
|
||||
"lub": {
|
||||
"room": "lubchat",
|
||||
"location": "Lubbock"
|
||||
},
|
||||
"buf": {
|
||||
"room": "bufchat",
|
||||
"location": "Buffalo"
|
||||
},
|
||||
"pdt": {
|
||||
"room": "pdtchat",
|
||||
"location": "Pendleton"
|
||||
},
|
||||
"mkx": {
|
||||
"room": "mkxchat",
|
||||
"location": "Milwaukee-Sullivan"
|
||||
},
|
||||
"grb": {
|
||||
"room": "grbchat",
|
||||
"location": "Green_Bay"
|
||||
},
|
||||
"top": {
|
||||
"room": "topchat",
|
||||
"location": "Topeka"
|
||||
},
|
||||
"rnk": {
|
||||
"room": "rnkchat",
|
||||
"location": "Blacksburg"
|
||||
},
|
||||
"lzk": {
|
||||
"room": "lzkchat",
|
||||
"location": "Little_Rock"
|
||||
},
|
||||
"ctp": {
|
||||
"room": "ctpchat",
|
||||
"location": "State_College"
|
||||
},
|
||||
"gld": {
|
||||
"room": "gldchat",
|
||||
"location": "Goodland"
|
||||
},
|
||||
"byz": {
|
||||
"room": "byzchat",
|
||||
"location": "Billings"
|
||||
},
|
||||
"mpx": {
|
||||
"room": "mpxchat",
|
||||
"location": "Twin_Cities-Chanhassen"
|
||||
},
|
||||
"zdc": {
|
||||
"room": "zdcchat",
|
||||
"location": "Washington_DC"
|
||||
},
|
||||
"lsx": {
|
||||
"room": "lsxchat",
|
||||
"location": "St_Louis"
|
||||
},
|
||||
"pah": {
|
||||
"room": "pahchat",
|
||||
"location": "Paducah"
|
||||
},
|
||||
"bou": {
|
||||
"room": "bouchat",
|
||||
"location": "Denver"
|
||||
},
|
||||
"tsa": {
|
||||
"room": "tsachat",
|
||||
"location": "Tulsa"
|
||||
},
|
||||
"zfw": {
|
||||
"room": "zfwchat",
|
||||
"location": "Fort_Worth"
|
||||
},
|
||||
"zau": {
|
||||
"room": "zauchat",
|
||||
"location": "Chicago"
|
||||
},
|
||||
"mqt": {
|
||||
"room": "mqtchat",
|
||||
"location": "Marquette"
|
||||
},
|
||||
"maf": {
|
||||
"room": "mafchat",
|
||||
"location": "Midland-Odessa"
|
||||
},
|
||||
"mrx": {
|
||||
"room": "mrxchat",
|
||||
"location": "Morristown"
|
||||
},
|
||||
"fgz": {
|
||||
"room": "fgzchat",
|
||||
"location": "Flagstaff"
|
||||
},
|
||||
"oax": {
|
||||
"room": "oaxchat",
|
||||
"location": "Omaha-Valley"
|
||||
},
|
||||
"btv": {
|
||||
"room": "btvchat",
|
||||
"location": "Burlington"
|
||||
},
|
||||
"ict": {
|
||||
"room": "ictchat",
|
||||
"location": "Wichita"
|
||||
},
|
||||
"mfr": {
|
||||
"room": "mfrchat",
|
||||
"location": "Medford"
|
||||
},
|
||||
"hgx": {
|
||||
"room": "hgxchat",
|
||||
"location": "Houston-Galveston"
|
||||
},
|
||||
"afg": {
|
||||
"room": "afgchat",
|
||||
"location": "Fairbanks"
|
||||
},
|
||||
"sgf": {
|
||||
"room": "sgfchat",
|
||||
"location": "Springfield"
|
||||
},
|
||||
"haw": {
|
||||
"room": "hawaii",
|
||||
"location": "Hawaii"
|
||||
},
|
||||
"zla": {
|
||||
"room": "zlachat",
|
||||
"location": "Los_Angeles"
|
||||
},
|
||||
"aly": {
|
||||
"room": "alychat",
|
||||
"location": "Albany"
|
||||
},
|
||||
"sjt": {
|
||||
"room": "sjtchat",
|
||||
"location": "San_Angelo"
|
||||
},
|
||||
"jan": {
|
||||
"room": "janchat",
|
||||
"location": "Jackson"
|
||||
},
|
||||
"gsp": {
|
||||
"room": "gspchat",
|
||||
"location": "Greenville-Spartanburg"
|
||||
},
|
||||
"lwx": {
|
||||
"room": "lwxchat",
|
||||
"location": "Baltimore_Md-_Washington_Dc"
|
||||
},
|
||||
"gyx": {
|
||||
"room": "gyxchat",
|
||||
"location": "Gray"
|
||||
},
|
||||
"wpc": {
|
||||
"room": "wpcchat",
|
||||
"location": "Weather_Prediction_Center"
|
||||
},
|
||||
"lbf": {
|
||||
"room": "lbfchat",
|
||||
"location": "North_Platte"
|
||||
},
|
||||
"jax": {
|
||||
"room": "jaxchat",
|
||||
"location": "Jacksonville"
|
||||
},
|
||||
"fgf": {
|
||||
"room": "fgfchat",
|
||||
"location": "Grand_Forks"
|
||||
}
|
||||
}
|
17
debug.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
const Discord = require('discord.js');
|
||||
const client = new Discord.Client({intents: ["Guilds"]})
|
||||
const config = require('./config.json');
|
||||
|
||||
categories = ["1237807432311373895", "1237807432709963807", "1237807433678590023", "1237807434425434164"]
|
||||
|
||||
client.once('ready', () => {
|
||||
console.log('Ready!');
|
||||
client.guilds.cache.get("1237792259248750673").channels.cache.forEach(channel => {
|
||||
if (!channel.parent) return;
|
||||
if (categories.includes(channel.parent.id)) {
|
||||
channel.delete();
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
client.login(config.discord.token);
|
137
funcs.js
Normal file
|
@ -0,0 +1,137 @@
|
|||
// Use OSM API to get coordinates https://nominatim.openstreetmap.org/search?q=search+query&format=json&limit=1
|
||||
const getCoordinates = async (location) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
// Make location url friendly
|
||||
location = encodeURIComponent(location);
|
||||
const url = `https://nominatim.openstreetmap.org/search?q=${location}&format=json&limit=1`;
|
||||
// use custom useragent (discord-iem-bot, chris@chrischro.me)
|
||||
const options = {
|
||||
headers: {
|
||||
'User-Agent': 'Discord-IEM-Bot/1.0 (chris@chrischro.me)',
|
||||
},
|
||||
};
|
||||
// Make request
|
||||
fetch(url, options)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.length > 0) {
|
||||
resolve({
|
||||
lat: data[0].lat,
|
||||
lon: data[0].lon,
|
||||
});
|
||||
} else {
|
||||
reject('Location not found');
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
reject(err);
|
||||
});
|
||||
})
|
||||
};
|
||||
|
||||
const getForecast = async (lat, lon) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const url = `https://api.weather.gov/points/${lat},${lon}`;
|
||||
// use same custom ua
|
||||
const options = {
|
||||
headers: {
|
||||
'User-Agent': 'Discord-IEM-Bot/1.0 (chris@chrischro.me)',
|
||||
},
|
||||
};
|
||||
// Make request
|
||||
fetch(url, options)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.properties?.forecast) {
|
||||
fetch(data.properties.forecast)
|
||||
.then(response => response.json())
|
||||
.then(data2 => {
|
||||
data2.properties.relativeLocation = data.properties.relativeLocation;
|
||||
resolve(data2);
|
||||
})
|
||||
.catch(err => {
|
||||
reject(err);
|
||||
});
|
||||
|
||||
} else {
|
||||
reject('Forecast not found');
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
reject(err);
|
||||
});
|
||||
})
|
||||
};
|
||||
|
||||
const getWeatherBySearch = async (search) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
getCoordinates(search)
|
||||
.then(coords => {
|
||||
getForecast(coords.lat, coords.lon)
|
||||
.then(data => {
|
||||
resolve(data);
|
||||
})
|
||||
.catch(err => {
|
||||
reject(err);
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
reject(err);
|
||||
});
|
||||
})
|
||||
};
|
||||
|
||||
const generateDiscordEmbeds = (forecastData, numOfDays) => {
|
||||
// Take the first 7 periods and make them into embeds
|
||||
const embeds = [];
|
||||
if (!numOfDays) numOfDays = 1;
|
||||
for (let i = 0; i < numOfDays; i++) {
|
||||
const period = forecastData.properties.periods[i];
|
||||
if (period.icon?.startsWith("/")) {
|
||||
period.icon = `https://api.weather.gov${period.icon}`
|
||||
}
|
||||
const embed = {
|
||||
title: `${period.name} in ${forecastData.properties.relativeLocation.properties.city} ${forecastData.properties.relativeLocation.properties.state}`,
|
||||
description: `Valid <t:${new Date(period.startTime)/1000}:f> - <t:${new Date(period.endTime)/1000}:f>\n${period.detailedForecast}`,
|
||||
timestamp: new Date(period.startTime),
|
||||
thumbnail: {
|
||||
url: period.icon,
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'Temperature',
|
||||
value: `${period.temperature}°F`,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: 'Wind',
|
||||
value: `${period.windDirection}@${period.windSpeed}`,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: 'Precipitation',
|
||||
value: period.probabilityOfPrecipitation?.value ? period.probabilityOfPrecipitation?.value + '%' : '0%',
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: 'Humidity',
|
||||
value: period.relativeHumidity?.value ? period.relativeHumidity.value + '%' : "0%",
|
||||
}
|
||||
|
||||
],
|
||||
footer: {
|
||||
text: `Data provided by the National Weather Service · Elevation ${forecastData.properties.elevation.value}m`
|
||||
}
|
||||
};
|
||||
embeds.push(embed);
|
||||
}
|
||||
return embeds;
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
getCoordinates,
|
||||
getForecast,
|
||||
getWeatherBySearch,
|
||||
generateDiscordEmbeds
|
||||
};
|
116
genblacklist.js
Normal file
|
@ -0,0 +1,116 @@
|
|||
const goodrooms = require("./goodrooms.json");
|
||||
// goodrooms is an array of objects {room: string, name: string}
|
||||
const { client, xml } = require("@xmpp/client");
|
||||
const colors = require("colors");
|
||||
|
||||
const generateRandomString = function (options, length) {
|
||||
let result = '';
|
||||
const characters = {
|
||||
upper: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
||||
lower: 'abcdefghijklmnopqrstuvwxyz',
|
||||
number: '0123456789',
|
||||
special: '!@#$%^&*()_+'
|
||||
};
|
||||
let chars = '';
|
||||
for (const key in options) {
|
||||
if (options[key]) {
|
||||
chars += characters[key];
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < length; i++) {
|
||||
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// Func to generate UUID
|
||||
const generateUUID = function () {
|
||||
return generateRandomString({ lower: true, upper: true, number: true }, 8) + "-" + generateRandomString({ lower: true, upper: true, number: true }, 4) + "-" + generateRandomString({ lower: true, upper: true, number: true }, 4) + "-" + generateRandomString({ lower: true, upper: true, number: true }, 4) + "-" + generateRandomString({ lower: true, upper: true, number: true }, 12);
|
||||
}
|
||||
|
||||
const xmpp = client({
|
||||
service: "xmpp://conference.weather.im",
|
||||
domain: "weather.im",
|
||||
resource: `discord-weather-bot-${generateRandomString({ upper: true, lower: true, number: true }, 5)}`, // Weird fix to "Username already in use"
|
||||
});
|
||||
|
||||
var blacklist = [];
|
||||
var rooms = {};
|
||||
xmpp.on("stanza", (stanza) => {
|
||||
// Debug stuff
|
||||
|
||||
|
||||
// Handle Room List
|
||||
if (stanza.is("iq") && stanza.attrs.type === "result" && stanza.getChild("query")) {
|
||||
query = stanza.getChild("query");
|
||||
if (query.attrs.xmlns === "http://jabber.org/protocol/disco#items") {
|
||||
query.getChildren("item").forEach((item) => {
|
||||
roomname = item.attrs.jid.split("@")[0];
|
||||
console.log(`${colors.cyan("[INFO]")} Found room: ${item.attrs.jid}`);
|
||||
// if room not in goodrooms list add to blacklist array
|
||||
if (!goodrooms.find(room => room.room === roomname)) {
|
||||
blacklist.push(item.attrs.jid);
|
||||
return console.log(`${colors.red("[INFO]")} Added room to blacklist: ${roomname}`);
|
||||
}
|
||||
|
||||
// Get proper text name from goodrooms
|
||||
properName = goodrooms.find(room => room.room === roomname).name;
|
||||
console.log(properName)
|
||||
|
||||
// room is in goodrooms, get first 3 of room name, add it to rooms object 3char: {room: roomname, name: name}
|
||||
rooms[roomname.substring(0, 3)] = { room: roomname, location: properName };
|
||||
});
|
||||
clearTimeout(start);
|
||||
start = setTimeout(() => {
|
||||
console.log(`${colors.green("[INFO]")} Blacklist: ${JSON.stringify(blacklist)}`);
|
||||
console.log(`${colors.green("[INFO]")} Rooms: ${JSON.stringify(rooms)}`);
|
||||
|
||||
xmpp.stop();
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
xmpp.on("online", async (address) => {
|
||||
|
||||
errCount = 0;
|
||||
// Start listening on all channels, (dont ban me funny man)
|
||||
// for (const channel in iem) {
|
||||
// console.log(`Joining ${channel.name}`)
|
||||
// await xmpp.send(xml("presence", { to: `${channel.jud}/${channel.name}` }));
|
||||
// }
|
||||
/* sub format
|
||||
<presence to="botstalk@conference.weather.im/add9b8f1-038d-47ed-b708-6ed60075a82f" xmlns="jabber:client">
|
||||
<x xmlns="http://jabber.org/protocol/muc#user">
|
||||
<item>
|
||||
<role>visitor</role>
|
||||
</item>
|
||||
</x>
|
||||
</presence>
|
||||
*/
|
||||
|
||||
// Request room list
|
||||
// Automatically find room list
|
||||
xmpp.send(xml("iq", { type: "get", to: "conference.weather.im", id: "rooms" }, xml("query", { xmlns: "http://jabber.org/protocol/disco#items" })));
|
||||
// Join all channels (Old method)
|
||||
// iem.forEach((channel => {
|
||||
// console.log(`${colors.cyan("[INFO]")} Joining ${channel.jid}/${channel.name}/${curUUID}`)
|
||||
// //xmpp.send(xml("presence", { to: `${channel.jid}/${channel.jid.split("@")[0]}` }));
|
||||
// xmpp.send(xml("presence", { to: `${channel.jid}/${channel.name}/${curUUID}` }, xml("item", { role: "visitor" })));
|
||||
// }))
|
||||
|
||||
console.log(`${colors.cyan("[INFO]")} Connected to XMPP server as ${address.toString()}`);
|
||||
|
||||
setTimeout(() => {
|
||||
startup = false;
|
||||
console.log(`${colors.cyan("[INFO]")} Startup complete, listening for messages...`);
|
||||
}, 1000)
|
||||
});
|
||||
|
||||
var start = setTimeout(() => {
|
||||
console.log(`${colors.green("[INFO]")} Blacklist: ${blacklist}`);
|
||||
console.log(`${colors.green("[INFO]")} Rooms: ${rooms}`);
|
||||
xmpp.stop();
|
||||
}, 5000);
|
||||
xmpp.start().catch(console.error);
|
654
goodrooms.json
Normal file
|
@ -0,0 +1,654 @@
|
|||
[
|
||||
{
|
||||
"room": "botstalk",
|
||||
"name": "All_Bots_Talk"
|
||||
},
|
||||
{
|
||||
"room": "nhcchat",
|
||||
"name": "National_Hurricane_Center"
|
||||
},
|
||||
{
|
||||
"room": "spcchat",
|
||||
"name": "Storm_Prediction_Center"
|
||||
},
|
||||
{
|
||||
"room": "wpcchat",
|
||||
"name": "Weather_Prediction_Center"
|
||||
},
|
||||
{
|
||||
"room": "abqchat",
|
||||
"name": "Albuquerque"
|
||||
},
|
||||
{
|
||||
"room": "abrchat",
|
||||
"name": "Aberdeen"
|
||||
},
|
||||
{
|
||||
"room": "afcchat",
|
||||
"name": "Anchorage"
|
||||
},
|
||||
{
|
||||
"room": "afgchat",
|
||||
"name": "Fairbanks"
|
||||
},
|
||||
{
|
||||
"room": "ajkchat",
|
||||
"name": "Juneau"
|
||||
},
|
||||
{
|
||||
"room": "akqchat",
|
||||
"name": "Wakefield"
|
||||
},
|
||||
{
|
||||
"room": "alychat",
|
||||
"name": "Albany"
|
||||
},
|
||||
{
|
||||
"room": "amachat",
|
||||
"name": "Amarillo"
|
||||
},
|
||||
{
|
||||
"room": "apxchat",
|
||||
"name": "Gaylord"
|
||||
},
|
||||
{
|
||||
"room": "arxchat",
|
||||
"name": "La_Crosse"
|
||||
},
|
||||
{
|
||||
"room": "bgmchat",
|
||||
"name": "Binghamton"
|
||||
},
|
||||
{
|
||||
"room": "bischat",
|
||||
"name": "Bismarck"
|
||||
},
|
||||
{
|
||||
"room": "bmxchat",
|
||||
"name": "Birmingham"
|
||||
},
|
||||
{
|
||||
"room": "boichat",
|
||||
"name": "Boise"
|
||||
},
|
||||
{
|
||||
"room": "bouchat",
|
||||
"name": "Denver"
|
||||
},
|
||||
{
|
||||
"room": "boxchat",
|
||||
"name": "Boston-Taunton"
|
||||
},
|
||||
{
|
||||
"room": "brochat",
|
||||
"name": "Brownsville"
|
||||
},
|
||||
{
|
||||
"room": "btvchat",
|
||||
"name": "Burlington"
|
||||
},
|
||||
{
|
||||
"room": "bufchat",
|
||||
"name": "Buffalo"
|
||||
},
|
||||
{
|
||||
"room": "byzchat",
|
||||
"name": "Billings"
|
||||
},
|
||||
{
|
||||
"room": "caechat",
|
||||
"name": "Columbia"
|
||||
},
|
||||
{
|
||||
"room": "carchat",
|
||||
"name": "Caribou"
|
||||
},
|
||||
{
|
||||
"room": "chschat",
|
||||
"name": "Charleston"
|
||||
},
|
||||
{
|
||||
"room": "clechat",
|
||||
"name": "Cleveland"
|
||||
},
|
||||
{
|
||||
"room": "crpchat",
|
||||
"name": "Corpus_Christi"
|
||||
},
|
||||
{
|
||||
"room": "ctpchat",
|
||||
"name": "State_College"
|
||||
},
|
||||
{
|
||||
"room": "cyschat",
|
||||
"name": "Cheyenne"
|
||||
},
|
||||
{
|
||||
"room": "ddcchat",
|
||||
"name": "Dodge_City"
|
||||
},
|
||||
{
|
||||
"room": "dlhchat",
|
||||
"name": "Duluth"
|
||||
},
|
||||
{
|
||||
"room": "dmxchat",
|
||||
"name": "Des_Moines"
|
||||
},
|
||||
{
|
||||
"room": "dtxchat",
|
||||
"name": "Detroit"
|
||||
},
|
||||
{
|
||||
"room": "dvnchat",
|
||||
"name": "Quad_Cities_Ia"
|
||||
},
|
||||
{
|
||||
"room": "eaxchat",
|
||||
"name": "Kansas_City-Pleasant_Hill"
|
||||
},
|
||||
{
|
||||
"room": "ekachat",
|
||||
"name": "Eureka"
|
||||
},
|
||||
{
|
||||
"room": "epzchat",
|
||||
"name": "El_Paso_Tx-Santa_Teresa"
|
||||
},
|
||||
{
|
||||
"room": "ewxchat",
|
||||
"name": "Austin-San_Antonio"
|
||||
},
|
||||
{
|
||||
"room": "ffcchat",
|
||||
"name": "Peachtree_City"
|
||||
},
|
||||
{
|
||||
"room": "fgfchat",
|
||||
"name": "Grand_Forks"
|
||||
},
|
||||
{
|
||||
"room": "fgzchat",
|
||||
"name": "Flagstaff"
|
||||
},
|
||||
{
|
||||
"room": "fsdchat",
|
||||
"name": "Sioux_Falls"
|
||||
},
|
||||
{
|
||||
"room": "fwdchat",
|
||||
"name": "Dallas-Fort_Worth"
|
||||
},
|
||||
{
|
||||
"room": "ggwchat",
|
||||
"name": "Glasgow"
|
||||
},
|
||||
{
|
||||
"room": "gidchat",
|
||||
"name": "Hastings"
|
||||
},
|
||||
{
|
||||
"room": "gjtchat",
|
||||
"name": "Grand_Junction"
|
||||
},
|
||||
{
|
||||
"room": "gldchat",
|
||||
"name": "Goodland"
|
||||
},
|
||||
{
|
||||
"room": "grbchat",
|
||||
"name": "Green_Bay"
|
||||
},
|
||||
{
|
||||
"room": "grrchat",
|
||||
"name": "Grand_Rapids"
|
||||
},
|
||||
{
|
||||
"room": "gspchat",
|
||||
"name": "Greenville-Spartanburg"
|
||||
},
|
||||
{
|
||||
"room": "gumchat",
|
||||
"name": "Guam"
|
||||
},
|
||||
{
|
||||
"room": "gyxchat",
|
||||
"name": "Gray"
|
||||
},
|
||||
{
|
||||
"room": "hawaii",
|
||||
"name": "Hawaii"
|
||||
},
|
||||
{
|
||||
"room": "hfochat",
|
||||
"name": "Honolulu"
|
||||
},
|
||||
{
|
||||
"room": "hgxchat",
|
||||
"name": "Houston-Galveston"
|
||||
},
|
||||
{
|
||||
"room": "hnxchat",
|
||||
"name": "San_Joaquin_Valley-Hanford"
|
||||
},
|
||||
{
|
||||
"room": "hunchat",
|
||||
"name": "Huntsville"
|
||||
},
|
||||
{
|
||||
"room": "ictchat",
|
||||
"name": "Wichita"
|
||||
},
|
||||
{
|
||||
"room": "ilmchat",
|
||||
"name": "Wilmington"
|
||||
},
|
||||
{
|
||||
"room": "ilnchat",
|
||||
"name": "Wilmington"
|
||||
},
|
||||
{
|
||||
"room": "ilxchat",
|
||||
"name": "Lincoln"
|
||||
},
|
||||
{
|
||||
"room": "indchat",
|
||||
"name": "Indianapolis"
|
||||
},
|
||||
{
|
||||
"room": "iwxchat",
|
||||
"name": "Northern_Indiana"
|
||||
},
|
||||
{
|
||||
"room": "janchat",
|
||||
"name": "Jackson"
|
||||
},
|
||||
{
|
||||
"room": "jaxchat",
|
||||
"name": "Jacksonville"
|
||||
},
|
||||
{
|
||||
"room": "jklchat",
|
||||
"name": "Jackson"
|
||||
},
|
||||
{
|
||||
"room": "jsjchat",
|
||||
"name": "San_Juan"
|
||||
},
|
||||
{
|
||||
"room": "keychat",
|
||||
"name": "Key_West"
|
||||
},
|
||||
{
|
||||
"room": "lbfchat",
|
||||
"name": "North_Platte"
|
||||
},
|
||||
{
|
||||
"room": "lchchat",
|
||||
"name": "Lake_Charles"
|
||||
},
|
||||
{
|
||||
"room": "lixchat",
|
||||
"name": "New_Orleans"
|
||||
},
|
||||
{
|
||||
"room": "lknchat",
|
||||
"name": "Elko"
|
||||
},
|
||||
{
|
||||
"room": "lmkchat",
|
||||
"name": "Louisville"
|
||||
},
|
||||
{
|
||||
"room": "lotchat",
|
||||
"name": "Chicago"
|
||||
},
|
||||
{
|
||||
"room": "loxchat",
|
||||
"name": "Los_Angeles-Oxnard"
|
||||
},
|
||||
{
|
||||
"room": "lsxchat",
|
||||
"name": "St_Louis"
|
||||
},
|
||||
{
|
||||
"room": "lubchat",
|
||||
"name": "Lubbock"
|
||||
},
|
||||
{
|
||||
"room": "lwxchat",
|
||||
"name": "Baltimore_Md-_Washington_Dc"
|
||||
},
|
||||
{
|
||||
"room": "lzkchat",
|
||||
"name": "Little_Rock"
|
||||
},
|
||||
{
|
||||
"room": "mafchat",
|
||||
"name": "Midland-Odessa"
|
||||
},
|
||||
{
|
||||
"room": "megchat",
|
||||
"name": "Memphis"
|
||||
},
|
||||
{
|
||||
"room": "mflchat",
|
||||
"name": "Miami"
|
||||
},
|
||||
{
|
||||
"room": "mfrchat",
|
||||
"name": "Medford"
|
||||
},
|
||||
{
|
||||
"room": "mhxchat",
|
||||
"name": "Newport-Morehead_City"
|
||||
},
|
||||
{
|
||||
"room": "mkxchat",
|
||||
"name": "Milwaukee-Sullivan"
|
||||
},
|
||||
{
|
||||
"room": "mlbchat",
|
||||
"name": "Melbourne"
|
||||
},
|
||||
{
|
||||
"room": "mobchat",
|
||||
"name": "Mobile"
|
||||
},
|
||||
{
|
||||
"room": "mpxchat",
|
||||
"name": "Twin_Cities-Chanhassen"
|
||||
},
|
||||
{
|
||||
"room": "mqtchat",
|
||||
"name": "Marquette"
|
||||
},
|
||||
{
|
||||
"room": "mrxchat",
|
||||
"name": "Morristown"
|
||||
},
|
||||
{
|
||||
"room": "msochat",
|
||||
"name": "Missoula"
|
||||
},
|
||||
{
|
||||
"room": "mtrchat",
|
||||
"name": "San_Francisco"
|
||||
},
|
||||
{
|
||||
"room": "oaxchat",
|
||||
"name": "Omaha-Valley"
|
||||
},
|
||||
{
|
||||
"room": "ohxchat",
|
||||
"name": "Nashville"
|
||||
},
|
||||
{
|
||||
"room": "okxchat",
|
||||
"name": "New_York"
|
||||
},
|
||||
{
|
||||
"room": "otxchat",
|
||||
"name": "Spokane"
|
||||
},
|
||||
{
|
||||
"room": "ounchat",
|
||||
"name": "Norman"
|
||||
},
|
||||
{
|
||||
"room": "pahchat",
|
||||
"name": "Paducah"
|
||||
},
|
||||
{
|
||||
"room": "pbzchat",
|
||||
"name": "Pittsburgh"
|
||||
},
|
||||
{
|
||||
"room": "pdtchat",
|
||||
"name": "Pendleton"
|
||||
},
|
||||
{
|
||||
"room": "phichat",
|
||||
"name": "Mount_Holly"
|
||||
},
|
||||
{
|
||||
"room": "pihchat",
|
||||
"name": "Pocatello-Idaho_Falls"
|
||||
},
|
||||
{
|
||||
"room": "pqrchat",
|
||||
"name": "Portland"
|
||||
},
|
||||
{
|
||||
"room": "psrchat",
|
||||
"name": "Phoenix"
|
||||
},
|
||||
{
|
||||
"room": "pubchat",
|
||||
"name": "Pueblo"
|
||||
},
|
||||
{
|
||||
"room": "rahchat",
|
||||
"name": "Raleigh"
|
||||
},
|
||||
{
|
||||
"room": "revchat",
|
||||
"name": "Reno"
|
||||
},
|
||||
{
|
||||
"room": "riwchat",
|
||||
"name": "Riverton"
|
||||
},
|
||||
{
|
||||
"room": "rlxchat",
|
||||
"name": "Charleston"
|
||||
},
|
||||
{
|
||||
"room": "rnkchat",
|
||||
"name": "Blacksburg"
|
||||
},
|
||||
{
|
||||
"room": "sewchat",
|
||||
"name": "Seattle"
|
||||
},
|
||||
{
|
||||
"room": "sgfchat",
|
||||
"name": "Springfield"
|
||||
},
|
||||
{
|
||||
"room": "sgxchat",
|
||||
"name": "San_Diego"
|
||||
},
|
||||
{
|
||||
"room": "shvchat",
|
||||
"name": "Shreveport"
|
||||
},
|
||||
{
|
||||
"room": "sjtchat",
|
||||
"name": "San_Angelo"
|
||||
},
|
||||
{
|
||||
"room": "sjuchat",
|
||||
"name": "San_Juan"
|
||||
},
|
||||
{
|
||||
"room": "slcchat",
|
||||
"name": "Salt_Lake_City"
|
||||
},
|
||||
{
|
||||
"room": "stochat",
|
||||
"name": "Sacramento"
|
||||
},
|
||||
{
|
||||
"room": "taechat",
|
||||
"name": "Tallahassee"
|
||||
},
|
||||
{
|
||||
"room": "tbwchat",
|
||||
"name": "Tampa_Bay_Area-Ruskin"
|
||||
},
|
||||
{
|
||||
"room": "tfxchat",
|
||||
"name": "Great_Falls"
|
||||
},
|
||||
{
|
||||
"room": "topchat",
|
||||
"name": "Topeka"
|
||||
},
|
||||
{
|
||||
"room": "tsachat",
|
||||
"name": "Tulsa"
|
||||
},
|
||||
{
|
||||
"room": "twcchat",
|
||||
"name": "Tucson"
|
||||
},
|
||||
{
|
||||
"room": "unrchat",
|
||||
"name": "Rapid_City"
|
||||
},
|
||||
{
|
||||
"room": "vefchat",
|
||||
"name": "Las_Vegas"
|
||||
},
|
||||
{
|
||||
"room": "alrchat",
|
||||
"name": "Atlanta_RFC"
|
||||
},
|
||||
{
|
||||
"room": "fwrchat",
|
||||
"name": "West_Gulf_RFC"
|
||||
},
|
||||
{
|
||||
"room": "krfchat",
|
||||
"name": "Missouri_River_Basin_RFC"
|
||||
},
|
||||
{
|
||||
"room": "msrchat",
|
||||
"name": "North_Central_RFC"
|
||||
},
|
||||
{
|
||||
"room": "ornchat",
|
||||
"name": "Lower_Mississippi_RFC"
|
||||
},
|
||||
{
|
||||
"room": "pacrchat",
|
||||
"name": "Alaska_-_Pacific_RFC"
|
||||
},
|
||||
{
|
||||
"room": "ptrchat",
|
||||
"name": "Northwest_RFC"
|
||||
},
|
||||
{
|
||||
"room": "rhachat",
|
||||
"name": "Mid_Atlantic_RFC"
|
||||
},
|
||||
{
|
||||
"room": "rsachat",
|
||||
"name": "California_-_Nevada_RFC"
|
||||
},
|
||||
{
|
||||
"room": "strchat",
|
||||
"name": "Colorado_RFC"
|
||||
},
|
||||
{
|
||||
"room": "tarchat",
|
||||
"name": "Northeast_RFC"
|
||||
},
|
||||
{
|
||||
"room": "tirchat",
|
||||
"name": "Ohio_RFC"
|
||||
},
|
||||
{
|
||||
"room": "tuachat",
|
||||
"name": "Arkansas_Red_River_RFC"
|
||||
},
|
||||
{
|
||||
"room": "pancchat",
|
||||
"name": "Anchorage"
|
||||
},
|
||||
{
|
||||
"room": "zabchat",
|
||||
"name": "Albuquerque"
|
||||
},
|
||||
{
|
||||
"room": "zauchat",
|
||||
"name": "Chicago"
|
||||
},
|
||||
{
|
||||
"room": "zbwchat",
|
||||
"name": "Boston"
|
||||
},
|
||||
{
|
||||
"room": "zdcchat",
|
||||
"name": "Washington_DC"
|
||||
},
|
||||
{
|
||||
"room": "zdvchat",
|
||||
"name": "Denver"
|
||||
},
|
||||
{
|
||||
"room": "zfwchat",
|
||||
"name": "Fort_Worth"
|
||||
},
|
||||
{
|
||||
"room": "zhnchat",
|
||||
"name": "Honolulu_CWSU"
|
||||
},
|
||||
{
|
||||
"room": "zhuchat",
|
||||
"name": "Houston"
|
||||
},
|
||||
{
|
||||
"room": "zidchat",
|
||||
"name": "Indianapolis"
|
||||
},
|
||||
{
|
||||
"room": "zjxchat",
|
||||
"name": "Jacksonville"
|
||||
},
|
||||
{
|
||||
"room": "zkcchat",
|
||||
"name": "Kansas_City"
|
||||
},
|
||||
{
|
||||
"room": "zlachat",
|
||||
"name": "Los_Angeles"
|
||||
},
|
||||
{
|
||||
"room": "zlcchat",
|
||||
"name": "Salt_Lake_City"
|
||||
},
|
||||
{
|
||||
"room": "zmachat",
|
||||
"name": "Miami"
|
||||
},
|
||||
{
|
||||
"room": "zmechat",
|
||||
"name": "Memphis"
|
||||
},
|
||||
{
|
||||
"room": "zmpchat",
|
||||
"name": "Minneapolis"
|
||||
},
|
||||
{
|
||||
"room": "znychat",
|
||||
"name": "New_York"
|
||||
},
|
||||
{
|
||||
"room": "zoachat",
|
||||
"name": "Oakland"
|
||||
},
|
||||
{
|
||||
"room": "zobchat",
|
||||
"name": "Cleveland"
|
||||
},
|
||||
{
|
||||
"room": "zsechat",
|
||||
"name": "Seattle"
|
||||
},
|
||||
{
|
||||
"room": "ztlchat",
|
||||
"name": "Atlanta"
|
||||
}
|
||||
]
|
BIN
images/error.gif
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
images/overlays/artcc.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
images/overlays/city.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
images/overlays/county.png
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
images/overlays/cwa.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
images/overlays/fema.png
Normal file
After Width: | Height: | Size: 113 KiB |
BIN
images/overlays/interstate.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
images/overlays/population.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
images/overlays/rfc.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
images/overlays/tribal.png
Normal file
After Width: | Height: | Size: 34 KiB |
26
package.json
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "weather-bot",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@discordjs/opus": "^0.9.0",
|
||||
"@discordjs/voice": "^0.17.0",
|
||||
"@xmpp/client": "^0.13.1",
|
||||
"@xmpp/debug": "^0.13.0",
|
||||
"colors": "^1.4.0",
|
||||
"discord.js": "14.14.1",
|
||||
"geolib": "^3.3.4",
|
||||
"html-entities": "^2.5.2",
|
||||
"jimp": "^0.22.12",
|
||||
"sodium": "^3.0.2",
|
||||
"sqlite3": "^5.1.7",
|
||||
"ts-node": "^10.9.2",
|
||||
"xml2json": "^0.12.0"
|
||||
}
|
||||
}
|
69
testing/voicetest.js
Normal file
|
@ -0,0 +1,69 @@
|
|||
const Discord = require('discord.js');
|
||||
const { Client, Intents } = require('discord.js');
|
||||
const client = new Client({ intents: ["GuildVoiceStates", "Guilds"] });
|
||||
|
||||
const config = require('../config.json');
|
||||
|
||||
const dVC = require('@discordjs/voice');
|
||||
const { join } = require('path');
|
||||
|
||||
// get user input for url and channel
|
||||
console.log(process.argv)
|
||||
|
||||
channelIN = process.argv[2];
|
||||
urlIN = process.argv[3];
|
||||
|
||||
client.once('ready', () => {
|
||||
console.log("ready");
|
||||
JoinChannel(client.channels.cache.get(channelIN), urlIN);
|
||||
});
|
||||
|
||||
client.login(config.discord.token);
|
||||
|
||||
function JoinChannel(channel, track, volume) {
|
||||
const connection = dVC.joinVoiceChannel({
|
||||
channelId: channel.id,
|
||||
guildId: channel.guild.id,
|
||||
adapterCreator: channel.guild.voiceAdapterCreator,
|
||||
selfDeaf: true
|
||||
});
|
||||
|
||||
|
||||
const resource = dVC.createAudioResource(track, {inlineVolume: true, silencePaddingFrames: 5});
|
||||
const player = dVC.createAudioPlayer();
|
||||
resource.volume.setVolume(2);
|
||||
connection.subscribe(player)
|
||||
player.play(resource);
|
||||
|
||||
connection.on(dVC.VoiceConnectionStatus.Ready, () => {console.log("ready"); player.play(resource);})
|
||||
connection.on(dVC.VoiceConnectionStatus.Disconnected, async (oldState, newState) => {
|
||||
try {
|
||||
console.log("Disconnected.")
|
||||
await Promise.race([
|
||||
dVC.entersState(connection, VoiceConnectionStatus.Signalling, 5_000),
|
||||
dVC.entersState(connection, VoiceConnectionStatus.Connecting, 5_000),
|
||||
]);
|
||||
} catch (error) {
|
||||
connection.destroy();
|
||||
}
|
||||
});
|
||||
player.on('error', error => {
|
||||
console.error(`Error: ${error.message} with resource ${error.resource.metadata.title}`);
|
||||
player.stop();
|
||||
});
|
||||
player.on(dVC.AudioPlayerStatus.Playing, () => {
|
||||
console.log('The audio player has started playing!');
|
||||
});
|
||||
player.on('idle', () => {
|
||||
connection.destroy();
|
||||
})
|
||||
console.log(player.state.resource.volume.volume)
|
||||
}
|
||||
|
||||
function LeaveVoiceChannel(channel) {
|
||||
// Get resource, player, etc, and destroy them
|
||||
const connection = dVC.getVoiceConnection(channel.guild.id);
|
||||
if (connection) {
|
||||
connection.destroy();
|
||||
}
|
||||
}
|
30
testing/wfo.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
// load wfos.json, find all wfos that have a 3 character room code, and add `chat` to the end of room codes
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const wfos = require('../wfos.json');
|
||||
|
||||
// wfos is an object of objects
|
||||
|
||||
// const newWfos = Object.keys(wfos).reduce((acc, key) => {
|
||||
// const wfo = wfos[key];
|
||||
// if (wfo.room.length === 3) {
|
||||
// wfo.room = `${wfo.room}chat`;
|
||||
// }
|
||||
// acc[key] = wfo;
|
||||
// return acc;
|
||||
// }, {});
|
||||
|
||||
// Loop thru wfos and find locations that have </td> at the end, remove that
|
||||
const newWfos = Object.keys(wfos).reduce((acc, key) => {
|
||||
const wfo = wfos[key];
|
||||
if (wfo.location.endsWith('</td>')) {
|
||||
wfo.location = wfo.location.slice(0, -5);
|
||||
}
|
||||
acc[key] = wfo;
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
|
||||
fs.writeFileSync(path.join(__dirname, 'wfos.json'), JSON.stringify(newWfos, null, 2));
|
231
testing/xml2jsontmp.js
Normal file
|
@ -0,0 +1,231 @@
|
|||
// Leaving this here for future use
|
||||
const xml2json = require('xml2json');
|
||||
|
||||
const xml = `
|
||||
<root>
|
||||
<item jid="ilnchat@conference.weather.im" name="ilnchat" />
|
||||
<item jid="zhuchat@conference.weather.im" name="zhuchat" />
|
||||
<item jid="rerchat@conference.weather.im" name="Record Event Reports (RER)" />
|
||||
<item jid="ncrfcchat@conference.weather.im" name="ncrfcchat" />
|
||||
<item jid="zmechat@conference.weather.im" name="zmechat" />
|
||||
<item jid="ggwchat@conference.weather.im" name="ggwchat" />
|
||||
<item jid="sewchat@conference.weather.im" name="sewchat" />
|
||||
<item jid="ohxchat@conference.weather.im" name="ohxchat" />
|
||||
<item jid="megchat@conference.weather.im" name="megchat" />
|
||||
<item jid="mobchat@conference.weather.im" name="mobchat" />
|
||||
<item jid="brochat@conference.weather.im" name="brochat" />
|
||||
<item jid="mkx_madison_spotters@conference.weather.im" name="MKX madison storm spotters" />
|
||||
<item jid="ddcchat@conference.weather.im" name="ddcchat" />
|
||||
<item jid="zanchat@conference.weather.im" name="zanchat" />
|
||||
<item jid="mflchat@conference.weather.im" name="mflchat" />
|
||||
<item jid="michiganwxalerts@conference.weather.im" name="michiganwxalerts" />
|
||||
<item jid="dvnchat@conference.weather.im" name="dvnchat" />
|
||||
<item jid="gjtchat@conference.weather.im" name="gjtchat" />
|
||||
<item jid="ztlchat@conference.weather.im" name="ztlchat" />
|
||||
<item jid="skywarnstatewidechase@conference.weather.im" name="Skywarn Statewide Chase team" />
|
||||
<item jid="lmkchat@conference.weather.im" name="lmkchat" />
|
||||
<item jid="wws44fl@conference.weather.im" name="WWS Tampa Bay" />
|
||||
<item jid="hatchat@conference.weather.im" name="hatchat" />
|
||||
<item jid="fwdchat@conference.weather.im" name="fwdchat" />
|
||||
<item jid="boichat@conference.weather.im" name="boichat" />
|
||||
<item jid="crisfield-chat@conference.weather.im" name="crisfield-chat" />
|
||||
<item jid="slcchat@conference.weather.im" name="slcchat" />
|
||||
<item jid="zobchat@conference.weather.im" name="zobchat" />
|
||||
<item jid="amachat@conference.weather.im" name="Amarillo, TX" />
|
||||
<item jid="pqrchat@conference.weather.im" name="pqrchat" />
|
||||
<item jid="gstweather@conference.weather.im" name="GST Weather" />
|
||||
<item jid="tws_chat@conference.weather.im" name="tws_chat" />
|
||||
<item jid="franklin_chat@conference.weather.im" name="Franklin VT Chatroom" />
|
||||
<item jid="zidchat@conference.weather.im" name="zidchat" />
|
||||
<item jid="cnrfcchat@conference.weather.im" name="cnrfcchat" />
|
||||
<item jid="nhcchat@conference.weather.im" name="nhcchat" />
|
||||
<item jid="mke-skywarn@conference.weather.im" name="MKE Skywarn" />
|
||||
<item jid="tnwxdiscuss@conference.weather.im" name="TN Statewide Weather Discussion" />
|
||||
<item jid="stochat@conference.weather.im" name="stochat" />
|
||||
<item jid="jklchat@conference.weather.im" name="jklchat" />
|
||||
<item jid="grrchat@conference.weather.im" name="grrchat" />
|
||||
<item jid="hnxchat@conference.weather.im" name="hnxchat" />
|
||||
<item jid="spcchat@conference.weather.im" name="Storm Prediction Center Chatroom" />
|
||||
<item jid="lchchat@conference.weather.im" name="lchchat" />
|
||||
<item jid="khws@conference.weather.im" name="Huffman Weather Service" />
|
||||
<item jid="kcichat@conference.weather.im" name="kcichat" />
|
||||
<item jid="zbwchat@conference.weather.im" name="zbwchat" />
|
||||
<item jid="otxchat@conference.weather.im" name="otxchat" />
|
||||
<item jid="kodster@conference.weather.im" name="kodster" />
|
||||
<item jid="vefchat@conference.weather.im" name="vefchat" />
|
||||
<item jid="pubchat@conference.weather.im" name="pubchat" />
|
||||
<item jid="wxst@conference.weather.im" name="Nationwide Encoder Relay Program" />
|
||||
<item jid="psrchat@conference.weather.im" name="psrchat" />
|
||||
<item jid="sgxchat@conference.weather.im" name="sgxchat" />
|
||||
<item jid="pbzchat@conference.weather.im" name="pbzchat" />
|
||||
<item jid="reddit_weatherlab@conference.weather.im" name="reddit_weatherlab" />
|
||||
<item jid="nalsw@conference.weather.im" name="nalsw" />
|
||||
<item jid="ekachat@conference.weather.im" name="ekachat" />
|
||||
<item jid="ilxchat@conference.weather.im" name="ilxchat" />
|
||||
<item jid="jsjchat@conference.weather.im" name="jsjchat" />
|
||||
<item jid="barnburnerwi@conference.weather.im" name="Barn Burner WI" />
|
||||
<item jid="ohiostormspottersteamoss@conference.weather.im" name="Ohio storm Spotters Team oss" />
|
||||
<item jid="mlbchat@conference.weather.im" name="mlbchat" />
|
||||
<item jid="arxchat@conference.weather.im" name="arxchat" />
|
||||
<item jid="ilmchat@conference.weather.im" name="ilmchat" />
|
||||
<item jid="okxchat@conference.weather.im" name="okxchat" />
|
||||
<item jid="botstalk@conference.weather.im" name="botstalk" />
|
||||
<item jid="lknchat@conference.weather.im" name="lknchat" />
|
||||
<item jid="siawx_chat@conference.weather.im" name="siawx_chat" />
|
||||
<item jid="rahchat@conference.weather.im" name="rahchat" />
|
||||
<item jid="afcchat@conference.weather.im" name="afcchat" />
|
||||
<item jid="lotchat@conference.weather.im" name="lotchat" />
|
||||
<item jid="n90@conference.weather.im" name="n90" />
|
||||
<item jid="boxchat@conference.weather.im" name="boxchat" />
|
||||
<item jid="znychat@conference.weather.im" name="znychat" />
|
||||
<item jid="akqchat@conference.weather.im" name="akqchat" />
|
||||
<item jid="nerfcchat@conference.weather.im" name="nerfcchat" />
|
||||
<item jid="zkcchat@conference.weather.im" name="zkcchat" />
|
||||
<item jid="bischat@conference.weather.im" name="bischat" />
|
||||
<item jid="twcchat@conference.weather.im" name="twcchat" />
|
||||
<item jid="lmrfcchat@conference.weather.im" name="lmrfcchat" />
|
||||
<item jid="abrchat@conference.weather.im" name="abrchat" />
|
||||
<item jid="mbrfcchat@conference.weather.im" name="mbrfcchat" />
|
||||
<item jid="pihchat@conference.weather.im" name="pihchat" />
|
||||
<item jid="zoachat@conference.weather.im" name="zoachat" />
|
||||
<item jid="mtrchat@conference.weather.im" name="mtrchat" />
|
||||
<item jid="sjuchat@conference.weather.im" name="sjuchat" />
|
||||
<item jid="gidchat@conference.weather.im" name="gidchat" />
|
||||
<item jid="zmpchat@conference.weather.im" name="zmpchat" />
|
||||
<item jid="phichat@conference.weather.im" name="phichat" />
|
||||
<item jid="pitchat@conference.weather.im" name="WWS Pittsburgh" />
|
||||
<item jid="chschat@conference.weather.im" name="chschat" />
|
||||
<item jid="ajkchat@conference.weather.im" name="ajkchat" />
|
||||
<item jid="chachat@conference.weather.im" name="WWS Charlotte" />
|
||||
<item jid="bmxchat@conference.weather.im" name="bmxchat" />
|
||||
<item jid="lixchat@conference.weather.im" name="lixchat" />
|
||||
<item jid="apxchat@conference.weather.im" name="apxchat" />
|
||||
<item jid="hunchat@conference.weather.im" name="hunchat" />
|
||||
<item jid="spcmobile2006@conference.weather.im" name="spcmobile2006" />
|
||||
<item jid="zmachat@conference.weather.im" name="zmachat" />
|
||||
<item jid="phl@conference.weather.im" name="PHL TRACON" />
|
||||
<item jid="dtxchat@conference.weather.im" name="dtxchat" />
|
||||
<item jid="wbkoweatherwatchers@conference.weather.im" name="wbkoweatherwatchers" />
|
||||
<item jid="gumchat@conference.weather.im" name="gumchat" />
|
||||
<item jid="gcwxchat@conference.weather.im" name="gcwxchat" />
|
||||
<item jid="zzmkxchat@conference.weather.im" name="zzmkxchat" />
|
||||
<item jid="dentcoeas@conference.weather.im" name="dentcoeas" />
|
||||
<item jid="marfcchat@conference.weather.im" name="marfcchat" />
|
||||
<item jid="easwtalk@conference.weather.im" name="easwtalk" />
|
||||
<item jid="crpchat@conference.weather.im" name="crpchat" />
|
||||
<item jid="gccc-nc-skywarn@conference.weather.im" name="GCCC NC Skywarn" />
|
||||
<item jid="zjxchat@conference.weather.im" name="zjxchat" />
|
||||
<item jid="shvchat@conference.weather.im" name="shvchat" />
|
||||
<item jid="tbwchat@conference.weather.im" name="tbwchat" />
|
||||
<item jid="cyschat@conference.weather.im" name="cyschat" />
|
||||
<item jid="hfochat@conference.weather.im" name="hfochat" />
|
||||
<item jid="dmxchat@conference.weather.im" name="Des Moines, IA" />
|
||||
<item jid="mseas-weather-discussion@conference.weather.im" name="MSEAS-Weather-Discussion" />
|
||||
<item jid="zsechat@conference.weather.im" name="zsechat" />
|
||||
<item jid="revchat@conference.weather.im" name="revchat" />
|
||||
<item jid="carchat@conference.weather.im" name="carchat" />
|
||||
<item jid="msochat@conference.weather.im" name="msochat" />
|
||||
<item jid="abc3340@conference.weather.im" name="abc3340" />
|
||||
<item jid="keychat@conference.weather.im" name="keychat" />
|
||||
<item jid="riwchat@conference.weather.im" name="riwchat" />
|
||||
<item jid="awpwxchat@conference.weather.im" name="awpwxchat" />
|
||||
<item jid="mhxchat@conference.weather.im" name="mhxchat" />
|
||||
<item jid="caechat@conference.weather.im" name="caechat" />
|
||||
<item jid="indchat@conference.weather.im" name="indchat" />
|
||||
<item jid="dlhchat@conference.weather.im" name="dlhchat" />
|
||||
<item jid="unrchat@conference.weather.im" name="unrchat" />
|
||||
<item jid="wilchat@conference.weather.im" name="WWS Columbus/Wilmington" />
|
||||
<item jid="okc_chatrooms@conference.weather.im" name="okc_chatrooms" />
|
||||
<item jid="kdtxchat@conference.weather.im" name="kdtxchat" />
|
||||
<item jid="zabchat@conference.weather.im" name="zabchat" />
|
||||
<item jid="wnpchat@conference.weather.im" name="wnpchat" />
|
||||
<item jid="zlcchat@conference.weather.im" name="zlcchat" />
|
||||
<item jid="ffcchat@conference.weather.im" name="ffcchat" />
|
||||
<item jid="epzchat@conference.weather.im" name="epzchat" />
|
||||
<item jid="taechat@conference.weather.im" name="taechat" />
|
||||
<item jid="fox6chat@conference.weather.im" name="fox6chat" />
|
||||
<item jid="cbrfcchat@conference.weather.im" name="cbrfcchat" />
|
||||
<item jid="wisconsin_storm_spotters@conference.weather.im" name="Wisconsin Storm Spotters" />
|
||||
<item jid="tfxchat@conference.weather.im" name="tfxchat" />
|
||||
<item jid="abqchat@conference.weather.im" name="abqchat" />
|
||||
<item jid="nwrfcchat@conference.weather.im" name="nwrfcchat" />
|
||||
<item jid="rlxchat@conference.weather.im" name="rlxchat" />
|
||||
<item jid="ounchat@conference.weather.im" name="ounchat" />
|
||||
<item jid="clechat@conference.weather.im" name="clechat" />
|
||||
<item jid="loxchat@conference.weather.im" name="loxchat" />
|
||||
<item jid="fsdchat@conference.weather.im" name="fsdchat" />
|
||||
<item jid="bgmchat@conference.weather.im" name="bgmchat" />
|
||||
<item jid="wgrfcchat@conference.weather.im" name="wgrfcchat" />
|
||||
<item jid="ewxchat@conference.weather.im" name="ewxchat" />
|
||||
<item jid="uswat@conference.weather.im" name="Uswat United States weather team" />
|
||||
<item jid="iowawx@conference.weather.im" name="iowawx" />
|
||||
<item jid="ohrfcchat@conference.weather.im" name="ohrfcchat" />
|
||||
<item jid="serfcchat@conference.weather.im" name="serfcchat" />
|
||||
<item jid="stichat@conference.weather.im" name="stichat" />
|
||||
<item jid="zdvchat@conference.weather.im" name="zdvchat" />
|
||||
<item jid="eaxchat@conference.weather.im" name="eaxchat" />
|
||||
<item jid="iwxchat@conference.weather.im" name="iwxchat" />
|
||||
<item jid="lubchat@conference.weather.im" name="lubchat" />
|
||||
<item jid="whntweather@conference.weather.im" name="whntweather" />
|
||||
<item jid="bufchat@conference.weather.im" name="bufchat" />
|
||||
<item jid="pdtchat@conference.weather.im" name="pdtchat" />
|
||||
<item jid="knsw@conference.weather.im" name="knsw" />
|
||||
<item jid="mkxchat@conference.weather.im" name="mkxchat" />
|
||||
<item jid="test@conference.weather.im" name="test" />
|
||||
<item jid="abc3340skywatcher@conference.weather.im" name="abc3340skywatcher" />
|
||||
<item jid="grbchat@conference.weather.im" name="grbchat" />
|
||||
<item jid="topchat@conference.weather.im" name="topchat" />
|
||||
<item jid="rnkchat@conference.weather.im" name="rnkchat" />
|
||||
<item jid="lzkchat@conference.weather.im" name="lzkchat" />
|
||||
<item jid="ctpchat@conference.weather.im" name="ctpchat" />
|
||||
<item jid="gldchat@conference.weather.im" name="gldchat" />
|
||||
<item jid="abrfcchat@conference.weather.im" name="abrfcchat" />
|
||||
<item jid="byzchat@conference.weather.im" name="byzchat" />
|
||||
<item jid="mpxchat@conference.weather.im" name="mpxchat" />
|
||||
<item jid="zdcchat@conference.weather.im" name="zdcchat" />
|
||||
<item jid="lsxchat@conference.weather.im" name="lsxchat" />
|
||||
<item jid="pahchat@conference.weather.im" name="pahchat" />
|
||||
<item jid="bouchat@conference.weather.im" name="Boulder, CO" />
|
||||
<item jid="tsachat@conference.weather.im" name="tsachat" />
|
||||
<item jid="bmxspotterchat@conference.weather.im" name="bmxspotterchat" />
|
||||
<item jid="zfwchat@conference.weather.im" name="zfwchat" />
|
||||
<item jid="zauchat@conference.weather.im" name="zauchat" />
|
||||
<item jid="aprfcchat@conference.weather.im" name="aprfcchat" />
|
||||
<item jid="wwsreport@conference.weather.im" name="WWS Report" />
|
||||
<item jid="bmxalertchat@conference.weather.im" name="bmxalertchat" />
|
||||
<item jid="mqtchat@conference.weather.im" name="mqtchat" />
|
||||
<item jid="mafchat@conference.weather.im" name="mafchat" />
|
||||
<item jid="mrxchat@conference.weather.im" name="mrxchat" />
|
||||
<item jid="fgzchat@conference.weather.im" name="fgzchat" />
|
||||
<item jid="twitter@conference.weather.im" name="twitter" />
|
||||
<item jid="oaxchat@conference.weather.im" name="oaxchat" />
|
||||
<item jid="btvchat@conference.weather.im" name="btvchat" />
|
||||
<item jid="potomac_tracon@conference.weather.im" name="Potomac TRACON" />
|
||||
<item jid="ictchat@conference.weather.im" name="ictchat" />
|
||||
<item jid="mfrchat@conference.weather.im" name="mfrchat" />
|
||||
<item jid="detroiteaschat@conference.weather.im" name="detroiteaschat" />
|
||||
<item jid="hgxchat@conference.weather.im" name="hgxchat" />
|
||||
<item jid="afgchat@conference.weather.im" name="afgchat" />
|
||||
<item jid="sgfchat@conference.weather.im" name="sgfchat" />
|
||||
<item jid="hawaii@conference.weather.im" name="Hawaii Weather" />
|
||||
<item jid="cwest@conference.weather.im" name="CWEST" />
|
||||
<item jid="zlachat@conference.weather.im" name="zlachat" />
|
||||
<item jid="alychat@conference.weather.im" name="alychat" />
|
||||
<item jid="sjtchat@conference.weather.im" name="sjtchat" />
|
||||
<item jid="janchat@conference.weather.im" name="janchat" />
|
||||
<item jid="gspchat@conference.weather.im" name="gspchat" />
|
||||
<item jid="lwxchat@conference.weather.im" name="lwxchat" />
|
||||
<item jid="gyxchat@conference.weather.im" name="gyxchat" />
|
||||
<item jid="wpcchat@conference.weather.im" name="WPC Chatroom" />
|
||||
<item jid="sweaseops1@conference.weather.im" name="sweaseops1" />
|
||||
<item jid="scwx@conference.weather.im" name="South Carolina Weather" />
|
||||
<item jid="lbfchat@conference.weather.im" name="lbfchat" />
|
||||
<item jid="jaxchat@conference.weather.im" name="jaxchat" />
|
||||
<item jid="nwsc@conference.weather.im" name="Nate's Weather Safety Center" />
|
||||
<item jid="fgfchat@conference.weather.im" name="fgfchat" />
|
||||
</root>
|
||||
`;
|
||||
|
||||
const json = xml2json.toJson(xml, { object: true });
|
||||
|
||||
console.log(JSON.stringify(json, null, 2));
|