Skip to content
Draft
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
b21e892
Initial work for ClaireLang
Sidpatchy Apr 30, 2024
0511ca2
Some
Sidpatchy May 6, 2024
34ce769
Probably a bad idea
Sidpatchy May 7, 2024
06707f4
Some 2
Sidpatchy May 7, 2024
20ee529
Bump deps
Sidpatchy Aug 17, 2024
852c87c
Update lang_en-US.yml
Sidpatchy Aug 23, 2024
a0cb074
Merge branch 'main' into ClaireLang
Sidpatchy Sep 27, 2024
ca35404
Progress
Sidpatchy Dec 20, 2024
6d8b803
Make Kotlin use Java 17
Sidpatchy Dec 20, 2024
eaf8650
halp, I no know how read docs
Sidpatchy Dec 21, 2024
a1d7704
IT'S HAPPENING
Sidpatchy Feb 14, 2025
2cb0471
thing
Sidpatchy Feb 16, 2025
b676153
Fix API breakages
Sidpatchy Feb 17, 2025
20d6e8a
will the ci build it now?
Sidpatchy Feb 17, 2025
094ddce
Update lang_TEMPLATE.yml
Sidpatchy Feb 17, 2025
00be347
Misc. cleanup
Sidpatchy Feb 17, 2025
9f79b0d
some more work
Sidpatchy Feb 18, 2025
e4be84d
docs: add code of conduct
Sidpatchy Feb 19, 2025
bd411c4
fix: make ClaireBot build again
Sidpatchy May 1, 2025
b348b04
feat: more progress on clairelang implementation
Sidpatchy May 1, 2025
dd1e74f
fix: remove my attempt at making AI do this
Sidpatchy May 1, 2025
87d1979
feat: more localization work
Sidpatchy May 6, 2025
8a7d1b7
chore: remove message cache code
Sidpatchy Aug 26, 2025
dea19c0
chore: remove old clairelang files
Sidpatchy Aug 26, 2025
9d84071
chore: remove missed message cache code
Sidpatchy Aug 26, 2025
ce4acc0
feat: command embeds fully localized
Sidpatchy Aug 26, 2025
5ce35c3
feat: (mostly) finalize English language file
Sidpatchy Sep 20, 2025
3327fb1
feat: update/fix placeholders
Sidpatchy Sep 20, 2025
10e1f67
feat: finalize(?) localization
Sidpatchy Sep 21, 2025
27fee42
feat: add machine-translated es-ES language file
Sidpatchy Sep 21, 2025
dc478f8
feat: add machine-translated ja-JP language file
Sidpatchy Sep 21, 2025
09c3ca8
chore: update lang_TEMPLATE.yml
Sidpatchy Sep 21, 2025
1faa848
docs: pull docs into main repo from ClaireBot-docs
Sidpatchy Oct 13, 2025
82e0223
docs: pull docs into main repo from ClaireBot-docs
Sidpatchy Oct 13, 2025
5fe50e9
Merge remote-tracking branch 'origin/docs' into docs
Sidpatchy Oct 13, 2025
6a3cbe7
Merge pull request #9 from Sidpatchy/docs
Sidpatchy Oct 13, 2025
820a667
docs: fix openapi.yml path
Sidpatchy Oct 14, 2025
aa87a8f
refactor: target JDK 24, bump deps, & replace SnakeYAML
Sidpatchy Oct 14, 2025
a7ee79d
refactor: move to JDK 25 & replace Kotlin data class with Java record
Sidpatchy Oct 14, 2025
0d90a02
refactor: update build.gradle to remove warnings about gradle 10
Sidpatchy Oct 14, 2025
3243ff6
chore(release): 3.4.0-alpha.1
Sidpatchy Oct 14, 2025
d073097
fix: update robin & log4j2 config
Sidpatchy Oct 14, 2025
2f52b19
chore(release): 3.4.0-alpha.2
Sidpatchy Oct 14, 2025
9e44b97
fix: remove trailing slashes from API endpoints
Sidpatchy Oct 14, 2025
fd6f665
chore(release): 3.4.0-alpha.3
Sidpatchy Oct 14, 2025
694f328
feat: urlbuilder for API classes
Sidpatchy Oct 14, 2025
d80fa28
chore(release): 3.4.0-alpha.4
Sidpatchy Oct 14, 2025
d2cd777
refactor: mark legacy error methods as deprecated
Sidpatchy Oct 15, 2025
1190b71
fix: multiple regressions eliminated
Sidpatchy Oct 15, 2025
929c226
chore(release): 3.4.0-alpha.5
Sidpatchy Oct 15, 2025
b0a8de1
fix: cb.user.id.accentcolour placeholder
Sidpatchy Oct 16, 2025
ed0d2c5
fix: ensure /config updates and displays channel changes correctly
Sidpatchy Oct 16, 2025
44ba9f1
fix: regression where LanguageManager attempts to access lang_und.yml
Sidpatchy Oct 16, 2025
f4d570c
chore(release): 3.4.0-alpha.6
Sidpatchy Oct 16, 2025
33c314f
feat: base64 encode poll and santa IDs to save characters
Sidpatchy Oct 16, 2025
63cde32
refactor: santa embed generation and logic
Sidpatchy Oct 16, 2025
9ced633
fix: voting and translation issues
Sidpatchy Oct 16, 2025
ea4f369
chore(release): 3.4.0-alpha.7
Sidpatchy Oct 16, 2025
a9939a9
refactor: code cleanup
Sidpatchy Oct 16, 2025
1e0457e
refactor: remove deprecated ErrorEmbed methods
Sidpatchy Oct 17, 2025
be70c0a
feat: add workflow for selecting user's preferred language
Sidpatchy Oct 17, 2025
ce7772b
feat: server language selection + enforced guild locale with fallback
Sidpatchy Oct 17, 2025
224ed85
chore(release): 3.4.0-beta.1
Sidpatchy Oct 17, 2025
4da8efe
feat: add en_GB
Sidpatchy Oct 17, 2025
bb0d7fa
fix: file name
Sidpatchy Oct 17, 2025
d447aad
feat: add en_PIRATE
Sidpatchy Oct 17, 2025
2801c1a
feat: add en-CORP
Sidpatchy Oct 17, 2025
8e501e1
fix: remove erroneous " from build.properties
Sidpatchy Apr 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,23 @@ jar {
}

group 'com.sidpatchy'
version '3.3.3'
version '3.4.0-SNAPSHOT'

processResources {
filesMatching('**/build.properties') {
expand(
version: project.version,
buildDate: new Date().format("yyyy-MM-dd HH:mm:ss")
)
}
}

sourceCompatibility = 17
targetCompatibility = 17
kotlin {
jvmToolchain(17)
}

repositories {
mavenLocal()
mavenCentral()
maven { url 'https://m2.dv8tion.net/releases' }
maven { url 'https://jitpack.io' }
Expand All @@ -27,7 +38,7 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.1'

implementation 'com.github.Sidpatchy:Robin:2.0.0'
implementation 'com.github.Sidpatchy:Robin:2.2.4'

implementation 'org.javacord:javacord:3.8.0'

Expand All @@ -40,7 +51,8 @@ dependencies {

implementation 'org.yaml:snakeyaml:2.0'
implementation 'org.json:json:20231013'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.16.1'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.18.0'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.0'

}

Expand Down
134 changes: 134 additions & 0 deletions code_of_conduct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@

# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
`conduct@sidpatchy.com` or `@sidpatchy` on the Discord.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

89 changes: 44 additions & 45 deletions src/main/java/com/sidpatchy/clairebot/API/APIUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class APIUser {
private final String userID;
Expand Down Expand Up @@ -72,72 +72,67 @@ public String getLanguage() {
*
* @return the value of pointsGuildID
*/
public ArrayList<String> getPointsGuildID() {
return (ArrayList<String>) user.getList("pointsGuildID")
.stream()
.map(Object::toString)
.collect(Collectors.toList());
public List<String> getPointsGuildID() {
return user.getList("pointsGuildID", String.class);
}

/**
*
* @return
*/
public ArrayList<Integer> getPointsMessages() {
return (ArrayList<Integer>) user.getList("pointsMessages")
.stream()
.filter(Integer.class::isInstance)
.map(Integer.class::cast)
.collect(Collectors.toList());
public List<Integer> getPointsMessages() {
return user.getList("pointsMessages", Integer.class);
}

public ArrayList<Integer> getPointsVoiceChat() {
return (ArrayList<Integer>) user.getList("pointsVoiceChat")
.stream()
.filter(Integer.class::isInstance)
.map(Integer.class::cast)
.collect(Collectors.toList());
public List<Integer> getPointsVoiceChat() {
return user.getList("pointsVoiceChat", Integer.class);
}

public void createUser(String accentColour,
String language,
ArrayList<String> pointsGuildID,
ArrayList<Integer> pointsMessages,
ArrayList<Integer> pointsVoiceChat) throws IOException {
List<String> pointsGuildID,
List<Integer> pointsMessages,
List<Integer> pointsVoiceChat) throws IOException {
POST post = new POST();
post.postToURL(Main.getApiPath() + "api/v1/user/", userConstructor(accentColour, language, pointsGuildID, pointsMessages, pointsVoiceChat));
}

public void createUserWithDefaults() {
Map<String, Object> defaults = Main.getUserDefaults();
RobinConfiguration.RobinSection defaults = new RobinConfiguration.RobinSection(Main.getUserDefaults());

try {
createUser(
(String) defaults.get("accentColour"),
(String) defaults.get("language"),
(ArrayList<String>) defaults.get("pointsGuildID"),
(ArrayList<Integer>) defaults.get("pointsMessages"),
(ArrayList<Integer>) defaults.get("pointsVoiceChat")
defaults.getString("accentColour"),
defaults.getString("language"),
defaults.getList("pointsGuildID", String.class),
defaults.getList("pointsMessages", Integer.class),
defaults.getList("pointsVoiceChat", Integer.class)
);
}
// top 10 bad ideas #1
catch (Exception ignored) {
ignored.printStackTrace();
Main.getLogger().error("Unable to create user with defaults.");
catch (Exception e) {
Main.getLogger().error("Unable to create user with defaults.", e);
}
createNewWithDefaults = false; // prevent recursion if ClaireData goes down.
}

public void updateUser(String accentColour,
String language,
ArrayList<String> pointsGuildID,
ArrayList<Integer> pointsMessages,
ArrayList<Integer> pointsVoiceChat) throws IOException {
List<String> pointsGuildID,
List<Integer> pointsMessages,
List<Integer> pointsVoiceChat) throws IOException {
// Add null check and fallback for language
if (language == null) {
new Exception("Language null origin trace").printStackTrace();
}

PUT put = new PUT();
put.putToURL(Main.getApiPath() + "api/v1/user/" + userID, userConstructor(accentColour, language, pointsGuildID, pointsMessages, pointsVoiceChat));
put.putToURL(Main.getApiPath() + "api/v1/user/" + userID,
userConstructor(accentColour, language, pointsGuildID, pointsMessages, pointsVoiceChat));
}

public void updateUserColour(String accentColour) throws IOException {
// Ensure that the values for the getters below are populated before querying.
getUser();
updateUser(accentColour,
getLanguage(),
getPointsGuildID(),
Expand All @@ -147,6 +142,8 @@ public void updateUserColour(String accentColour) throws IOException {
}

public void updateUserLanguage(String languageString) throws IOException {
// Ensure that the values for the getters below are populated before querying.
getUser();
updateUser(getAccentColour(),
languageString,
getPointsGuildID(),
Expand All @@ -155,14 +152,16 @@ public void updateUserLanguage(String languageString) throws IOException {
}

public void updateUserPointsGuildID(String guildID, Integer newPoints) throws IOException {
updateUserPointsGuildID((ArrayList<String>) LevelingTools.updateUserPoints(userID, guildID, newPoints));
updateUserPointsGuildID(LevelingTools.updateUserPoints(userID, guildID, newPoints));
}

public void updateUserPointsGuildID(Map<String, Integer> guildPointsToUpdate) throws IOException {
updateUserPointsGuildID((ArrayList<String>) LevelingTools.updateUserPoints(userID, guildPointsToUpdate));
updateUserPointsGuildID(LevelingTools.updateUserPoints(userID, guildPointsToUpdate));
}

public void updateUserPointsGuildID(ArrayList<String> pointsGuildID) throws IOException {
public void updateUserPointsGuildID(List<String> pointsGuildID) throws IOException {
// Ensure that the values for the getters below are populated before querying.
getUser();
updateUser(getAccentColour(),
getLanguage(),
pointsGuildID,
Expand All @@ -187,18 +186,18 @@ public void deleteUser() throws IOException {
*/
public String userConstructor(String accentColour,
String language,
ArrayList<String> pointsGuildID,
ArrayList<Integer> pointsMessages,
ArrayList<Integer> pointsVoiceChat) {
List<String> pointsGuildID,
List<Integer> pointsMessages,
List<Integer> pointsVoiceChat) {
ObjectMapper objectMapper = new ObjectMapper();
ObjectNode userNode = objectMapper.createObjectNode();

userNode.put("userID", userID);
userNode.put("accentColour", accentColour);
userNode.put("language", language);
userNode.put("pointsGuildID", objectMapper.valueToTree(pointsGuildID));
userNode.put("pointsMessages", objectMapper.valueToTree(pointsMessages));
userNode.put("pointsVoiceChat", objectMapper.valueToTree(pointsVoiceChat));
userNode.set("pointsGuildID", objectMapper.valueToTree(pointsGuildID));
userNode.set("pointsMessages", objectMapper.valueToTree(pointsMessages));
userNode.set("pointsVoiceChat", objectMapper.valueToTree(pointsVoiceChat));

return userNode.toString();
}
Expand Down Expand Up @@ -235,4 +234,4 @@ private void fixUserPointsGuildID() throws IOException {
updateUserPointsGuildID((ArrayList<String>) defaults.get("pointsGuildID"));
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/sidpatchy/clairebot/Clockwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Helper extends TimerTask {
public void run() {
try {
config.loadFromURL("https://raw.githubusercontent.com/nikolaischunk/discord-phishing-links/main/domain-list.json");
Clockwork.setPhishingDomains(config.getList("domains")
Clockwork.setPhishingDomains(config.getList("domains", String.class)
.stream()
.map(Object::toString)
.collect(Collectors.toList()));
Expand Down
Loading