forked from SokoraDesu/Sokora
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from ZakaHaceCosas/dev
some (possibly cool) stuff
Showing
21 changed files
with
237 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ node_modules/ | |
.DS_Store | ||
data.db | ||
.idea | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,44 @@ | ||
# Sokora Contributing Guide | ||
|
||
## Prerequisites | ||
|
||
- Basic knowledge of [TypeScript](https://typescriptlang.org/) and [discord.js](https://discord.js.org/). | ||
- [Bun](https://bun.sh) installed. | ||
|
||
## Get started with contributing | ||
|
||
### Getting the code | ||
|
||
- Make a fork of this repository. | ||
- Clone your fork. | ||
|
||
### Creating your bot | ||
|
||
- Head over to the [Discord Developer Portal](https://discord.com/developers/applications) and make a new application. | ||
- Invite your bot to your server. | ||
- Reset and then copy your bot's token. | ||
|
||
### Setting up .env | ||
- Run `bun run setup` and our cli tool will install dependencies and write .env for you | ||
|
||
- Run `bun run setup` and our CLI tool will install dependencies and write .env for you. It'll ask you to paste in your bot's token. | ||
|
||
### Running | ||
|
||
- Run `bun dev`. | ||
|
||
Be sure to open a pull request when you're ready to push your changes. Be descriptive of the changes you've made. | ||
|
||
 | ||
## Code style guidelines | ||
|
||
A few, simple guidelines onto how code contributed to Sokora should look like. | ||
|
||
- Keep a consistent indentation of two spaces. Don't use tabs. | ||
- Use `K&R` style for bracket placement (`function() {}` instead of `function() \n {}`). | ||
- Use `camelCase` for both variables and function names. | ||
- Keep lines reasonably short, don't fear linebreaks. Of course, longer lines are valid where needed. | ||
- Use early returns to avoid nesting. | ||
- Avoid curly braces in one-line `if` statements. | ||
- Non-nullish assertions are valid when needed. | ||
- Use the cache instead of a new `fetch()` call where possible, to avoid unnecessary usage (e.g., if possible, prefer `guild.members.cache` over `await guild.members.fetch()`). | ||
|
||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Outputs the given settings_string | ||
* @param {string} string Settings string, either a key or a value. | ||
*/ | ||
export function humanizeSettings(string: string) { | ||
if (!string) return; | ||
const humanized = string | ||
.trim() | ||
.replaceAll("_", " ") | ||
.replaceAll("true", "Enabled") | ||
.replaceAll("false", "Disabled") | ||
.replaceAll("(name)", "`(name)`") | ||
.replaceAll("(servername)", "`(servername)`") | ||
.replaceAll("(count)", "`(count)`"); | ||
|
||
return humanized; | ||
} |