mirror of
https://github.com/Sheldan/OnePlusBot.git
synced 2026-01-07 18:03:46 +00:00
Compare commits
17 Commits
oneplusbot
...
oneplusbot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bcfaf1c928 | ||
|
|
124d45ba5b | ||
|
|
4cdaf87412 | ||
|
|
13cf06e1dc | ||
|
|
e8ae0f430d | ||
|
|
cda9d1a2b8 | ||
|
|
653246f3ee | ||
|
|
0879c7cc93 | ||
|
|
4ea878dd42 | ||
|
|
562f5ae9e1 | ||
|
|
92925d176f | ||
|
|
6a5f45c416 | ||
|
|
c7e8fd315f | ||
|
|
95ad8fdd3a | ||
|
|
51775b454e | ||
|
|
aa4de8f571 | ||
|
|
eae07fd07c |
42
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
42
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
name: Bug Report
|
||||
description: Found a bug that needs fixing?
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: General Troubleshooting
|
||||
description: You confirm to have made the following checks first.
|
||||
options:
|
||||
- label: I have checked for similar issues on the Issue-tracker.
|
||||
required: true
|
||||
- label: I have updated to the latest version
|
||||
required: true
|
||||
- label: I have checked the branches or the maintainers' PRs for upcoming bug fixes.
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Description"
|
||||
description: "General information about the bug"
|
||||
placeholder: "..."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Steps to reproduce"
|
||||
description: "What happened when the bug occurred?"
|
||||
placeholder: "1. ..."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Expected behaviour"
|
||||
description: "What should happen?"
|
||||
placeholder: "It should..."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Actual behaviour"
|
||||
description: "What did happen instead?"
|
||||
placeholder: "It actually ..."
|
||||
validations:
|
||||
required: true
|
||||
36
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
36
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Feature request
|
||||
description: Want some functionality added?
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: General Information
|
||||
description: You confirm to have made the following checks first.
|
||||
options:
|
||||
- label: I have checked for similar issues on the Issue-tracker.
|
||||
required: true
|
||||
- label: I have updated to the latest version
|
||||
required: true
|
||||
- label: I have checked the branches or the maintainers' PRs for upcoming features fixes.
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Description"
|
||||
description: "General description of the feature"
|
||||
placeholder: "..."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Feature worth and general use"
|
||||
description: "Why should this exist?"
|
||||
placeholder: "..."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Suggestions for implementation"
|
||||
description: "Any ideas about what the feature should behave/look like? Commands?"
|
||||
placeholder: "It should..."
|
||||
validations:
|
||||
required: false
|
||||
|
||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -34,5 +34,5 @@ jobs:
|
||||
env:
|
||||
REGISTRY_PREFIX: docker.pkg.github.com/sheldan/oneplusbot/
|
||||
VERSION: ${{ env.version }}
|
||||
ABSTRACTO_VERSION: 1.3.9
|
||||
ABSTRACTO_VERSION: 1.4.1
|
||||
ABSTRACTO_REGISTRY_PREFIX: docker.pkg.github.com/sheldan/abstracto/
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Sheldan
|
||||
Copyright (c) 2022 Sheldan
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>executable</artifactId>
|
||||
@@ -191,6 +191,12 @@
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
|
||||
<artifactId>seasonal</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.custom</groupId>
|
||||
<artifactId>oneplus-bot-customizations</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import dev.sheldan.oneplus.bot.custom.moderation.config.ModerationCustomFeatureD
|
||||
import dev.sheldan.oneplus.bot.custom.moderation.config.ModerationCustomPostTarget;
|
||||
import dev.sheldan.oneplus.bot.custom.moderation.model.template.WarningThresholdNotificationModel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.GuildMessageChannel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -71,7 +71,7 @@ public class WarningAddedListener implements WarningCreatedListener {
|
||||
|
||||
Long channelId = model.getWarningChannelId();
|
||||
Long warnedUserId = model.getWarnedUserId();
|
||||
TextChannel channel = channelService.getTextChannelFromServer(serverId, channelId);
|
||||
GuildMessageChannel channel = channelService.getMessageChannelFromServer(serverId, channelId);
|
||||
WarningThresholdNotificationModel notificationModel = WarningThresholdNotificationModel
|
||||
.builder()
|
||||
.channelDisplay(ChannelDisplay.fromChannel(channel))
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ 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.models.command.faq.FAQResponseModel;
|
||||
import dev.sheldan.oneplus.bot.modules.faq.service.FAQResponseServiceBean;
|
||||
import net.dv8tion.jda.api.entities.GuildMessageChannel;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -50,7 +51,7 @@ public class FAQ extends AbstractConditionableCommand {
|
||||
String commandName;
|
||||
if(!parameters.isEmpty()) {
|
||||
commandName = (String) parameters.get(0);
|
||||
TextChannel channel;
|
||||
GuildMessageChannel channel;
|
||||
if (parameters.size() == 2) {
|
||||
channel = (TextChannel) parameters.get(1);
|
||||
} else {
|
||||
|
||||
@@ -22,10 +22,7 @@ import dev.sheldan.oneplus.bot.modules.faq.service.management.FAQChannelGroupCom
|
||||
import dev.sheldan.oneplus.bot.modules.faq.service.management.FAQCommandAliasManagementService;
|
||||
import dev.sheldan.oneplus.bot.modules.faq.service.management.FAQCommandManagementServiceBean;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dv8tion.jda.api.entities.ISnowflake;
|
||||
import net.dv8tion.jda.api.entities.SelfUser;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.api.entities.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -67,7 +64,7 @@ public class FAQResponseServiceBean {
|
||||
@Autowired
|
||||
private FAQResponseServiceBean self;
|
||||
|
||||
public CompletableFuture<FAQResponseModel> loadFAQResponse(String commandName, TextChannel textChannel) {
|
||||
public CompletableFuture<FAQResponseModel> loadFAQResponse(String commandName, GuildMessageChannel textChannel) {
|
||||
AServer server = serverManagementService.loadServer(textChannel.getGuild().getIdLong());
|
||||
Optional<FAQCommand> faqCommandOptional = faqCommandManagementServiceBean.findByNameAndServer(commandName, server);
|
||||
if(!faqCommandOptional.isPresent()) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
|
||||
<artifactId>oneplus-bot-modules</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -14,6 +14,13 @@
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.abstracto.scheduling</groupId>
|
||||
<artifactId>scheduling-int</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
||||
@@ -11,8 +11,8 @@ import dev.sheldan.oneplus.bot.modules.news.model.NewsMessageModel;
|
||||
import dev.sheldan.oneplus.bot.modules.news.model.database.NewsPost;
|
||||
import dev.sheldan.oneplus.bot.modules.news.service.management.NewsPostManagementServiceBean;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dv8tion.jda.api.entities.GuildMessageChannel;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -113,7 +113,7 @@ public class NewsServiceBean {
|
||||
log.info("Updating news post {} with new content based on message from user {} in server {}.",
|
||||
newsPost.getSourceMessageId(), updatedMessage.getIdLong(), updatedMessage.getGuild().getId());
|
||||
MessageToSend messageToSend = templateService.renderEmbedTemplate(MESSAGE_TEMPLATE_KEY, model, serverId);
|
||||
TextChannel newsChannel = channelService.getTextChannelFromServer(serverId, newsPost.getNewsChannel().getId());
|
||||
GuildMessageChannel newsChannel = channelService.getMessageChannelFromServer(serverId, newsPost.getNewsChannel().getId());
|
||||
return channelService.editMessageInAChannelFuture(messageToSend, newsChannel, newsPost.getNewsMessageId())
|
||||
.thenApply(message -> null);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<module>setup</module>
|
||||
<module>referral</module>
|
||||
<module>faq</module>
|
||||
<module>seasonal</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
|
||||
<artifactId>oneplus-bot-modules</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
39
application/oneplus-bot-modules/seasonal/pom.xml
Normal file
39
application/oneplus-bot-modules/seasonal/pom.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
|
||||
<artifactId>oneplus-bot-modules</artifactId>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>seasonal</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/liquibase.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,18 @@
|
||||
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
|
||||
<id>liquibase</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<outputDirectory>.</outputDirectory>
|
||||
<directory>${project.basedir}/src/main/resources/migrations</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -0,0 +1,24 @@
|
||||
package dev.sheldan.oneplus.bot.modules.seasonal.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.config.ModuleDefinition;
|
||||
import dev.sheldan.abstracto.core.command.config.ModuleInfo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class SeasonalEntertainmentFeatureDefinition implements ModuleDefinition {
|
||||
public static final String ENTERTAINMENT = "entertainment";
|
||||
|
||||
@Override
|
||||
public ModuleInfo getInfo() {
|
||||
return ModuleInfo
|
||||
.builder()
|
||||
.name(ENTERTAINMENT)
|
||||
.templated(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getParentModule() {
|
||||
return "default";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package dev.sheldan.oneplus.bot.modules.seasonal.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum SeasonalFeatureDefinition implements FeatureDefinition {
|
||||
LIGHTS("lights");
|
||||
|
||||
private String key;
|
||||
|
||||
SeasonalFeatureDefinition(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package dev.sheldan.oneplus.bot.modules.seasonal.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
|
||||
@Configuration
|
||||
@PropertySource("classpath:seasonal.properties")
|
||||
public class SeasonalProperties {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package dev.sheldan.oneplus.bot.modules.seasonal.lights.command;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
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.exception.EntityGuildMismatchException;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.config.SeasonalEntertainmentFeatureDefinition;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.config.SeasonalFeatureDefinition;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.lights.service.LightsRoleServiceBean;
|
||||
import net.dv8tion.jda.api.entities.Role;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class AddRoleToLights extends AbstractConditionableCommand {
|
||||
|
||||
@Autowired
|
||||
private LightsRoleServiceBean lightsMemberServiceBean;
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
Role role = (Role) parameters.get(0);
|
||||
if(!role.getGuild().equals(commandContext.getGuild())) {
|
||||
throw new EntityGuildMismatchException();
|
||||
}
|
||||
lightsMemberServiceBean.addMemberToSeasonalLights(role);
|
||||
return CommandResult.fromSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandConfiguration getConfiguration() {
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(Parameter.builder().name("role").templated(true).type(Role.class).build());
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("addRoleToLights")
|
||||
.module(SeasonalEntertainmentFeatureDefinition.ENTERTAINMENT)
|
||||
.templated(true)
|
||||
.supportsEmbedException(true)
|
||||
.causesReaction(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
return SeasonalFeatureDefinition.LIGHTS;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package dev.sheldan.oneplus.bot.modules.seasonal.lights.command;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
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.exception.EntityGuildMismatchException;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.config.SeasonalEntertainmentFeatureDefinition;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.config.SeasonalFeatureDefinition;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.lights.service.LightsRoleServiceBean;
|
||||
import net.dv8tion.jda.api.entities.Role;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class RemoveRoleFromLights extends AbstractConditionableCommand {
|
||||
|
||||
@Autowired
|
||||
private LightsRoleServiceBean lightsMemberServiceBean;
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandContext commandContext) {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
Role role = (Role) parameters.get(0);
|
||||
if(!role.getGuild().equals(commandContext.getGuild())) {
|
||||
throw new EntityGuildMismatchException();
|
||||
}
|
||||
lightsMemberServiceBean.removeMemberFromSeasonalLights(role);
|
||||
return CommandResult.fromSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandConfiguration getConfiguration() {
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(Parameter.builder().name("role").templated(true).type(Role.class).build());
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("removeRoleFromLights")
|
||||
.module(SeasonalEntertainmentFeatureDefinition.ENTERTAINMENT)
|
||||
.templated(true)
|
||||
.supportsEmbedException(true)
|
||||
.causesReaction(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
return SeasonalFeatureDefinition.LIGHTS;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package dev.sheldan.oneplus.bot.modules.seasonal.lights.command;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
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.oneplus.bot.modules.seasonal.config.SeasonalEntertainmentFeatureDefinition;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.config.SeasonalFeatureDefinition;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.lights.service.LightsRoleServiceBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@Component
|
||||
public class SwitchLights extends AbstractConditionableCommand {
|
||||
|
||||
@Autowired
|
||||
private LightsRoleServiceBean lightsMemberServiceBean;
|
||||
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
return lightsMemberServiceBean.switchLights(commandContext.getGuild())
|
||||
.thenApply(unused -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandConfiguration getConfiguration() {
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
HelpInfo helpInfo = HelpInfo
|
||||
.builder()
|
||||
.templated(true)
|
||||
.build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("switchLights")
|
||||
.module(SeasonalEntertainmentFeatureDefinition.ENTERTAINMENT)
|
||||
.templated(true)
|
||||
.async(true)
|
||||
.causesReaction(true)
|
||||
.supportsEmbedException(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
return SeasonalFeatureDefinition.LIGHTS;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package dev.sheldan.oneplus.bot.modules.seasonal.lights.config;
|
||||
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.lights.models.LightsRoleColor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "abstracto.feature.lights")
|
||||
public class LightsColorConfig {
|
||||
private List<LightsRoleColor> colors;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package dev.sheldan.oneplus.bot.modules.seasonal.lights.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureConfig;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.config.SeasonalFeatureDefinition;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class LightsFeatureConfig implements FeatureConfig {
|
||||
|
||||
@Override
|
||||
public FeatureDefinition getFeature() {
|
||||
return SeasonalFeatureDefinition.LIGHTS;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package dev.sheldan.oneplus.bot.modules.seasonal.lights.models;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class LightsRoleColor {
|
||||
private Integer r;
|
||||
private Integer g;
|
||||
private Integer b;
|
||||
|
||||
public Color toColor() {
|
||||
return new Color(r, g, b);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package dev.sheldan.oneplus.bot.modules.seasonal.lights.models.database;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.database.ARole;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import lombok.*;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Builder
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "lights_role")
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode
|
||||
public class LightsRole {
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
private Long id;
|
||||
|
||||
@Getter
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "server_id", nullable = false)
|
||||
private AServer server;
|
||||
|
||||
@Getter
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@PrimaryKeyJoinColumn
|
||||
private ARole role;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package dev.sheldan.oneplus.bot.modules.seasonal.lights.repository;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.lights.models.database.LightsRole;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface LightsRoleRepository extends JpaRepository<LightsRole, Long> {
|
||||
List<LightsRole> findByServer(AServer server);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package dev.sheldan.oneplus.bot.modules.seasonal.lights.service;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.database.ARole;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.service.RoleService;
|
||||
import dev.sheldan.abstracto.core.service.management.RoleManagementService;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import dev.sheldan.abstracto.core.utils.FutureUtils;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.lights.config.LightsColorConfig;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.lights.models.database.LightsRole;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.lights.service.management.LightsRoleServiceManagementBean;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Role;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.awt.*;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class LightsRoleServiceBean {
|
||||
|
||||
@Autowired
|
||||
private ServerManagementService serverManagementService;
|
||||
|
||||
@Autowired
|
||||
private LightsRoleServiceManagementBean serviceManagementBean;
|
||||
|
||||
@Autowired
|
||||
private RoleManagementService roleManagementService;
|
||||
|
||||
@Autowired
|
||||
private RoleService roleService;
|
||||
|
||||
@Autowired
|
||||
private SecureRandom secureRandom;
|
||||
|
||||
@Autowired
|
||||
private LightsColorConfig lightsColorConfig;
|
||||
|
||||
public void addMemberToSeasonalLights(Role role) {
|
||||
ARole aRole = roleManagementService.findRole(role.getIdLong());
|
||||
log.info("Adding {} to lights for guild {}.", role.getId(), role.getGuild().getId());
|
||||
serviceManagementBean.addMemberToLights(aRole);
|
||||
}
|
||||
|
||||
public void removeMemberFromSeasonalLights(Role role) {
|
||||
ARole aRole = roleManagementService.findRole(role.getIdLong());
|
||||
log.info("Removing {} from lights for guild {}.", role.getId(), role.getGuild().getId());
|
||||
serviceManagementBean.removeMemberFromLights(aRole);
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> switchLights(Guild guild) {
|
||||
log.info("Switching lights in guild {}", guild.getIdLong());
|
||||
AServer server = serverManagementService.loadServer(guild.getIdLong());
|
||||
List<LightsRole> lightUsers = serviceManagementBean.getLightsUserInServer(server);
|
||||
List<Long> roleIds = lightUsers
|
||||
.stream()
|
||||
.map(lightsMember -> lightsMember.getRole().getId())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<CompletableFuture<Void>> futures = new ArrayList<>();
|
||||
roleIds.forEach(roleId -> {
|
||||
Role foundRole = guild.getRoleById(roleId);
|
||||
if(foundRole != null) {
|
||||
futures.add(roleService.setRoleColorTo(foundRole, getRandomColor()));
|
||||
}
|
||||
});
|
||||
return FutureUtils.toSingleFutureGeneric(futures);
|
||||
}
|
||||
|
||||
private Color getRandomColor() {
|
||||
return lightsColorConfig.getColors().get(secureRandom.nextInt(lightsColorConfig.getColors().size())).toColor();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package dev.sheldan.oneplus.bot.modules.seasonal.lights.service.management;
|
||||
|
||||
import dev.sheldan.abstracto.core.models.database.ARole;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.lights.models.database.LightsRole;
|
||||
import dev.sheldan.oneplus.bot.modules.seasonal.lights.repository.LightsRoleRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class LightsRoleServiceManagementBean {
|
||||
|
||||
@Autowired
|
||||
private LightsRoleRepository lightMemberRepository;
|
||||
|
||||
public void addMemberToLights(ARole aRole) {
|
||||
if(!lightMemberRepository.existsById(aRole.getId())) {
|
||||
LightsRole member = LightsRole
|
||||
.builder()
|
||||
.id(aRole.getId())
|
||||
.server(aRole.getServer())
|
||||
.role(aRole)
|
||||
.build();
|
||||
lightMemberRepository.save(member);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeMemberFromLights(ARole aRole) {
|
||||
lightMemberRepository.deleteById(aRole.getId());
|
||||
}
|
||||
|
||||
public List<LightsRole> getLightsUserInServer(AServer server) {
|
||||
return lightMemberRepository.findByServer(server);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
<include file="tables/tables.xml" relativeToChangelogFile="true"/>
|
||||
<include file="seedData/data.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
<property name="lightsFeature" value="(SELECT id FROM feature WHERE key = 'lights')"/>
|
||||
<property name="entertainmentModule" value="(SELECT id FROM module WHERE name = 'entertainment')"/>
|
||||
<changeSet author="Sheldan" id="lights-commands" >
|
||||
<insert tableName="command">
|
||||
<column name="name" value="addRoleToLights"/>
|
||||
<column name="module_id" valueComputed="${entertainmentModule}"/>
|
||||
<column name="feature_id" valueComputed="${lightsFeature}"/>
|
||||
</insert>
|
||||
<insert tableName="command">
|
||||
<column name="name" value="removeRoleFromLights"/>
|
||||
<column name="module_id" valueComputed="${entertainmentModule}"/>
|
||||
<column name="feature_id" valueComputed="${lightsFeature}"/>
|
||||
</insert>
|
||||
<insert tableName="command">
|
||||
<column name="name" value="switchLights"/>
|
||||
<column name="module_id" valueComputed="${entertainmentModule}"/>
|
||||
<column name="feature_id" valueComputed="${lightsFeature}"/>
|
||||
</insert>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
<include file="feature.xml" relativeToChangelogFile="true"/>
|
||||
<include file="command.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
<changeSet author="Sheldan" id="seasonal_lights_feature-insertion">
|
||||
<insert tableName="feature">
|
||||
<column name="key" value="lights"/>
|
||||
</insert>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
|
||||
<changeSet author="Sheldan" id="lights_role-table">
|
||||
<createTable tableName="lights_role">
|
||||
<column name="id" type="BIGINT">
|
||||
<constraints nullable="true" primaryKey="true" primaryKeyName="pk_lights_role"/>
|
||||
</column>
|
||||
<column name="server_id" type="BIGINT">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="role_id" type="BIGINT">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="created" type="TIMESTAMP WITHOUT TIME ZONE">
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
<column name="updated" type="TIMESTAMP WITHOUT TIME ZONE"/>
|
||||
</createTable>
|
||||
<addForeignKeyConstraint baseColumnNames="server_id" baseTableName="lights_role" constraintName="fk_lights_role_server"
|
||||
deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION"
|
||||
referencedColumnNames="id" referencedTableName="server" validate="true"/>
|
||||
<addForeignKeyConstraint baseColumnNames="id" baseTableName="lights_role" constraintName="fk_lights_role_role"
|
||||
deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION"
|
||||
referencedColumnNames="id" referencedTableName="role" validate="true"/>
|
||||
|
||||
|
||||
<sql>
|
||||
DROP TRIGGER IF EXISTS lights_role_update_trigger ON lights_role;
|
||||
CREATE TRIGGER lights_role_update_trigger BEFORE UPDATE ON lights_role FOR EACH ROW EXECUTE PROCEDURE update_trigger_procedure();
|
||||
</sql>
|
||||
<sql>
|
||||
DROP TRIGGER IF EXISTS lights_role_insert_trigger ON lights_role;
|
||||
CREATE TRIGGER lights_role_insert_trigger BEFORE INSERT ON lights_role FOR EACH ROW EXECUTE PROCEDURE insert_trigger_procedure();
|
||||
</sql>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
<include file="lights_role.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
|
||||
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
|
||||
<include file="1.5.9/collection.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
@@ -0,0 +1,30 @@
|
||||
abstracto.featureFlags.lights.featureName=lights
|
||||
abstracto.featureFlags.lights.enabled=false
|
||||
|
||||
abstracto.feature.lights.colors[0].r=12
|
||||
abstracto.feature.lights.colors[0].g=169
|
||||
abstracto.feature.lights.colors[0].b=12
|
||||
|
||||
abstracto.feature.lights.colors[1].r=206
|
||||
abstracto.feature.lights.colors[1].g=13
|
||||
abstracto.feature.lights.colors[1].b=13
|
||||
|
||||
abstracto.feature.lights.colors[2].r=255
|
||||
abstracto.feature.lights.colors[2].g=255
|
||||
abstracto.feature.lights.colors[2].b=255
|
||||
|
||||
abstracto.feature.lights.colors[3].r=148
|
||||
abstracto.feature.lights.colors[3].g=125
|
||||
abstracto.feature.lights.colors[3].b=0
|
||||
|
||||
abstracto.feature.lights.colors[4].r=77
|
||||
abstracto.feature.lights.colors[4].g=106
|
||||
abstracto.feature.lights.colors[4].b=255
|
||||
|
||||
abstracto.feature.lights.colors[5].r=166
|
||||
abstracto.feature.lights.colors[5].g=51
|
||||
abstracto.feature.lights.colors[5].b=222
|
||||
|
||||
abstracto.feature.lights.colors[6].r=246
|
||||
abstracto.feature.lights.colors[6].g=232
|
||||
abstracto.feature.lights.colors[6].b=63
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>oneplus-bot-modules</artifactId>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot</groupId>
|
||||
<artifactId>oneplusbot</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>dev.sheldan.oneplus.bot.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
<modules>
|
||||
<module>executable</module>
|
||||
<module>oneplus-bot-customizations</module>
|
||||
@@ -38,15 +38,7 @@
|
||||
<artifactId>core-int</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>utility-int</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>dev.sheldan.abstracto.scheduling</groupId>
|
||||
<artifactId>scheduling-int</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.deployment</groupId>
|
||||
<artifactId>deployment</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -29,4 +29,4 @@ PGADMIN_DEFAULT_EMAIL=sheldan@sheldan.dev
|
||||
PGADMIN_DEFAULT_PASSWORD=admin
|
||||
TOKEN=<INSERT TOKEN>
|
||||
YOUTUBE_API_KEY=<INSERT KEY>
|
||||
ONEPLUS_BOT_VERSION=1.5.8
|
||||
ONEPLUS_BOT_VERSION=1.6.0
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.deployment</groupId>
|
||||
<artifactId>deployment</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -372,16 +372,6 @@
|
||||
<destFileName>starboard.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.translations</groupId>
|
||||
<artifactId>utility</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<destFileName>utility.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.translations</groupId>
|
||||
<artifactId>webservices</artifactId>
|
||||
@@ -513,6 +503,16 @@
|
||||
<destFileName>referral.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.translations.modules</groupId>
|
||||
<artifactId>seasonal-translations</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<destFileName>seasonal.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.translations.modules</groupId>
|
||||
<artifactId>faq-translations</artifactId>
|
||||
@@ -590,17 +590,6 @@
|
||||
<destFileName>dynamic-activity.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>utility-impl</artifactId>
|
||||
<version>${abstracto.version}</version>
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>utility.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>modmail-impl</artifactId>
|
||||
@@ -834,6 +823,17 @@
|
||||
<destFileName>faq.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.modules</groupId>
|
||||
<artifactId>seasonal</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>seasonal.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.oneplus.bot.application</groupId>
|
||||
<artifactId>database</artifactId>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"voice-channel-context", "anti-raid",
|
||||
"starboard-custom", "dynamic-activity-custom-translations", "moderation-custom",
|
||||
"overrides-translation-moderation",
|
||||
"news", "setup", "referral", "faq"],
|
||||
"news", "setup", "referral", "faq", "seasonal"],
|
||||
"liquibase_artifacts": [
|
||||
{ "zip": "scheduling", "file": "scheduling-changeLog.xml" },
|
||||
{ "zip": "core", "file": "core-changeLog.xml" },
|
||||
@@ -40,7 +40,8 @@
|
||||
{ "zip": "moderation-custom", "file": "moderation-custom-changeLog.xml"},
|
||||
{ "zip": "dynamic-activity-custom", "file": "dynamicActivity-custom-changeLog.xml"},
|
||||
{ "zip": "news", "file": "news-changeLog.xml"},
|
||||
{ "zip": "faq", "file": "faq-changeLog.xml"}
|
||||
{ "zip": "faq", "file": "faq-changeLog.xml"},
|
||||
{ "zip": "seasonal", "file": "seasonal-changeLog.xml"}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
29
deployment/infrastructure/terraform/.gitignore
vendored
Normal file
29
deployment/infrastructure/terraform/.gitignore
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# Local .terraform directories
|
||||
**/.terraform/*
|
||||
|
||||
# .tfstate files
|
||||
*.tfstate
|
||||
*.tfstate.*
|
||||
|
||||
# Crash log files
|
||||
crash.log
|
||||
|
||||
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
|
||||
# .tfvars files are managed as part of configuration and so should be included in
|
||||
# version control.
|
||||
#
|
||||
# example.tfvars
|
||||
|
||||
# Ignore override files as they are usually used to override resources locally and so
|
||||
# are not checked in
|
||||
override.tf
|
||||
override.tf.json
|
||||
*_override.tf
|
||||
*_override.tf.json
|
||||
|
||||
# Include override files you do wish to add to version control using negated pattern
|
||||
#
|
||||
# !example_override.tf
|
||||
|
||||
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
|
||||
# example: *tfplan*
|
||||
23
deployment/infrastructure/terraform/.terraform.lock.hcl
generated
Normal file
23
deployment/infrastructure/terraform/.terraform.lock.hcl
generated
Normal file
@@ -0,0 +1,23 @@
|
||||
# This file is maintained automatically by "terraform init".
|
||||
# Manual edits may be lost in future updates.
|
||||
|
||||
provider "registry.terraform.io/hetznercloud/hcloud" {
|
||||
version = "1.34.3"
|
||||
hashes = [
|
||||
"h1:ZAFEiotL15xHI957CrTJEm3z83/lFMQdNWiMqN7Dyu4=",
|
||||
"zh:08e4aea3c4e895d941c24d76f373977e5fae112c531b56cb2fcdaa8b5086ebec",
|
||||
"zh:09f1255aad8f790c86a14522c7fff2fcb6529bb18f1e49a7423ca79db07f5a47",
|
||||
"zh:0b2bcab12aa913adaf89228a250eb41e827c64723a741f2b74b318833f77c9df",
|
||||
"zh:0c6947f73dc5779b2425e231b22643741b1877705fb4135df06f7a201f10d094",
|
||||
"zh:26513bdefecae83411997a5c4e11dffd886b4594cb8663f4b0c36a064b1a650e",
|
||||
"zh:42790576142fb7d0ce851923f58a642e7e4c9e6df9a02b531703131d836daade",
|
||||
"zh:5095ea6c8b31dfebd52a03f9ba4e2a8a7ecb0c0442f68c98cab76b677c343e81",
|
||||
"zh:6b80223b2831f9f2adf72c7ed37692cef67c8f43de62c405c7162bf524896bc3",
|
||||
"zh:6b90164e839ad0977b3feb4dbec153ab76a4f7ee8451ee2d202992ff5a4157b1",
|
||||
"zh:72d88705afb9d0a9d90a5ad342c605cb119b678e76f45c5e4c516da5d591f907",
|
||||
"zh:881889a9e974a15c616cd7648f1c415a4fb3e9a08c166bcb17e488bfcbb67985",
|
||||
"zh:967286f7ef73bb15c2412b9ae8853d1176a039374c5ea39cbfd75e7ebe13bcfd",
|
||||
"zh:967a6cc506a019c1720f0207068097a06eb006e940ecc63060373b4b4b6181cc",
|
||||
"zh:a68e5e2e2f03656e427045e32ca999422e00be299fc6ecedbd41bef48871b7c5",
|
||||
]
|
||||
}
|
||||
10
deployment/infrastructure/terraform/cloud.tf
Normal file
10
deployment/infrastructure/terraform/cloud.tf
Normal file
@@ -0,0 +1,10 @@
|
||||
terraform {
|
||||
cloud {
|
||||
hostname = "app.terraform.io"
|
||||
organization = "OnePlusBot"
|
||||
|
||||
workspaces {
|
||||
name = "main"
|
||||
}
|
||||
}
|
||||
}
|
||||
7
deployment/infrastructure/terraform/main.tf
Normal file
7
deployment/infrastructure/terraform/main.tf
Normal file
@@ -0,0 +1,7 @@
|
||||
module "hetzner" {
|
||||
source = "git@github.com:Sheldan/discord-bot-terraform-module.git//hetzner-bot?ref=v1.0.1"
|
||||
ssh_key_key = "Sheldan"
|
||||
project_name = "OnePlusBot"
|
||||
user_name = "sheldan"
|
||||
hcloud_token = var.hcloud_token
|
||||
}
|
||||
4
deployment/infrastructure/terraform/output.tf
Normal file
4
deployment/infrastructure/terraform/output.tf
Normal file
@@ -0,0 +1,4 @@
|
||||
output "instance_ipv4" {
|
||||
description = "IPv4 address of the instance"
|
||||
value = module.hetzner.instance_ipv4
|
||||
}
|
||||
3
deployment/infrastructure/terraform/variables.tf
Normal file
3
deployment/infrastructure/terraform/variables.tf
Normal file
@@ -0,0 +1,3 @@
|
||||
variable "hcloud_token" {
|
||||
type = string
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>oneplusbot</artifactId>
|
||||
<groupId>dev.sheldan.oneplus.bot</groupId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
8
pom.xml
8
pom.xml
@@ -12,15 +12,15 @@
|
||||
|
||||
<groupId>dev.sheldan.oneplus.bot</groupId>
|
||||
<artifactId>oneplusbot</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<!-- edit in release.yml as well -->
|
||||
<!-- when releasing a new opbot version, update the .env as well-->
|
||||
<abstracto.version>1.3.9</abstracto.version>
|
||||
<abstracto.templates.version>1.2.21</abstracto.templates.version>
|
||||
<abstracto.version>1.4.2</abstracto.version>
|
||||
<abstracto.templates.version>1.4.2</abstracto.templates.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
@@ -56,7 +56,7 @@
|
||||
<scm>
|
||||
<url>https://maven.pkg.github.com/Sheldan/OnePlusBot</url>
|
||||
<developerConnection>scm:git:git@github.com:Sheldan/OnePlusBot.git</developerConnection>
|
||||
<tag>oneplusbot-1.5.8</tag>
|
||||
<tag>oneplusbot-1.6.0</tag>
|
||||
</scm>
|
||||
|
||||
</project>
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.customizations</groupId>
|
||||
<artifactId>customization-templates</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
{
|
||||
"title": {
|
||||
"title": "<@safe_include "warning_threshold_reached_notification_title"/>"
|
||||
},
|
||||
<#include "abstracto_color">,
|
||||
<#assign warnedMemberMention=memberDisplay.memberMention>
|
||||
<#assign warnedUserId=memberDisplay.userId>
|
||||
<#assign memberMention=memberDisplay.memberMention>
|
||||
<#assign warnCount=warnCount>
|
||||
<#assign channelDisplay=channelDisplay>
|
||||
<#assign messageId=messageId>
|
||||
"description": "<@safe_include "warning_threshold_reached_notification_description"/>"
|
||||
"embeds": [
|
||||
{
|
||||
"title": {
|
||||
"title": "<@safe_include "warning_threshold_reached_notification_title"/>"
|
||||
},
|
||||
<#include "abstracto_color">,
|
||||
<#assign warnedMemberMention=memberDisplay.memberMention>
|
||||
<#assign warnedUserId=memberDisplay.userId>
|
||||
<#assign memberMention=memberDisplay.memberMention>
|
||||
<#assign warnCount=warnCount>
|
||||
<#assign channelDisplay=channelDisplay>
|
||||
<#assign messageId=messageId>
|
||||
"description": "<@safe_include "warning_threshold_reached_notification_description"/>"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates</groupId>
|
||||
<artifactId>oneplus-bot-templates</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -1,41 +1,45 @@
|
||||
{
|
||||
"title": {
|
||||
"title": "<@safe_include "starboard_post_created_title"/>"
|
||||
},
|
||||
<#include "abstracto_color">,
|
||||
"description": "<@safe_include "starboard_post_created_description"/>",
|
||||
"fields": [
|
||||
{
|
||||
"name": "<@safe_include "starboard_post_notification_field_starboard_message"/>",
|
||||
<#if starboardMessage??>
|
||||
"value": "[<@safe_include "starboard_post_notification_field_starboard_message_jump"/>](${starboardMessage.jumpUrl})"
|
||||
<#else>
|
||||
"value": "${post.starboardMessageId?c}"
|
||||
</#if>
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "starboard_post_notification_field_starred_message"/>",
|
||||
<#if starredMessage??>
|
||||
"value": "[<@safe_include "starboard_post_notification_field_starboard_message_jump"/>](${starredMessage.jumpUrl})"
|
||||
<#else>
|
||||
"value": "${post.postMessageId?c}"
|
||||
</#if>
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "starboard_post_notification_field_starred_user"/>",
|
||||
<#if starredMember??>
|
||||
"value": "${starredMember.asMention}"
|
||||
<#else>
|
||||
"value": "${starredUserId?c} (<@safe_include "user_left_server"/>)"
|
||||
</#if>
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "starboard_post_notification_field_starring_user"/>",
|
||||
<#if starringMember??>
|
||||
"value": "${starringMember.asMention}"
|
||||
<#else>
|
||||
"value": "${starringUserId?c} (<@safe_include "user_left_server"/>)"
|
||||
</#if>
|
||||
}
|
||||
]
|
||||
"embeds": [
|
||||
{
|
||||
"title": {
|
||||
"title": "<@safe_include "starboard_post_created_title"/>"
|
||||
},
|
||||
<#include "abstracto_color">,
|
||||
"description": "<@safe_include "starboard_post_created_description"/>",
|
||||
"fields": [
|
||||
{
|
||||
"name": "<@safe_include "starboard_post_notification_field_starboard_message"/>",
|
||||
<#if starboardMessage??>
|
||||
"value": "[<@safe_include "starboard_post_notification_field_starboard_message_jump"/>](${starboardMessage.jumpUrl})"
|
||||
<#else>
|
||||
"value": "${post.starboardMessageId?c}"
|
||||
</#if>
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "starboard_post_notification_field_starred_message"/>",
|
||||
<#if starredMessage??>
|
||||
"value": "[<@safe_include "starboard_post_notification_field_starboard_message_jump"/>](${starredMessage.jumpUrl})"
|
||||
<#else>
|
||||
"value": "${post.postMessageId?c}"
|
||||
</#if>
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "starboard_post_notification_field_starred_user"/>",
|
||||
<#if starredMember??>
|
||||
"value": "${starredMember.asMention}"
|
||||
<#else>
|
||||
"value": "${starredUserId?c} (<@safe_include "user_left_server"/>)"
|
||||
</#if>
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "starboard_post_notification_field_starring_user"/>",
|
||||
<#if starringMember??>
|
||||
"value": "${starringMember.asMention}"
|
||||
<#else>
|
||||
"value": "${starringUserId?c} (<@safe_include "user_left_server"/>)"
|
||||
</#if>
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,33 +1,37 @@
|
||||
{
|
||||
"title": {
|
||||
"title": "<@safe_include "starboard_post_deleted_title"/>"
|
||||
},
|
||||
<#include "abstracto_color">,
|
||||
"description": "<@safe_include "starboard_post_deleted_description"/>",
|
||||
"fields": [
|
||||
{
|
||||
"name": "<@safe_include "starboard_post_notification_field_starred_message"/>",
|
||||
<#if starredMessage??>
|
||||
"value": "[<@safe_include "starboard_post_notification_field_starboard_message_jump"/>](${starredMessage.jumpUrl})"
|
||||
<#else>
|
||||
"value": "${starredMessageSimple.jumpUrl}"
|
||||
</#if>
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "starboard_post_notification_field_starred_user"/>",
|
||||
<#if starredMember??>
|
||||
"value": "${starredMember.asMention}"
|
||||
<#else>
|
||||
"value": "${starredUserId?c} (<@safe_include "user_left_server"/>)"
|
||||
</#if>
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "starboard_post_notification_field_starring_user"/>",
|
||||
<#if starringMember??>
|
||||
"value": "${starringMember.asMention}"
|
||||
<#else>
|
||||
"value": "${starringUserId?c} (<@safe_include "user_left_server"/>)"
|
||||
</#if>
|
||||
}
|
||||
]
|
||||
"embeds": [
|
||||
{
|
||||
"title": {
|
||||
"title": "<@safe_include "starboard_post_deleted_title"/>"
|
||||
},
|
||||
<#include "abstracto_color">,
|
||||
"description": "<@safe_include "starboard_post_deleted_description"/>",
|
||||
"fields": [
|
||||
{
|
||||
"name": "<@safe_include "starboard_post_notification_field_starred_message"/>",
|
||||
<#if starredMessage??>
|
||||
"value": "[<@safe_include "starboard_post_notification_field_starboard_message_jump"/>](${starredMessage.jumpUrl})"
|
||||
<#else>
|
||||
"value": "${starredMessageSimple.jumpUrl}"
|
||||
</#if>
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "starboard_post_notification_field_starred_user"/>",
|
||||
<#if starredMember??>
|
||||
"value": "${starredMember.asMention}"
|
||||
<#else>
|
||||
"value": "${starredUserId?c} (<@safe_include "user_left_server"/>)"
|
||||
</#if>
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "starboard_post_notification_field_starring_user"/>",
|
||||
<#if starringMember??>
|
||||
"value": "${starringMember.asMention}"
|
||||
<#else>
|
||||
"value": "${starringUserId?c} (<@safe_include "user_left_server"/>)"
|
||||
</#if>
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.modules</groupId>
|
||||
<artifactId>oneplus-bot-module-templates</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
<#include "abstracto_color">,
|
||||
"description": "
|
||||
"embeds": [
|
||||
{
|
||||
<#include "abstracto_color">,
|
||||
"description": "
|
||||
<#list uses as usage>
|
||||
<#assign usage=usage>
|
||||
<#assign commandName=usage.faqCommandName><@safe_include "FAQUsage_command_display"/>:
|
||||
@@ -11,4 +13,6 @@
|
||||
<@safe_include "FAQUsage_usage_display"/><#sep>, </#list>
|
||||
<#else>
|
||||
<@safe_include "FAQUsage_no_usages"/></#list>"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,20 +2,24 @@
|
||||
<#if additionalMessage??>
|
||||
"additionalMessage": "${additionalMessage?json_string}"
|
||||
</#if>
|
||||
<#if description?? || imageURL??>
|
||||
<#include "user_author">
|
||||
<#if additionalMessage??>,</#if>
|
||||
<@user_author user=author/>
|
||||
<#if description??>
|
||||
,"description": "${description?json_string}"
|
||||
</#if>
|
||||
,"color" : {
|
||||
"r": "${red}",
|
||||
"g": "${green}",
|
||||
"b": "${blue}"
|
||||
}
|
||||
<#if imageURL??>
|
||||
,"imageUrl": "${imageURL}"
|
||||
</#if>
|
||||
</#if>
|
||||
"embeds": [
|
||||
{
|
||||
<#if description?? || imageURL??>
|
||||
<#include "user_author">
|
||||
<#if additionalMessage??>,</#if>
|
||||
<@user_author user=author/>
|
||||
<#if description??>
|
||||
,"description": "${description?json_string}"
|
||||
</#if>
|
||||
,"color" : {
|
||||
"r": "${red}",
|
||||
"g": "${green}",
|
||||
"b": "${blue}"
|
||||
}
|
||||
<#if imageURL??>
|
||||
,"imageUrl": "${imageURL}"
|
||||
</#if>
|
||||
</#if>
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
{
|
||||
<#include "abstracto_color">,
|
||||
"description": "
|
||||
<@safe_include "listFAQCommands_command_header"/>
|
||||
"embeds": [
|
||||
{
|
||||
<#include "abstracto_color">,
|
||||
"description": "
|
||||
<@safe_include "listFAQCommands_command_header"/>
|
||||
|
||||
<#list commands as command>
|
||||
<#assign command=command>
|
||||
@@ -17,4 +19,6 @@
|
||||
|
||||
<#else>
|
||||
<@safe_include "listFAQCommands_no_commands"/></#list>"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.modules</groupId>
|
||||
<artifactId>oneplus-bot-module-templates</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
{
|
||||
<#assign roleMention="<@&479202891358535681>"/>
|
||||
<#assign authorMention>${author.user.name}#${author.user.discriminator}</#assign>
|
||||
"additionalMessage": "<@safe_include "news_post_description"/>",
|
||||
<#if message.attachments?size gt 0>
|
||||
"imageUrl": "${message.attachments[0].proxyUrl}",
|
||||
</#if>
|
||||
"metaConfig": {
|
||||
"allowsRoleMention": true,
|
||||
"preventEmptyEmbed": true
|
||||
}
|
||||
"additionalMessage": "<@safe_include "news_post_description"/>",
|
||||
"embeds": [
|
||||
{
|
||||
<#if message.attachments?size gt 0>
|
||||
"imageUrl": "${message.attachments[0].proxyUrl}",
|
||||
</#if>
|
||||
"metaConfig": {
|
||||
"preventEmptyEmbed": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"messageConfig": {
|
||||
"allowsRoleMention": true
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates</groupId>
|
||||
<artifactId>oneplus-bot-templates</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
{
|
||||
<#include "abstracto_color">,
|
||||
<#include "member_author">
|
||||
<#assign member=postingMember>
|
||||
<@member_author member=member/>,
|
||||
<#include "full_member_info">
|
||||
"description": "<@safe_include "referralListener_referral_post_description"/>",
|
||||
"fields": [
|
||||
<#list referrals as referral><#assign referral=referral>
|
||||
{
|
||||
"name": "<@safe_include "referral_link_type_${referral.type.key}"/>",
|
||||
"value": "[${referral.referralIdentifier?json_string}](${referral.referralLink?json_string})"
|
||||
}
|
||||
<#sep>,
|
||||
</#list>
|
||||
]
|
||||
"embeds": [
|
||||
{
|
||||
<#include "abstracto_color">,
|
||||
<#include "member_author">
|
||||
<#assign member=postingMember>
|
||||
<@member_author member=member/>,
|
||||
<#include "full_member_info">
|
||||
"description": "<@safe_include "referralListener_referral_post_description"/>",
|
||||
"fields": [
|
||||
<#list referrals as referral><#assign referral=referral>
|
||||
{
|
||||
"name": "<@safe_include "referral_link_type_${referral.type.key}"/>",
|
||||
"value": "[${referral.referralIdentifier?json_string}](${referral.referralLink?json_string})"
|
||||
}
|
||||
<#sep>,
|
||||
</#list>
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
{
|
||||
<#include "abstracto_color">,
|
||||
"description": "<@safe_include "too_recent_referral_post"/>",
|
||||
"timeStamp": "${nextReferralDate}"
|
||||
"embeds": [
|
||||
{
|
||||
<#include "abstracto_color">,
|
||||
"description": "<@safe_include "too_recent_referral_post"/>",
|
||||
"timeStamp": "${nextReferralDate}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,13 +3,13 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates</groupId>
|
||||
<artifactId>templates</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>oneplus-bot-templates</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
{
|
||||
<#include "abstracto_color">,
|
||||
"fields": [
|
||||
{
|
||||
"name": "<@safe_include "urban_search_command_response_embed_field_title_link"/>",
|
||||
"value": "${definition.url?json_string}",
|
||||
"inline": "true"
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "urban_search_command_response_embed_field_title_example"/>",
|
||||
"value": "${definition.example?json_string}",
|
||||
"valueLengthLimit": 250,
|
||||
"inline": "true"
|
||||
}
|
||||
],
|
||||
"additionalMessage": "${definition.definition?json_string}",
|
||||
"metaConfig": {
|
||||
"messageLimit": 1,
|
||||
"additionalMessageLengthLimit": 250
|
||||
}
|
||||
"additionalMessage": "${definition.definition?json_string}",
|
||||
"embeds": [
|
||||
{
|
||||
<#include "abstracto_color">,
|
||||
"fields": [
|
||||
{
|
||||
"name": "<@safe_include "urban_search_command_response_embed_field_title_link"/>",
|
||||
"value": "${definition.url?json_string}",
|
||||
"inline": "true"
|
||||
},
|
||||
{
|
||||
"name": "<@safe_include "urban_search_command_response_embed_field_title_example"/>",
|
||||
"value": "${definition.example?json_string}",
|
||||
"valueLengthLimit": 250,
|
||||
"inline": "true"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"messageConfig": {
|
||||
"messageLimit": 1,
|
||||
"additionalMessageLengthLimit": 250
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot</groupId>
|
||||
<artifactId>oneplusbot</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<groupId>dev.sheldan.oneplus.bot.templates</groupId>
|
||||
<artifactId>templates</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
The channel in which warn threshold notifications should be sent to. Default: ${defaultValue}
|
||||
The channel in which warn threshold notifications should be sent to. Default: ${currentTarget}
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.translations</groupId>
|
||||
<artifactId>translations</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</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.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.translations.modules</groupId>
|
||||
<artifactId>module-translations</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.translations.modules</groupId>
|
||||
<artifactId>module-translations</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.translations</groupId>
|
||||
<artifactId>translations</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<module>news-translations</module>
|
||||
<module>referral-translations</module>
|
||||
<module>setup-translations</module>
|
||||
<module>seasonal-translations</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.translations.modules</groupId>
|
||||
<artifactId>module-translations</artifactId>
|
||||
<version>1.5.8</version>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.translations.modules</groupId>
|
||||
<artifactId>module-translations</artifactId>
|
||||
<version>1.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>seasonal-translations</artifactId>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<finalName>seasonal-translations-${project.version}</finalName>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,15 @@
|
||||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
|
||||
<id>zip</id>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<outputDirectory>.</outputDirectory>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -0,0 +1 @@
|
||||
Adds a role to the lights mechanism
|
||||
@@ -0,0 +1 @@
|
||||
Adds this role to the mechanism which switches the colors of the defined roles to a random color, when `switchLights` is executed.
|
||||
@@ -0,0 +1 @@
|
||||
The role to add to the lights mechanism
|
||||
@@ -0,0 +1 @@
|
||||
Removes a role from the lights mechanism
|
||||
@@ -0,0 +1 @@
|
||||
Removes this role from the mechanism which switches the colors of the defined roles to a random color, when `switchLights` is executed.
|
||||
@@ -0,0 +1 @@
|
||||
The role to remove
|
||||
@@ -0,0 +1 @@
|
||||
Switches the configured roles to a random color
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user