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

View file

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

View file

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

View file

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

View file

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