mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-03 20:49:54 +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:
parent
72f728323e
commit
4748c5de2c
5 changed files with 81 additions and 81 deletions
|
@ -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)));
|
||||
}
|
||||
|
|
52
src/Messages.Designer.cs
generated
52
src/Messages.Designer.cs
generated
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue