mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 09:09:00 +03:00
20 lines
585 B
C#
20 lines
585 B
C#
|
using Remora.Discord.Commands.Contexts;
|
|||
|
using Remora.Discord.Commands.Extensions;
|
|||
|
using Remora.Rest.Core;
|
|||
|
|
|||
|
namespace Octobot.Extensions;
|
|||
|
|
|||
|
public static class CommandContextExtensions
|
|||
|
{
|
|||
|
public static bool TryGetContextIDs(
|
|||
|
this ICommandContext context, out Snowflake guildId,
|
|||
|
out Snowflake channelId, out Snowflake executorId)
|
|||
|
{
|
|||
|
channelId = default;
|
|||
|
executorId = default;
|
|||
|
return context.TryGetGuildID(out guildId)
|
|||
|
&& context.TryGetChannelID(out channelId)
|
|||
|
&& context.TryGetUserID(out executorId);
|
|||
|
}
|
|||
|
}
|