-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up config and create reaction listener
- Loading branch information
1 parent
ae006d2
commit c556a05
Showing
4 changed files
with
69 additions
and
1 deletion.
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
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
30 changes: 30 additions & 0 deletions
30
application/src/main/java/org/togetherjava/tjbot/config/OofsAndLmaosConfig.java
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,30 @@ | ||
package org.togetherjava.tjbot.config; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonRootName; | ||
|
||
@JsonRootName("oofsAndLmaos") | ||
public final class OofsAndLmaosConfig { | ||
private final String oofEmojiName; | ||
private final String lmaoEmojiName; | ||
private final long starboardChannelId; | ||
|
||
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES) | ||
public OofsAndLmaosConfig(String oofEmojiName, String lmaoEmojiName, long starboardChannelId) { | ||
this.oofEmojiName = oofEmojiName; | ||
this.lmaoEmojiName = lmaoEmojiName; | ||
this.starboardChannelId = starboardChannelId; | ||
} | ||
|
||
public String getOofEmojiName() { | ||
return oofEmojiName; | ||
} | ||
|
||
public String getLmaoEmojiName() { | ||
return lmaoEmojiName; | ||
} | ||
|
||
public long getStarboardChannelId() { | ||
return starboardChannelId; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
application/src/main/java/org/togetherjava/tjbot/features/basic/OofsAndLmaosStarboard.java
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,27 @@ | ||
package org.togetherjava.tjbot.features.basic; | ||
|
||
import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel; | ||
import net.dv8tion.jda.api.events.message.react.MessageReactionAddEvent; | ||
import net.dv8tion.jda.api.hooks.ListenerAdapter; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import org.togetherjava.tjbot.config.Config; | ||
import org.togetherjava.tjbot.config.OofsAndLmaosConfig; | ||
import org.togetherjava.tjbot.features.EventReceiver; | ||
|
||
public class OofsAndLmaosStarboard extends ListenerAdapter implements EventReceiver { | ||
|
||
private final OofsAndLmaosConfig config; | ||
|
||
public OofsAndLmaosStarboard(Config config) { | ||
this.config = config.getOofsAndLmaos(); | ||
} | ||
|
||
@Override | ||
public void onMessageReactionAdd(@NotNull MessageReactionAddEvent event) { | ||
String emojiName = event.getReaction().getEmoji().asCustom().getName(); | ||
MessageChannel channel = event.getChannel(); | ||
// TODO | ||
|
||
} | ||
} |