From 67a15f38225c9c22d6112617c0689c40eed9711e Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Thu, 18 May 2023 10:28:25 +0500 Subject: [PATCH] =?UTF-8?q?Remora.Discord=20part=203=20out=20of=20?= =?UTF-8?q?=E2=88=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Octol1ttle --- Boyfriend.cs | 2 +- Boyfriend.csproj | 4 +- EventResponders.cs | 203 ++++++++++++++++++++++++---------- Extensions.cs | 45 ++++++-- Messages.Designer.cs | 254 +++++++++++++++++++++---------------------- Messages.resx | 4 +- Messages.ru.resx | 4 +- Messages.tt-ru.resx | 4 +- 8 files changed, 322 insertions(+), 198 deletions(-) diff --git a/Boyfriend.cs b/Boyfriend.cs index 6c1e2a5..3ac5a18 100644 --- a/Boyfriend.cs +++ b/Boyfriend.cs @@ -62,7 +62,7 @@ public class Boyfriend { services.AddTransient(); services.Configure( - options => options.Intents |= GatewayIntents.MessageContents); + options => options.Intents |= GatewayIntents.MessageContents | GatewayIntents.GuildMembers); } ).ConfigureLogging( c => c.AddConsole() diff --git a/Boyfriend.csproj b/Boyfriend.csproj index e7aa859..0d6969a 100644 --- a/Boyfriend.csproj +++ b/Boyfriend.csproj @@ -19,11 +19,13 @@ + + @@ -35,7 +37,7 @@ - + ResXFileCodeGenerator Messages.Designer.cs diff --git a/EventResponders.cs b/EventResponders.cs index c41e4f1..fdeeb9b 100644 --- a/EventResponders.cs +++ b/EventResponders.cs @@ -1,4 +1,6 @@ using System.Drawing; +using DiffPlex; +using DiffPlex.DiffBuilder; using Microsoft.Extensions.Logging; using Remora.Discord.API.Abstractions.Gateway.Events; using Remora.Discord.API.Abstractions.Objects; @@ -29,32 +31,30 @@ public class GuildCreateResponder : IResponder { var guild = gatewayEvent.Guild.AsT0; Boyfriend.Logger.LogInformation("Joined guild \"{Name}\"", guild.Name); - var channelResult = guild.ID.GetChannel("PrivateFeedbackChannel"); + var channelResult = guild.ID.GetConfigChannel("PrivateFeedbackChannel"); if (!channelResult.IsDefined(out var channel)) return Result.FromSuccess(); var currentUserResult = await _userApi.GetCurrentUserAsync(ct); if (!currentUserResult.IsDefined(out var currentUser)) return Result.FromError(currentUserResult); - if (guild.GetConfigBool("ReceiveStartupMessages").IsDefined(out var shouldSendStartupMessage) - && shouldSendStartupMessage) { - Messages.Culture = guild.GetCulture(); - var i = Random.Shared.Next(1, 4); + if (!guild.GetConfigBool("ReceiveStartupMessages").IsDefined(out var shouldSendStartupMessage) + || !shouldSendStartupMessage) return Result.FromSuccess(); - var embed = new EmbedBuilder() - .WithTitle(Boyfriend.GetLocalized($"Beep{i}")) - .WithDescription(Messages.Ready) - .WithUserFooter(currentUser) - .WithCurrentTimestamp() - .WithColour(Color.Aqua) - .Build(); + Messages.Culture = guild.ID.GetGuildCulture(); + var i = Random.Shared.Next(1, 4); - if (!embed.IsDefined(out var built)) return Result.FromError(embed); + var embed = new EmbedBuilder() + .WithTitle(Boyfriend.GetLocalized($"Beep{i}")) + .WithDescription(Messages.Ready) + .WithUserFooter(currentUser) + .WithCurrentTimestamp() + .WithColour(Color.Aqua) + .Build(); - return (Result)await _channelApi.CreateMessageAsync( - channel, embeds: new[] { built }!, ct: ct); - } + if (!embed.IsDefined(out var built)) return Result.FromError(embed); - return Result.FromSuccess(); + return (Result)await _channelApi.CreateMessageAsync( + channel, embeds: new[] { built }!, ct: ct); } } @@ -62,60 +62,151 @@ public class MessageDeletedResponder : IResponder { private readonly IDiscordRestAuditLogAPI _auditLogApi; private readonly CacheService _cacheService; private readonly IDiscordRestChannelAPI _channelApi; - private readonly IDiscordRestUserAPI _userApi; public MessageDeletedResponder( - IDiscordRestChannelAPI channelApi, IDiscordRestUserAPI userApi, CacheService cacheService, - IDiscordRestAuditLogAPI auditLogApi) { - _channelApi = channelApi; - _userApi = userApi; - _cacheService = cacheService; + IDiscordRestAuditLogAPI auditLogApi, CacheService cacheService, IDiscordRestChannelAPI channelApi) { _auditLogApi = auditLogApi; + _cacheService = cacheService; + _channelApi = channelApi; } public async Task RespondAsync(IMessageDelete gatewayEvent, CancellationToken ct = default) { if (!gatewayEvent.GuildID.IsDefined(out var guildId)) return Result.FromSuccess(); - var channelResult = guildId.GetChannel("PrivateFeedbackChannel"); - if (!channelResult.IsDefined(out var channel)) return Result.FromSuccess(); + var channelResult = guildId.GetConfigChannel("PrivateFeedbackChannel"); + if (!channelResult.IsDefined(out var logChannel)) return Result.FromSuccess(); var messageResult = await _cacheService.TryGetValueAsync( new KeyHelpers.MessageCacheKey(gatewayEvent.ChannelID, gatewayEvent.ID), ct); - if (messageResult.IsDefined(out var message)) { - var auditLogResult = await _auditLogApi.GetGuildAuditLogAsync( - guildId, actionType: AuditLogEvent.MessageDelete, limit: 1, ct: ct); - if (!auditLogResult.IsDefined(out var auditLogPage)) return Result.FromError(auditLogResult); + if (!messageResult.IsDefined(out var message)) return Result.FromError(messageResult); + if (string.IsNullOrWhiteSpace(message.Content)) return Result.FromSuccess(); - var auditLog = auditLogPage.AuditLogEntries.Single(); - if (!auditLog.Options.IsDefined(out var options)) - return Result.FromError(new ArgumentNullError(nameof(auditLog.Options))); + var auditLogResult = await _auditLogApi.GetGuildAuditLogAsync( + guildId, actionType: AuditLogEvent.MessageDelete, limit: 1, ct: ct); + if (!auditLogResult.IsDefined(out var auditLogPage)) return Result.FromError(auditLogResult); - var user = message.Author; - if (options.ChannelID == gatewayEvent.ChannelID - && DateTimeOffset.UtcNow.Subtract(auditLog.ID.Timestamp).TotalSeconds <= 2) { - var userResult = await _userApi.GetUserAsync(auditLog.UserID!.Value, ct); - if (!userResult.IsDefined(out user)) return Result.FromError(userResult); - } + var auditLog = auditLogPage.AuditLogEntries.Single(); + if (!auditLog.Options.IsDefined(out var options)) + return Result.FromError(new ArgumentNullError(nameof(auditLog.Options))); - var embed = new EmbedBuilder() - .WithAuthor(string.Format(Messages.CachedMessageDeleted, message.Author)) - .WithTitle( - message.Author, - string.Format( - Messages.CachedMessageDeleted, - $"{message.Author.Username}#{message.Author.Discriminator:0000}")) - .WithDescription(Markdown.BlockCode(message.Content.SanitizeForBlockCode())) - .WithActionFooter(user) - .WithTimestamp(message.Timestamp) - .WithColour(Color.Crimson) - .Build(); - - if (!embed.IsDefined(out var built)) return Result.FromError(embed); - - return (Result)await _channelApi.CreateMessageAsync( - channel, embeds: new[] { built }, allowedMentions: Boyfriend.NoMentions, ct: ct); + var user = message.Author; + if (options.ChannelID == gatewayEvent.ChannelID + && DateTimeOffset.UtcNow.Subtract(auditLog.ID.Timestamp).TotalSeconds <= 2) { + var userResult = await _cacheService.TryGetValueAsync( + new KeyHelpers.UserCacheKey(auditLog.UserID!.Value), ct); + if (!userResult.IsDefined(out user)) return Result.FromError(userResult); } - return (Result)messageResult; + Messages.Culture = guildId.GetGuildCulture(); + var embed = new EmbedBuilder() + .WithSmallTitle( + message.Author, + string.Format( + Messages.CachedMessageDeleted, + message.Author.GetTag())) + .WithDescription( + $"{Mention.Channel(gatewayEvent.ChannelID)}\n{Markdown.BlockCode(message.Content.SanitizeForBlockCode())}") + .WithActionFooter(user) + .WithTimestamp(message.Timestamp) + .WithColour(Color.Crimson) + .Build(); + if (!embed.IsDefined(out var built)) return Result.FromError(embed); + + return (Result)await _channelApi.CreateMessageAsync( + logChannel, embeds: new[] { built }, allowedMentions: Boyfriend.NoMentions, ct: ct); + } +} + +public class MessageEditedResponder : IResponder { + private readonly CacheService _cacheService; + private readonly IDiscordRestChannelAPI _channelApi; + + public MessageEditedResponder(CacheService cacheService, IDiscordRestChannelAPI channelApi) { + _cacheService = cacheService; + _channelApi = channelApi; + } + + public async Task RespondAsync(IMessageUpdate gatewayEvent, CancellationToken ct = default) { + if (!gatewayEvent.GuildID.IsDefined(out var guildId)) return Result.FromSuccess(); + if (!gatewayEvent.ChannelID.IsDefined(out var channelId)) + return Result.FromError(new ArgumentNullError(nameof(gatewayEvent.ChannelID))); + if (!gatewayEvent.ID.IsDefined(out var messageId)) + return Result.FromError(new ArgumentNullError(nameof(gatewayEvent.ID))); + if (!gatewayEvent.Content.IsDefined(out var newContent)) + return Result.FromError(new ArgumentNullError(nameof(gatewayEvent.Content))); + if (!gatewayEvent.EditedTimestamp.IsDefined(out var timestamp)) + return Result.FromError(new ArgumentNullError(nameof(gatewayEvent.EditedTimestamp))); + + var messageResult = await _cacheService.TryGetValueAsync( + new KeyHelpers.MessageCacheKey(channelId, messageId), ct); + if (!messageResult.IsDefined(out var message)) return Result.FromError(messageResult); + if (string.IsNullOrWhiteSpace(message.Content) + || string.IsNullOrWhiteSpace(newContent) + || message.Content == newContent) return Result.FromSuccess(); + + var logChannelResult = guildId.GetConfigChannel("PrivateFeedbackChannel"); + if (!logChannelResult.IsDefined(out var logChannel)) return Result.FromSuccess(); + + var currentUserResult = await _cacheService.TryGetValueAsync( + new KeyHelpers.CurrentUserCacheKey(), ct); + if (!currentUserResult.IsDefined(out var currentUser)) return Result.FromError(currentUserResult); + + var diff = new SideBySideDiffBuilder(Differ.Instance).BuildDiffModel(message.Content, newContent, true, true); + + Messages.Culture = guildId.GetGuildCulture(); + var embed = new EmbedBuilder() + .WithSmallTitle( + message.Author, + string.Format(Messages.CachedMessageEdited, message.Author.GetTag()), + $"https://discord.com/channels/{guildId}/{channelId}/{messageId}") + .WithDescription($"{Mention.Channel(message.ChannelID)}\n{diff.AsMarkdown()}") + .WithUserFooter(currentUser) + .WithTimestamp(timestamp.Value) + .WithColour(Color.Gold) + .Build(); + if (!embed.IsDefined(out var built)) return Result.FromError(embed); + + return (Result)await _channelApi.CreateMessageAsync( + logChannel, embeds: new[] { built }, allowedMentions: Boyfriend.NoMentions, ct: ct); + } +} + +public class GuildMemberAddResponder : IResponder { + private readonly CacheService _cacheService; + private readonly IDiscordRestChannelAPI _channelApi; + + public GuildMemberAddResponder(CacheService cacheService, IDiscordRestChannelAPI channelApi) { + _cacheService = cacheService; + _channelApi = channelApi; + } + + public async Task RespondAsync(IGuildMemberAdd gatewayEvent, CancellationToken ct = default) { + if (!gatewayEvent.GuildID.GetConfigString("WelcomeMessage").IsDefined(out var welcomeMessage) + || welcomeMessage is "off" or "disable" or "disabled") + return Result.FromSuccess(); + if (welcomeMessage is "default" or "reset") { + Messages.Culture = gatewayEvent.GuildID.GetGuildCulture(); + welcomeMessage = Messages.DefaultWelcomeMessage; + } + + if (!gatewayEvent.GuildID.GetConfigChannel("PublicFeedbackChannel").IsDefined(out var channel)) + return Result.FromSuccess(); + if (!gatewayEvent.User.IsDefined(out var user)) + return Result.FromError(new ArgumentNullError(nameof(gatewayEvent.User))); + + var guildResult = await _cacheService.TryGetValueAsync( + new KeyHelpers.GuildCacheKey(gatewayEvent.GuildID), ct); + if (!guildResult.IsDefined(out var guild)) return Result.FromError(guildResult); + + var embed = new EmbedBuilder() + .WithSmallTitle(user, string.Format(welcomeMessage, user.GetTag(), guild.Name)) + .WithGuildFooter(guild) + .WithTimestamp(gatewayEvent.JoinedAt) + .WithColour(Color.LawnGreen) + .Build(); + if (!embed.IsDefined(out var built)) return Result.FromError(embed); + + return (Result)await _channelApi.CreateMessageAsync( + channel, embeds: new[] { built }, allowedMentions: Boyfriend.NoMentions, ct: ct); } } diff --git a/Extensions.cs b/Extensions.cs index 216b346..7c760e9 100644 --- a/Extensions.cs +++ b/Extensions.cs @@ -1,9 +1,12 @@ using System.Globalization; +using System.Text; +using DiffPlex.DiffBuilder.Model; using Microsoft.Extensions.Configuration; using Remora.Discord.API; using Remora.Discord.API.Abstractions.Objects; using Remora.Discord.API.Objects; using Remora.Discord.Extensions.Embeds; +using Remora.Discord.Extensions.Formatting; using Remora.Rest.Core; using Remora.Results; @@ -21,15 +24,20 @@ public static class Extensions { return value is not null ? Result.FromSuccess(value.Value) : Result.FromError(new NotFoundError()); } - public static Result GetChannel(this Snowflake guildId, string key) { + public static Result GetConfigChannel(this Snowflake guildId, string key) { var value = Boyfriend.GuildConfiguration.GetValue($"GuildConfigs:{guildId}:{key}"); return value is not null ? Result.FromSuccess(DiscordSnowflake.New(value.Value)) : Result.FromError(new NotFoundError()); } - public static CultureInfo GetCulture(this IGuild guild) { - var value = Boyfriend.GuildConfiguration.GetValue($"GuildConfigs:{guild.ID}:Language"); + public static Result GetConfigString(this Snowflake guildId, string key) { + var value = Boyfriend.GuildConfiguration.GetValue($"GuildConfigs:{guildId}:{key}"); + return value is not null ? Result.FromSuccess(value) : Result.FromError(new NotFoundError()); + } + + public static CultureInfo GetGuildCulture(this Snowflake guildId) { + var value = Boyfriend.GuildConfiguration.GetValue($"GuildConfigs:{guildId}:Language"); return value is not null ? CultureInfoCache[value] : CultureInfoCache["en"]; } @@ -39,7 +47,7 @@ public static class Extensions { ? avatarUrlResult.Entity.AbsoluteUri : CDN.GetDefaultUserAvatarUrl(user, imageSize: 256).Entity.AbsoluteUri; - return builder.WithFooter(new EmbedFooter($"{user.Username}#{user.Discriminator:0000}", avatarUrl)); + return builder.WithFooter(new EmbedFooter(user.GetTag(), avatarUrl)); } public static EmbedBuilder WithActionFooter(this EmbedBuilder builder, IUser user) { @@ -49,21 +57,44 @@ public static class Extensions { : CDN.GetDefaultUserAvatarUrl(user, imageSize: 256).Entity.AbsoluteUri; return builder.WithFooter( - new EmbedFooter($"{Messages.IssuedBy}:\n{user.Username}#{user.Discriminator:0000}", avatarUrl)); + new EmbedFooter($"{Messages.IssuedBy}:\n{user.GetTag()}", avatarUrl)); } - public static EmbedBuilder WithTitle(this EmbedBuilder builder, IUser avatarSource, string text) { + public static EmbedBuilder WithSmallTitle( + this EmbedBuilder builder, IUser avatarSource, string text, string? url = default) { var avatarUrlResult = CDN.GetUserAvatarUrl(avatarSource, imageSize: 256); var avatarUrl = avatarUrlResult.IsSuccess ? avatarUrlResult.Entity : CDN.GetDefaultUserAvatarUrl(avatarSource, imageSize: 256).Entity; - builder.Author = new EmbedAuthorBuilder(text, iconUrl: avatarUrl.AbsoluteUri); + builder.Author = new EmbedAuthorBuilder(text, url, avatarUrl.AbsoluteUri); return builder; } + public static EmbedBuilder WithGuildFooter(this EmbedBuilder builder, IGuild guild) { + var iconUrlResult = CDN.GetGuildIconUrl(guild, imageSize: 256); + var iconUrl = iconUrlResult.IsSuccess + ? iconUrlResult.Entity.AbsoluteUri + : default(Optional); + + return builder.WithFooter(new EmbedFooter(guild.Name, iconUrl)); + } + public static string SanitizeForBlockCode(this string s) { return s.Replace("```", "​`​`​`​"); } + + public static string AsMarkdown(this SideBySideDiffModel model) { + var builder = new StringBuilder(); + foreach (var line in model.OldText.Lines.Where(piece => !string.IsNullOrWhiteSpace(piece.Text))) + builder.Append("-- ").AppendLine(line.Text); + foreach (var line in model.NewText.Lines) builder.Append("++ ").AppendLine(line.Text); + + return Markdown.BlockCode(builder.ToString().SanitizeForBlockCode(), "diff"); + } + + public static string GetTag(this IUser user) { + return $"{user.Username}#{user.Discriminator:0000}"; + } } diff --git a/Messages.Designer.cs b/Messages.Designer.cs index 348180b..b6dd8dc 100644 --- a/Messages.Designer.cs +++ b/Messages.Designer.cs @@ -9,21 +9,21 @@ namespace Boyfriend { using System; - - + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Messages { - + private static System.Resources.ResourceManager resourceMan; - + private static System.Globalization.CultureInfo resourceCulture; - + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Messages() { } - + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] internal static System.Resources.ResourceManager ResourceManager { get { @@ -34,7 +34,7 @@ namespace Boyfriend { return resourceMan; } } - + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] internal static System.Globalization.CultureInfo Culture { get { @@ -44,721 +44,721 @@ namespace Boyfriend { resourceCulture = value; } } - + internal static string Ready { get { return ResourceManager.GetString("Ready", resourceCulture); } } - + internal static string CachedMessageDeleted { get { return ResourceManager.GetString("CachedMessageDeleted", resourceCulture); } } - + internal static string CachedMessageCleared { get { return ResourceManager.GetString("CachedMessageCleared", resourceCulture); } } - + internal static string CachedMessageEdited { get { return ResourceManager.GetString("CachedMessageEdited", resourceCulture); } } - + internal static string DefaultWelcomeMessage { get { return ResourceManager.GetString("DefaultWelcomeMessage", resourceCulture); } } - + internal static string Beep1 { get { return ResourceManager.GetString("Beep1", resourceCulture); } } - + internal static string Beep2 { get { return ResourceManager.GetString("Beep2", resourceCulture); } } - + internal static string Beep3 { get { return ResourceManager.GetString("Beep3", resourceCulture); } } - + internal static string CommandNoPermissionBot { get { return ResourceManager.GetString("CommandNoPermissionBot", resourceCulture); } } - + internal static string CommandNoPermissionUser { get { return ResourceManager.GetString("CommandNoPermissionUser", resourceCulture); } } - + internal static string YouWereBanned { get { return ResourceManager.GetString("YouWereBanned", resourceCulture); } } - + internal static string PunishmentExpired { get { return ResourceManager.GetString("PunishmentExpired", resourceCulture); } } - + internal static string ClearAmountTooSmall { get { return ResourceManager.GetString("ClearAmountTooSmall", resourceCulture); } } - + internal static string ClearAmountTooLarge { get { return ResourceManager.GetString("ClearAmountTooLarge", resourceCulture); } } - + internal static string CommandHelp { get { return ResourceManager.GetString("CommandHelp", resourceCulture); } } - + internal static string YouWereKicked { get { return ResourceManager.GetString("YouWereKicked", resourceCulture); } } - + internal static string Milliseconds { get { return ResourceManager.GetString("Milliseconds", resourceCulture); } } - + internal static string MemberAlreadyMuted { get { return ResourceManager.GetString("MemberAlreadyMuted", resourceCulture); } } - + internal static string ChannelNotSpecified { get { return ResourceManager.GetString("ChannelNotSpecified", resourceCulture); } } - + internal static string RoleNotSpecified { get { return ResourceManager.GetString("RoleNotSpecified", resourceCulture); } } - + internal static string CurrentSettings { get { return ResourceManager.GetString("CurrentSettings", resourceCulture); } } - + internal static string SettingsLang { get { return ResourceManager.GetString("SettingsLang", resourceCulture); } } - + internal static string SettingsPrefix { get { return ResourceManager.GetString("SettingsPrefix", resourceCulture); } } - + internal static string SettingsRemoveRolesOnMute { get { return ResourceManager.GetString("SettingsRemoveRolesOnMute", resourceCulture); } } - + internal static string SettingsSendWelcomeMessages { get { return ResourceManager.GetString("SettingsSendWelcomeMessages", resourceCulture); } } - + internal static string SettingsMuteRole { get { return ResourceManager.GetString("SettingsMuteRole", resourceCulture); } } - + internal static string LanguageNotSupported { get { return ResourceManager.GetString("LanguageNotSupported", resourceCulture); } } - + internal static string Yes { get { return ResourceManager.GetString("Yes", resourceCulture); } } - + internal static string No { get { return ResourceManager.GetString("No", resourceCulture); } } - + internal static string UserNotBanned { get { return ResourceManager.GetString("UserNotBanned", resourceCulture); } } - + internal static string MemberNotMuted { get { return ResourceManager.GetString("MemberNotMuted", resourceCulture); } } - + internal static string SettingsWelcomeMessage { get { return ResourceManager.GetString("SettingsWelcomeMessage", resourceCulture); } } - + internal static string ClearAmountInvalid { get { return ResourceManager.GetString("ClearAmountInvalid", resourceCulture); } } - + internal static string FeedbackUserBanned { get { return ResourceManager.GetString("FeedbackUserBanned", resourceCulture); } } - + internal static string SettingDoesntExist { get { return ResourceManager.GetString("SettingDoesntExist", resourceCulture); } } - + internal static string SettingsReceiveStartupMessages { get { return ResourceManager.GetString("SettingsReceiveStartupMessages", resourceCulture); } } - + internal static string InvalidSettingValue { get { return ResourceManager.GetString("InvalidSettingValue", resourceCulture); } } - + internal static string InvalidRole { get { return ResourceManager.GetString("InvalidRole", resourceCulture); } } - + internal static string InvalidChannel { get { return ResourceManager.GetString("InvalidChannel", resourceCulture); } } - + internal static string DurationRequiredForTimeOuts { get { return ResourceManager.GetString("DurationRequiredForTimeOuts", resourceCulture); } } - + internal static string CannotTimeOutBot { get { return ResourceManager.GetString("CannotTimeOutBot", resourceCulture); } } - + internal static string EventCreated { get { return ResourceManager.GetString("EventCreated", resourceCulture); } } - + internal static string SettingsEventNotificationRole { get { return ResourceManager.GetString("SettingsEventNotificationRole", resourceCulture); } } - + internal static string SettingsEventNotificationChannel { get { return ResourceManager.GetString("SettingsEventNotificationChannel", resourceCulture); } } - + internal static string SettingsEventStartedReceivers { get { return ResourceManager.GetString("SettingsEventStartedReceivers", resourceCulture); } } - + internal static string EventStarted { get { return ResourceManager.GetString("EventStarted", resourceCulture); } } - + internal static string SettingsFrowningFace { get { return ResourceManager.GetString("SettingsFrowningFace", resourceCulture); } } - + internal static string EventCancelled { get { return ResourceManager.GetString("EventCancelled", resourceCulture); } } - + internal static string EventCompleted { get { return ResourceManager.GetString("EventCompleted", resourceCulture); } } - + internal static string Ever { get { return ResourceManager.GetString("Ever", resourceCulture); } } - + internal static string FeedbackMessagesCleared { get { return ResourceManager.GetString("FeedbackMessagesCleared", resourceCulture); } } - + internal static string FeedbackMemberKicked { get { return ResourceManager.GetString("FeedbackMemberKicked", resourceCulture); } } - + internal static string FeedbackMemberMuted { get { return ResourceManager.GetString("FeedbackMemberMuted", resourceCulture); } } - + internal static string FeedbackUserUnbanned { get { return ResourceManager.GetString("FeedbackUserUnbanned", resourceCulture); } } - + internal static string FeedbackMemberUnmuted { get { return ResourceManager.GetString("FeedbackMemberUnmuted", resourceCulture); } } - + internal static string SettingsNothingChanged { get { return ResourceManager.GetString("SettingsNothingChanged", resourceCulture); } } - + internal static string SettingNotDefined { get { return ResourceManager.GetString("SettingNotDefined", resourceCulture); } } - + internal static string FeedbackSettingsUpdated { get { return ResourceManager.GetString("FeedbackSettingsUpdated", resourceCulture); } } - + internal static string CommandDescriptionBan { get { return ResourceManager.GetString("CommandDescriptionBan", resourceCulture); } } - + internal static string CommandDescriptionClear { get { return ResourceManager.GetString("CommandDescriptionClear", resourceCulture); } } - + internal static string CommandDescriptionHelp { get { return ResourceManager.GetString("CommandDescriptionHelp", resourceCulture); } } - + internal static string CommandDescriptionKick { get { return ResourceManager.GetString("CommandDescriptionKick", resourceCulture); } } - + internal static string CommandDescriptionMute { get { return ResourceManager.GetString("CommandDescriptionMute", resourceCulture); } } - + internal static string CommandDescriptionPing { get { return ResourceManager.GetString("CommandDescriptionPing", resourceCulture); } } - + internal static string CommandDescriptionSettings { get { return ResourceManager.GetString("CommandDescriptionSettings", resourceCulture); } } - + internal static string CommandDescriptionUnban { get { return ResourceManager.GetString("CommandDescriptionUnban", resourceCulture); } } - + internal static string CommandDescriptionUnmute { get { return ResourceManager.GetString("CommandDescriptionUnmute", resourceCulture); } } - + internal static string MissingNumber { get { return ResourceManager.GetString("MissingNumber", resourceCulture); } } - + internal static string MissingUser { get { return ResourceManager.GetString("MissingUser", resourceCulture); } } - + internal static string InvalidUser { get { return ResourceManager.GetString("InvalidUser", resourceCulture); } } - + internal static string MissingMember { get { return ResourceManager.GetString("MissingMember", resourceCulture); } } - + internal static string InvalidMember { get { return ResourceManager.GetString("InvalidMember", resourceCulture); } } - + internal static string UserCannotBanMembers { get { return ResourceManager.GetString("UserCannotBanMembers", resourceCulture); } } - + internal static string UserCannotManageMessages { get { return ResourceManager.GetString("UserCannotManageMessages", resourceCulture); } } - + internal static string UserCannotKickMembers { get { return ResourceManager.GetString("UserCannotKickMembers", resourceCulture); } } - + internal static string UserCannotModerateMembers { get { return ResourceManager.GetString("UserCannotModerateMembers", resourceCulture); } } - + internal static string UserCannotManageGuild { get { return ResourceManager.GetString("UserCannotManageGuild", resourceCulture); } } - + internal static string BotCannotBanMembers { get { return ResourceManager.GetString("BotCannotBanMembers", resourceCulture); } } - + internal static string BotCannotManageMessages { get { return ResourceManager.GetString("BotCannotManageMessages", resourceCulture); } } - + internal static string BotCannotKickMembers { get { return ResourceManager.GetString("BotCannotKickMembers", resourceCulture); } } - + internal static string BotCannotModerateMembers { get { return ResourceManager.GetString("BotCannotModerateMembers", resourceCulture); } } - + internal static string BotCannotManageGuild { get { return ResourceManager.GetString("BotCannotManageGuild", resourceCulture); } } - + internal static string MissingBanReason { get { return ResourceManager.GetString("MissingBanReason", resourceCulture); } } - + internal static string MissingKickReason { get { return ResourceManager.GetString("MissingKickReason", resourceCulture); } } - + internal static string MissingMuteReason { get { return ResourceManager.GetString("MissingMuteReason", resourceCulture); } } - + internal static string MissingUnbanReason { get { return ResourceManager.GetString("MissingUnbanReason", resourceCulture); } } - + internal static string MissingUnmuteReason { get { return ResourceManager.GetString("MissingUnmuteReason", resourceCulture); } } - + internal static string UserCannotBanOwner { get { return ResourceManager.GetString("UserCannotBanOwner", resourceCulture); } } - + internal static string UserCannotBanThemselves { get { return ResourceManager.GetString("UserCannotBanThemselves", resourceCulture); } } - + internal static string UserCannotBanBot { get { return ResourceManager.GetString("UserCannotBanBot", resourceCulture); } } - + internal static string BotCannotBanTarget { get { return ResourceManager.GetString("BotCannotBanTarget", resourceCulture); } } - + internal static string UserCannotBanTarget { get { return ResourceManager.GetString("UserCannotBanTarget", resourceCulture); } } - + internal static string UserCannotKickOwner { get { return ResourceManager.GetString("UserCannotKickOwner", resourceCulture); } } - + internal static string UserCannotKickThemselves { get { return ResourceManager.GetString("UserCannotKickThemselves", resourceCulture); } } - + internal static string UserCannotKickBot { get { return ResourceManager.GetString("UserCannotKickBot", resourceCulture); } } - + internal static string BotCannotKickTarget { get { return ResourceManager.GetString("BotCannotKickTarget", resourceCulture); } } - + internal static string UserCannotKickTarget { get { return ResourceManager.GetString("UserCannotKickTarget", resourceCulture); } } - + internal static string UserCannotMuteOwner { get { return ResourceManager.GetString("UserCannotMuteOwner", resourceCulture); } } - + internal static string UserCannotMuteThemselves { get { return ResourceManager.GetString("UserCannotMuteThemselves", resourceCulture); } } - + internal static string UserCannotMuteBot { get { return ResourceManager.GetString("UserCannotMuteBot", resourceCulture); } } - + internal static string BotCannotMuteTarget { get { return ResourceManager.GetString("BotCannotMuteTarget", resourceCulture); } } - + internal static string UserCannotMuteTarget { get { return ResourceManager.GetString("UserCannotMuteTarget", resourceCulture); } } - + internal static string UserCannotUnmuteOwner { get { return ResourceManager.GetString("UserCannotUnmuteOwner", resourceCulture); } } - + internal static string UserCannotUnmuteThemselves { get { return ResourceManager.GetString("UserCannotUnmuteThemselves", resourceCulture); } } - + internal static string UserCannotUnmuteBot { get { return ResourceManager.GetString("UserCannotUnmuteBot", resourceCulture); } } - + internal static string BotCannotUnmuteTarget { get { return ResourceManager.GetString("BotCannotUnmuteTarget", resourceCulture); } } - + internal static string UserCannotUnmuteTarget { get { return ResourceManager.GetString("UserCannotUnmuteTarget", resourceCulture); } } - + internal static string EventEarlyNotification { get { return ResourceManager.GetString("EventEarlyNotification", resourceCulture); } } - + internal static string SettingsEventEarlyNotificationOffset { get { return ResourceManager.GetString("SettingsEventEarlyNotificationOffset", resourceCulture); } } - + internal static string UserNotFound { get { return ResourceManager.GetString("UserNotFound", resourceCulture); } } - + internal static string SettingsStarterRole { get { return ResourceManager.GetString("SettingsStarterRole", resourceCulture); } } - + internal static string CommandDescriptionRemind { get { return ResourceManager.GetString("CommandDescriptionRemind", resourceCulture); } } - + internal static string SettingsPublicFeedbackChannel { get { return ResourceManager.GetString("SettingsPublicFeedbackChannel", resourceCulture); } } - + internal static string SettingsPrivateFeedbackChannel { get { return ResourceManager.GetString("SettingsPrivateFeedbackChannel", resourceCulture); } } - + internal static string SettingsReturnRolesOnRejoin { get { return ResourceManager.GetString("SettingsReturnRolesOnRejoin", resourceCulture); } } - + internal static string SettingsAutoStartEvents { get { return ResourceManager.GetString("SettingsAutoStartEvents", resourceCulture); } } - + internal static string MissingReminderText { get { return ResourceManager.GetString("MissingReminderText", resourceCulture); } } - + internal static string FeedbackReminderAdded { get { return ResourceManager.GetString("FeedbackReminderAdded", resourceCulture); } } - + internal static string InvalidRemindIn { get { return ResourceManager.GetString("InvalidRemindIn", resourceCulture); } } - + internal static string IssuedBy { get { return ResourceManager.GetString("IssuedBy", resourceCulture); diff --git a/Messages.resx b/Messages.resx index 9b4eeda..1d41ed5 100644 --- a/Messages.resx +++ b/Messages.resx @@ -131,8 +131,8 @@ Cleared message from {0} in channel {1}: {2} - Edited message in channel {0}: {1} -> {2} - + Edited message by {0}: + {0}, welcome to {1} diff --git a/Messages.ru.resx b/Messages.ru.resx index 9f454d9..64575a7 100644 --- a/Messages.ru.resx +++ b/Messages.ru.resx @@ -131,8 +131,8 @@ Очищено сообщение от {0} в канале {1}: {2} - Отредактировано сообщение в канале {0}: {1} -> {2} - + Сообщение {0} отредактировано: + {0}, добро пожаловать на сервер {1} diff --git a/Messages.tt-ru.resx b/Messages.tt-ru.resx index 26ad51e..38c581f 100644 --- a/Messages.tt-ru.resx +++ b/Messages.tt-ru.resx @@ -131,8 +131,8 @@ вырезано сообщение (используя `!clear`) от {0} в канале {1}: {2} - переделано сообщение от {0}: {1} -> {2} - + сообщение {0} переделано: + {0}, добро пожаловать на сервер {1}