1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 17:19:00 +03:00
Octobot/TeamOctolings.Octobot/Extensions/CommandContextExtensions.cs

20 lines
599 B
C#
Raw Normal View History

using Remora.Discord.Commands.Contexts;
using Remora.Discord.Commands.Extensions;
using Remora.Rest.Core;
namespace TeamOctolings.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);
}
}