A Discord bot that provides STKAddons services and other STK-related needs.
Find a file
2025-09-02 03:22:54 +02:00
cogs query database directly instead of checking on cache for opted out status 2025-07-23 21:50:28 +08:00
lang Translated using Weblate (Spanish) 2025-09-02 01:22:41 +00:00
utils format code with black 2024-11-22 15:07:17 +05:00
.gitignore Gotify Push support 2024-08-06 16:20:17 +05:00
bot.py change loglevels, remove unnecessary logging 2025-05-12 13:31:59 +00:00
l10n.py format code with black 2024-11-22 15:07:17 +05:00
languages.json Add french language to list 2025-04-17 03:01:13 +00:00
launch.py initialize previously not auto-initialized tables 2025-07-23 21:49:59 +08:00
LICENSE Initial commit 2023-12-31 11:27:32 +06:00
profile.png forgot to add profile 2025-01-30 08:49:49 +08:00
README.md add rewrite notice 2025-08-03 09:39:51 +08:00
requirements.txt statistical commands 2025-03-21 13:40:16 +05:00

linaSTK is being rewritten!

linaSTK will now be rewritten from the ground up, with more cleaner code as well as an excuse to use the supertuxkart.py library. It will be codenamed "Daiwa Scarlet" (a Japanese horse, also found in Umamusume: Pretty Derby).

linaSTK

Translation status

linaSTK is a Discord bot that provides SuperTuxKart Online Services ("STKAddons") and other goodies to your Discord server. This bot is meant to be self-hosted for now.

This bot is currently used for the SuperTuxKart Discord, but you can self host it yourself.

Features

General

  • Player tracking
  • STK Seen
  • Top 10 ranked players
  • Player searching
  • Friends list
  • Server list
  • PokeMap
  • Addon querying
  • Ranking info of a player

Internal

  • Authentication
  • Polling
  • Session revalidation
  • Player caching (saves username and ID for future use)

How to set up

This assumes you have knowledge on how to create a Discord bot and set up the proper intents and invite it, as well as how to use the Linux command line, and how to create a PostgreSQL database.

Only Linux is supported. Other platforms will not be supported.

But feel free to contact me for help setting up the bot.

  1. Initial set up
git clone https://codeberg.org/linaSTK/bot linastk-bot
cd linastk-bot
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
  1. Create a file named constants.py in the root of the folder. Then fill in the information.
# Accent color (used for embeds)
# You must use the hexadecimal representation of the color, or it won't work!
# Example: if your color is #fbce3a then put 0xfbce3a
ACCENT_COLOR = 0xfbce3a

# SuperTuxKart credentials
# This is required to make most features work.

# It is not recommended to use your main account for this.
# You can create an account here: https://online.supertuxkart.net/register.php

STK_USERNAME = ""
STK_PASSWORD = ""

# This is where you put your bot's Discord token. In any circumstances, DO NOT share this
# to anyone, not even your best friend that you trust! If you accidentally share it,
# IMMEDIATELY reset it.
TOKEN = ""

# Prefix for the bot.
# While lina mostly uses slash commands, some are hybrid and some only use
# the old prefix-based command system.
PREFIX = '&'

# PostgreSQL connection
POSTGRESQL = "postgresql://user:pass@localhost/db" 

# Max amount of players a user can track.
# If the user goes above this value, they will not be able to add additional
# players to track unless a user removes one to free up space.
MAX_PTRACK = 15

# Account used to handle linking SuperTuxKart accounts to their Discord

VERIFIER_USERNAME = ""
VERIFIER_PASSWORD = ""
  1. Run the bot
python launch.py

Translate linaSTK

Help making linaSTK accessible to the world! Contribute to translations on Codeberg Translate.

Special Thanks

  • Dernis (NobWow) - helping me with SQL, code, and giving linaSTK a comfy home (a server).
  • alias dapdap
  • kimden
  • The SuperTuxKart STKAddons authors
  • The folks at the SuperTuxKart Discord server

License

Bot

This bot is licensed under the GNU Affero General Public License, version 3.

Certain portions of the source code are from Rapptz's RoboDanny bot, licensed under the Mozilla Public License, version 2.

lina

The Lina character

Lina is a cute character I came up with during development. All artwork related to her is licensed under the Creative Commons Attribution Share Alike 4.0 International license. You may use her and/or improve it as long as you comply with the license.

With the following exception:

  • You may not use her artwork for ANY Large Language Model or Artificial Intelligence training. This act violates the license and is prohibited.

Learn more about her on https://codeberg.org/linaSTK/lore (work in progress)


Made with ❤️ by searingmoonlight