Merge pull request #771 from samdivaio/1.0

some fixes and cleanup
This commit is contained in:
Master Kwoth 2016-11-19 04:00:40 +01:00 committed by GitHub
commit 12110a7fc1
2 changed files with 34 additions and 34 deletions

View File

@ -38,7 +38,7 @@ namespace NadekoBot.Modules.Help
public async Task Modules(IUserMessage umsg)
{
await umsg.Channel.SendMessageAsync("`List of modules:` ```xl\n• " + string.Join("\n• ", _commands.Modules.Select(m => m.Name)) + $"\n``` `Type \"-commands module_name\" to get a list of commands in that module.`")
await umsg.Channel.SendMessageAsync("📜 **List of modules:** ```xl\n• " + string.Join("\n• ", _commands.Modules.Select(m => m.Name)) + $"\n``` **Type** `-commands module_name` **to get a list of commands in that module.** ***e.g.*** `-commands games`")
.ConfigureAwait(false);
}
@ -58,18 +58,18 @@ namespace NadekoBot.Modules.Help
var cmdsArray = cmds as Command[] ?? cmds.ToArray();
if (!cmdsArray.Any())
{
await channel.SendMessageAsync("That module does not exist.").ConfigureAwait(false);
await channel.SendMessageAsync("🚫 **That module does not exist.**").ConfigureAwait(false);
return;
}
if (module != "customreactions" && module != "conversations")
{
await channel.SendTableAsync("`List Of Commands:`\n", cmdsArray, el => $"{el.Text,-15} {"["+el.Aliases.Skip(1).FirstOrDefault()+"]",-8}").ConfigureAwait(false);
await channel.SendTableAsync("📃 **List Of Commands:**\n", cmdsArray, el => $"{el.Text,-15} {"["+el.Aliases.Skip(1).FirstOrDefault()+"]",-8}").ConfigureAwait(false);
}
else
{
await channel.SendMessageAsync("`List Of Commands:`\n• " + string.Join("\n• ", cmdsArray.Select(c => $"{c.Text}")));
await channel.SendMessageAsync("📃 **List Of Commands:**\n• " + string.Join("\n• ", cmdsArray.Select(c => $"{c.Text}")));
}
await channel.SendMessageAsync($"`You can type \"{NadekoBot.ModulePrefixes[typeof(Help).Name]}h CommandName\" to see the help about that specific command.`").ConfigureAwait(false);
await channel.SendMessageAsync($" **Type** `\"{NadekoBot.ModulePrefixes[typeof(Help).Name]}h CommandName\"` **to see the help for that specified command.** ***e.g.*** `-h >8ball`").ConfigureAwait(false);
}
[NadekoCommand, Usage, Description, Aliases]
@ -88,7 +88,7 @@ namespace NadekoBot.Modules.Help
if (com == null)
{
await channel.SendMessageAsync("`No command found.`");
await channel.SendMessageAsync("🔍 **I can't find that command.**");
return;
}
var str = $"**__Help for:__ `{com.Text}`**";
@ -107,7 +107,7 @@ namespace NadekoBot.Modules.Help
.Select(ca =>
{
if (ca.AttributeType == typeof(OwnerOnlyAttribute))
return "**Bot owner only.**";
return "**Bot Owner only.**";
else if (ca.AttributeType == typeof(RequirePermissionAttribute))
return $"**Requires {(GuildPermission)ca.ConstructorArguments.FirstOrDefault().Value} server permission.**".Replace("Guild", "Server");
else
@ -182,4 +182,4 @@ Don't forget to leave your discord name or id in the message.
public int GetHashCode(Command obj) => obj.Text.GetHashCode();
}
}
}

View File

@ -1,4 +1,4 @@
using Discord;
using Discord;
using Discord.Commands;
using NadekoBot.Attributes;
using NadekoBot.Extensions;
@ -46,21 +46,21 @@ namespace NadekoBot.Modules.Utility
var createdAt = new DateTime(2015, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(server.Id >> 22);
var sb = new StringBuilder();
var users = await server.GetUsersAsync();
sb.AppendLine($@"`Name:` **{server.Name}**
`Owner:` **{await server.GetUserAsync(server.OwnerId)}**
`Id:` **{server.Id}**
`Icon Url:` **{ server.IconUrl}**
`TextChannels:` **{(await server.GetTextChannelsAsync()).Count()}** `VoiceChannels:` **{(await server.GetVoiceChannelsAsync()).Count()}**
`Members:` **{users.Count}** `-` {users.Count(u => u.Status == UserStatus.Online)}:green_heart: {users.Count(u => u.Status == UserStatus.Idle)}:yellow_heart: {users.Count(u => u.Status == UserStatus.DoNotDisturb)}:heart: {users.Count(u=> u.Status == UserStatus.Offline || u.Status == UserStatus.Unknown)}:black_heart:
`Roles:` **{server.Roles.Count()}**
`Created At:` **{createdAt.ToString("dd.MM.yyyy HH:mm")}**
sb.AppendLine($@"__`Name:`__ **{server.Name}**
__`Owner:`__ **{await server.GetUserAsync(server.OwnerId)}**
__`ID:`__ **{server.Id}**
__`Icon URL:`__ { server.IconUrl}
__`TextChannels:`__ **{(await server.GetTextChannelsAsync()).Count()}** `VoiceChannels:` **{(await server.GetVoiceChannelsAsync()).Count()}**
__`Members:`__ **{users.Count}** `-` {users.Count(u => u.Status == UserStatus.Online)}:green_heart: {users.Count(u => u.Status == UserStatus.Idle)}:yellow_heart: {users.Count(u => u.Status == UserStatus.DoNotDisturb)}:heart: {users.Count(u=> u.Status == UserStatus.Offline || u.Status == UserStatus.Unknown)}:black_heart:
__`Roles:`__ **{server.Roles.Count()}**
__`Created At:`__ **{createdAt.ToString("dd.MM.yyyy HH:mm")}**
");
if (server.Emojis.Count() > 0)
sb.AppendLine($"`Custom Emojis:` **{string.Join(", ", server.Emojis)}**");
sb.AppendLine($"__`Custom Emojis:`__ *{string.Join(", ", server.Emojis)}*");
if (server.Features.Count() > 0)
sb.AppendLine($"`Features:` **{string.Join(", ", server.Features)}**");
sb.AppendLine($"__`Features:`__ **{string.Join(", ", server.Features)}**");
if (!string.IsNullOrWhiteSpace(server.SplashUrl))
sb.AppendLine($"`Region:` **{server.VoiceRegionId}**");
sb.AppendLine($"__`Region:`__ **{server.VoiceRegionId}**");
await msg.Reply(sb.ToString()).ConfigureAwait(false);
}
@ -72,11 +72,11 @@ namespace NadekoBot.Modules.Utility
if (ch == null)
return;
var createdAt = new DateTime(2015, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(ch.Id >> 22);
var toReturn = $@"`Name:` **#{ch.Name}**
`Id:` **{ch.Id}**
`Created At:` **{createdAt.ToString("dd.MM.yyyy HH:mm")}**
`Topic:` **{ch.Topic}**
`Users:` **{(await ch.GetUsersAsync()).Count()}**";
var toReturn = $@"__`Name:`__ **#{ch.Name}**
__`ID:`__ **{ch.Id}**
__`Created At:`__ **{createdAt.ToString("dd.MM.yyyy HH:mm")}**
__`Topic:`__ {ch.Topic}
__`Users:`__ **{(await ch.GetUsersAsync()).Count()}**";
await msg.Reply(toReturn).ConfigureAwait(false);
}
@ -88,16 +88,16 @@ namespace NadekoBot.Modules.Utility
var user = usr ?? msg.Author as IGuildUser;
if (user == null)
return;
var toReturn = $"`Name#Discrim:` **#{user.Username}#{user.Discriminator}**\n";
var toReturn = $"__`Name:`__ **{user.Username}#{user.Discriminator}**\n";
if (!string.IsNullOrWhiteSpace(user.Nickname))
toReturn += $"`Nickname:` **{user.Nickname}**";
toReturn += $@"`Id:` **{user.Id}**
`Current Game:` **{(user.Game?.Name == null ? "-" : user.Game.Name)}**
`Joined Server:` **{user.JoinedAt?.ToString("dd.MM.yyyy HH:mm")}**
`Joined Discord:` **{user.CreatedAt.ToString("dd.MM.yyyy HH:mm")}**
`Roles:` **({user.Roles.Count()}) - {string.Join(", ", user.Roles.Select(r => r.Name)).SanitizeMentions()}**
`AvatarUrl:` **{await NadekoBot.Google.ShortenUrl(user.AvatarUrl).ConfigureAwait(false)}**";
toReturn += $"__`Nickname:`__ **{user.Nickname}** ";
toReturn += $@"__`ID:`__ **{user.Id}**
__`Current Game:`__ **{(user.Game?.Name == null ? "-" : user.Game.Name)}**
__`Joined Server:`__ **{user.JoinedAt?.ToString("dd.MM.yyyy HH:mm")}**
__`Joined Discord:`__ **{user.CreatedAt.ToString("dd.MM.yyyy HH:mm")}**
__`Roles:`__ **({user.Roles.Count()}) - {string.Join(", ", user.Roles.Select(r => r.Name)).SanitizeMentions()}**
__`Avatar URL:`__ **{await NadekoBot.Google.ShortenUrl(user.AvatarUrl).ConfigureAwait(false)}**";
await msg.Reply(toReturn).ConfigureAwait(false);
}
}
}
}