Gutted BJBot - /bj doesn't work
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
from discord import *
|
||||
from discord.ext import commands
|
||||
import discord
|
||||
|
||||
from BlackJack import *
|
||||
|
||||
client = commands.Bot(command_prefix='~~')
|
||||
|
||||
async def discordInput(interaction: discord.Interaction, message:str):
|
||||
await interaction.response.send_message(message)
|
||||
def check(m):
|
||||
return m.content in ["h", "s"] and m.channel == interaction.channel
|
||||
msg = await client.wait_for('message', check=check)
|
||||
|
||||
async def discordOutput(ctx, message):
|
||||
await ctx.send(message)
|
||||
|
||||
@client.event
|
||||
async def on_ready():
|
||||
@@ -12,6 +19,8 @@ async def on_ready():
|
||||
|
||||
@client.command()
|
||||
async def play_game(ctx, arg):
|
||||
await ctx.send("Players hand = " + str(getHandTotal(bj.playerHand)) + ": " + handNumbersToCards(
|
||||
bj.playerHand) + "\n" + "Dealers hand = ??: " + convertNumberToCard(bj.dealerHand[0]) + "??")
|
||||
bj = BlackJack()
|
||||
gameOver = False
|
||||
playerStood = False
|
||||
@@ -32,8 +41,7 @@ async def play_game(ctx, arg):
|
||||
gameOver = bj.checkGameOver(dealerWinState)
|
||||
if gameOver:
|
||||
continue
|
||||
await ctx.send("Players hand = " + str(getHandTotal(bj.playerHand)) + ": " + handNumbersToCards(
|
||||
bj.playerHand) + "\n" + "Dealers hand = ??: " + convertNumberToCard(bj.dealerHand[0]) + "??")
|
||||
|
||||
|
||||
await ctx.send("Hit or Stand? (h/s)")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user