-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
331 additions
and
97 deletions.
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
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
29 changes: 29 additions & 0 deletions
29
src/main/java/de/chojo/repbot/actions/messages/log/MessageLog.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,29 @@ | ||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* | ||
* Copyright (C) RainbowDashLabs and Contributor | ||
*/ | ||
package de.chojo.repbot.actions.messages.log; | ||
|
||
import de.chojo.jdautil.interactions.message.Message; | ||
import de.chojo.jdautil.interactions.message.provider.MessageProvider; | ||
import de.chojo.repbot.actions.messages.log.handler.MessageAnalyzer; | ||
import de.chojo.repbot.dao.provider.Guilds; | ||
import net.dv8tion.jda.api.Permission; | ||
|
||
public class MessageLog implements MessageProvider<Message> { | ||
private final Guilds guilds; | ||
|
||
public MessageLog(Guilds guilds) { | ||
this.guilds = guilds; | ||
} | ||
|
||
@Override | ||
public Message message() { | ||
return Message.of("Message Log") | ||
.handler(new MessageAnalyzer(guilds)) | ||
.setGuildOnly(true) | ||
.withPermission(Permission.MESSAGE_MANAGE) | ||
.build(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/de/chojo/repbot/actions/messages/log/handler/MessageAnalyzer.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,25 @@ | ||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* | ||
* Copyright (C) RainbowDashLabs and Contributor | ||
*/ | ||
package de.chojo.repbot.actions.messages.log.handler; | ||
|
||
import de.chojo.jdautil.interactions.message.MessageHandler; | ||
import de.chojo.jdautil.wrapper.EventContext; | ||
import de.chojo.repbot.commands.log.handler.Analyzer; | ||
import de.chojo.repbot.dao.provider.Guilds; | ||
import net.dv8tion.jda.api.events.interaction.command.MessageContextInteractionEvent; | ||
|
||
public class MessageAnalyzer implements MessageHandler { | ||
private final Guilds guilds; | ||
|
||
public MessageAnalyzer(Guilds guilds) { | ||
this.guilds = guilds; | ||
} | ||
|
||
@Override | ||
public void onMessage(MessageContextInteractionEvent event, EventContext eventContext) { | ||
Analyzer.sendAnalyzerLog(event, guilds, event.getTarget().getIdLong(), eventContext); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/de/chojo/repbot/actions/user/donated/received/UserDonated.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,28 @@ | ||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* | ||
* Copyright (C) RainbowDashLabs and Contributor | ||
*/ | ||
package de.chojo.repbot.actions.user.donated.received; | ||
|
||
import de.chojo.jdautil.interactions.user.User; | ||
import de.chojo.jdautil.interactions.user.provider.UserProvider; | ||
import de.chojo.repbot.actions.user.donated.received.handler.DonatedReputation; | ||
import de.chojo.repbot.dao.provider.Guilds; | ||
import net.dv8tion.jda.api.Permission; | ||
|
||
public class UserDonated implements UserProvider<User> { | ||
private final Guilds guilds; | ||
|
||
public UserDonated(Guilds guilds) { | ||
this.guilds = guilds; | ||
} | ||
|
||
@Override | ||
public User user() { | ||
return User.of("Given Reputation").handler(new DonatedReputation(guilds)) | ||
.setGuildOnly(true) | ||
.withPermission(Permission.MESSAGE_MANAGE) | ||
.build(); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/de/chojo/repbot/actions/user/donated/received/handler/DonatedReputation.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 @@ | ||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* | ||
* Copyright (C) RainbowDashLabs and Contributor | ||
*/ | ||
package de.chojo.repbot.actions.user.donated.received.handler; | ||
|
||
import de.chojo.jdautil.interactions.user.UserHandler; | ||
import de.chojo.jdautil.wrapper.EventContext; | ||
import de.chojo.repbot.commands.log.handler.Donated; | ||
import de.chojo.repbot.commands.log.handler.Received; | ||
import de.chojo.repbot.dao.provider.Guilds; | ||
import net.dv8tion.jda.api.events.interaction.command.UserContextInteractionEvent; | ||
|
||
public class DonatedReputation implements UserHandler { | ||
private final Guilds guilds; | ||
|
||
public DonatedReputation(Guilds guilds) { | ||
this.guilds = guilds; | ||
} | ||
|
||
|
||
@Override | ||
public void onUser(UserContextInteractionEvent event, EventContext eventContext) { | ||
Donated.send(event, event.getTargetMember(), guilds, eventContext); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/de/chojo/repbot/actions/user/received/UserReceived.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,28 @@ | ||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* | ||
* Copyright (C) RainbowDashLabs and Contributor | ||
*/ | ||
package de.chojo.repbot.actions.user.received; | ||
|
||
import de.chojo.jdautil.interactions.user.User; | ||
import de.chojo.jdautil.interactions.user.provider.UserProvider; | ||
import de.chojo.repbot.actions.user.received.handler.ReceivedReputation; | ||
import de.chojo.repbot.dao.provider.Guilds; | ||
import net.dv8tion.jda.api.Permission; | ||
|
||
public class UserReceived implements UserProvider<User> { | ||
private final Guilds guilds; | ||
|
||
public UserReceived(Guilds guilds) { | ||
this.guilds = guilds; | ||
} | ||
|
||
@Override | ||
public User user() { | ||
return User.of("Received Reputation").handler(new ReceivedReputation(guilds)) | ||
.setGuildOnly(true) | ||
.withPermission(Permission.MESSAGE_MANAGE) | ||
.build(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/de/chojo/repbot/actions/user/received/handler/ReceivedReputation.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,26 @@ | ||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* | ||
* Copyright (C) RainbowDashLabs and Contributor | ||
*/ | ||
package de.chojo.repbot.actions.user.received.handler; | ||
|
||
import de.chojo.jdautil.interactions.user.UserHandler; | ||
import de.chojo.jdautil.wrapper.EventContext; | ||
import de.chojo.repbot.commands.log.handler.Received; | ||
import de.chojo.repbot.dao.provider.Guilds; | ||
import net.dv8tion.jda.api.events.interaction.command.UserContextInteractionEvent; | ||
|
||
public class ReceivedReputation implements UserHandler { | ||
private final Guilds guilds; | ||
|
||
public ReceivedReputation(Guilds guilds) { | ||
this.guilds = guilds; | ||
} | ||
|
||
|
||
@Override | ||
public void onUser(UserContextInteractionEvent event, EventContext eventContext) { | ||
Received.send(event, event.getTargetMember(), guilds, eventContext); | ||
} | ||
} |
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
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
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
Oops, something went wrong.