Skip to content

Commit

Permalink
Updated master
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni committed Jan 2, 2022
2 parents 56333f8 + 7e135b7 commit 6aece9b
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions UPBot Code/Commands/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,28 @@ public async Task GameCommand(CommandContext ctx)
}

[Command("bool")]
[Description("Returns True or False")]
public async Task BoolCommand(CommandContext ctx)
{
Utils.LogUserCommand(ctx);
UtilityFunctions.LogUserCommand(ctx);
await PlayBool(ctx);
}

[Command("rps")]
public async Task RPSCommand(CommandContext ctx, string kind)
[Description("Play Rock, Paper, Scissors")]
public async Task RPSCommand(CommandContext ctx, [Description("rock | paper | scissors")] string kind)
{
Utils.LogUserCommand(ctx);
UtilityFunctions.LogUserCommand(ctx);
await PlayRockPaperScissors(ctx, kind);
}

[Command("rps")]
public async Task RPSCommand(CommandContext ctx)
{
Utils.LogUserCommand(ctx);
UtilityFunctions.LogUserCommand(ctx);
await PlayRockPaperScissors(ctx, null);
}


readonly Random random = new Random();

Task PlayBool(CommandContext ctx)
Expand All @@ -58,7 +59,6 @@ Task PlayBool(CommandContext ctx)
default:
return ctx.RespondAsync("false");
}

}

enum RPSTypes : ushort
Expand All @@ -70,9 +70,6 @@ enum RPSTypes : ushort

Task PlayRockPaperScissors(CommandContext ctx, string kind)
{
if (kind == null)
return ctx.RespondAsync("```\nRock Paper Scissors\nUsage pattern: rps [rock|paper|scissors]\n```");

RPSTypes playerChoice;

switch(kind)
Expand All @@ -94,7 +91,8 @@ Task PlayRockPaperScissors(CommandContext ctx, string kind)

if(playerChoice == botChoice)
{
return ctx.RespondAsync("@@@\nDRAW!".Replace("@@@", botChoice.ToString()));
//return ctx.RespondAsync("@@@\nDRAW!".Replace("@@@", botChoice.ToString()));
return ctx.Channel.SendMessageAsync(ctx.Member.Mention + "\n@@@\nDRAW!".Replace("@@@", botChoice.ToString()));
}
if(playerChoice == RPSTypes.Rock && botChoice == RPSTypes.Scissors)
{
Expand Down

0 comments on commit 6aece9b

Please sign in to comment.