Skip to content

Commit

Permalink
fix wolfram alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmNotGoodWithComputers committed Apr 6, 2019
1 parent 2aac160 commit 77ed160
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions BotCommands/AnswerCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,20 @@ public bool CanExecute(SocketMessage message)

public async Task Execute(SocketMessage message)
{
var requestQuery = message.Content.Replace("!", "");
var requestQuery = message.Content.Replace("!answer ", "");

if (requestQuery == "what is the heaviest object in the universe")
{
var matthewResponse = new EmbedBuilder();
matthewResponse.AddField(new EmbedFieldBuilder().WithName("Result").WithValue("Matthew"));
return;
}

await message.Channel.TriggerTypingAsync();
var result = wolframAlphaClient.ApiCall(requestQuery);
if (result == null)
{
await message.Channel.SendMessageAsync("No answer was found to this question");
await message.Channel.SendMessageAsync("Wolfram|Alpha seems to be down");
return;
}

Expand Down

0 comments on commit 77ed160

Please sign in to comment.