Class DiscordParser
java.lang.Object
com.github.alex1304.ultimategdbot.api.utils.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.GuildChannel>
parseGuildChannel(Bot bot, discord4j.core.object.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.core.object.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. EmitsIllegalArgumentException
if 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.core.object.util.Snowflake guildId, String str)Parses the input into a Discord role. EmitsIllegalArgumentException
if 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.GuildChannel> parseGuildChannel(Bot bot, discord4j.core.object.util.Snowflake guildId, String str)Parses the input into a Discord channel. EmitsIllegalArgumentException
if 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
-