Pass entire Interaction object to interaction commands, instead of just the data

This commit is contained in:
Daan Boerlage 2021-09-20 02:12:57 +02:00
parent aaea8d0540
commit d17ca4c556
Signed by: daan
GPG key ID: FCE070E1E4956606
2 changed files with 2 additions and 2 deletions

View file

@ -22,7 +22,7 @@ namespace Geekbot.Core.Interactions
} }
public abstract Command GetCommandInfo(); public abstract Command GetCommandInfo();
public abstract Task<InteractionResponse> Exec(InteractionData interaction); public abstract Task<InteractionResponse> Exec(Interaction interaction);
void IInteractionBase.BeforeExecute() => this.BeforeExecute(); void IInteractionBase.BeforeExecute() => this.BeforeExecute();
void IInteractionBase.AfterExecute() => this.AfterExecute(); void IInteractionBase.AfterExecute() => this.AfterExecute();

View file

@ -41,7 +41,7 @@ namespace Geekbot.Core.Interactions
var type = _commands[interaction.Data.Name]; var type = _commands[interaction.Data.Name];
var command = (InteractionBase)Activator.CreateInstance(type); var command = (InteractionBase)Activator.CreateInstance(type);
return await command.Exec(interaction.Data); return await command.Exec(interaction);
} }
} }
} }