better help, some cleanup, some data on login

This commit is contained in:
Master Kwoth 2016-01-21 01:33:30 +01:00
parent 56cdd6ec66
commit b969f1ff73
3 changed files with 13 additions and 7 deletions

View File

@ -39,7 +39,7 @@ namespace NadekoBot
foreach (var com in client.Commands().AllCommands) { foreach (var com in client.Commands().AllCommands) {
if (com.Category != lastCategory) { if (com.Category != lastCategory) {
helpstr += "\n### " + com.Category + " \n"; helpstr += "\n### " + com.Category + " \n";
helpstr += "Command [alias] | Description | Usage\n"; helpstr += "Command and aliases | Description | Usage\n";
helpstr += "----------------|--------------|-------\n"; helpstr += "----------------|--------------|-------\n";
lastCategory = com.Category; lastCategory = com.Category;
} }
@ -66,7 +66,7 @@ namespace NadekoBot
{ {
var str = "`" + com.Text + "`"; var str = "`" + com.Text + "`";
foreach (var a in com.Aliases) foreach (var a in com.Aliases)
str += " [" + a + " ]"; str += ", `" + a + "`";
str += " **Description:** " + com.Description + "\n"; str += " **Description:** " + com.Description + "\n";
return str; return str;
} }

View File

@ -224,7 +224,7 @@ namespace NadekoBot.Modules
} }
}); });
CreateCommand(cgb, "are you real") cgb.CreateCommand("are you real")
.Description("Useless.") .Description("Useless.")
.Do(async e => .Do(async e =>
{ {
@ -236,13 +236,13 @@ namespace NadekoBot.Modules
.Alias(new string[] { "!", "?" }) .Alias(new string[] { "!", "?" })
.Do(SayYes()); .Do(SayYes());
CreateCommand(cgb, "draw") cgb.CreateCommand("draw")
.Description("Nadeko instructs you to type $draw. Gambling functions start with $") .Description("Nadeko instructs you to type $draw. Gambling functions start with $")
.Do(async e => .Do(async e =>
{ {
await e.Send("Sorry, I don't gamble, type $draw for that function."); await e.Send("Sorry, I don't gamble, type $draw for that function.");
}); });
CreateCommand(cgb, "fire") cgb.CreateCommand("fire")
.Description("Shows a unicode fire message. Optional parameter [x] tells her how many times to repeat the fire.\n**Usage**: @NadekoBot fire [x]") .Description("Shows a unicode fire message. Optional parameter [x] tells her how many times to repeat the fire.\n**Usage**: @NadekoBot fire [x]")
.Parameter("times", ParameterType.Optional) .Parameter("times", ParameterType.Optional)
.Do(async e => .Do(async e =>
@ -296,7 +296,7 @@ namespace NadekoBot.Modules
} }
}); });
AliasCommand(CreateCommand(cgb, "save"), "s") cgb.CreateCommand("save")
.Description("Saves something for the owner in a file.") .Description("Saves something for the owner in a file.")
.Parameter("all", ParameterType.Unparsed) .Parameter("all", ParameterType.Unparsed)
.Do(async e => .Do(async e =>

View File

@ -9,6 +9,7 @@ using Discord.Modules;
using Discord.Audio; using Discord.Audio;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Timers; using System.Timers;
using System.Linq;
namespace NadekoBot namespace NadekoBot
{ {
@ -101,7 +102,12 @@ namespace NadekoBot
client.ExecuteAndWait(async () => client.ExecuteAndWait(async () =>
{ {
await client.Connect(c.Username, c.Password); await client.Connect(c.Username, c.Password);
Console.WriteLine("Connected!"); Console.WriteLine("Logged in as: " + client.CurrentUser.Name);
Console.WriteLine("Bot id: " + client.CurrentUser.Id);
Console.WriteLine("Servers: " + client.Servers.Count());
Console.WriteLine("Channels: " + client.Servers.Sum(s=>s.AllChannels.Count()));
Console.WriteLine("Discord.Net version: " + DiscordConfig.LibVersion);
Console.WriteLine("-------------------------");
}); });
Console.WriteLine("Exiting..."); Console.WriteLine("Exiting...");
Console.ReadKey(); Console.ReadKey();