Skip to main content

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.

  1. Navigate where you want the config save directory to be created

  2. Create a virtual environment

$ python3 -m venv venv
  1. Activate the environment
$ source venv/bin/activate
  1. Install THIS DOES NOT WORK CURRENTLY PLEASE REFER TO DEVELOPMENT SECTION
$ pip install -U wheel
$ pip install -U shark_games 
  1. Setup
$ sharkgames setup

Follow the setup guide provided

  1. 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.

  1. Navigate to the directory where you set it up

  2. Activate the environment

$ source venv/bin/activate
  1. Update THIS DOES NOT WORK CURRENTLY PLEASE REFER TO DEVELOPMENT SECTION
$ pip install -U wheel
$ pip install -U shark_games 
  1. 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

  1. Build python3 -m build

  2. Load the package pip install --force-reinstall dist/shark_games-v.v.v-py3-none-any.whl replace v.v.v with the actual version number. The version number can be found in ./shark_games/init.py

  3. 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/*

  4. Run the tests test test test not 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 a 503). 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

shark_games-0.2.1.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shark_games-0.2.1-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file shark_games-0.2.1.tar.gz.

File metadata

  • Download URL: shark_games-0.2.1.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for shark_games-0.2.1.tar.gz
Algorithm Hash digest
SHA256 04290614dc1fc475e0b6523ac7cb5ef5c8d13c56e94940c416ad4c4d31ac9eff
MD5 968274102439ffd73f740cdf7a8ceb1f
BLAKE2b-256 7b55ab3292242b32b8505f8301664e7efc5a2397cd1b49d2bf485d03a38d8225

See more details on using hashes here.

File details

Details for the file shark_games-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: shark_games-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for shark_games-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b6dc328923943e41022eb632e7df868de33d82444aba092cca689006ca49e715
MD5 6a8fc730b153d30c8920c6dd7e05ccfa
BLAKE2b-256 68cc403ce763f839c7e7a637a46b17a884213d3ece137af009a058d86666bae6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page