Fixed modules/commands compile errors

This commit is contained in:
RogueException
2015-12-23 03:00:46 -04:00
parent 06fae0c95a
commit 1762bf438f
9 changed files with 62 additions and 63 deletions

View File

@@ -51,14 +51,14 @@ namespace Discord.Commands
.Description("Returns information about commands.")
.Do(async e =>
{
Channel replyChannel = _config.HelpMode == HelpMode.Public ? e.Channel : await client.CreatePMChannel(e.User);
Channel replyChannel = _config.HelpMode == HelpMode.Public ? e.Channel : await e.User.CreateChannel();
if (e.Args.Length > 0) //Show command help
{
var map = _map.GetItem(string.Join(" ", e.Args));
if (map != null)
await ShowCommandHelp(map, e.User, e.Channel, replyChannel);
else
await client.SendMessage(replyChannel, "Unable to display help: Unknown command.");
await replyChannel.SendMessage("Unable to display help: Unknown command.");
}
else //Show general help
await ShowGeneralHelp(e.User, e.Channel, replyChannel);
@@ -68,7 +68,7 @@ namespace Discord.Commands
client.MessageReceived += async (s, e) =>
{
if (_allCommands.Count == 0) return;
if (e.Message.IsAuthor) return;
if (e.Message.User.Id == _client.CurrentUser.Id) return;
string msg = e.Message.RawText;
if (msg.Length == 0) return;
@@ -199,7 +199,7 @@ namespace Discord.Commands
output.AppendLine($"`help <command>` can tell you more about how to use a command.");
}
return _client.SendMessage(replyChannel ?? channel, output.ToString());
return (replyChannel ?? channel).SendMessage(output.ToString());
}
private Task ShowCommandHelp(CommandMap map, User user, Channel channel, Channel replyChannel = null)
@@ -255,7 +255,7 @@ namespace Discord.Commands
output.AppendLine("There are no commands you have permission to run.");
}
return _client.SendMessage(replyChannel ?? channel, output.ToString());
return (replyChannel ?? channel).SendMessage(output.ToString());
}
public Task ShowCommandHelp(Command command, User user, Channel channel, Channel replyChannel = null)
{
@@ -265,7 +265,7 @@ namespace Discord.Commands
output.AppendLine(error ?? DefaultPermissionError);
else
ShowCommandHelpInternal(command, user, channel, output);
return _client.SendMessage(replyChannel ?? channel, output.ToString());
return (replyChannel ?? channel).SendMessage(output.ToString());
}
private void ShowCommandHelpInternal(Command command, User user, Channel channel, StringBuilder output)
{