You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To start up, run the bot once, and it will generate a `config` directory. Stop the bot, and set the up **all of the following values**:
8
8
- in `systems.json`
9
9
-`jdaBotToken` to your bot's token
10
+
- (some `adminUsers` which, e.g., can manipulate the database)
10
11
- in `{guildId}.json`
11
12
-`moderation.logChannelId` to a channelId
12
13
-`moderation.staffRoleId` to a roleId
@@ -15,65 +16,49 @@ To start up, run the bot once, and it will generate a `config` directory. Stop t
15
16
16
17
Note that this is just what is required for the bot to start. Certain features may require other values to be set.
17
18
19
+
# Configuration
18
20
19
-
# Commands
20
-
Commands are defined in this bot using a `.yaml` configuration file located in `src/main/resources/commands`. The data in this file is transformed at startup time into an array of `net.javadiscord.javabot.command.data.slash_commands.SlashCommandConfig` objects using JSON deserialization.
21
-
22
-
These commands are then used by `net.javadiscord.javabot.command.InteractionHandler#registerSlashCommands(Guild)` to register the defined commands as Discord slash commands which become available to users in guilds and private messages with the bot.
23
-
24
-
**Each command MUST define a `handler` property, whose name is the fully-qualified class name of a `SlashCommand`.** When registering commands, the bot will look for such a class, and attempt to create a new instance of it using a no-args constructor. Therefore, make sure that your handler class has a no-args constructor.
25
-
26
-
### Privileges
27
-
To specify that a command should only be allowed to be executed by certain people, you can specify a list of privileges. For example:
28
-
```yaml
29
-
- name: jam-admin
30
-
description: Administrator actions for configuring the Java Jam.
In this example, we define that the `jam-admin` command is first of all, *not enabled by default*, and also we say that anyone from the `jam.adminRoleId` role (as found using `Bot.config.getJam().getAdminRoleId()`). Additionally, we also say that the user whose id is `235439851263098880` is allowed to use this command. See `BotConfig#resolve(String)` for more information about how role names are resolved at runtime.
40
-
41
-
*Context-Commands work in almost the same way, follow the steps above but replace `SlashCommand` with `MessageContextCommand` or `UserContextCommand`.*
21
+
The bot's configuration consists of a collection of simple JSON files:
22
+
-`systems.json` contains global settings for the bot's core systems.
23
+
- For every guild, a `{guildId}.json` file exists, which contains any guild-specific configuration settings.
42
24
43
-
### Autocomplete
44
-
To enable Autocomplete for a certain Slash Command Option, head to the command's entry in the corresponding
45
-
YAML-File and set the `autocomplete` value.
25
+
At startup, the bot will initially start by loading just the global settings, and then when the Discord ready event is received, the bot will add configuration for each guild it's in, loading it from the matching JSON file, or creating a new file if needed.
46
26
47
-
```yaml
48
-
- name: remove
49
-
description: Removes a question from the queue.
50
-
options:
51
-
- name: id
52
-
description: The id of the question to remove.
53
-
required: true
54
-
autocomplete: true
55
-
type: INTEGER
56
-
```
27
+
# Commands
57
28
58
-
Now, you just need to implement `Autocompletable` in your handler class.
29
+
We're using [DIH4JDA](https://github.com/DynxstyGIT/DIH4JDA) as our Command/Interaction framework, which makes it quite easy to add new commands.
The `handleAutocomplete` method of your handler class now gets fired once someone is focusing any Slash Command Option that has the `autocomplete`
71
-
property set to true.
57
+
For more information on how this works, visit the [DIH4JDA Wiki!](https://github.com/DynxstyGIT/DIH4JDA/wiki)
72
58
59
+
# Credits
73
60
74
-
# Configuration
75
-
The bot's configuration consists of a collection of simple JSON files:
76
-
- `systems.json`contains global settings for the bot's core systems.
77
-
- For every guild, a `{guildId}.json` file exists, which contains any guild-specific configuration settings.
61
+
Inspiration we took from other communities:
78
62
79
-
At startup, the bot will initially start by loading just the global settings, and then when the Discord ready event is received, the bot will add configuration for each guild it's in, loading it from the matching JSON file, or creating a new file if needed.
63
+
- We designed our [Help Channel System](https://github.com/Java-Discord/JavaBot/tree/main/src/main/java/net/javadiscord/javabot/systems/help) similar to the one on the [Python Discord](https://discord.gg/python).
64
+
-[`/move-conversation`](https://github.com/Java-Discord/JavaBot/blob/main/src/main/java/net/javadiscord/javabot/systems/user_commands/MoveConversationCommand.java) is heavily inspired by the [Rust Programming Language Community Server](https://discord.gg/rust-lang-community)
0 commit comments