PieInTheSky-Inc / YaDc

This is a Discord bot for Pixel Starships, based on Dolores.
Apache License 2.0
18 stars 19 forks source link

Yet another Dolores clone

This is a Discord Bot for Pixel Starships, targeted for hosting on Heroku.

Collaboration Guide

Coding style

This repository largely follows PEP8 with the following differences:

and the following changes/specifications:

The style may vary slightly between modules. Make sure to match the general style for a given module you're working on.

Module structure

Modules are divided into one or more sections as described below. Within these sections, functions are ordered by their visibility (public or private) and then by their name.

A section consists of a comment containing the title followed by a group of functions. There's a gap of 2 lines between the imports and the 1st section of each module. Between two subsequent sections, there's a gap of 5 line breaks.

...imports...

# ---------- Section name ----------

group of functions

# ---------- Section 2 name ----------

group of functions
...

This section contains custom typehint definitions.

This section contains public and private constants. These may be initialized in the Initialization section. Constants are ordered and grouped by name. Between each group there's a gap of 1 line.

This section contains classes related to the module. There's a gap of 5 lines between two subsequent classes.

This section contains public functions used by the bot's commands'. If a module contains functions used by multiple commands, there may be multiple Command functions sections. These sections are named in relation to the respective command, e.g. Fleet functions. They also may contain any helper functions used exclusively by functions contained in this section.

This section contains functions used for transforming data returned by the Pixel Starships' API.

This section contains public and private helper functions related to the module. If such functions are only being used in one specific Command functions section, move the respective helper function there instead.

This section contains boilerplate functions for creation of EntityDetails and EntityDetailsCollection objects.

This section may contain module-specific database functions.

This section contains code to create mockups of API data used for testing.

This section contains variables that get initialized during module setup and methods for asnyc initialization of constants and variables.

Hosting your own copy

Check HOSTING.md for instructions on hosting your own copy of the bot.

Bot Usage on Discord

The bot will fully initialize upon start.

In Discord chat, open the help using the command:

/help

As the author you can also get a list of all commands using:

/commands