|
8 | 8 |
|
9 | 9 | import net.dv8tion.jda.api.Permission; |
10 | 10 | import net.dv8tion.jda.api.entities.Member; |
| 11 | +import net.dv8tion.jda.api.entities.Message; |
11 | 12 | import net.dv8tion.jda.api.entities.User; |
12 | 13 | import net.dv8tion.jda.api.entities.channel.middleman.GuildChannel; |
13 | 14 | import net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent; |
| 15 | +import net.dv8tion.jda.api.exceptions.ErrorHandler; |
14 | 16 | import net.dv8tion.jda.api.interactions.AutoCompleteQuery; |
15 | 17 | import net.dv8tion.jda.api.interactions.Interaction; |
16 | 18 | import net.dv8tion.jda.api.interactions.commands.Command; |
17 | 19 | import net.dv8tion.jda.api.interactions.commands.OptionType; |
18 | 20 | import net.dv8tion.jda.api.interactions.commands.build.OptionData; |
| 21 | +import net.dv8tion.jda.api.requests.ErrorResponse; |
19 | 22 |
|
20 | 23 | import org.jetbrains.annotations.NotNull; |
21 | 24 |
|
22 | 25 | import xyz.srnyx.javautilities.manipulation.Mapper; |
23 | 26 |
|
24 | 27 | import xyz.srnyx.lazylibrary.LazyEmoji; |
25 | 28 |
|
26 | | -import java.util.Collection; |
27 | | -import java.util.Comparator; |
28 | | -import java.util.List; |
| 29 | +import java.util.*; |
29 | 30 | import java.util.function.Function; |
30 | 31 |
|
31 | 32 |
|
32 | 33 | /** |
33 | 34 | * Class for miscellaneous utilities |
34 | 35 | */ |
35 | 36 | public class LazyUtilities { |
| 37 | + /** |
| 38 | + * An empty set of {@link Message.MentionType mention types} |
| 39 | + */ |
| 40 | + @NotNull public static final Set<Message.MentionType> NO_MENTIONS = Collections.emptySet(); |
| 41 | + /** |
| 42 | + * An {@link ErrorHandler} that ignores {@link ErrorResponse#UNKNOWN_MESSAGE} errors |
| 43 | + */ |
| 44 | + @NotNull public static final ErrorHandler IGNORE_UNKNOWN_MESSAGE = new ErrorHandler().ignore(ErrorResponse.UNKNOWN_MESSAGE); |
| 45 | + /** |
| 46 | + * An {@link ErrorHandler} that ignores {@link ErrorResponse#CANNOT_SEND_TO_USER} errors |
| 47 | + */ |
| 48 | + @NotNull public static final ErrorHandler IGNORE_CANNOT_SEND_TO_USER = new ErrorHandler().ignore(ErrorResponse.CANNOT_SEND_TO_USER); |
| 49 | + /** |
| 50 | + * An {@link ErrorHandler} that ignores {@link ErrorResponse#UNKNOWN_MEMBER} errors |
| 51 | + */ |
| 52 | + @NotNull public static final ErrorHandler IGNORE_UNKNOWN_MEMBER = new ErrorHandler().ignore(ErrorResponse.UNKNOWN_MEMBER); |
| 53 | + /** |
| 54 | + * An {@link ErrorHandler} that ignores {@link ErrorResponse#MAX_MESSAGE_PINS} errors |
| 55 | + */ |
| 56 | + @NotNull public static final ErrorHandler IGNORE_MAX_MESSAGE_PINS = new ErrorHandler().ignore(ErrorResponse.MAX_MESSAGE_PINS); |
| 57 | + /** |
| 58 | + * An {@link ErrorHandler} that ignores {@link ErrorResponse#MISSING_PERMISSIONS} errors |
| 59 | + */ |
| 60 | + @NotNull public static final ErrorHandler IGNORE_MISSING_PERMISSIONS = new ErrorHandler().ignore(ErrorResponse.MISSING_PERMISSIONS); |
| 61 | + |
36 | 62 | /** |
37 | 63 | * Get a {@link PaginatorBuilder} with: |
38 | 64 | * <ul> |
|
0 commit comments