1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 09:09:00 +03:00

Rename /showinfo to avoid confusion with /guildinfo (#153)

Depends on #152

Signed-off-by: Macintosh II <mctaylxrs@outlook.com>
Signed-off-by: Macintosh II <95250141+mctaylors@users.noreply.github.com>
This commit is contained in:
Macintxsh 2023-10-06 15:35:08 +03:00 committed by GitHub
parent 72f728323e
commit 4748c5de2c
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 81 additions and 81 deletions

View file

@ -483,46 +483,46 @@
<data name="ReminderText" xml:space="preserve"> <data name="ReminderText" xml:space="preserve">
<value>Reminder text: {0}</value> <value>Reminder text: {0}</value>
</data> </data>
<data name="ShowInfoDisplayName" xml:space="preserve"> <data name="UserInfoDisplayName" xml:space="preserve">
<value>Display name</value> <value>Display name</value>
</data> </data>
<data name="InformationAbout" xml:space="preserve"> <data name="InformationAbout" xml:space="preserve">
<value>Information about {0}</value> <value>Information about {0}</value>
</data> </data>
<data name="ShowInfoMuted" xml:space="preserve"> <data name="UserInfoMuted" xml:space="preserve">
<value>Muted</value> <value>Muted</value>
</data> </data>
<data name="ShowInfoDiscordUserSince" xml:space="preserve"> <data name="UserInfoDiscordUserSince" xml:space="preserve">
<value>Discord user since</value> <value>Discord user since</value>
</data> </data>
<data name="ShowInfoBanned" xml:space="preserve"> <data name="UserInfoBanned" xml:space="preserve">
<value>Banned</value> <value>Banned</value>
</data> </data>
<data name="ShowInfoPunishments" xml:space="preserve"> <data name="UserInfoPunishments" xml:space="preserve">
<value>Punishments</value> <value>Punishments</value>
</data> </data>
<data name="ShowInfoBannedPermanently" xml:space="preserve"> <data name="UserInfoBannedPermanently" xml:space="preserve">
<value>Banned permanently</value> <value>Banned permanently</value>
</data> </data>
<data name="ShowInfoNotOnGuild" xml:space="preserve"> <data name="UserInfoNotOnGuild" xml:space="preserve">
<value>Not in the guild</value> <value>Not in the guild</value>
</data> </data>
<data name="ShowInfoMutedByTimeout" xml:space="preserve"> <data name="UserInfoMutedByTimeout" xml:space="preserve">
<value>Muted by timeout</value> <value>Muted by timeout</value>
</data> </data>
<data name="ShowInfoMutedByMuteRole" xml:space="preserve"> <data name="UserInfoMutedByMuteRole" xml:space="preserve">
<value>Muted by mute role</value> <value>Muted by mute role</value>
</data> </data>
<data name="ShowInfoGuildMemberSince" xml:space="preserve"> <data name="UserInfoGuildMemberSince" xml:space="preserve">
<value>Guild member since</value> <value>Guild member since</value>
</data> </data>
<data name="ShowInfoGuildNickname" xml:space="preserve"> <data name="UserInfoGuildNickname" xml:space="preserve">
<value>Nickname</value> <value>Nickname</value>
</data> </data>
<data name="ShowInfoGuildRoles" xml:space="preserve"> <data name="UserInfoGuildRoles" xml:space="preserve">
<value>Roles</value> <value>Roles</value>
</data> </data>
<data name="ShowInfoGuildMemberPremiumSince" xml:space="preserve"> <data name="UserInfoGuildMemberPremiumSince" xml:space="preserve">
<value>Nitro booster since</value> <value>Nitro booster since</value>
</data> </data>
<data name="RandomTitle" xml:space="preserve"> <data name="RandomTitle" xml:space="preserve">

View file

@ -483,46 +483,46 @@
<data name="ReminderText" xml:space="preserve"> <data name="ReminderText" xml:space="preserve">
<value>Текст напоминания: {0}</value> <value>Текст напоминания: {0}</value>
</data> </data>
<data name="ShowInfoDisplayName" xml:space="preserve"> <data name="UserInfoDisplayName" xml:space="preserve">
<value>Отображаемое имя</value> <value>Отображаемое имя</value>
</data> </data>
<data name="InformationAbout" xml:space="preserve"> <data name="InformationAbout" xml:space="preserve">
<value>Информация о {0}</value> <value>Информация о {0}</value>
</data> </data>
<data name="ShowInfoMuted" xml:space="preserve"> <data name="UserInfoMuted" xml:space="preserve">
<value>Заглушен</value> <value>Заглушен</value>
</data> </data>
<data name="ShowInfoDiscordUserSince" xml:space="preserve"> <data name="UserInfoDiscordUserSince" xml:space="preserve">
<value>Вступил в Discord</value> <value>Вступил в Discord</value>
</data> </data>
<data name="ShowInfoBanned" xml:space="preserve"> <data name="UserInfoBanned" xml:space="preserve">
<value>Забанен</value> <value>Забанен</value>
</data> </data>
<data name="ShowInfoPunishments" xml:space="preserve"> <data name="UserInfoPunishments" xml:space="preserve">
<value>Наказания</value> <value>Наказания</value>
</data> </data>
<data name="ShowInfoBannedPermanently" xml:space="preserve"> <data name="UserInfoBannedPermanently" xml:space="preserve">
<value>Забанен навсегда</value> <value>Забанен навсегда</value>
</data> </data>
<data name="ShowInfoNotOnGuild" xml:space="preserve"> <data name="UserInfoNotOnGuild" xml:space="preserve">
<value>Не на сервере</value> <value>Не на сервере</value>
</data> </data>
<data name="ShowInfoMutedByTimeout" xml:space="preserve"> <data name="UserInfoMutedByTimeout" xml:space="preserve">
<value>Заглушен с помощью тайм-аута</value> <value>Заглушен с помощью тайм-аута</value>
</data> </data>
<data name="ShowInfoMutedByMuteRole" xml:space="preserve"> <data name="UserInfoMutedByMuteRole" xml:space="preserve">
<value>Заглушен с помощью роли мута</value> <value>Заглушен с помощью роли мута</value>
</data> </data>
<data name="ShowInfoGuildMemberSince" xml:space="preserve"> <data name="UserInfoGuildMemberSince" xml:space="preserve">
<value>Вступил на сервер</value> <value>Вступил на сервер</value>
</data> </data>
<data name="ShowInfoGuildNickname" xml:space="preserve"> <data name="UserInfoGuildNickname" xml:space="preserve">
<value>Никнейм</value> <value>Никнейм</value>
</data> </data>
<data name="ShowInfoGuildRoles" xml:space="preserve"> <data name="UserInfoGuildRoles" xml:space="preserve">
<value>Роли</value> <value>Роли</value>
</data> </data>
<data name="ShowInfoGuildMemberPremiumSince" xml:space="preserve"> <data name="UserInfoGuildMemberPremiumSince" xml:space="preserve">
<value>Начал бустить сервер</value> <value>Начал бустить сервер</value>
</data> </data>
<data name="RandomTitle" xml:space="preserve"> <data name="RandomTitle" xml:space="preserve">

View file

@ -483,46 +483,46 @@
<data name="ReminderText" xml:space="preserve"> <data name="ReminderText" xml:space="preserve">
<value>че там в напоминалке: {0}</value> <value>че там в напоминалке: {0}</value>
</data> </data>
<data name="ShowInfoDisplayName" xml:space="preserve"> <data name="UserInfoDisplayName" xml:space="preserve">
<value>дисплейнейм</value> <value>дисплейнейм</value>
</data> </data>
<data name="InformationAbout" xml:space="preserve"> <data name="InformationAbout" xml:space="preserve">
<value>деанон {0}</value> <value>деанон {0}</value>
</data> </data>
<data name="ShowInfoMuted" xml:space="preserve"> <data name="UserInfoMuted" xml:space="preserve">
<value>замучен</value> <value>замучен</value>
</data> </data>
<data name="ShowInfoDiscordUserSince" xml:space="preserve"> <data name="UserInfoDiscordUserSince" xml:space="preserve">
<value>юзер Discord со времен</value> <value>юзер Discord со времен</value>
</data> </data>
<data name="ShowInfoBanned" xml:space="preserve"> <data name="UserInfoBanned" xml:space="preserve">
<value>забанен</value> <value>забанен</value>
</data> </data>
<data name="ShowInfoPunishments" xml:space="preserve"> <data name="UserInfoPunishments" xml:space="preserve">
<value>приколы полученные по заслугам</value> <value>приколы полученные по заслугам</value>
</data> </data>
<data name="ShowInfoBannedPermanently" xml:space="preserve"> <data name="UserInfoBannedPermanently" xml:space="preserve">
<value>забанен</value> <value>забанен</value>
</data> </data>
<data name="ShowInfoNotOnGuild" xml:space="preserve"> <data name="UserInfoNotOnGuild" xml:space="preserve">
<value>вышел из сервера</value> <value>вышел из сервера</value>
</data> </data>
<data name="ShowInfoMutedByTimeout" xml:space="preserve"> <data name="UserInfoMutedByTimeout" xml:space="preserve">
<value>замучен таймаутом</value> <value>замучен таймаутом</value>
</data> </data>
<data name="ShowInfoMutedByMuteRole" xml:space="preserve"> <data name="UserInfoMutedByMuteRole" xml:space="preserve">
<value>замучен ролькой</value> <value>замучен ролькой</value>
</data> </data>
<data name="ShowInfoGuildMemberSince" xml:space="preserve"> <data name="UserInfoGuildMemberSince" xml:space="preserve">
<value>участник сервера со времен</value> <value>участник сервера со времен</value>
</data> </data>
<data name="ShowInfoGuildNickname" xml:space="preserve"> <data name="UserInfoGuildNickname" xml:space="preserve">
<value>сервернейм</value> <value>сервернейм</value>
</data> </data>
<data name="ShowInfoGuildRoles" xml:space="preserve"> <data name="UserInfoGuildRoles" xml:space="preserve">
<value>рольки</value> <value>рольки</value>
</data> </data>
<data name="ShowInfoGuildMemberPremiumSince" xml:space="preserve"> <data name="UserInfoGuildMemberPremiumSince" xml:space="preserve">
<value>бустит сервер со времен</value> <value>бустит сервер со времен</value>
</data> </data>
<data name="RandomTitle" xml:space="preserve"> <data name="RandomTitle" xml:space="preserve">

View file

@ -19,7 +19,7 @@ using Remora.Results;
namespace Octobot.Commands; namespace Octobot.Commands;
/// <summary> /// <summary>
/// Handles tool commands: /showinfo, /guildinfo, /random, /timestamp. /// Handles tool commands: /userinfo, /guildinfo, /random, /timestamp.
/// </summary> /// </summary>
[UsedImplicitly] [UsedImplicitly]
public class ToolsCommandGroup : CommandGroup public class ToolsCommandGroup : CommandGroup
@ -63,11 +63,11 @@ public class ToolsCommandGroup : CommandGroup
/// <returns> /// <returns>
/// A feedback sending result which may or may not have succeeded. /// A feedback sending result which may or may not have succeeded.
/// </returns> /// </returns>
[Command("showinfo")] [Command("userinfo")]
[DiscordDefaultDMPermission(false)] [DiscordDefaultDMPermission(false)]
[Description("Shows info about user")] [Description("Shows info about user")]
[UsedImplicitly] [UsedImplicitly]
public async Task<Result> ExecuteShowInfoAsync( public async Task<Result> ExecuteUserInfoAsync(
[Description("User to show info about")] [Description("User to show info about")]
IUser? target = null) IUser? target = null)
{ {
@ -101,11 +101,11 @@ public class ToolsCommandGroup : CommandGroup
if (target.GlobalName is not null) if (target.GlobalName is not null)
{ {
builder.Append("- ").AppendLine(Messages.ShowInfoDisplayName) builder.Append("- ").AppendLine(Messages.UserInfoDisplayName)
.AppendLine(Markdown.InlineCode(target.GlobalName)); .AppendLine(Markdown.InlineCode(target.GlobalName));
} }
builder.Append("- ").AppendLine(Messages.ShowInfoDiscordUserSince) builder.Append("- ").AppendLine(Messages.UserInfoDiscordUserSince)
.AppendLine(Markdown.Timestamp(target.ID.Timestamp)); .AppendLine(Markdown.Timestamp(target.ID.Timestamp));
var memberData = data.GetOrCreateMemberData(target.ID); var memberData = data.GetOrCreateMemberData(target.ID);
@ -129,7 +129,7 @@ public class ToolsCommandGroup : CommandGroup
if (isMuted || existingBanResult.IsDefined()) if (isMuted || existingBanResult.IsDefined())
{ {
builder.Append("### ") builder.Append("### ")
.AppendLine(Markdown.Bold(Messages.ShowInfoPunishments)); .AppendLine(Markdown.Bold(Messages.UserInfoPunishments));
} }
if (isMuted) if (isMuted)
@ -149,7 +149,7 @@ public class ToolsCommandGroup : CommandGroup
if (!guildMemberResult.IsSuccess && !existingBanResult.IsDefined()) if (!guildMemberResult.IsSuccess && !existingBanResult.IsDefined())
{ {
builder.Append("### ") builder.Append("### ")
.AppendLine(Markdown.Bold(Messages.ShowInfoNotOnGuild)); .AppendLine(Markdown.Bold(Messages.UserInfoNotOnGuild));
embedColor = ColorsList.Default; embedColor = ColorsList.Default;
} }
@ -169,23 +169,23 @@ public class ToolsCommandGroup : CommandGroup
{ {
if (guildMember.Nickname.IsDefined(out var nickname)) if (guildMember.Nickname.IsDefined(out var nickname))
{ {
builder.Append("- ").AppendLine(Messages.ShowInfoGuildNickname) builder.Append("- ").AppendLine(Messages.UserInfoGuildNickname)
.AppendLine(Markdown.InlineCode(nickname)); .AppendLine(Markdown.InlineCode(nickname));
} }
builder.Append("- ").AppendLine(Messages.ShowInfoGuildMemberSince) builder.Append("- ").AppendLine(Messages.UserInfoGuildMemberSince)
.AppendLine(Markdown.Timestamp(guildMember.JoinedAt)); .AppendLine(Markdown.Timestamp(guildMember.JoinedAt));
if (guildMember.PremiumSince.IsDefined(out var premiumSince)) if (guildMember.PremiumSince.IsDefined(out var premiumSince))
{ {
builder.Append("- ").AppendLine(Messages.ShowInfoGuildMemberPremiumSince) builder.Append("- ").AppendLine(Messages.UserInfoGuildMemberPremiumSince)
.AppendLine(Markdown.Timestamp(premiumSince.Value)); .AppendLine(Markdown.Timestamp(premiumSince.Value));
color = ColorsList.Magenta; color = ColorsList.Magenta;
} }
if (guildMember.Roles.Count > 0) if (guildMember.Roles.Count > 0)
{ {
builder.Append("- ").AppendLine(Messages.ShowInfoGuildRoles); builder.Append("- ").AppendLine(Messages.UserInfoGuildRoles);
for (var i = 0; i < guildMember.Roles.Count - 1; i++) for (var i = 0; i < guildMember.Roles.Count - 1; i++)
{ {
builder.Append($"<@&{guildMember.Roles[i]}>, "); builder.Append($"<@&{guildMember.Roles[i]}>, ");
@ -201,29 +201,29 @@ public class ToolsCommandGroup : CommandGroup
{ {
if (memberData.BannedUntil < DateTimeOffset.MaxValue) if (memberData.BannedUntil < DateTimeOffset.MaxValue)
{ {
builder.Append("- ").AppendLine(Messages.ShowInfoBanned) builder.Append("- ").AppendLine(Messages.UserInfoBanned)
.Append(" - ").AppendLine(string.Format( .Append(" - ").AppendLine(string.Format(
Messages.DescriptionActionExpiresAt, Markdown.Timestamp(memberData.BannedUntil.Value))); Messages.DescriptionActionExpiresAt, Markdown.Timestamp(memberData.BannedUntil.Value)));
return; return;
} }
builder.Append("- ").AppendLine(Messages.ShowInfoBannedPermanently); builder.Append("- ").AppendLine(Messages.UserInfoBannedPermanently);
} }
private static void AppendMuteInformation( private static void AppendMuteInformation(
MemberData memberData, DateTimeOffset? communicationDisabledUntil, StringBuilder builder) MemberData memberData, DateTimeOffset? communicationDisabledUntil, StringBuilder builder)
{ {
builder.Append("- ").AppendLine(Messages.ShowInfoMuted); builder.Append("- ").AppendLine(Messages.UserInfoMuted);
if (memberData.MutedUntil is not null && DateTimeOffset.UtcNow <= memberData.MutedUntil) if (memberData.MutedUntil is not null && DateTimeOffset.UtcNow <= memberData.MutedUntil)
{ {
builder.Append(" - ").AppendLine(Messages.ShowInfoMutedByMuteRole) builder.Append(" - ").AppendLine(Messages.UserInfoMutedByMuteRole)
.Append(" - ").AppendLine(string.Format( .Append(" - ").AppendLine(string.Format(
Messages.DescriptionActionExpiresAt, Markdown.Timestamp(memberData.MutedUntil.Value))); Messages.DescriptionActionExpiresAt, Markdown.Timestamp(memberData.MutedUntil.Value)));
} }
if (communicationDisabledUntil is not null) if (communicationDisabledUntil is not null)
{ {
builder.Append(" - ").AppendLine(Messages.ShowInfoMutedByTimeout) builder.Append(" - ").AppendLine(Messages.UserInfoMutedByTimeout)
.Append(" - ").AppendLine(string.Format( .Append(" - ").AppendLine(string.Format(
Messages.DescriptionActionExpiresAt, Markdown.Timestamp(communicationDisabledUntil.Value))); Messages.DescriptionActionExpiresAt, Markdown.Timestamp(communicationDisabledUntil.Value)));
} }

View file

@ -804,81 +804,81 @@ namespace Octobot {
} }
} }
internal static string ShowInfoDisplayName { internal static string UserInfoDisplayName {
get { get {
return ResourceManager.GetString("ShowInfoDisplayName", resourceCulture); return ResourceManager.GetString("UserInfoDisplayName", resourceCulture);
} }
} }
internal static string ShowInfoDiscordUserSince { internal static string UserInfoDiscordUserSince {
get { get {
return ResourceManager.GetString("ShowInfoDiscordUserSince", resourceCulture); return ResourceManager.GetString("UserInfoDiscordUserSince", resourceCulture);
} }
} }
internal static string ShowInfoMuted { internal static string UserInfoMuted {
get { get {
return ResourceManager.GetString("ShowInfoMuted", resourceCulture); return ResourceManager.GetString("UserInfoMuted", resourceCulture);
} }
} }
internal static string ShowInfoBanned { internal static string UserInfoBanned {
get { get {
return ResourceManager.GetString("ShowInfoBanned", resourceCulture); return ResourceManager.GetString("UserInfoBanned", resourceCulture);
} }
} }
internal static string ShowInfoPunishments { internal static string UserInfoPunishments {
get { get {
return ResourceManager.GetString("ShowInfoPunishments", resourceCulture); return ResourceManager.GetString("UserInfoPunishments", resourceCulture);
} }
} }
internal static string ShowInfoBannedPermanently { internal static string UserInfoBannedPermanently {
get { get {
return ResourceManager.GetString("ShowInfoBannedPermanently", resourceCulture); return ResourceManager.GetString("UserInfoBannedPermanently", resourceCulture);
} }
} }
internal static string ShowInfoNotOnGuild { internal static string UserInfoNotOnGuild {
get { get {
return ResourceManager.GetString("ShowInfoNotOnGuild", resourceCulture); return ResourceManager.GetString("UserInfoNotOnGuild", resourceCulture);
} }
} }
internal static string ShowInfoMutedByTimeout { internal static string UserInfoMutedByTimeout {
get { get {
return ResourceManager.GetString("ShowInfoMutedByTimeout", resourceCulture); return ResourceManager.GetString("UserInfoMutedByTimeout", resourceCulture);
} }
} }
internal static string ShowInfoMutedByMuteRole { internal static string UserInfoMutedByMuteRole {
get { get {
return ResourceManager.GetString("ShowInfoMutedByMuteRole", resourceCulture); return ResourceManager.GetString("UserInfoMutedByMuteRole", resourceCulture);
} }
} }
internal static string ShowInfoGuildMemberSince { internal static string UserInfoGuildMemberSince {
get { get {
return ResourceManager.GetString("ShowInfoGuildMemberSince", resourceCulture); return ResourceManager.GetString("UserInfoGuildMemberSince", resourceCulture);
} }
} }
internal static string ShowInfoGuildNickname { internal static string UserInfoGuildNickname {
get { get {
return ResourceManager.GetString("ShowInfoGuildNickname", resourceCulture); return ResourceManager.GetString("UserInfoGuildNickname", resourceCulture);
} }
} }
internal static string ShowInfoGuildRoles { internal static string UserInfoGuildRoles {
get { get {
return ResourceManager.GetString("ShowInfoGuildRoles", resourceCulture); return ResourceManager.GetString("UserInfoGuildRoles", resourceCulture);
} }
} }
internal static string ShowInfoGuildMemberPremiumSince { internal static string UserInfoGuildMemberPremiumSince {
get { get {
return ResourceManager.GetString("ShowInfoGuildMemberPremiumSince", resourceCulture); return ResourceManager.GetString("UserInfoGuildMemberPremiumSince", resourceCulture);
} }
} }