mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-09 23:55:42 +00:00
Expose Client from CommandContext
This commit is contained in:
parent
a1e018b32e
commit
18f26925da
@ -9,12 +9,10 @@ namespace VpSharp.Commands;
|
||||
/// </summary>
|
||||
public sealed class CommandContext
|
||||
{
|
||||
private readonly VirtualParadiseClient _client;
|
||||
|
||||
internal CommandContext(VirtualParadiseClient client, VirtualParadiseAvatar avatar, string commandName, string alias,
|
||||
string rawArguments)
|
||||
{
|
||||
_client = client;
|
||||
Client = client;
|
||||
Avatar = avatar;
|
||||
CommandName = commandName;
|
||||
Alias = alias;
|
||||
@ -40,6 +38,12 @@ public sealed class CommandContext
|
||||
/// <value>The executing avatar.</value>
|
||||
public VirtualParadiseAvatar Avatar { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the client which raised the event.
|
||||
/// </summary>
|
||||
/// <value>The Virtual Paradise client.</value>
|
||||
public VirtualParadiseClient Client { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the command name.
|
||||
/// </summary>
|
||||
@ -64,7 +68,7 @@ public sealed class CommandContext
|
||||
public Task<VirtualParadiseMessage> RespondAsync(string message, bool ephemeral = false)
|
||||
{
|
||||
return ephemeral
|
||||
? Avatar.SendMessageAsync(_client.CurrentAvatar?.Name, message, FontStyle.Regular, Color.Black)
|
||||
: _client.SendMessageAsync(message);
|
||||
? Avatar.SendMessageAsync(Client.CurrentAvatar?.Name, message, FontStyle.Regular, Color.Black)
|
||||
: Client.SendMessageAsync(message);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user