public async Task SendDiscordEmbedAsync(ulong chanId, DisukuEmbed embed) { var channel = GetSocketTextChannel(chanId); var discordEmbed = DisukuEntityConverter.ConvertEmbed(embed); await channel.SendMessageAsync(embed : discordEmbed); }
public async Task DislayUserProfile(SocketGuildUser discordUser = null) { if (discordUser is null) { discordUser = Context.User as SocketGuildUser; } var disukuUser = DisukuEntityConverter.ConvertToDisukuUser(discordUser); await _userProfileService.ReplyUserAsync(Context.Channel.Id, disukuUser); }
private async Task LogAsync(LogMessage logMessage) { var disukuLog = DisukuEntityConverter.CovertLog(logMessage); if (logMessage.Exception is null) { await _logger.LogAsync(disukuLog); } else { await _logger.LogCriticalAsync(disukuLog, logMessage.Exception); } }
private async Task CommandExecutedAsync(Optional <CommandInfo> command, ICommandContext context, IResult result) { if (!command.IsSpecified) { return; } var commandLog = DisukuEntityConverter.ConvertCommandLog(context.Guild as SocketGuild, context.Channel as SocketGuildChannel, context.User as SocketGuildUser, command.Value); if (result.IsSuccess) { await _logger.LogCommandAsync(commandLog); } else { await _logger.LogCommandAsync(commandLog, result.ErrorReason); var embed = new EmbedBuilder() .WithTitle("ERROR") .WithDescription(result.ErrorReason) .WithColor(Color.DarkRed); await context.Channel.SendMessageAsync(embed : embed.Build()); } }
public async Task ListQuotes(SocketGuildUser user) { var disukuUser = DisukuEntityConverter.ConvertToDisukuUser(user); await _quoteService.List(Context.Channel.Id, disukuUser); }
private async Task LogAsync(LogMessage logMessage) { var disukuLog = DisukuEntityConverter.CovertLog(logMessage); await _logger.LogAsync(disukuLog); }
public async Task DisplayGuildProfile() { var guild = DisukuEntityConverter.ConvertToDisukuGuild(Context.Guild); await _guildProfileService.ReplyGuildAsync(Context.Channel.Id, guild); }