2023-10-12 18:37:25 +03:00
|
|
|
|
using Remora.Discord.Commands.Contexts;
|
|
|
|
|
using Remora.Discord.Commands.Extensions;
|
|
|
|
|
using Remora.Rest.Core;
|
|
|
|
|
|
2024-05-16 18:34:26 +03:00
|
|
|
|
namespace TeamOctolings.Octobot.Extensions;
|
2023-10-12 18:37:25 +03:00
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|