Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config system and customize command handling #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,12 @@ fabric.properties
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# End of https://www.toptal.com/developers/gitignore/api/intellij,java
# End of https://www.toptal.com/developers/gitignore/api/intellij,java
/.idea/copyright/*.xml
/.idea/.gitignore
/.idea/compiler.xml
/.idea/gradle.xml
/.idea/jarRepositories.xml
/.idea/misc.xml
/.idea/uiDesigner.xml
/.idea/vcs.xml
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
*/
Andre601 marked this conversation as resolved.
Show resolved Hide resolved

plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '5.2.0'
id 'idea'
id "java"
id "application"
id "com.github.johnrengelman.shadow" version "8.1.1"
Andre601 marked this conversation as resolved.
Show resolved Hide resolved
}

group 'io.codemc'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Apr 28 16:10:49 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions src/main/java/io/codemc/bot/menu/ApplicationMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private static void handleEvent(CodeMCBot bot, MessageContextMenuEvent event, bo
event.replyModal(modal).queue();
}

public static class Accept extends MessageContextMenu{
public static final class Accept extends MessageContextMenu{

private final CodeMCBot bot;

Expand All @@ -101,7 +101,7 @@ protected void execute(MessageContextMenuEvent event){
}
}

public static class Deny extends MessageContextMenu{
public static final class Deny extends MessageContextMenu{

private final CodeMCBot bot;

Expand Down
49 changes: 13 additions & 36 deletions src/main/resources/config.json
Andre601 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,47 +1,24 @@
{
"bot_token": "TOKEN",
"server": 405915656039694336,
"server": 0,
"channels": {
"request_access": 1233971297185431582,
"accepted_requests": 784119059138478080,
"rejected_requests": 800423355551449098
"request_access": 0,
"accepted_requests": 0,
"rejected_requests": 0
},
"author_role": 405918641859723294,
"author_role": 0,
"allowed_roles": {
"application": [
405917902865170453,
659568973079379971,
1233971297185431582
],
"disable": [
405917902865170453
],
"msg": [
405917902865170453
],
"reload": [
405917902865170453
]
"application": [],
"disable": [],
"msg": [],
"reload": []
},
"users": {
"owner": 204232208049766400,
"co_owners": [
143088571656437760,
282975975954710528
]
"owner": 0,
"co_owners": []
},
"messages": {
"accepted": [
"Your request has been **accepted**!",
"You will now be able to login with your GitHub Account and access the approved Repository on the CI.",
"",
"Remember to [visit our Documentation](https://docs.codemc.io) and [Read our FAQ](https://docs.codemc.io/faq) to learn how to setup automatic builds!"
],
"denied": [
"Your request has been **rejected**!",
"The reason for the denial is stated below.",
"",
"You may re-apply unless mentioned otherwise in the Reason."
]
"accepted": [],
"denied": []
}
}
47 changes: 47 additions & 0 deletions src/main/resources/config.json.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"bot_token": "TOKEN",
"server": 405915656039694336,
"channels": {
"request_access": 1233971297185431582,
"accepted_requests": 784119059138478080,
"rejected_requests": 800423355551449098
},
"author_role": 405918641859723294,
"allowed_roles": {
"application": [
405917902865170453,
659568973079379971,
1233971297185431582
],
"disable": [
405917902865170453
],
"msg": [
405917902865170453
],
"reload": [
405917902865170453
]
},
"users": {
"owner": 204232208049766400,
"co_owners": [
143088571656437760,
282975975954710528
]
},
"messages": {
"accepted": [
"Your request has been **accepted**!",
"You will now be able to login with your GitHub Account and access the approved Repository on the CI.",
"",
"Remember to [visit our Documentation](https://docs.codemc.io) and [Read our FAQ](https://docs.codemc.io/faq) to learn how to setup automatic builds!"
],
"denied": [
"Your request has been **rejected**!",
"The reason for the denial is stated below.",
"",
"You may re-apply unless mentioned otherwise in the Reason."
]
}
}