Compare commits
No commits in common. "e7abbd6012504b059b9eac6f7789aef5dbef533a" and "c3272ad9aca03c8e77f714497748a0211ec3eaf5" have entirely different histories.
e7abbd6012
...
c3272ad9ac
3 changed files with 5 additions and 32 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -39,8 +39,8 @@ build/
|
|||
.DS_Store
|
||||
|
||||
### Other Stuff ###
|
||||
config*.json
|
||||
config.example.json
|
||||
**/resources/config*.json
|
||||
!**/resources/config.example.json
|
||||
!**/resources/config.schema.json
|
||||
|
||||
### why would this not be here already ###
|
||||
|
|
28
README.md
28
README.md
|
@ -9,31 +9,3 @@ A multipurpose Discord bot written in Java.
|
|||
### Tested Operating Systems
|
||||
- macOS 14.4.1
|
||||
- Windows 10 (22H2)
|
||||
|
||||
---
|
||||
|
||||
## Config file schema
|
||||
```json
|
||||
{
|
||||
"token": "your_token",
|
||||
"prefix": "oki!",
|
||||
"mariadb": {
|
||||
"host": "127.0.0.1",
|
||||
"user": "db_user",
|
||||
"password": "db_password",
|
||||
"database": "doki_prod"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Commands
|
||||
|
||||
| Command | Description | Arguments | Aliases |
|
||||
|---------------|------------------------------------------------------------------------------|---------------|---------|
|
||||
| `leaderboard` | Gets the leaderboard for the current guild | None | `lb` |
|
||||
| `rank` | Gets the rank of the specified user (message author if none specified) | `[user ping]` | None |
|
||||
| `about` | Gets information about the bot | None | None |
|
||||
| `ping` | Gets the bot's gateway & rest ping | None | None |
|
||||
| `whois` | Gets information about the specified user (message author if none specified) | `[user ping]` | None |
|
|
@ -22,7 +22,8 @@ public class Config {
|
|||
*/
|
||||
public static Config readConfig() throws IOException {
|
||||
Logger log = Logging.getLogger();
|
||||
try (InputStream in = new FileInputStream("./config.json")) {
|
||||
try (InputStream in=Thread.currentThread().getContextClassLoader().getResourceAsStream("config.json")) {
|
||||
assert in != null;
|
||||
Reader reader = new InputStreamReader(in, StandardCharsets.UTF_8);
|
||||
log.info("Loaded config");
|
||||
return new Gson().fromJson(reader, Config.class);
|
||||
|
|
Loading…
Reference in a new issue