Games bot for Sharkey (and *key software) hosted on @games@woem.men
Project description
shark-games
Games bot for Sharkey (and *key software) hosted on @games@woem.men
Usage
@ping help
note that the ping can be placed anywhere indipendently from the text.
Hosting
this maybe gets replaced with proper docs
Prerequisite
Python 3.12
PLEASE NOTE only python 3.12 is supported currently. It might work also with other versions, but that isn't on the priority list now. As soon as it is finished, I will update the requirements to support also other versions.
-
Navigate where you want the config save directory to be created
-
Create a virtual environment
$ python3 -m venv venv
- Activate the environment
$ source venv/bin/activate
- Install
$ pip install -U wheel
$ pip install -U shark_games
- Setup
$ sharkgames setup
Follow the setup guide provided
- Run
$ sharkgames run
Update
Make sure the bot isn't running!
IMPORTANT Always check changelog whenever updating. There might be instanced where the automatic update of config doesn't work, for example if you need to enter a value. In that case you need to manually change the config or set up the bot again.
-
Navigate to the directory where you set it up
-
Activate the environment
$ source venv/bin/activate
- Update
$ pip install -U wheel
$ pip install -U shark_games
- Run the bot
sharkgames run
You should see a Updating… dialog if there is a config update being done.
Development
This guide assumes you have already a virtual enviroment set up and activated
-
Build
python3 -m build -
Load the package
pip install --force-reinstall dist/shark_games-v.v.v-py3-none-any.whlreplace v.v.v with the actual version number. The version number can be found in ./shark_games/init.py -
Test pypi this isn't mandatory for contributors, you can safely ignore this PLEASE NOTE: make sure only one version is inside the dist directroy
python3 -m twine upload --repository testpypi dist/* -
Run the tests
test test testnot available yet
Naming etc.
Simply because python doesn't work with -, the package is named shark_games. Commands use sharkgames (for setup etc.) While the rest shark-games should be used.
Post install config options
The config is saved in ./shark-games/config.json.
config options
"interval"(int): how often it checks for new notes. Setting it higher makes each request take longer, but when setting it to low it reduces the amount of requests it can process (the rate limit allows one API call per second). Default: 10, Minimum: 2"warnInvalidCommand"(bool): if it should warn the user when an invalid command is issued. I highly recommend against the usage, as in case of a thread (where responses would automatically ping the bot) it would mean a lot of useless and annoying warnings. Default: false -"RateLimitHandling"(dict):"max_retries"(int): How many times it should retry after a rate limit got hit. Default: 5"base_delay"(float): In case the rate limit does not answer a time when retry, it will try to wait in a exponential way. This is the minimum delay from where it starts. Default: 1.0"max_delay"(float): This is the maximum delay in case of a non specified wait time, as described above. Default: 45.0"base_request_delay"(float): How long it should wait between each request. This is used because based on my testing, it allows only one request every second, and if you hit the rate limit too often it will block you (temporarily via a503). After a first rate limit hit, this will automatically increase, though this increase will not be reflected in the config afterwards. Default: 1.0
LICENSE
Copyright (C) 2024 sophie (itsme@itssophi.ee)
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/.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters