SkillAgentSearch skills...

Killua

Source code for the discord bot Killua

Install / Use

/learn @Kile/Killua
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Killua Discord Bot

<p align="center"> <a href="https://discord.com/oauth2/authorize?client_id=756206646396452975&scope=bot&permissions=268723414"> <img src="https://i.imgur.com/diOmUcl.png"> </a> </p> <p align="center"> <a href="https://top.gg/bot/756206646396452975"> <img src="https://top.gg/api/widget/756206646396452975.svg" alt="Killua" /> </a> </p> <h4 align="center">Games, Moderation, todo lists and much more.</h4> <p align="center"> <a href="https://discord.gg/zXqDHkm/"> <img alt="Discord Server" src="https://img.shields.io/discord/691713541262147687.svg?label=Discord&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2&style=flat"> </a> <a> <img scr="https://img.shields.io/github/commit-activity/w/Kile/Killua"> </a> <a href="https://github.com/Rapptz/discord.py/"> <img src="https://img.shields.io/badge/discord-py-blue.svg" alt="discord.py"> </a> <a href="https://killua.dev/"> <img src="https://img.shields.io/website?down_color=lightgrey&down_message=offline&up_color=green&up_message=online&url=https%3A%2F%2Fkillua.dev"> </a> <a> <img scr="https://img.shields.io/github/license/Kile/Killua"> </a> <a> <img src="https://img.shields.io/github/contributors/Kile/Killua"> </a> <a href="https://www.patreon.com/KileAlkuri"> <img src="https://img.shields.io/badge/Support-Killua!-blue.svg" alt="Support Killua on Patreon!"> </a> </p>

Table of Contents

  1. What is Killua?
  2. Links
  3. Algorithms
  4. Flowchart
  5. Programming concepts list
  6. Contributors
  7. Running Killua locally
  8. Contributing
  9. Grafana
  10. Thanks for checking this repo out!

What is Killua?

I started Killua as a way to learn python and different programming concepts. It definitely was not the easiest way to do it, but it got me to a good level of python knowledge plus having a cool bot! As a result, I greatly appreciate issues, PRs and contributions enhancing my code.

Links

Algorithms

Killua contains a number of interesting algorithms which I have explained more and gone into detail in the algorithms folder.

Flowchart

setup-current

Programming concepts list

As explained previously, I use Killua as a tool to learn more about python and programming. Here is a list of programming concepts Killua uses and which ones it is planned to use at some point in the future.

  • [x] OOP (Object Oriented Programming)
  • [x] Web scraping
  • [x] IPC (Inter Process Communication)
  • [x] Providing and requesting REST-APIs
  • [x] Image manipulation
  • [x] Asynchronous Programming
  • [x] logging
  • [x] NonSQL databases
  • [x] Python typing library
  • [x] GitHub PRs, branches, issues, todo-lists, CLI
  • [x] caching
  • [x] Website with backend
  • [x] CSS
  • [x] Threading
  • [x] Github workflows
  • [x] Docker
  • [x] Rust
  • [x] Prometheus
  • [x] Grafana
  • [ ] Dynamically deploying docker containers/Kubernetes
  • [ ] Custom sharding the bot (related to the above)

Contributors

I would like to give a big thank you to everyone who has helped me on this journey, each in their different way.

Helped me a lot with the Rust API rewrite, spotting an issue that took me8 months to track down as well as helping my code to be much cleaner.

Who has been with the project since the start, creating the website and supporting it through Patreon.

An incredibly talented artist who made many artworks which make Killua look and feel so much better for little to no price.

Contributed initial parts of the web scraping code.

Helped to change the incredibly bad mess of everything in one file into an organised, dynamic system and helped out with git commands.

He contributed a lot to one of the best looking commands, book which uses image generation to make your collection book filled with cards. More recently he also helped a lot with making voting confirmations look much better!

Helped write some of the action texts, topics, 8ball responses and would you rather questions.

Wrote a great library to use Prometheus/Grafana with discord.py which became the template for the current implementation. He also assisted me with questions during this process.

Found a lot of hug images and also tracked down most artists of previously used ones to give them credit making Killua a much more considerate bot.

Gave me the original idea for this bot and helped me in the early stages, enduring lots of pings and stupid questions.

Running Killua locally

Regardless of how you decide to run Killua, you need to edit the .env file. This file contains all secrets needed for the bot to run. A few can be left the same as the template for debugging purpose, such as MODE which defined if the bot should run in development or production mode. The GF_ variables are the admin login for Grafana which can remain default unless you deploy the bot in production somewhere (which is stealing so please like - don't)

This file has a template in the same directory with the same name but with .template at the end. You can copy it and edit it to your liking.

Assets

Killua uses a lot of images. These are stored in the assets folder. Some assets are gitignored and will not be in this folder. These are mainly all cards images except the PLACEHOLDERs and all hugs except 0.gif. This is to avoid revealing secrets about the game and to avoid yoinking people's art for the hug images. The bot should still run out of the box without these. For local development, you should not need these images. However if you do want to use them, you need to edit cards.json or hugs.json respectively to point to the correct image you upload. The bot is not designed to handle a card url that does not have an asset associated with it, so if you want to use the private cards, you need to supply all images. More about this in the next section. Similarly if you change the only hug image that is not gitignored but not its data in hugs.json, it will not work.

If you want to use/edit the "Greed Island" game locally

The default behavior for where the bot gets all the card data from is a censored list from the remote API api.killua.dev/cards.json?public=true. (The public list if it is run in dev mode, the non-censored list requires authorization). This is intended to work out of the box when you first run Killua locally. If you would like to edit the list of cards though, you can instead force Killua to instead request that endpoint from your local instance of the API. To do this, run Killua with the --force-local or -fl flag. This will instead request localhost or the Docker container the API runs in.

To use the local cards endpoint, you need to download the cards.json file. You can do this by running python3 -m killua --download <public/private> where <public/private> is the type of cards you want to download (private will require the API_KEY env variable set as it is the uncensored version). This will download the cards from the remote API and save them in the right directory (cards.json). You can edit these freely, however spell cards and their effects are in the code and not that file, so using a spell card ID will still behave as a spell card.

If you are running the bot using Docker (and build it locally with the --build flag), the default behavior is to use the remote API if in dev mode, and the local API in production mode. This is so development is plug and play and production runs faster by directly requesting another container rather than the internet. To change this, go into the Dockerfile in the killua directory and edit the arguments passed to the bot in the last line (CMD). You can add the --force-local flag to force the bot to use the local which will then request the API container instead.

[!NOTE] Even when using --force-local, your local cards will still be censored if in dev mode. To prevent this, omit the --development or -d flag when running the bot. The censored version is still designed in a way that will let you test most of the functionality (eg name autocomplete, images in the book command etc) so most of the time this will not really be necessary. You may need to replace the emoji though as some code needs it to be a custom emoji.

Syncing Gitignored Images to Production

This repository supports optional syncing of gitignored images in the "hugs" and "cards" folders to a production server as well as the gitignored cards.json. This feature ensures the latest assets are always available in production when changes are pushed t

View on GitHub
GitHub Stars79
CategoryDevelopment
Updated24d ago
Forks9

Languages

Python

Security Score

100/100

Audited on Mar 7, 2026

No findings