Development Guide for IndiSpark's Monorepo @ Development Guide:
Welcome to IndiSpark's Development Guide!
Our two main projects are Brave Bot and our website. We use uv to manage the Python Versions installed, the packages used and more. Please ensure you have uv installed.
Git Clone Links:
Clone with SSH: Click Here
git@gitlab.com:indispark/indispark.gitlab.io.git
Clone with HTTPS: Click Here
https://gitlab.com/indispark/indispark.gitlab.io.git
Brave Bot Development Guide:
Please follow the guidelines below when modifying anything Brave Bot. Our monorepo's used Python version is outlined in .python-version.
- When creating a new command please ensure you update
data.py.- If you are renaming a command please update it's name in it's respective unit's commands list.
- Add comments explaining any confusing/complex logic.
- When creating a slash command it must start like:
@discord.slash_command()(Please ensure you fill out thenameanddescriptionarguments)ApplicationContextis always alised asctx.
- Any error messages should be like the one displayed below: (
{no}is the cross emoji. Which must be imported fromassets.data)
- All Errors must also be captured via Brave Bot's Sentry Integration. To do this import the function named:
sentry_capture_error()fromutils.integrations. Only the Error argument is required.- The User ID. Not required if no User ID can be given.
- The Error.(Giving the execption is preferred, else write the error/limitation the user has ran into. Common Errors have Error Messages that you must use)
- No Topia Profile Error:
No Topia Profile Found - Override Disabled (System Disabled):
{Name of Override} Disabled- Example:
Topia Override Disabled
- Example:
- Trying to take action aganist Bots/Apps:
Can not {Action} Bots/Apps- Example:
Can not Ban Bots/Apps
- Example:
- Trying to take action aganist a user higher or equal to you:
Can not {Action} Users higher than you or equal to you- Example:
Can not Ban Users higher than you or equal to you
- Example:
- Trying to take action aganist yourself:
Can not {Action} Yourself- Example:
Can not Ban Yourself
- Example:
- Insufficient Coin Balance:
Insufficient Coins in User's Balance - Not in required type of Channel.
User not in a {Type of Channel}- Example:
User not in a VC
- Example:
- No Topia Profile Error:
- Use Emojis where deemed nesccary.
- When something finishes / completes you send a ephemeral message like the error one but instead of the
{no}use{yes}. - Unit Emojis can be used where you deem needed.
- When something finishes / completes you send a ephemeral message like the error one but instead of the
- Please use the functions made in the
utilsdirectory. This is so the codebase is simplified and and easier to read. (Nearly all overrides have a "check" function somewhere in the utils directory. You must use it)- Common API Functions. Including:
- Sentry.io Integration Functions.
- GitLab Integration Functions.
- Common Maths Functions.
- Common Embed Functions.
- GlobaLog Embed Generator
- Brave Bot Pro Acqusition Embed Generator
- Common Database Functions.
- Common Pro Functions.
- For Pro User Check use the function called
pro_user_check(). - To check if the Pro System is enabled use the function called
pro_override_check()- To check weather a specific part of the Pro System is enabled use the correct function.
- For User use:
pro_user_type_override_check() - For Server use:
pro_server_type_override_check()
- For User use:
- To check weather a specific part of the Pro System is enabled use the correct function.
- For Pro User Check use the function called
- Common Topia Functions.
- Please use the topia override function named
topia_override_check() - Please also use the Profile suspension check function named:
profile_suspension_check()
- Please use the topia override function named
- YAML Config Functions.
- Override(s) Functions.
- Common API Functions. Including:
Website Development Guide:
- Images should be stored in the Images folder named
assets. Only.png/.svgimages are allowed. - When updating the layout of the website (adding, removing or renaming a page) please ensure you update the
mkdocs.yml- Look at exisiting configuration if stuck.
- We currently are not working on different languages of the website. If you wish to start please create an issue.
- Guide Specific titles:
- For Brave Bot do:
# {title} @ Brave Bot:on the first line. - For the Linux Guide do:
# {title} @ Linux Guide:on the first line. - For the Coding Guide do
# {title} @ Coding Guide:on the first line. - For the Development & Contributor Guide do
# {title} @ Development Guide:on the first line.
- For Brave Bot do:
- When doing command scripts please ensure you put it in code-bloc and use shell/bash.
- If possible please code examples to the Community Examples folder located in the community folder.
- When writing a new blog post please ensure you have the following at the top:
- Title
- Date
- Authors
- Slug
- Description
- Pin
- Categories
---
title: Blog Post
date: 2024-11-01 # Publication Date
authors: [J3ZZA]
slug: blog
description: Test / Example
pin: false
categories:
- General
- Miscellaneous
---
Blog Assets Guide:
When creating a "Service Update", "Product Update" or a "Roadmap" post, please use the base asset provided in the assets folder.
- For a Product Update post use the image named:
pu-asset.png - For a Service Update post use the image named:
su-asset.png - For a Roadmap post use the image named:
roadmap-asset.png
CI/CD:
Please know that every Monday & Friday at 3pm UTC, checks are carried out on the monorepo for styling issues and more. If you have any proposals that could possibly improve the system please create an issue.
UV & Packages:
When updating the pyproject.toml manually please do uv lock aftwards. If you do uv update [package] then you do not need to do the lock command.