DiSwarm Handler
Basic DiSwarm bot handling class, and standardized communication protocol
Usage
Main class: Handler(channel, token, swarm_id, bot_id, lead_timeout=5, role=None)
Channel: Discord server channel to run swarm in
Token: Discord bot token
Swarm_id: Unique id of entire swarm
Bot_id: Unique id of bot
Lead_timeout: Seconds before bot declares itself swarm leader
Role: Role in swarm. Changing this from None overrides leader/drone selection.
Subclass this, and redefine the function process_one(self, response) to perform different tasks based on input. This is much like the socketserver.BaseRequestHandler.handle() method.
Other functions:
request(req, args=()) Requests data from swarm.
Req: Request text
Args: tuple of arguments to pass to swarm
process(): Processes swarm queue and returns list of process_one() outputs
Notes
- Swarm ID: the same for all bots in your swarm, but it should be unique from any other swarm, at least on your swarm channel. To be safe, use a randomly generated string or number. Make sure every bot in your swarm has the same id, because bots with different ids cannot see eachother's messages.
Requires
pip install DiSwarm(Will install all dependencies
As an alternative, run pip install diswarm-handler to download this and all dependencies.
Metadata
Release files for diswarm-handler 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| diswarm-handler-1.1.tar.gz | 2.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| diswarm_handler-1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.5 kB
Release files / diswarm-handler-1.1.tar.gz
| Download URL | diswarm-handler-1.1.tar.gz |
|---|---|
| Size | 2.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
577f71d4aa4a46ef0ad90d6977d013bfcb1ccbf43713f9a26378bbcd398bd34f
|
|
BLAKE2b-256 checksum How to use checksums |
94411284e10391b32b012103b005cf803cdee699f15a5c2c450bc2b66e6b7477
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.4
|
Release files / diswarm_handler-1.1-py3-none-any.whl
| Download URL | diswarm_handler-1.1-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4a3d43879c9ec8ef7afcde503ddba3c82af3d152d2972d4d1b208fa40ccf10ba
|
|
BLAKE2b-256 checksum How to use checksums |
e133afe2752482cc133c2c7d2c48c7bfa23126af319755cce45e898171284240
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.4
|
Security for diswarm-handler 1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.