mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
Made .sinfo slightly better
This commit is contained in:
@@ -32,35 +32,40 @@ namespace NadekoBot.Modules.Utility
|
|||||||
var channel = (ITextChannel)ctx.Channel;
|
var channel = (ITextChannel)ctx.Channel;
|
||||||
guildName = guildName?.ToUpperInvariant();
|
guildName = guildName?.ToUpperInvariant();
|
||||||
SocketGuild guild;
|
SocketGuild guild;
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(guildName))
|
if (string.IsNullOrWhiteSpace(guildName))
|
||||||
guild = (SocketGuild)channel.Guild;
|
guild = (SocketGuild)channel.Guild;
|
||||||
else
|
else
|
||||||
guild = _client.Guilds.FirstOrDefault(g => g.Name.ToUpperInvariant() == guildName.ToUpperInvariant());
|
guild = _client.Guilds.FirstOrDefault(g => g.Name.ToUpperInvariant() == guildName.ToUpperInvariant());
|
||||||
|
|
||||||
if (guild is null)
|
if (guild is null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var ownername = guild.GetUser(guild.OwnerId);
|
var ownername = guild.GetUser(guild.OwnerId);
|
||||||
var textchn = guild.TextChannels.Count();
|
var textchn = guild.TextChannels.Count;
|
||||||
var voicechn = guild.VoiceChannels.Count();
|
var voicechn = guild.VoiceChannels.Count;
|
||||||
|
var channels = $@"{GetText(strs.text_channels(textchn))}
|
||||||
|
{GetText(strs.voice_channels(voicechn))}";
|
||||||
var createdAt = new DateTime(2015, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(guild.Id >> 22);
|
var createdAt = new DateTime(2015, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(guild.Id >> 22);
|
||||||
var features = string.Join("\n", guild.Features);
|
var features = string.Join(", ", guild.Features);
|
||||||
if (string.IsNullOrWhiteSpace(features))
|
if (string.IsNullOrWhiteSpace(features))
|
||||||
features = "-";
|
features = "-";
|
||||||
|
|
||||||
var embed = _eb.Create()
|
var embed = _eb.Create()
|
||||||
.WithAuthor(GetText(strs.server_info))
|
.WithAuthor(GetText(strs.server_info))
|
||||||
.WithTitle(guild.Name)
|
.WithTitle(guild.Name)
|
||||||
.AddField(GetText(strs.id), guild.Id.ToString(), true)
|
.AddField(GetText(strs.id), guild.Id.ToString(), true)
|
||||||
.AddField(GetText(strs.owner), ownername.ToString(), true)
|
.AddField(GetText(strs.owner), ownername.ToString(), true)
|
||||||
.AddField(GetText(strs.members), guild.MemberCount.ToString(), true)
|
.AddField(GetText(strs.members), guild.MemberCount.ToString(), true)
|
||||||
.AddField(GetText(strs.text_channels), textchn.ToString(), true)
|
.AddField(GetText(strs.channels), channels, true)
|
||||||
.AddField(GetText(strs.voice_channels), voicechn.ToString(), true)
|
|
||||||
.AddField(GetText(strs.created_at), $"{createdAt:dd.MM.yyyy HH:mm}", true)
|
.AddField(GetText(strs.created_at), $"{createdAt:dd.MM.yyyy HH:mm}", true)
|
||||||
.AddField(GetText(strs.region), guild.VoiceRegionId.ToString(), true)
|
|
||||||
.AddField(GetText(strs.roles), (guild.Roles.Count - 1).ToString(), true)
|
.AddField(GetText(strs.roles), (guild.Roles.Count - 1).ToString(), true)
|
||||||
.AddField(GetText(strs.features), features, true)
|
.AddField(GetText(strs.features), features)
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
|
|
||||||
if (Uri.IsWellFormedUriString(guild.IconUrl, UriKind.Absolute))
|
if (Uri.IsWellFormedUriString(guild.IconUrl, UriKind.Absolute))
|
||||||
embed.WithThumbnailUrl(guild.IconUrl);
|
embed.WithThumbnailUrl(guild.IconUrl);
|
||||||
|
|
||||||
if (guild.Emotes.Any())
|
if (guild.Emotes.Any())
|
||||||
{
|
{
|
||||||
embed.AddField(GetText(strs.custom_emojis) + $"({guild.Emotes.Count})",
|
embed.AddField(GetText(strs.custom_emojis) + $"({guild.Emotes.Count})",
|
||||||
|
@@ -605,12 +605,13 @@
|
|||||||
"shard": "Shard",
|
"shard": "Shard",
|
||||||
"showemojis": "**Name:** {0} **Link:** {1}",
|
"showemojis": "**Name:** {0} **Link:** {1}",
|
||||||
"showemojis_none": "No special emojis found.",
|
"showemojis_none": "No special emojis found.",
|
||||||
"text_channels": "Text channels",
|
"channels": "Channels",
|
||||||
|
"text_channels": "Text: {0}",
|
||||||
|
"voice_channels": "Voice: {0}",
|
||||||
"uptime": "Uptime",
|
"uptime": "Uptime",
|
||||||
"userid": "{0} of the user {1} is {2}",
|
"userid": "{0} of the user {1} is {2}",
|
||||||
"roleid": "{0} of the role {1} is {2}",
|
"roleid": "{0} of the role {1} is {2}",
|
||||||
"users": "Users",
|
"users": "Users",
|
||||||
"voice_channels": "Voice channels",
|
|
||||||
"current_poll_results": "Current poll results",
|
"current_poll_results": "Current poll results",
|
||||||
"poll_already_running": "Poll is already running on this server.",
|
"poll_already_running": "Poll is already running on this server.",
|
||||||
"poll_created": "📃 {0} has created a poll",
|
"poll_created": "📃 {0} has created a poll",
|
||||||
|
Reference in New Issue
Block a user