Skip to content

Commit ffeff8c

Browse files
authored
Remove deprecated elements and prepare for beta (#212)
1 parent be0fded commit ffeff8c

File tree

99 files changed

+197
-3209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+197
-3209
lines changed

src/main/java/io/github/freya022/botcommands/api/commands/CommandList.java

Lines changed: 0 additions & 104 deletions
This file was deleted.

src/main/java/io/github/freya022/botcommands/api/commands/application/CommandScope.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package io.github.freya022.botcommands.api.commands.application;
22

33
import io.github.freya022.botcommands.api.commands.application.annotations.DeclarationFilter;
4-
import io.github.freya022.botcommands.api.commands.application.context.annotations.JDAMessageCommand;
5-
import io.github.freya022.botcommands.api.commands.application.context.annotations.JDAUserCommand;
6-
import io.github.freya022.botcommands.api.commands.application.slash.annotations.TopLevelSlashCommandData;
74
import io.github.freya022.botcommands.api.core.config.BApplicationConfigBuilder;
85
import net.dv8tion.jda.api.interactions.InteractionContextType;
96

@@ -26,9 +23,4 @@ public enum CommandScope {
2623
* <p>These commands cannot be filtered.
2724
*/
2825
GLOBAL,
29-
/**
30-
* @deprecated Replace this by setting {@link TopLevelSlashCommandData#contexts()}/{@link JDAMessageCommand#contexts()}/{@link JDAUserCommand#contexts()} to {@link InteractionContextType#GUILD}
31-
*/
32-
@Deprecated(forRemoval = true)
33-
GLOBAL_NO_DM;
3426
}

src/main/java/io/github/freya022/botcommands/api/commands/text/BaseCommandEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ public Member getMember() {
108108
}
109109

110110
/**
111-
* Returns the default embed, equivalent to {@link BContext#getDefaultEmbedSupplier() BContext.getDefaultEmbedSupplier().get()}
111+
* Returns the default embed, equivalent to {@link TextCommandsContext#getDefaultEmbedSupplier() BContext.getDefaultEmbedSupplier().get()}
112112
*
113113
* @return Default embed of the bot
114114
*/
115115
@NotNull
116116
public abstract EmbedBuilder getDefaultEmbed();
117117

118118
/**
119-
* Returns the default embed footer icon, equivalent to {@link BContext#getDefaultEmbedFooterIconSupplier() BContext.getDefaultFooterIconSupplier().get()}
119+
* Returns the default embed footer icon, equivalent to {@link TextCommandsContext#getDefaultEmbedFooterIconSupplier() BContext.getDefaultFooterIconSupplier().get()}
120120
*
121121
* @return Default embed footer icon of the bot
122122
*/

src/main/java/io/github/freya022/botcommands/api/core/SettingsProvider.java

Lines changed: 0 additions & 90 deletions
This file was deleted.

src/main/kotlin/io/github/freya022/botcommands/api/commands/application/ApplicationCommand.kt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,6 @@ abstract class ApplicationCommand {
4545
return emptyList()
4646
}
4747

48-
/**
49-
* Returns a collection of [Guild] IDs in which the specified command ID will be allowed to be pushed in.
50-
*
51-
* Return values:
52-
* - `null` if the command can be used in any guild
53-
* - An empty list if the command cannot be used anywhere
54-
* - A list of guild IDs, where the command will be usable
55-
*
56-
* Make sure to not allow more than one command with the same path.
57-
*
58-
* @param commandId The ID of the command that has been set with [@CommandId][CommandId]
59-
* @param commandPath The [CommandPath] of the specified command ID
60-
*
61-
* @return A collection of Guild IDs where the specified command is allowed to be pushed in<br>
62-
* This returns `null` by default
63-
*
64-
* @see CommandId @CommandId
65-
*/
66-
@Deprecated(message = "Replaced by DeclarationFilter and CommandDeclarationFilter")
67-
open fun getGuildsForCommandId(commandId: String, commandPath: CommandPath): Collection<Long>? {
68-
return null
69-
}
70-
7148
/**
7249
* Returns the generated value supplier of a [@GeneratedOption][GeneratedOption].
7350
*

src/main/kotlin/io/github/freya022/botcommands/api/commands/application/ApplicationCommandInfo.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ interface ApplicationCommandInfo : CommandInfo, Executable,
2525

2626
override val discordOptions: List<ApplicationCommandOption>
2727

28-
@Deprecated("For removal, confusing on whether it searches nested parameters, prefer using collection operations on 'parameters' instead, make an extension or an utility method")
29-
override fun getParameter(declaredName: String): ApplicationCommandParameter?
30-
3128
/**
3229
* Returns the full command name of this application command, separate with spaces.
3330
*

src/main/kotlin/io/github/freya022/botcommands/api/commands/application/CommandMap.kt

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/main/kotlin/io/github/freya022/botcommands/api/commands/application/builder/TopLevelApplicationCommandBuilder.kt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,16 @@
11
package io.github.freya022.botcommands.api.commands.application.builder
22

3-
import io.github.freya022.botcommands.api.commands.application.CommandScope
43
import io.github.freya022.botcommands.api.commands.application.context.annotations.JDAMessageCommand
54
import io.github.freya022.botcommands.api.commands.application.context.annotations.JDAUserCommand
65
import io.github.freya022.botcommands.api.commands.application.options.builder.ApplicationCommandOptionAggregateBuilder
76
import io.github.freya022.botcommands.api.commands.application.provider.GlobalApplicationCommandManager
87
import io.github.freya022.botcommands.api.commands.application.provider.GuildApplicationCommandManager
98
import io.github.freya022.botcommands.api.commands.application.slash.annotations.TopLevelSlashCommandData
10-
import io.github.freya022.botcommands.api.core.utils.enumSetOf
119
import net.dv8tion.jda.api.Permission
1210
import net.dv8tion.jda.api.interactions.IntegrationType
1311
import net.dv8tion.jda.api.interactions.InteractionContextType
14-
import java.util.*
1512

1613
interface TopLevelApplicationCommandBuilder<T : ApplicationCommandOptionAggregateBuilder<T>> : ApplicationCommandBuilder<T> {
17-
/**
18-
* @see TopLevelSlashCommandData.scope
19-
* @see JDAUserCommand.scope
20-
* @see JDAMessageCommand.scope
21-
*/
22-
@Deprecated("Replaced with interaction contexts")
23-
val scope: CommandScope
24-
get() = when (EnumSet.copyOf(contexts)) {
25-
enumSetOf(InteractionContextType.GUILD) -> CommandScope.GUILD
26-
enumSetOf(InteractionContextType.GUILD, InteractionContextType.BOT_DM) -> CommandScope.GLOBAL
27-
else -> throw IllegalArgumentException("Cannot map $contexts to a CommandScope")
28-
}
2914

3015
/**
3116
* Represents where a command can be used.

src/main/kotlin/io/github/freya022/botcommands/api/commands/application/context/message/MessageCommandInfo.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,4 @@ interface MessageCommandInfo : TopLevelApplicationCommandInfo, ApplicationComman
1515

1616
override val discordOptions: List<MessageContextCommandOption>
1717
get() = parameters.flatMap { it.allOptions }.filterIsInstance<MessageContextCommandOption>()
18-
19-
@Suppress("DeprecatedCallableAddReplaceWith")
20-
@Deprecated("For removal, confusing on whether it searches nested parameters, prefer using collection operations on 'parameters' instead, make an extension or an utility method")
21-
override fun getParameter(declaredName: String): MessageContextCommandParameter? =
22-
parameters.find { it.name == declaredName }
2318
}

src/main/kotlin/io/github/freya022/botcommands/api/commands/application/context/message/options/MessageContextCommandOption.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import io.github.freya022.botcommands.api.commands.application.context.options.C
77
*/
88
interface MessageContextCommandOption : ContextCommandOption {
99

10-
@Deprecated("Renamed to 'executable'", replaceWith = ReplaceWith("executable"))
11-
override val command get() = executable
1210
override val executable get() = parent.executable
1311
override val parent: MessageContextCommandParameter
1412
}

0 commit comments

Comments
 (0)