Skip to content

Commit dbafffd

Browse files
authored
Merge pull request #4 from MCDiamondFire/master
awesome
2 parents 5024a58 + 8d2df10 commit dbafffd

File tree

97 files changed

+2061
-2190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2061
-2190
lines changed

.editorconfig

Lines changed: 1191 additions & 1191 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ build
55
/src/main/resources/swear_filter.json
66

77
*.json
8-
*.png
98
*.txt

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,13 @@ After setting up the config, you will need to paste the following into the swear
6161
]
6262
}
6363
```
64+
65+
## Special Thanks To
66+
67+
![YourKit Logo](https://www.yourkit.com/images/yklogo.png)
68+
69+
YourKit supports open source projects with innovative and intelligent tools
70+
for monitoring and profiling Java and .NET applications.
71+
YourKit is the creator of [YourKit Java Profiler](https://www.yourkit.com/java/profiler/),
72+
[YourKit .NET Profiler](https://www.yourkit.com/.net/profiler/),
73+
and [YourKit YouMonitor](ttps://www.yourkit.com/youmonitor/).

build.gradle

Lines changed: 0 additions & 45 deletions
This file was deleted.

build.gradle.kts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
plugins {
2+
java
3+
application
4+
id("com.github.johnrengelman.shadow") version "7.1.2"
5+
}
6+
7+
application {
8+
mainClass.set("com.diamondfire.helpbot.HelpBot")
9+
}
10+
11+
group = "com.diamondfire.helpbot"
12+
13+
repositories {
14+
mavenCentral()
15+
maven(url = "https://jitpack.io")
16+
maven(url = "https://m2.dv8tion.net/releases")
17+
}
18+
19+
dependencies {
20+
implementation ("net.dv8tion:JDA:5.0.0-beta.20") {
21+
exclude(module = "opus-java")
22+
}
23+
24+
implementation("club.minnced:discord-webhooks:0.5.8")
25+
implementation("ch.qos.logback:logback-classic:1.2.5")
26+
implementation("com.google.code.gson:gson:2.8.6")
27+
implementation ("com.github.Steveice10:MCProtocolLib:c5e4b66")
28+
implementation("mysql:mysql-connector-java:5.1.13")
29+
implementation("org.codehaus.groovy:groovy-jsr223:3.0.8")
30+
implementation("net.kyori:adventure-api:4.16.0")
31+
implementation("net.kyori:adventure-text-minimessage:4.16.0")
32+
implementation("dev.vankka:mcdiscordreserializer:4.3.0")
33+
}
34+
35+
tasks {
36+
compileJava {
37+
options.encoding = "UTF-8"
38+
}
39+
40+
jar {
41+
manifest {
42+
attributes["Main-Class"] = "com.diamondfire.helpbot.HelpBot"
43+
}
44+
}
45+
46+
build {
47+
dependsOn(shadowJar)
48+
}
49+
}

gradlew

100644100755
File mode changed.

settings.gradle

Lines changed: 0 additions & 2 deletions
This file was deleted.

settings.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rootProject.name = "DFHelpBot"
2+

src/main/java/com/diamondfire/helpbot/HelpBot.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
package com.diamondfire.helpbot;
22

3-
43
import com.diamondfire.helpbot.bot.HelpBotInstance;
54
import com.diamondfire.helpbot.df.codeinfo.codedatabase.changelog.CodeDifferenceHandler;
65
import com.diamondfire.helpbot.df.codeinfo.codedatabase.db.CodeDatabase;
7-
import com.diamondfire.helpbot.sys.tag.TagHandler;
86

97
import javax.security.auth.login.LoginException;
10-
import java.io.IOException;
118

129
public class HelpBot {
1310

src/main/java/com/diamondfire/helpbot/bot/HelpBotInstance.java

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.diamondfire.helpbot.bot.config.Config;
2121
import com.diamondfire.helpbot.bot.events.*;
2222
import com.diamondfire.helpbot.sys.tasks.TaskRegistry;
23+
import com.google.gson.Gson;
2324
import net.dv8tion.jda.api.*;
2425
import net.dv8tion.jda.api.entities.Activity;
2526
import net.dv8tion.jda.api.requests.GatewayIntent;
@@ -31,10 +32,11 @@
3132

3233
public class HelpBotInstance {
3334

35+
public static final Gson GSON = new Gson();
36+
3437
private static final Config config = new Config();
3538
public static final long DF_GUILD = config.getGuild();
3639
public static final long LOG_CHANNEL = config.getLogChannel();
37-
public static final OkHttpClient HTTP_CLIENT = new OkHttpClient();
3840

3941
private static JDA jda;
4042
private static final TaskRegistry loop = new TaskRegistry();
@@ -49,12 +51,13 @@ public static void initialize() throws LoginException {
4951
new SearchCommand(),
5052
new TagsCommand(),
5153
// others
52-
new CowsayCommand(),
54+
//new CowsayCommand(),
5355
new MimicCommand(),
54-
new FetchDataCommand(),
56+
new SolvedCommand(),
57+
//new FetchDataCommand(),
5558
new InfoCommand(),
5659
new EvalCommand(),
57-
new GarfieldCommand(),
60+
//new GarfieldCommand(),
5861
new HelpCommand(),
5962
new RestartCommand(),
6063
new ActionDumpCommand(),
@@ -75,10 +78,10 @@ public static void initialize() throws LoginException {
7578
new MutedCommand(),
7679
new UnmuteCommand(),
7780
new VerifyCommand(),
78-
new PollCommand(),
81+
// new PollCommand(), - Unused
7982
new IdeaCommand(),
80-
new StoreCommand(),
81-
new ChannelMuteCommand(),
83+
// new StoreCommand(),
84+
// new ChannelMuteCommand(), - not finished
8285
// statsbot
8386
new StatsCommand(),
8487
new SupportBadCommand(),
@@ -104,7 +107,7 @@ public static void initialize() throws LoginException {
104107
new QueueCommand(),
105108
new WhoHelpedCommand(),
106109
new HelpedByCommand(),
107-
new NamesCommand(),
110+
// new NamesCommand(), - Dead
108111
new PlayerJoinGraphCommand(),
109112
//new CpCommand(),
110113
//new CpRequirementsCommand(),
@@ -122,24 +125,23 @@ public static void initialize() throws LoginException {
122125
new ExcuseStaffCommand(),
123126
new ExcusedStaffCommand(),
124127
new SupportBannedPlayersCommand(),
125-
new DiscussionMuteCommand(),
126128
new NbsCommand(),
127129
new DailySessionsCommand(),
128130
new EightBallCommand(),
129-
new OcrCommand(),
131+
// new OcrCommand(), - Dead
130132
new JoinsCommand(),
131133
new TagCommand(),
132134
new PurgeCommand()
133135
);
134136

135137
JDABuilder builder = JDABuilder.createDefault(config.getToken())
136-
.enableIntents(GatewayIntent.GUILD_MEMBERS)
138+
.enableIntents(GatewayIntent.GUILD_MEMBERS, GatewayIntent.MESSAGE_CONTENT, GatewayIntent.DIRECT_MESSAGES, GatewayIntent.DIRECT_MESSAGE_REACTIONS)
137139
.setStatus(OnlineStatus.ONLINE)
138140
.setMemberCachePolicy(MemberCachePolicy.NONE)
139141
.setActivity(Activity.watching("for " + getConfig().getPrefix() + "help"))
140142
.setGatewayEncoding(GatewayEncoding.ETF)
141143
.disableCache(CacheFlag.ACTIVITY, CacheFlag.VOICE_STATE, CacheFlag.CLIENT_STATUS)
142-
.addEventListeners(new MessageEvent(), new ReadyEvent(), new GuildJoinEvent(), new ButtonEvent(), new MessageEditEvent());
144+
.addEventListeners(new MessageEvent(), new ReadyEvent(), new GuildJoinEvent(), new ButtonEvent(), new MessageEditEvent(), new PostAppliedTagsEvent(), new ChannelCreatedEvent(), new ChannelArchiveEvent());
143145

144146
jda = builder.build();
145147
CommandHandler.getInstance().initialize();
@@ -149,10 +151,6 @@ public static JDA getJda() {
149151
return jda;
150152
}
151153

152-
public static OkHttpClient getHttpClient() {
153-
return HTTP_CLIENT;
154-
}
155-
156154
public static Config getConfig() {
157155
return config;
158156
}

0 commit comments

Comments
 (0)