Skip to content

4. Additional Developer Notes

Noah Steinberg edited this page Aug 19, 2018 · 6 revisions

TespaCarleton Discordbot Developer Notes

Discord API

Please see the discord.js API and guides located at https://discord.js.org/#/

Recommended Setup (CTO current setup)

Editor: Microsoft Visual Studio Code

Including addons: Bookmarks, Bracket Pair Colorizer, ESLint, Github build status, Gitlens - Git supercharged.

Node Version 8.9.1

OS: Windows 10 with Ubuntu Subsystem enabled for Linux testing and mySQL.

Style and Code Guide

File layout

  • app.js - base startup and bot logic
  • database.js - logic for working with persistent/stored data in the mysql database
  • generator.js - logic for providing peronalised error messages to end users
  • commands/*.js - logic for all different types of commands. Each file represents commands specific to a role/permission level.

Function Documentation

Please document all functions as specified by http://usejsdoc.org/ (invocation syntax (or entry condition), short description, and params list as a minimum) Furthermore, feel free to include inline comments to clarify any program logic or longer functions

Global Variable Usage

Several global variables are used to keep track of certain configuration values or constants throughout the program. As a general rule, global variables should be avoided, but if you must make use of a global, please redefine it as a local at the top of the file like

logger = global.logger

so it is easy to see what globals your module/file depends on.

Other Style Notes

Overall, all commits/additions to the code are subject to code review from a developer with merge permissions from the main repo. (Usually the CTO or a council member). Before asking for code review you should always keep in mind... Is my code clear? Is my code well commented? Is anything in my code hacky? Is there any errors I haven't accounted for? Have I tested this code on my own? If any of these questions is not a resounding yes, you should reconsider asking for code review.

Bug Reporting and Feature Requests

All bug reporting and feature requests are initially done through Trello. Please contact Noah Steinberg (@Cadaverific) in order to receive an invitation to the group. This board will be visible to anyone who is a part of the Tespa Carleton Discord Team, and from there Bug Reports and Feature requests will be migrated over by the CTO or another council member based on priority/validity and assigned to a developer.