Code quality
SonarCloud
SonarCloud code scanning is also paired with SonarLint in Visual Studio Code.
Quality Gate | Measures |
---|---|
Other Code Quality scanners
*Better Code does not have an option to make its dashboard publicly viewable. The hyperlink leads to Better Code’s main website.
Better Code* | Semmle LGTM |
---|---|
Security
Security always comes first. While CAutomator is built for one server and a specific purposes, personal data may be stored by cloned running copies of the bot. Check the security dashboard of this repository for more details.
SonarCloud | Snyk | CodeQL |
---|---|---|
Features
Profile system
A common problem within the Calculated Anarchy server is IRL identities. CAutomator fixes this problem with the CAutomator Profile System.
The way it used to work was the server #namelist, where people had to manually check the details of each user. Additionally, the namelist would only be updated every so often that when it was used to check the details of a user, it would be severely out of date.
Enter the CAutomator Profile System:
The CAutomator profile system is able to show the user’s IRL name, pronouns, birthday, Switch friend code, pride badges and interests. It also has the ability to show the user’s time and time zone, as well show a brief “about me”!
Usage
-profile register: register your details onto the database.
-profile edit: edit your details.
-profile search: make an advanced search.
-profile help: this, but in embed form.
-profile update: update your username and pronouns.
Edit a profile
Advanced search
To learn more about the code, look at the old code or look at modules/speciality/profile.js
.
Custom role management
A key reason for the creation of CAutomator is custom role management. On the Calculated Anarchy server, users who reached Level 30+ would be eligible for a custom role on the server. This process used to be done manually, before I created CAutomator and before iwa helped me with the code.
In the Node.js rewrite, CAutomator can assign and edit roles, and position them automatically - from first user who reached Level 30+ afterwards.
Usage
You need Level 30+ to run this command.
-role <hex colour> <role name>
(example:-role 00ff00 Hy's Role
)-role remove
To learn more about the code, look at the old code or look at modules/speciality/role.js
.
Time and weather
The Calculated Anarchy server has members from all around the globe: some in Europe, some in America, and most of us in Australia. CAutomator uses weather-js
to fetch the weather around the globe, and uses luxon
and moment-timezone
to fetch time around the globe.
Usage
-weather [location]
(example:-weather Adelaide
)-time [tz]
(example:-time Australia/Adelaide
, usesmoment-timezone
and the tz database to verify timezone)
To learn more about the code, look at:
- original code for weather
modules/utility/weather.js
modules/utility/time.js
Invite management
CAutomator can manage invites into the server, by limiting who can create an invite, how many the invite can allow in, and how long they have to wait until they can invite another user.
Usage
You need Level 10+ to run this command. You also need DMs open, and you can only run this command once at least every 24 hours.
-invite
To learn more about the code, look at modules/speciality/invite.js