mirror of
https://github.com/Sheldan/OnePlusBot.git
synced 2026-01-01 15:28:28 +00:00
Compare commits
41 Commits
release-20
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb6afc82dd | ||
|
|
fea16496c4 | ||
|
|
c91f27a716 | ||
|
|
a109d3f36d | ||
|
|
135c693bc8 | ||
|
|
ff284d4e10 | ||
|
|
d4eb9ffad5 | ||
|
|
976defa902 | ||
|
|
96d5ca06e7 | ||
|
|
bdcfccf5ad | ||
|
|
e60ab82870 | ||
|
|
2ca92279ae | ||
|
|
fc41501a21 | ||
|
|
320efc91b4 | ||
|
|
3bcfca46b6 | ||
|
|
615d1d10b5 | ||
|
|
2926d9fe09 | ||
|
|
edad07ac94 | ||
|
|
d1eeb15253 | ||
|
|
6b0bbca290 | ||
|
|
780c0d05bc | ||
|
|
14d4091bf7 | ||
|
|
c4e1ce6cd7 | ||
|
|
06fd28e536 | ||
|
|
00db737bdb | ||
|
|
161327f27e | ||
|
|
d15f025309 | ||
|
|
b7555e9851 | ||
|
|
3aef21f281 | ||
|
|
597d3b8a8a | ||
|
|
bc353fed55 | ||
|
|
31279bb059 | ||
|
|
8e6804a1dc | ||
|
|
a39124e208 | ||
|
|
42a94359bb | ||
|
|
3bddf1d1c4 | ||
|
|
c10dc6765c | ||
|
|
0b4b163e43 | ||
|
|
7be4891075 | ||
|
|
6f0ce5af12 | ||
|
|
f9d50fa6cc |
4
.env
4
.env
@@ -1,4 +1,4 @@
|
||||
REGISTRY_PREFIX=harbor.sheldan.dev/oneplus-bot/
|
||||
ABSTRACTO_PREFIX=harbor.sheldan.dev/abstracto/
|
||||
VERSION=1.6.30
|
||||
ABSTRACTO_VERSION=1.5.48
|
||||
VERSION=1.7.4
|
||||
ABSTRACTO_VERSION=1.6.15
|
||||
20
.github/workflows/build.yml
vendored
20
.github/workflows/build.yml
vendored
@@ -31,3 +31,23 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
user: Sheldan
|
||||
token: ${{ secrets.ABSTRACTO_PAT }}
|
||||
- name: Login to Harbor
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: harbor.sheldan.dev
|
||||
username: ${{ secrets.HARBOR_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_TOKEN }}
|
||||
- name: Load env file
|
||||
id: dotenv
|
||||
uses: falti/dotenv-action@v1.0.4
|
||||
with:
|
||||
path: .env
|
||||
- name: Docker build
|
||||
run: docker compose build
|
||||
env:
|
||||
REGISTRY_PREFIX: ${{ steps.dotenv.outputs.registry_prefix }}
|
||||
VERSION: ${{ steps.dotenv.outputs.version }}
|
||||
- name: Helm package and push
|
||||
working-directory: ./deployment/helm/
|
||||
run: |-
|
||||
helm package oneplus-bot
|
||||
@@ -1,6 +1,6 @@
|
||||
# r/oneplus Discord bot privacy policy
|
||||
|
||||
Last updated: 06.09.2021
|
||||
Last updated: 23.02.2025
|
||||
|
||||
## Description
|
||||
|
||||
@@ -16,17 +16,20 @@ The detailed list of what information is stored and processed is the following:
|
||||
* the name of emotes which are used in the bot for convenience, if they are customized
|
||||
* towards which channel (identified by ID) certain messages by the bot are posted. e.g. logging, news, starboard
|
||||
* **no message content, username, channel name or role name is stored, except at the places where its mentioned**
|
||||
* a logfile is used in order to examine any malfunctions, the content is deleted after 7 days
|
||||
* most of the stored records have a 'created' and 'updated' timestamp, in order to assist in examining bugs and malfunctions
|
||||
* which commands have which cooldown in which channel group and in which channel group they are disabled
|
||||
* which channel is in which channel group
|
||||
* which role is allowed to execute which command
|
||||
* which features are enabled
|
||||
* which feature modes are enabled
|
||||
* **aliases** created for the commands
|
||||
* **information** necessary to handle components (buttons, select menus). This information is of varying nature and can be user identifiable information
|
||||
* **emotes** which should be used for varying places (assignable roles, particular emotes which are overwriten, such as star board)
|
||||
|
||||
|
||||
### Moderation
|
||||
* the date of the latest report via the reaction report system, in order to disallow quick reports
|
||||
* mute reason, duration, mute date, who muted whom and in which message was the mute executed
|
||||
* **mute reason**, duration, mute date, who muted whom and in which message was the mute executed
|
||||
* the names of filtered invite link servers in order to find out if it would be valid to allow the invite
|
||||
* any configured allowed invite links the server ID and the actually used invite
|
||||
* this is necessary in order to determine the server via its ID and allow other unknown invite links. The invite link is necessary as there is no way to map server ID to actual server
|
||||
@@ -41,6 +44,9 @@ The detailed list of what information is stored and processed is the following:
|
||||
* the user who warned a user
|
||||
* whether the warning was decayed and when
|
||||
|
||||
### Giveaway
|
||||
* the give away information: **description**, provider, manager, target date, winners and participants
|
||||
|
||||
### Embedded messages
|
||||
* embedded message information
|
||||
* this information includes who embedded which message in which channel and is deleted after a few days
|
||||
@@ -49,10 +55,12 @@ The detailed list of what information is stored and processed is the following:
|
||||
* the name of emotes which are being tracked in the emote usage tracking system for purely convenience reasons
|
||||
* **who** used which emote is **not** tracked
|
||||
* at which day an emote was used how many times
|
||||
* whether the emote was a reaction
|
||||
|
||||
### News
|
||||
* general information about news posts
|
||||
* the source message of the command, the created news post, and the author in order to enable the update mechanism
|
||||
* news posts from the oneplus Forums for automatic retrieval and comparison to see which posts are new. The ID of the users for who the forum posts are checked.
|
||||
|
||||
### Referral system
|
||||
* the date of the latest referral post in order to enforce the referral bump mechanism
|
||||
@@ -62,6 +70,13 @@ The detailed list of what information is stored and processed is the following:
|
||||
* the date it was created, and the date it is due
|
||||
* the id of the message which contained the command
|
||||
* whether you have been reminded
|
||||
* the users who have joined the reminders
|
||||
|
||||
### Modmail
|
||||
* the information that a modmail thread existed (creation, status and close date), and the IDs of the messages that have been sent in both directions
|
||||
|
||||
### Polls
|
||||
* the **text** of polls, the creator of polls and who made which decision in polls
|
||||
|
||||
### Starboard
|
||||
* the message which was the origin for the starboard post
|
||||
@@ -71,11 +86,11 @@ The detailed list of what information is stored and processed is the following:
|
||||
* this is necessary to provide the information about 'top star giver' and to disallow duplicate starboard reactions
|
||||
|
||||
### Suggestion
|
||||
* *the message content* of the message used to create the suggestion
|
||||
* **the message content** of the message used to create the suggestion
|
||||
* this was used for the message used to update the status of a suggestion, but this is currently disabled
|
||||
* the author of the suggestion and the message which has been posted in the suggestions channel
|
||||
* every suggestion will be deleted completely from the database a few days after it has reached a final state (rejected, denied, accepted)
|
||||
* whether you voted for a suggestion and which decision you took
|
||||
* whether you voted for a suggestion and which decision you made
|
||||
|
||||
### Leveling system
|
||||
* the amount of messages which were considered for the leveling system
|
||||
@@ -86,6 +101,10 @@ The detailed list of what information is stored and processed is the following:
|
||||
* which roles are configured to be used as experience roles and at which level they are assigned
|
||||
* which roles are used to disable experience gain
|
||||
|
||||
### Entertainment
|
||||
* PressF: for **what** the pressF was initiated by whom and who participated
|
||||
|
||||
|
||||
### FAQ
|
||||
* the names of FAQ commands
|
||||
* in which channel groups a FAQ command has a response
|
||||
@@ -100,6 +119,7 @@ The detailed list of what information is stored and processed is the following:
|
||||
### Assignable roles
|
||||
* the names of assignable role places and assignable role button text, together with the associated emote markdown (if given)
|
||||
* the assigned assignable roles for each member in order to provide the 'unique' assignable role functionality
|
||||
* custom configured conditions to enable a level restriction
|
||||
|
||||
## Grafana dashboard
|
||||
|
||||
@@ -121,7 +141,7 @@ All of this information cannot be linked to any user (or any server for that mat
|
||||
## How can I decide which information is collected?
|
||||
It is not possible to opt-out of singular sub-services of the bot. Should you decide that your information should not be collected, please cease usage of the bot immediately (leave any guild the bot operates in).
|
||||
|
||||
_Should you decide to no longer utilize the bot, you may request your data to be erased within 30 days as per GDPR if you are a citizen of the EU. You can do this by sending an email to oneplus.appeals@pm.me with the subject: GDPR Data removal <Username#0000> <UserId>. If your request is incomplete, we cannot acknowledge it and therefore your data will not be removed. In order to identify authentic requests, please contact modmail beforehand by sending a direct message to the bot and stating your intention._
|
||||
_Should you decide to no longer utilize the bot, you may request your data to be erased within 30 days as per GDPR if you are a citizen of the EU. You can do this by sending a message to the user "sheldan" on Discord: GDPR Data removal <Username> <UserId>. If your request is incomplete, we cannot acknowledge it and therefore your data will not be removed. In order to identify authentic requests, please contact modmail beforehand by sending a direct message to the bot and stating your intention._
|
||||
|
||||
|
||||
## Legal information
|
||||
@@ -134,7 +154,7 @@ OnePlus and OPPO are legal owners of OxygenOS. Visit https://oneplus.com/brand t
|
||||
## Open source content
|
||||
This bot uses the following open source libraries and frameworks:
|
||||
|
||||
* [abstracto](https://github.com/Sheldan/abstracto) is used as a base for this bot, providing a lot of the functionalities
|
||||
* [abstracto](https://github.com/Sheldan/abstracto) is used as a base for this bot, providing most of the functionalities
|
||||
* [JDA](https://github.com/DV8FromTheWorld/JDA/) The Discord API Wrapper used
|
||||
* [Spring boot](https://github.com/spring-projects/spring-boot) is used as a framework to create standalone application in Java with Java EE methods. (including Dependency injection and more)
|
||||
* [Hibernate](https://github.com/hibernate/hibernate-orm) is used as a reference implementation of JPA.
|
||||
@@ -142,7 +162,8 @@ This bot uses the following open source libraries and frameworks:
|
||||
* [Ehcache](https://github.com/ehcache/ehcache3) is used as a caching implementation.
|
||||
* [Lombok](https://github.com/rzwitserloot/lombok) is used as a framework in order to speed up creation of container classes and builders.
|
||||
* [Quartz](https://github.com/quartz-scheduler/quartz) is used as a scheduling framework in order to provide functionalities which either require a delayed or cronjob behaviour.
|
||||
* [Docker](https://github.com/docker) is used to package the application into a container and [Docker Compose](https://github.com/docker/compose) is used to orchestrate the containers
|
||||
* [Docker](https://github.com/docker) is used to package the application into a container and [k3s](https://k3s.io/) to orchestrate the containers
|
||||
* [Liquibase](https://github.com/liquibase/liquibase) is used to manage changes to the database
|
||||
* [Prometheus](https://prometheus.io) to scrap and collect the metrics about how the bot is operating
|
||||
* [Grafana](https://grafana.com) to visualize metrics of the bot
|
||||
|
||||
* [Grafana](https://grafana.com) to visualize metrics of the bot and [Loki](https://grafana.com/oss/loki/) for logging
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>executable</artifactId>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.custom</groupId>
|
||||
<artifactId>oneplus-bot-customizations</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>oneplus-bot-customizations</artifactId>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.custom</groupId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.custom</groupId>
|
||||
<artifactId>oneplus-bot-customizations</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>oneplus-bot-modules</artifactId>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -8,10 +8,7 @@ import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.ChannelService;
|
||||
import dev.sheldan.abstracto.core.service.JSONValidationService;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import dev.sheldan.abstracto.core.utils.FileService;
|
||||
import dev.sheldan.oneplus.bot.modules.faq.config.FAQFeatureDefinition;
|
||||
import dev.sheldan.oneplus.bot.modules.faq.config.FAQModuleDefinition;
|
||||
import dev.sheldan.oneplus.bot.modules.faq.service.FAQServiceBean;
|
||||
@@ -27,18 +24,9 @@ import java.util.concurrent.CompletableFuture;
|
||||
@Slf4j
|
||||
public class DeleteFAQ extends AbstractConditionableCommand {
|
||||
|
||||
@Autowired
|
||||
private FileService fileService;
|
||||
|
||||
@Autowired
|
||||
private FAQServiceBean faqServiceBean;
|
||||
|
||||
@Autowired
|
||||
private ChannelService channelService;
|
||||
|
||||
@Autowired
|
||||
private JSONValidationService jsonValidationService;
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
|
||||
@@ -66,14 +66,14 @@ public class FAQ extends AbstractConditionableCommand {
|
||||
.forEach(faqResponseMessageModel ->
|
||||
messageFutures.add(FutureUtils.
|
||||
toSingleFutureGeneric(channelService.
|
||||
sendEmbedTemplateInTextChannelList(FAQ_RESPONSE_TEMPLATE_KEY,
|
||||
sendEmbedTemplateInMessageChannel(FAQ_RESPONSE_TEMPLATE_KEY,
|
||||
faqResponseMessageModel, commandContext.getChannel()))));
|
||||
return FutureUtils.toSingleFutureGeneric(messageFutures);
|
||||
} else {
|
||||
return FutureUtils
|
||||
.toSingleFutureGeneric(
|
||||
channelService.
|
||||
sendEmbedTemplateInTextChannelList(FAQ_RESPONSE_NO_COMMAND_FOUND_TEMPLATE_KEY,
|
||||
sendEmbedTemplateInMessageChannel(FAQ_RESPONSE_NO_COMMAND_FOUND_TEMPLATE_KEY,
|
||||
faqResponseModel, commandContext.getChannel()));
|
||||
}
|
||||
})
|
||||
@@ -85,7 +85,7 @@ public class FAQ extends AbstractConditionableCommand {
|
||||
return FutureUtils
|
||||
.toSingleFutureGeneric(
|
||||
channelService.
|
||||
sendEmbedTemplateInTextChannelList(FAQ_RESPONSE_NO_COMMAND_FOUND_TEMPLATE_KEY,
|
||||
sendEmbedTemplateInMessageChannel(FAQ_RESPONSE_NO_COMMAND_FOUND_TEMPLATE_KEY,
|
||||
model, commandContext.getChannel()))
|
||||
.thenApply(unused -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class FAQUsage extends AbstractConditionableCommand {
|
||||
model = faqUsageServiceBean.getFAQUsageModel(server, commandName);
|
||||
}
|
||||
|
||||
return FutureUtils.toSingleFutureGeneric(channelService.sendEmbedTemplateInTextChannelList(FAQ_USAGE_RESPONSE_TEMPLATE_KEY, model, commandContext.getChannel()))
|
||||
return FutureUtils.toSingleFutureGeneric(channelService.sendEmbedTemplateInMessageChannel(FAQ_USAGE_RESPONSE_TEMPLATE_KEY, model, commandContext.getChannel()))
|
||||
.thenApply(unused -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ListFAQCommands extends AbstractConditionableCommand {
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
AServer server = serverManagementService.loadServer(commandContext.getGuild());
|
||||
ListFAQCommandsModel model = faqServiceBean.getCommandListingForServer(server);
|
||||
return FutureUtils.toSingleFutureGeneric(channelService.sendEmbedTemplateInTextChannelList(LIST_FAQ_COMMANDS_RESPONSE_TEMPLATE_KEY, model, commandContext.getChannel()))
|
||||
return FutureUtils.toSingleFutureGeneric(channelService.sendEmbedTemplateInMessageChannel(LIST_FAQ_COMMANDS_RESPONSE_TEMPLATE_KEY, model, commandContext.getChannel()))
|
||||
.thenApply(unused -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
|
||||
<artifactId>oneplus-bot-modules</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -36,10 +36,24 @@ public class UpdateNews extends AbstractConditionableCommand {
|
||||
|
||||
@Override
|
||||
public CommandConfiguration getConfiguration() {
|
||||
Parameter newsPostId = Parameter.builder().name("newsPostId").type(Long.class).templated(true).build();
|
||||
Parameter newsText = Parameter.builder().name("text").type(String.class).remainder(true).templated(true).build();
|
||||
Parameter newsPostId = Parameter
|
||||
.builder()
|
||||
.name("newsPostId")
|
||||
.type(Long.class)
|
||||
.templated(true)
|
||||
.build();
|
||||
Parameter newsText = Parameter
|
||||
.builder()
|
||||
.name("text")
|
||||
.type(String.class)
|
||||
.remainder(true)
|
||||
.templated(true)
|
||||
.build();
|
||||
List<Parameter> parameters = Arrays.asList(newsPostId, newsText);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
HelpInfo helpInfo = HelpInfo
|
||||
.builder()
|
||||
.templated(true)
|
||||
.build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("updateNews")
|
||||
.module(NewsModuleDefinition.NEWS)
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.oneplus.bot.modules.news.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureConfig;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.abstracto.core.config.FeatureMode;
|
||||
import dev.sheldan.abstracto.core.config.PostTargetEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -22,4 +23,9 @@ public class NewsFeature implements FeatureConfig {
|
||||
public List<PostTargetEnum> getRequiredPostTargets() {
|
||||
return Arrays.asList(NewsPostTarget.NEWS_TARGET, NewsPostTarget.FORUM_POST_NOTIFICATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FeatureMode> getAvailableModes() {
|
||||
return Arrays.asList(NewsFeatureMode.AUTOMATIC_POST, NewsFeatureMode.AUTOMATIC_PUBLISH);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package dev.sheldan.oneplus.bot.modules.news.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureMode;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum NewsFeatureMode implements FeatureMode {
|
||||
AUTOMATIC_POST("automaticPost"),
|
||||
AUTOMATIC_PUBLISH("automaticPublish");
|
||||
|
||||
private final String key;
|
||||
|
||||
NewsFeatureMode(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package dev.sheldan.oneplus.bot.modules.news.model;
|
||||
|
||||
import dev.sheldan.oneplus.bot.modules.news.model.forum.ForumPost;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Builder
|
||||
@Getter
|
||||
public class ForumPostEntry {
|
||||
private Long postId;
|
||||
private String subject;
|
||||
private String content;
|
||||
private Long creatorId;
|
||||
|
||||
public static ForumPostEntry fromPost(ForumPost forumPost) {
|
||||
return ForumPostEntry
|
||||
.builder()
|
||||
.postId(forumPost.getId())
|
||||
.subject(forumPost.getSubject())
|
||||
.content(forumPost.getContent())
|
||||
.creatorId(forumPost.getSource().getUserId())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package dev.sheldan.oneplus.bot.modules.news.model;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class ForumPostModel {
|
||||
private List<ForumPostEntry> entries;
|
||||
}
|
||||
@@ -1,10 +1,15 @@
|
||||
package dev.sheldan.oneplus.bot.modules.news.service;
|
||||
|
||||
import dev.sheldan.abstracto.core.service.FeatureModeService;
|
||||
import dev.sheldan.abstracto.core.service.PostTargetService;
|
||||
import dev.sheldan.abstracto.core.templating.model.MessageToSend;
|
||||
import dev.sheldan.abstracto.core.templating.service.TemplateService;
|
||||
import dev.sheldan.abstracto.core.utils.FutureUtils;
|
||||
import dev.sheldan.oneplus.bot.modules.news.config.NewsFeatureDefinition;
|
||||
import dev.sheldan.oneplus.bot.modules.news.config.NewsFeatureMode;
|
||||
import dev.sheldan.oneplus.bot.modules.news.config.NewsPostTarget;
|
||||
import dev.sheldan.oneplus.bot.modules.news.model.ForumPostEntry;
|
||||
import dev.sheldan.oneplus.bot.modules.news.model.ForumPostModel;
|
||||
import dev.sheldan.oneplus.bot.modules.news.model.ForumPostNotificationEntry;
|
||||
import dev.sheldan.oneplus.bot.modules.news.model.ForumPostNotificationModel;
|
||||
import dev.sheldan.oneplus.bot.modules.news.model.database.NewsForumPost;
|
||||
@@ -13,11 +18,14 @@ import dev.sheldan.oneplus.bot.modules.news.model.forum.ForumPost;
|
||||
import dev.sheldan.oneplus.bot.modules.news.service.management.NewsForumPostManagementServiceBean;
|
||||
import dev.sheldan.oneplus.bot.modules.news.service.management.NewsSourceManagementServiceBean;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -45,7 +53,11 @@ public class NewsSourceServiceBean {
|
||||
@Autowired
|
||||
private NewsSourceServiceBean self;
|
||||
|
||||
@Autowired
|
||||
private FeatureModeService featureModeService;
|
||||
|
||||
private static final String NEWS_FORUM_POST_NOTIFICATION_TEMPLATE_KEY = "newsForumPost_notification";
|
||||
private static final String NEWS_FORUM_POST_TEMPLATE_KEY = "newsForumPost";
|
||||
|
||||
public void checkForNewThreads() {
|
||||
Long targetServerId = Long.parseLong(System.getenv(NEWS_FORUM_POST_NOTIFICATION_SERVER_ID_ENV_NAME));
|
||||
@@ -54,34 +66,75 @@ public class NewsSourceServiceBean {
|
||||
if(newForumPosts.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<ForumPostNotificationEntry> entries = new ArrayList<>();
|
||||
newForumPosts.forEach(forumPost -> entries.add(ForumPostNotificationEntry.fromPost(forumPost)));
|
||||
|
||||
ForumPostNotificationModel model = ForumPostNotificationModel
|
||||
.builder()
|
||||
.entries(entries)
|
||||
.build();
|
||||
if(featureModeService.featureModeActive(NewsFeatureDefinition.NEWS, targetServerId, NewsFeatureMode.AUTOMATIC_POST)) {
|
||||
List<ForumPostEntry> entries = new ArrayList<>();
|
||||
newForumPosts.forEach(forumPost -> entries.add(ForumPostEntry.fromPost(forumPost)));
|
||||
ForumPostModel model = ForumPostModel
|
||||
.builder()
|
||||
.entries(entries)
|
||||
.build();
|
||||
MessageToSend messageToSend = templateService.renderEmbedTemplate(NEWS_FORUM_POST_TEMPLATE_KEY, model, targetServerId);
|
||||
List<CompletableFuture<Message>> messageFutures = postTargetService.sendEmbedInPostTarget(messageToSend, NewsPostTarget.NEWS_TARGET, targetServerId);
|
||||
FutureUtils.toSingleFutureGeneric(messageFutures)
|
||||
.thenAccept(unused -> {
|
||||
log.info("Sent news forum post notification.");
|
||||
List<Pair<Long, Long>> posts = entries
|
||||
.stream()
|
||||
.map(forumPostNotificationEntry -> Pair.of(forumPostNotificationEntry.getCreatorId(), forumPostNotificationEntry.getPostId()))
|
||||
.toList();
|
||||
self.persistForumPostsAndThreadCount(posts);
|
||||
self.handleAutomaticPublish(messageFutures, targetServerId);
|
||||
});
|
||||
} else {
|
||||
List<ForumPostNotificationEntry> entries = new ArrayList<>();
|
||||
newForumPosts.forEach(forumPost -> entries.add(ForumPostNotificationEntry.fromPost(forumPost)));
|
||||
ForumPostNotificationModel model = ForumPostNotificationModel
|
||||
.builder()
|
||||
.entries(entries)
|
||||
.build();
|
||||
MessageToSend messageToSend = templateService.renderEmbedTemplate(NEWS_FORUM_POST_NOTIFICATION_TEMPLATE_KEY, model, targetServerId);
|
||||
FutureUtils.toSingleFutureGeneric(postTargetService.sendEmbedInPostTarget(messageToSend, NewsPostTarget.FORUM_POST_NOTIFICATION, targetServerId))
|
||||
.thenAccept(unused -> {
|
||||
log.info("Sent news forum post notification.");
|
||||
List<Pair<Long, Long>> posts = entries
|
||||
.stream()
|
||||
.map(forumPostNotificationEntry -> Pair.of(forumPostNotificationEntry.getCreatorId(), forumPostNotificationEntry.getPostId()))
|
||||
.toList();
|
||||
self.persistForumPostsAndThreadCount(posts);
|
||||
}).exceptionally(throwable -> {
|
||||
log.error("Failed to send news forum post notification.", throwable);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
MessageToSend messageToSend = templateService.renderEmbedTemplate(NEWS_FORUM_POST_NOTIFICATION_TEMPLATE_KEY, model, targetServerId);
|
||||
|
||||
FutureUtils.toSingleFutureGeneric(postTargetService.sendEmbedInPostTarget(messageToSend, NewsPostTarget.FORUM_POST_NOTIFICATION, targetServerId))
|
||||
.thenAccept(unused -> {
|
||||
log.info("Sent news forum post notification.");
|
||||
self.persistForumPostsAndThreadCount(entries);
|
||||
}).exceptionally(throwable -> {
|
||||
log.error("Failed to send news forum post notification.", throwable);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void persistForumPostsAndThreadCount(List<ForumPostNotificationEntry> entries) {
|
||||
public CompletableFuture<Message> handleAutomaticPublish(List<CompletableFuture<Message>> messageFutures, Long serverId) {
|
||||
if(featureModeService.featureModeActive(NewsFeatureDefinition.NEWS, serverId, NewsFeatureMode.AUTOMATIC_PUBLISH)) {
|
||||
if(messageFutures != null && !messageFutures.isEmpty() && messageFutures.get(0) != null) {
|
||||
Message newsMessage = messageFutures.get(0).join();
|
||||
log.info("Publishing message {} in server {}.", newsMessage.getId(), serverId);
|
||||
return newsMessage.crosspost().submit();
|
||||
} else {
|
||||
log.info("No message found - not cross posting.");
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
} else {
|
||||
log.info("Automatic publishing disabled in server {}.", serverId);
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void persistForumPostsAndThreadCount(List<Pair<Long, Long>> posts) {
|
||||
Map<Long, NewsSource> sourceMap = newsSourceManagementServiceBean.loadNewsSources()
|
||||
.stream()
|
||||
.collect(Collectors.toMap(NewsSource::getUserId, Function.identity()));
|
||||
|
||||
entries.forEach(forumPostNotificationEntry ->
|
||||
newsForumPostManagementServiceBean.createPost(sourceMap.get(forumPostNotificationEntry.getCreatorId()), forumPostNotificationEntry.getPostId()));
|
||||
posts.forEach(forumPostNotificationEntry ->
|
||||
newsForumPostManagementServiceBean.createPost(sourceMap.get(forumPostNotificationEntry.getLeft()), forumPostNotificationEntry.getRight()));
|
||||
|
||||
sourceMap.values().forEach(newsSource -> {
|
||||
Long currentThreadCount = forumApiClient.getCurrentThreadCount(newsSource);
|
||||
|
||||
@@ -7,6 +7,14 @@ abstracto.featureFlags.news.enabled=false
|
||||
abstracto.feature.news.removalDays=4
|
||||
abstracto.feature.news.postLockSeconds=3600
|
||||
|
||||
abstracto.featureModes.automaticPublish.featureName=news
|
||||
abstracto.featureModes.automaticPublish.mode=automaticPublish
|
||||
abstracto.featureModes.automaticPublish.enabled=false
|
||||
|
||||
abstracto.featureModes.automaticPost.featureName=news
|
||||
abstracto.featureModes.automaticPost.mode=automaticPost
|
||||
abstracto.featureModes.automaticPost.enabled=false
|
||||
|
||||
abstracto.feature.news.userURL=https://community.oneplus.com/ajax/user/frontend/user/info?uid=%s
|
||||
# TODO support pagination.. eventually
|
||||
abstracto.feature.news.threadURL=https://community.oneplus.com/ajax/user/frontend/thread/page?page=1&limit=1000&uid=%s
|
||||
abstracto.feature.news.threadURL=https://community.oneplus.com/ajax/user/frontend/thread/page?page=1&limit=100&uid=%s
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
|
||||
<artifactId>oneplus-bot-modules</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ public class ReferralListener implements AsyncMessageReceivedListener {
|
||||
.build();
|
||||
ServerUser serverUser = ServerUser.fromMember(message.getMember());
|
||||
CompletableFutureList<Message> sendFutures = new CompletableFutureList<>(channelService
|
||||
.sendEmbedTemplateInMessageChannelList(REFERRAL_POST_EMBED_TEMPLATE_KEY, postModel, message.getChannel()));
|
||||
.sendEmbedTemplateInMessageChannel(REFERRAL_POST_EMBED_TEMPLATE_KEY, postModel, message.getChannel()));
|
||||
CompletableFuture<Void> deletionFuture = messageService.deleteMessage(message);
|
||||
CompletableFuture.allOf(sendFutures.getMainFuture(), deletionFuture)
|
||||
.thenAccept(unused -> self.updateReferralStateInDatabase(serverUser))
|
||||
@@ -139,7 +139,7 @@ public class ReferralListener implements AsyncMessageReceivedListener {
|
||||
|
||||
private void deleteAndNotify(Message message, String usedTemplate, Object usedModel) {
|
||||
CompletableFutureList<Message> futures = new CompletableFutureList<>(channelService
|
||||
.sendEmbedTemplateInMessageChannelList(usedTemplate, usedModel, message.getChannel()));
|
||||
.sendEmbedTemplateInMessageChannel(usedTemplate, usedModel, message.getChannel()));
|
||||
futures.getMainFuture().thenAccept(unused ->
|
||||
scheduledExecutorService.schedule(() ->
|
||||
futures.getObjects().forEach(createdMessage -> messageService.deleteMessage(createdMessage)),
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
|
||||
<artifactId>oneplus-bot-modules</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>oneplus-bot-modules</artifactId>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot</groupId>
|
||||
<artifactId>oneplusbot</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>dev.sheldan.oneplus.bot.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
<modules>
|
||||
<module>executable</module>
|
||||
<module>oneplus-bot-customizations</module>
|
||||
|
||||
@@ -2,4 +2,4 @@ apiVersion: v2
|
||||
name: oneplus-bot
|
||||
description: A Helm chart for Kubernetes
|
||||
type: application
|
||||
version: 1.6.30
|
||||
version: 1.7.4
|
||||
|
||||
@@ -4,4 +4,5 @@ metadata:
|
||||
name: api-keys
|
||||
data:
|
||||
discordToken: {{ $.Values.apiKeys.discord.token | b64enc }} # b64enc is needed, because a stringData secret field cannot hold numeric values
|
||||
youtubeApiKey: {{ $.Values.apiKeys.youtube.apiKey | b64enc }}
|
||||
youtubeApiKey: {{ $.Values.apiKeys.youtube.apiKey | b64enc }}
|
||||
freeCurrencyApiApiKey: {{ $.Values.apiKeys.freeCurrencyApi.apiKey | b64enc }}
|
||||
@@ -75,6 +75,11 @@ spec:
|
||||
key: youtubeApiKey
|
||||
- name: PRIVATE_REST_API_HOST
|
||||
value: "{{ .Values.privateRestApi.service.name }}.{{ .Release.Namespace }}.svc.cluster.local"
|
||||
- name: FREE_CURRENCY_API_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: api-keys
|
||||
key: freeCurrencyApiApiKey
|
||||
- name: PRIVATE_REST_API_PORT
|
||||
value: "{{ .Values.privateRestApi.service.targetPort }}"
|
||||
- name: FRONTEND_BASE
|
||||
|
||||
@@ -3,7 +3,7 @@ bot:
|
||||
repository: harbor.sheldan.dev/oneplus-bot
|
||||
pullPolicy: IfNotPresent
|
||||
image: oneplus-bot-image
|
||||
tag: 1.6.30
|
||||
tag: 1.7.4
|
||||
livenessProbe:
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 5
|
||||
@@ -22,23 +22,23 @@ templateDeployment:
|
||||
repository: harbor.sheldan.dev/abstracto
|
||||
pullPolicy: Always
|
||||
image: abstracto-template-deployment
|
||||
tag: 1.5.48
|
||||
tag: 1.6.15
|
||||
templateDeploymentData:
|
||||
repository: harbor.sheldan.dev/oneplus-bot
|
||||
pullPolicy: Always
|
||||
image: oneplus-bot-template-data
|
||||
tag: 1.6.30
|
||||
tag: 1.7.4
|
||||
dbConfigDeployment:
|
||||
enabled: true
|
||||
repository: harbor.sheldan.dev/abstracto
|
||||
pullPolicy: Always
|
||||
image: abstracto-db-deployment
|
||||
tag: 1.5.48
|
||||
tag: 1.6.15
|
||||
dbConfigDeploymentData:
|
||||
repository: harbor.sheldan.dev/oneplus-bot
|
||||
pullPolicy: Always
|
||||
image: oneplus-bot-db-data
|
||||
tag: 1.6.30
|
||||
tag: 1.7.4
|
||||
dbCredentials:
|
||||
host: null
|
||||
port: null
|
||||
@@ -51,7 +51,7 @@ privateRestApi:
|
||||
repository: harbor.sheldan.dev/oneplus-bot
|
||||
pullPolicy: Always
|
||||
image: oneplus-bot-private-rest-api
|
||||
tag: 1.6.30
|
||||
tag: 1.7.4
|
||||
podAnnotations: {}
|
||||
podSecurityContext: {}
|
||||
securityContext: {}
|
||||
@@ -82,7 +82,7 @@ restApi:
|
||||
repository: harbor.sheldan.dev/oneplus-bot
|
||||
pullPolicy: Always
|
||||
image: oneplus-bot-rest-api
|
||||
tag: 1.6.30
|
||||
tag: 1.7.4
|
||||
podAnnotations: {}
|
||||
podSecurityContext: {}
|
||||
securityContext: {}
|
||||
@@ -138,6 +138,8 @@ apiKeys:
|
||||
twitch:
|
||||
secret: null
|
||||
clientId: null
|
||||
freeCurrencyApi:
|
||||
apiKey: null
|
||||
imagePullSecrets: null
|
||||
nameOverride: ''
|
||||
fullnameOverride: ''
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.deployment</groupId>
|
||||
<artifactId>deployment</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM alpine:3.18.0
|
||||
FROM alpine:3.22.1
|
||||
MAINTAINER Sheldan
|
||||
ADD config/ /var/db-config/
|
||||
ADD liquibase-artifacts /var/db-config/liquibase-zips
|
||||
|
||||
@@ -1,8 +1,32 @@
|
||||
FROM amazoncorretto:17.0.8-alpine3.18
|
||||
MAINTAINER Sheldan
|
||||
VOLUME /tmp
|
||||
ADD config/* /config/
|
||||
ADD wrapper/*.sh /
|
||||
# https://careers.wolt.com/en/blog/tech/how-to-reduce-jvm-docker-image-size
|
||||
FROM amazoncorretto:17.0.14-alpine3.20 AS corretto-jdk
|
||||
|
||||
RUN apk add --no-cache binutils
|
||||
|
||||
RUN $JAVA_HOME/bin/jlink \
|
||||
--verbose \
|
||||
--add-modules ALL-MODULE-PATH \
|
||||
--strip-debug \
|
||||
--no-man-pages \
|
||||
--no-header-files \
|
||||
--compress=2 \
|
||||
--output /customjre
|
||||
|
||||
FROM alpine:3.22.1
|
||||
|
||||
ENV JAVA_HOME=/jre
|
||||
ENV PATH="${JAVA_HOME}/bin:${PATH}"
|
||||
|
||||
COPY --from=corretto-jdk /customjre $JAVA_HOME
|
||||
|
||||
ARG APPLICATION_USER=appuser
|
||||
|
||||
RUN adduser --no-create-home -u 1000 -D $APPLICATION_USER
|
||||
|
||||
RUN mkdir /app && chown -R $APPLICATION_USER /app
|
||||
|
||||
COPY --chown=1000:1000 config/* /config/
|
||||
COPY --chown=1000:1000 wrapper/*.sh /
|
||||
RUN chmod +x /start.sh
|
||||
ADD bot/app.jar /app.jar
|
||||
COPY --chown=1000:1000 bot/app.jar /app.jar
|
||||
CMD ["/start.sh"]
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM alpine:3.18.0
|
||||
FROM alpine:3.22.1
|
||||
MAINTAINER Sheldan
|
||||
ADD config /var/template-config/
|
||||
ADD template-artifacts /var/template-config/templates
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>oneplusbot</artifactId>
|
||||
<groupId>dev.sheldan.oneplus.bot</groupId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
6
pom.xml
6
pom.xml
@@ -12,13 +12,13 @@
|
||||
|
||||
<groupId>dev.sheldan.oneplus.bot</groupId>
|
||||
<artifactId>oneplusbot</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<abstracto.version>1.5.48</abstracto.version>
|
||||
<abstracto.templates.version>1.4.45</abstracto.templates.version>
|
||||
<abstracto.version>1.6.15</abstracto.version>
|
||||
<abstracto.templates.version>1.4.61</abstracto.templates.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.customizations</groupId>
|
||||
<artifactId>customization-templates</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates</groupId>
|
||||
<artifactId>oneplus-bot-templates</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.customizations</groupId>
|
||||
<artifactId>customization-templates</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.modules</groupId>
|
||||
<artifactId>oneplus-bot-module-templates</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.modules</groupId>
|
||||
<artifactId>oneplus-bot-module-templates</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
<#assign roleMention="<@&479202891358535681>"/>
|
||||
"additionalMessage": "${roleMention}",
|
||||
"embeds": [
|
||||
{
|
||||
<#macro postDisplay post>
|
||||
${post.subject?json_string}
|
||||
https://community.oneplus.com/thread/${post.postId?c}
|
||||
|
||||
</#macro>
|
||||
"description": "<#list entries as entry><@postDisplay post=entry /></#list>"
|
||||
}
|
||||
],
|
||||
"messageConfig": {
|
||||
"allowsRoleMention": true
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates</groupId>
|
||||
<artifactId>oneplus-bot-templates</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.modules</groupId>
|
||||
<artifactId>oneplus-bot-module-templates</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates</groupId>
|
||||
<artifactId>templates</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>oneplus-bot-templates</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
<modules>
|
||||
<module>module-templates</module>
|
||||
<module>customization-templates</module>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.overrides</groupId>
|
||||
<artifactId>template-overrides</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.overrides</groupId>
|
||||
<artifactId>template-overrides</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.overrides</groupId>
|
||||
<artifactId>template-overrides</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.overrides</groupId>
|
||||
<artifactId>template-overrides</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates</groupId>
|
||||
<artifactId>oneplus-bot-templates</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.overrides</groupId>
|
||||
<artifactId>template-overrides</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.overrides</groupId>
|
||||
<artifactId>template-overrides</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot</groupId>
|
||||
<artifactId>oneplusbot</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<groupId>dev.sheldan.oneplus.bot.templates</groupId>
|
||||
<artifactId>templates</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
</project>
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.translations.customizations</groupId>
|
||||
<artifactId>customization-translations</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.translations.customizations</groupId>
|
||||
<artifactId>customization-translations</artifactId>
|
||||
<version>1.6.32-SNAPSHOT</version>
|
||||
<version>1.7.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user