Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
dunkyl committed Dec 22, 2023
2 parents 0f63db1 + 1ade314 commit 868cd53
Show file tree
Hide file tree
Showing 10 changed files with 171 additions and 233 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public Mono<QuasiMessage> setTimeZoneCommand(
Channel channel
) {
var collection = library.getDatabaseManager().collection(TimeZoneConfig.class);
var filter = eq("id", user.getIdLong());
var filter = eq("_id", user.getIdLong());
Publisher<?> result;
if (tz == null) {
result = collection.deleteOne(filter);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/qixils/quasicord/db/CollectionName.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface CollectionName {
@NonNull String name();
@NonNull String value();
}
2 changes: 1 addition & 1 deletion src/main/java/dev/qixils/quasicord/db/DatabaseManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private static String collectionNameOf(Object object) {
private static String collectionNameOf(Class<?> clazz) {
String collectionName;
if (clazz.isAnnotationPresent(CollectionName.class))
collectionName = clazz.getAnnotation(CollectionName.class).name();
collectionName = clazz.getAnnotation(CollectionName.class).value();
else
collectionName = clazz.getSimpleName();
return collectionName.substring(0, Math.min(collectionName.length(), 127));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* An entry in the locale configuration database collection.
* This stores the selected locale for a user, channel, or guild.
*/
@CollectionName(name = "locale")
@CollectionName("locale")
public class LocaleConfig {

@BsonId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* An entry in the timezone configuration database collection.
* This stores the selected timezone for a user.
*/
@CollectionName(name = "timezone")
@CollectionName("timezone")
public class TimeZoneConfig {

@BsonId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public static void consumeCommandResult(@NonNull CommandInteraction interaction,
case Mono<?> mono -> mono.subscribe(res -> consumeCommandResult(interaction, res));
case CompletableFuture<?> fut -> fut.thenAccept(res -> consumeCommandResult(interaction, res));
// terminal cases:
case null -> interaction.deferReply().queue();
case Boolean ephemeral -> interaction.deferReply(ephemeral).queue();
case null -> {}
case Boolean ephemeral -> interaction.deferReply(ephemeral).queue(); // TODO: replace with little enum class?
case QuasiMessage message -> message.text().asString(Context.fromInteraction(interaction)).subscribe(string -> {
var action = interaction.reply(string);
message.modifier().accept(action);
Expand Down
Loading

0 comments on commit 868cd53

Please sign in to comment.