INNER CODE UNIT · C#
json
kwsch/SysBot.NET · SysBot.Pokemon.Discord/SysCord.cs:245
var json = JsonSerializer.Serialize(commands.Select(c => new {
c.Name,
c.Description,
Params = c.Parameters.Select(p => new { p.Name, p.Description, p.DiscordOptionType })
}));
return Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(json)));
}
private async Task LoadCommandsAndChannels()
{
var cfg = Hub.Config.Discord;
if (!CommandsRegistered)
await RegisterSlashCommands(cfg).ConfigureAwait(false);
if (MessageChannelsLoaded)
return;