Class DiscordParser
java.lang.Object
com.github.alex1304.ultimategdbot.api.util.DiscordParser
public class DiscordParser extends Object
Contains utility methods to parse a user input into a Discord entity.
-
Method Summary
Modifier and Type Method Description static reactor.core.publisher.Mono<discord4j.core.object.entity.channel.GuildChannel>parseGuildChannel(Bot bot, discord4j.rest.util.Snowflake guildId, String str)Parses the input into a Discord channel.static reactor.core.publisher.Mono<discord4j.core.object.entity.Role>parseRole(Bot bot, discord4j.rest.util.Snowflake guildId, String str)Parses the input into a Discord role.static reactor.core.publisher.Mono<discord4j.core.object.entity.User>parseUser(Bot bot, String str)Parses the input into a Discord user.
-
Method Details
-
parseUser
public static reactor.core.publisher.Mono<discord4j.core.object.entity.User> parseUser(Bot bot, String str)Parses the input into a Discord user. EmitsIllegalArgumentExceptionif not found.- Parameters:
bot- the bot used to make requests to Discordstr- the input- Returns:
- a Mono emitting the found user
-
parseRole
public static reactor.core.publisher.Mono<discord4j.core.object.entity.Role> parseRole(Bot bot, discord4j.rest.util.Snowflake guildId, String str)Parses the input into a Discord role. EmitsIllegalArgumentExceptionif not found.- Parameters:
bot- the bot used to make requests to DiscordguildId- the ID of the guild the desired role belongs tostr- the input- Returns:
- a Mono emitting the found role
-
parseGuildChannel
public static reactor.core.publisher.Mono<discord4j.core.object.entity.channel.GuildChannel> parseGuildChannel(Bot bot, discord4j.rest.util.Snowflake guildId, String str)Parses the input into a Discord channel. EmitsIllegalArgumentExceptionif not found.- Parameters:
bot- the bot used to make requests to DiscordguildId- the ID of the guild the desired channel belongs tostr- the input- Returns:
- a Mono emitting the found channel
-