ignore

inline fun <T> RestResult<T>.ignore(predicate: (Throwable) -> Boolean): RestResult<T>(source)

Deprecated

Moved to the BotCommands-jda-ktx module You can find & replace: Find: io.github.freya022.botcommands.api.core.utils.ignore Replace: dev.freya02.botcommands.jda.ktx.requests.ignore

Dismisses the encapsulated exception if it corresponds to the predicate.

Allows for RestResult.orThrow to be used on failures without throwing, but does not allow using functions returning values.

Exceptions thrown in predicate are returned in a new RestResult.

See also


fun <T> RestResult<T>.ignore(ignored: ErrorResponse, vararg responses: ErrorResponse): RestResult<T>(source)

Deprecated

Moved to the BotCommands-jda-ktx module You can find & replace: Find: io.github.freya022.botcommands.api.core.utils.ignore Replace: dev.freya02.botcommands.jda.ktx.requests.ignore

Dismisses the encapsulated error response if it corresponds to an ignored response.

Allows for RestResult.orThrow to be used on failures without throwing, but does not allow using functions returning values.

See also


fun <T> RestResult<T>.ignore(ignored: KClass<out Throwable>, vararg types: KClass<out Throwable>): RestResult<T>(source)

Deprecated

Moved to the BotCommands-jda-ktx module You can find & replace: Find: io.github.freya022.botcommands.api.core.utils.ignore Replace: dev.freya02.botcommands.jda.ktx.requests.ignore

Dismisses the encapsulated exception if it corresponds to an ignored exception.

Allows for RestResult.orThrow to be used on failures without throwing, but does not allow using functions returning values.

See also