Gutted BJBot - /bj doesn't work
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import discord
|
||||
from discord import app_commands
|
||||
from BlackJack import BlackJack
|
||||
|
||||
botIntents = discord.Intents.all()
|
||||
|
||||
|
||||
client = discord.Client(intents=botIntents)
|
||||
tree = app_commands.CommandTree(client)
|
||||
|
||||
@@ -41,7 +41,21 @@ class Buttons(discord.ui.View):
|
||||
for child in self.children:
|
||||
child.disabled = True
|
||||
await interaction.response.edit_message(content=f"Ouch!", view=self)
|
||||
|
||||
|
||||
@tree.command(description="Play Black Jack!")
|
||||
async def bj(interaction: discord.Interaction):
|
||||
discinput = lambda m: discordInput(interaction, m)
|
||||
discoutput = lambda m: discordOutput(interaction, m)
|
||||
blackJack = BlackJack(discinput, discoutput)
|
||||
blackJack.play_game(100)
|
||||
|
||||
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(interaction, message):
|
||||
await interaction.response.send_message(message)
|
||||
|
||||
client.run('NzgwNzg4NDIwMjkzMDM0MDA0.GEKkUB.Bbl09D3lWMGea_mcIESPMLUyGlkW-6N53BPFjI')
|
||||
Reference in New Issue
Block a user