Ledger reimplemented with SQLite3
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import discord
|
||||
import sqlite3
|
||||
from discord import app_commands
|
||||
from BlackJack import BlackJack
|
||||
|
||||
|
||||
botIntents = discord.Intents.all()
|
||||
|
||||
client = discord.Client(intents=botIntents)
|
||||
@@ -75,7 +77,7 @@ async def bj(interaction: discord.Interaction):
|
||||
discoutput = lambda m: discordOutput(interaction, m)
|
||||
blackJack = BlackJack(discinput, discoutput)
|
||||
await interaction.response.send_message("Let's play Black Jack!")
|
||||
await blackJack.play_game(interaction.user, 100)
|
||||
await blackJack.play_game(interaction.user.id, 100)
|
||||
|
||||
async def discordInput(interaction: discord.Interaction, message:str):
|
||||
response = HitOrStand()
|
||||
@@ -86,6 +88,14 @@ async def discordInput(interaction: discord.Interaction, message:str):
|
||||
async def discordOutput(interaction: discord.Interaction, message):
|
||||
await interaction.followup.send(message)
|
||||
|
||||
@tree.command(description="Find your Balance")
|
||||
async def bal(interaction: discord.Interaction):
|
||||
conn = sqlite3.connect("ledger.db")
|
||||
cur = conn.cursor()
|
||||
ID = interaction.user.id
|
||||
data = cur.execute("SELECT * FROM ledger WHERE USERID = ?", (ID,))
|
||||
await interaction.response.send_message(data)
|
||||
|
||||
"""
|
||||
#### Fin ####
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user