-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
93 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using csharp_discord_bot.Helpers; | ||
using DSharpPlus.CommandsNext; | ||
using DSharpPlus.CommandsNext.Attributes; | ||
using DSharpPlus.Entities; | ||
|
||
namespace csharp_discord_bot.Commands | ||
{ | ||
public class CardGameEmbed : BaseCommandModule | ||
{ | ||
[Command("cardgame")] | ||
public async Task CardGame(CommandContext ctx) | ||
{ | ||
var userCard = new CardSystem(); | ||
var botCard = new CardSystem(); | ||
|
||
var userCardEmbed = new DiscordEmbedBuilder | ||
{ | ||
Title = $"Your card is {userCard.SelectedCard}", | ||
Color = DiscordColor.Lilac, | ||
}; | ||
|
||
await ctx.Channel.SendMessageAsync(embed: userCardEmbed); | ||
|
||
var botCardEmbed = new DiscordEmbedBuilder | ||
{ | ||
Title = $"The bot Drew a {botCard.SelectedCard}", | ||
Color = DiscordColor.Orange | ||
}; | ||
|
||
await ctx.Channel.SendMessageAsync(embed: botCardEmbed); | ||
|
||
if (userCard.SelectedNumber > botCard.SelectedNumber) | ||
{ | ||
// User wins | ||
var winMessage = new DiscordEmbedBuilder | ||
{ | ||
Title = "Congrat!, You Win the game!!", | ||
Color = DiscordColor.Green | ||
}; | ||
|
||
await ctx.Channel.SendMessageAsync(embed: winMessage); | ||
} | ||
else | ||
{ | ||
// Bot wins | ||
var loseMessage = new DiscordEmbedBuilder | ||
{ | ||
Title = "You Lose the game!!", | ||
Color = DiscordColor.Red | ||
}; | ||
|
||
await ctx.Channel.SendMessageAsync(embed: loseMessage); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters