#Interaction Framework

1 messages · Page 1 of 1 (latest)

grizzled sun
#

(Context.Interaction as IComponentInteraction). UpdateAsync

empty oracle
#

hmm okay

#

and can i ask you about preconditions?

grizzled sun
#

I mean
There're docs for them

empty oracle
#

i mean how to handle it if return

return Task.FromResult(PreconditionResult.FromError("Role Not Found."));
grizzled sun
#

Iirc an event should be fire on InteractionService

#

Which will have the result of the execution

empty oracle
#

Maybe you have some example?

grizzled sun
#

I mean

#

Just add a handler to it

#

One of properties will be IResult

#

And iresult has .IsSuccess property

#

And .ErrorReason with the message you return in precondition

empty oracle
#

where i need to put IResult?

grizzled sun
#

...
You need to add a handler for an event
InteractionExecuted will be triggered for all types of interactions so you probably should use it

And the handler should look like this

public async Task OnIntetactionExecuted(ICommandInfo command, IInteractionContext context, IResult result)
{
    if(!result.IsSuccess)
    {
    // Handle error
}
}
empty oracle
#
private async Task HandleInteraction(SocketInteraction interaction)
``` like this one?
grizzled sun
#

...
no

#

InteractionService.InteractionExexuted

#

This is the event you need

#

And the handler for it I sent above

empty oracle
#

ohh found it

#

ty will try

grizzled sun
#

А
Стоп
Лол
Я мог бы всё вот так быстрее объяснить

empty oracle
#

не плохо 😄

#

Я просто второй день сижу в Interaction Framework на том что с Example

grizzled sun
#

Понимаемо
Ну как говорится - на вопросы по возможности отвечу

grizzled sun
#

Hello 🙂

ornate lynx
#

Рашн, сука блять, водка.