forked from DevLops01/DiscordCryptoCasino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
575 lines (507 loc) · 24 KB
/
bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
import discord
from botSecret import secret
from fetch import *
from data import *
from discord.ext import commands
import random
from collections import namedtuple
import asyncio
import time
# Set coin specific parameters
CoinName = "" # Enter the ticker of the Altcoin
MaxCoinFlipBet = 10 # Enter the max bet amount for coinflip
MinCoinFlipBet = 1 # Enter the min bet amount for coinflip
MaxBlackJackBet = 10 # Enter the max bet amount for blackjack
MinBlackJackBet = 0.01 # Enter the min bet amount for blackjack
MaxDiceBet = 10 # Enter the max bet amount for dice
MinDiceBet = 0.01 # Enter the min bet amount for dice
LostBetsAddy = "" # Enter the address the client would like lost bets to be sent to
myUid = "" # Enter the account name for the address the client would like to pay out wins from
bot = commands.Bot(command_prefix='$')
bot.remove_command("help")
@bot.event
async def on_ready():
print("Bot is online!")
print('Logged in as {0.user}'.format(bot))
@bot.command()
async def help(ctx):
tuid = "<@" + str(ctx.author.id) + ">"
await ctx.channel.send(tuid + """
\n**$create** - Creates a wallet attached to your discord account.
\n**$balance** - Check your wallet balance.
\n**$address** - Returns the users Wallet address.
\n**$send** - Sends coins to any address. Example: ' $send Cca1eNQMF4JYCjzBsbJBbLLHE2jDPmqzop 1 '
\n**$coinflip** - Starts a game of coinflip. Example: ' $coinflip 1 Heads ' where 1 is the amount you wish to bet.
\n**$blackjack** - Starts a game of blackjack. Example: ' $blackjack 10 ' where 10 is the amount you wish to bet.
\n**$dice** - Starts a game of dice. Example: ' $dice 10 6 ' where 10 is the amount you wish to bet and 6 is the amount to roll under in order to win.
\n**$payouts** - Returns a list of payouts for Dice depending on what the 'under' is set at.
""")
@bot.command()
async def payouts(ctx):
tuid = "<@" + str(ctx.author.id) + ">"
await ctx.channel.send(tuid + """
```\n**Dice Payouts:**
\nUnder 11 Payout = 1.09 * Bet
\nUnder 10 Payout = 1.2 * Bet
\nUnder 9 Payout = 1.33 * Bet
\nUnder 8 Payout = 1.5 * Bet
\nUnder 7 Payout = 1.71 * Bet
\nUnder 6 Payout = 2 * Bet
\nUnder 5 Payout = 2.4 * Bet
\nUnder 4 Payout = 3 * Bet
\nUnder 3 Payout = 4 * Bet
\nSnake Eyes Payout = 6 * Bet```
""")
# Create User Wallet
@bot.command()
async def create(ctx):
c.execute("SELECT * FROM users")
existingUsers = c.fetchall()
raw = str(ctx.author.id)
uid = "<@" + str(ctx.author.id) + ">"
for i in existingUsers:
if i[0] == raw:
botMessage = await ctx.channel.send(uid + " \nYou already have a wallet.")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
else:
address = getNewAddy(ctx.author.id)
balance = getBalance(str(ctx.author.id))
username = str(ctx.author)
createWallet(raw, username, address, balance)
print(c.fetchall())
botMessage = await ctx.channel.send(uid + ' ' + '\n**AltCasino Wallet - ' + CoinName + ' ** \n**Address:** '
+ str(address['result']) + '. \n**Balance:** ' + str(balance['result']))
updateBalances()
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
# Return User Balance
@bot.command()
async def balance(ctx):
c.execute("SELECT * FROM users WHERE userid=:uid",
{'uid': ctx.author.id})
existingUsers = c.fetchall()
uid = "<@" + str(ctx.author.id) + ">"
for i in existingUsers:
newBalance = i[3]
botMessage = await ctx.channel.send(uid + ' ' + '\n**AltCasino Wallet - ' + CoinName + '** \n**Balance:** ' + str(newBalance) + ' ' + CoinName)
updateBalances()
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
else:
botMessage =await ctx.channel.send(uid + "\nYou haven't created a wallet yet. Please use **$create** command.")
updateBalances()
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
# Return User Deposit Address
@bot.command()
async def address(ctx):
updateBalances()
c.execute("SELECT * FROM users WHERE userid=:uid",
{'uid': ctx.author.id})
existingUsers = c.fetchall()
uid = "<@" + str(ctx.author.id) + ">"
for i in existingUsers:
userAddy = i[2]
print(userAddy)
botMessage = await ctx.channel.send(uid + '\n**AltCasino Wallet - CPU**' + '\n**Wallet Address:** ' + userAddy)
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
else:
botMessage = await ctx.channel.send(uid + "\nYou haven't created a wallet yet. Please use **$create** command.")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
# Send Coins
@bot.command()
async def send(ctx, arg1, arg2):
tuid = uid = "<@" + str(ctx.author.id) + ">"
uid = ctx.author.id
address = arg1
amount = arg2
spend = sendCoins(str(uid), str(address), str(amount))
print(spend)
if str(spend['result']) == "None":
botMessage = await ctx.channel.send(tuid + "\n**Error:** " + str(spend['error']['message']))
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
# await ctx.channel.send(tuid + "\n**Error:** Insufficient Funds")
else:
botMessage = await ctx.channel.send(tuid + "\nTransaction Successful: \n**TXID:** " + str(spend['result']))
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
# Start a Game of Coinflip
@bot.command()
async def coinflip(ctx, bet, userChoice):
updateBalances()
c.execute("SELECT * FROM users WHERE userid=:uid",
{'uid': ctx.author.id})
existingUsers = c.fetchall()
uid = str(ctx.author.id)
tuid = "<@" + str(ctx.author.id) + ">"
for i in existingUsers:
userAddy = i[2]
toPlay = getBalance(str(ctx.author.id))
newBalance = toPlay['result']
if newBalance < float(bet):
botMessage = await ctx.channel.send(tuid + "\nSorry, you don't have that many coins. \n**Balance:** " + str(newBalance) + ' ' + CoinName)
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
elif float(bet) > MaxCoinFlipBet:
botMessage = await ctx.channel.send(tuid + "\nSorry, the max bet for Coinflip is " + str(MaxCoinFlipBet) + ' ' + CoinName)
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
elif float(bet) < MinCoinFlipBet:
botMessage = await ctx.channel.send(tuid + "\nSorry, the minimum bet for Coinflip is " + str(MinCoinFlipBet) + ' ' + CoinName)
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
elif newBalance >= float(bet):
betOn = userChoice.lower()
Heads = "heads"
Tails = "tails"
options = [Heads, Tails]
landed = random.choice(options)
if landed == betOn:
botMessage1 = await ctx.channel.send(tuid + "\nCoin landed on **" + landed.upper() + "**" + "\n**Congratulations!** You Won " + str(bet) + ' ' + CoinName)
sendCoins(myUid, userAddy, bet)
updateBalances()
botMessage = await ctx.channel.send("**Please wait 5 seconds before placing a new bet**")
time.sleep(5)
await botMessage.delete()
await botMessage1.delete()
await ctx.message.delete()
await ctx.channel.purge(limit=3)
await ctx.channel.send("**You can now place a new bet**")
return
elif landed != betOn:
botMessage1 = await ctx.channel.send(tuid +"\nCoin landed on **" + landed.upper() + "**" + "\n**Oops!** You Lost " + str(bet) + ' ' + CoinName)
sendCoins(uid, LostBetsAddy, bet)
updateBalances()
botMessage = await ctx.channel.send("**Please wait 5 seconds before placing a new bet**")
time.sleep(5)
await botMessage.delete()
await botMessage1.delete()
await ctx.message.delete()
await ctx.channel.purge(limit=3)
await ctx.channel.send("**You can now place a new bet**")
return
return
else:
botMessage = await ctx.channel.send(tuid + "\nYou haven't created a wallet yet. Please use **$create** command.")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
def check(ctx):
return lambda m: m.author == ctx.author and m.channel == ctx.channel
async def get_input_of_type(func, ctx):
while True:
try:
msg = await bot.wait_for('message', timeout= 30, check=check(ctx))
return func(msg.content)
except ValueError:
continue
# Start a game of BlackJack
@bot.command()
async def blackjack(ctx, bet):
toPlay = getBalance(str(ctx.author.id))
newBalance = toPlay['result']
tuid = "<@" + str(ctx.author.id) + ">"
if float(bet) > MaxBlackJackBet:
botMessage = await ctx.channel.send(tuid + "\nSorry, Max bet for Black Jack is " + str(MaxBlackJackBet) )
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
elif float(bet) < MinBlackJackBet:
botMessage = await ctx.channel.send(tuid + "\nSorry, Minimum bet for Black Jack is " + str(MaxBlackJackBet) )
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
if newBalance < float(bet):
botMessage = await ctx.channel.send(tuid + "\nSorry, you don't have that many coins. \n**Balance:** "
+ str(newBalance) + ' ' + CoinName)
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
uid = str(ctx.author.id)
c.execute("SELECT * FROM users WHERE userid=:uid",
{'uid': ctx.author.id})
existingUsers = c.fetchall()
if existingUsers == []:
botMessage = await ctx.channel.send(tuid + "\nYou haven't created a wallet yet. Please use **$create** command.")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
for i in existingUsers:
userAddy = i[2]
cValue = {'Ace': 1, 'Two': 2, 'Three': 3, 'Four': 4, 'Five': 5, 'Six': 6,
'Seven': 7, 'Eight': 8, 'Nine': 9, 'Ten': 10, 'Jack': 10, 'Queen': 10, 'King': 10}
cSuit = {'Hearts': 0, 'Spades': 1, 'Clubs': 2, 'Diamonds': 3}
deck = [] # Empt Deck Array
dCards = [] # Empty Dealer Cards Array
pCards = [] # Empty Player Cards Array
# Build Deck
for i in cValue.keys():
for j in cSuit.keys():
deck.append(i + ' of ' + j) # Adds 52 cards to the Deck Array
# Shuffle Deck
random.shuffle(deck)
random.shuffle(deck)
random.shuffle(deck)
# Dealer Hand
while len(dCards) != 2:
dCards.append(random.choice(deck)) # Picks Random Cards from the deck and places them into the Dealers Hand
if len(dCards) == 2:
dFirstCard = getCardValue(dCards[0])
dSecondCard = getCardValue(dCards[1])
dealerTotal = dFirstCard + dSecondCard
while len(pCards) != 2:
pCards.append(random.choice(deck)) # Picks Random Cards from the deck and places them into the Players Hand
if len(pCards) == 2:
pFirstCard = getCardValue(pCards[0]) # Returns card's numerical value
pSecondCard = getCardValue(pCards[1])
playerTotal = pFirstCard + pSecondCard # Sum of Players first and second card
# Determine if user wants to Hit or Stay
if playerTotal < 21:
botMessage = await ctx.channel.send(tuid + "\nDealer Has **HIDDEN** & " + '**' + dCards[0] + '**'
+ "\nYou Have " + '**' + str(pCards) + '**' + ' :** ' + str(playerTotal) + '**'
+ "\n**Stay**: [S] or **Hit**: [H]?")
stayOrHit = await get_input_of_type(str, ctx)
while stayOrHit.lower() != "h" and stayOrHit.lower() != "s":
botMessage = await ctx.channel.send(tuid + "\n Please enter **Stay**: [S] or **Hit**: [H]")
stayOrHit = await get_input_of_type(str, ctx)
while stayOrHit.lower() == "h":
pCards.append(random.choice(deck))
cardNum = len(pCards)
cardNum -= 1
newCard = getCardValue(pCards[cardNum])
playerTotal += newCard
botMessage = await ctx.channel.send(tuid + "\nDealer Has **HIDDEN** & " + '**' + dCards[0] + '**'
+ "\nYou Have " + '**' + str(pCards) + '**' + ' : **' + str(playerTotal) + '**' + "\n**Stay**: [S] or **Hit**: [H]?")
# if Player hit and hasn't busted ask player to Stay or Hit
if playerTotal <= 21:
stayOrHit = await get_input_of_type(str, ctx)
while stayOrHit.lower() != "h" and stayOrHit.lower() != "s":
botMessage = await ctx.channel.send(tuid + "\n Please enter **Stay**: [S] or **Hit**: [H]")
stayOrHit = await get_input_of_type(str, ctx)
# Determine if Player Hit and hasn't busted
elif playerTotal > 21:
botMessage = await ctx.channel.send(tuid + "\nBust! You Lost " + str(bet) + ' ' + CoinName + '\nYour Total: **' + str(playerTotal) + '**')
sendCoins(uid, LostBetsAddy, bet)
updateBalances()
botMessage = await ctx.channel.send("**Please wait 5 seconds before placing a new bet**")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
await ctx.channel.purge(limit=10)
botMessage = await ctx.channel.send("You can now place a new bet.")
return
# If Decision does not equal hit
# TODO switch this to a more explicit method, setting it equal to Stay causes random infinite loops
# It's currently fixed by not allowing input other than stay or hit
while stayOrHit.lower() != "h":
# If Dealer hand is less than 16, Dealer draws another card
if dealerTotal <= 16:
dCards.append(random.choice(deck))
DcardNum = len(dCards)
DcardNum -= 1
newDCard = getCardValue(dCards[DcardNum])
dealerTotal += newDCard
# Determine if Dealer Hand Busted
elif dealerTotal > 21:
botMessage = await ctx.channel.send(tuid + "\nDealer Has " + '**' + str(dCards) + '**'
+ "\nYou Have " + '**' + str(pCards) + '**' + ' : **' + str(playerTotal) + '**')
botMessage = await ctx.channel.send(tuid + "\nYou Won! " + str(bet) + ' ' + CoinName +"\nDealer Busted" + '\nYour Total: ' '**' + str(playerTotal) + '** \nDealer Total: **' + str(dealerTotal) + '**')
sendCoins(myUid, userAddy, bet)
updateBalances()
botMessage = await ctx.channel.send("**Please wait 5 seconds before placing a new bet**")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
await ctx.channel.purge(limit=10)
botMessage = await ctx.channel.send("You can now place a new bet.")
return
# Determine Winner
elif dealerTotal > 16 and dealerTotal <= 21:
if dealerTotal < playerTotal:
botMessage = await ctx.channel.send(tuid + "\nDealer Has " + '**' + str(dCards) + '**'
+ "\nYou Have " + '**' + str(pCards) + '**' + ' : **' + str(playerTotal) + '**')
botMessage = await ctx.channel.send(tuid + "\nYou Won! " + str(bet) + ' ' +CoinName + '\nYour Total: ' '**' + str(playerTotal) + '** \nDealer Total: **' + str(dealerTotal)+ '**')
sendCoins(myUid, userAddy, bet)
updateBalances()
botMessage = await ctx.channel.send("**Please wait 5 seconds before placing a new bet**")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
await ctx.channel.purge(limit=10)
botMessage = await ctx.channel.send("You can now place a new bet.")
return
elif dealerTotal > playerTotal:
botMessage = await ctx.channel.send(tuid + "\nDealer Has " + '**' + str(dCards) + '**'
+ "\nYou Have " + '**' + str(pCards) + '**' + ' : **' + str(playerTotal) + '**')
botMessage = await ctx.channel.send(tuid + "\nYou Lost! " + str(bet) + ' ' +CoinName + '\nYour Total: ' '**' + str(playerTotal) + '** \nDealer Total: **' + str(dealerTotal) + '**')
sendCoins(uid, LostBetsAddy, bet)
updateBalances()
botMessage = await ctx.channel.send("**Please wait 5 seconds before placing a new bet**")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
await ctx.channel.purge(limit=10)
botMessage = await ctx.channel.send("You can now place a new bet.")
return
# Determine A Tie
if playerTotal == dealerTotal and playerTotal <= 21 and dealerTotal <= 21:
botMessage = await ctx.channel.send(tuid + "\nDealer Has " + '**' + str(dCards) + '**'
+ "\nYou Have " + '**' + str(pCards) + '**' + ' : **' + str(playerTotal) + '**')
botMessage = await ctx.channel.send(tuid + "\nTie! No Payout " + '\nYour Total: ' '**' + str(playerTotal) + '** \nDealer Total: **' + str(dealerTotal) + '**')
updateBalances()
botMessage = await ctx.channel.send("**Please wait 5 seconds before placing a new bet**")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
await ctx.channel.purge(limit=10)
botMessage = await ctx.channel.send("You can now place a new bet.")
return
# Start a game of Dice
@bot.command()
async def dice(ctx, bet, under):
tuid = "<@" + str(ctx.author.id) + ">"
uid = str(ctx.author.id)
c.execute("SELECT * FROM users WHERE userid=:uid",
{'uid': ctx.author.id})
existingUsers = c.fetchall()
if existingUsers == []:
botMessage = await ctx.channel.send(tuid + "\nYou haven't created a wallet yet. Please use **$create** command.")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
toPlay = getBalance(str(ctx.author.id))
newBalance = toPlay['result']
if newBalance < float(bet):
botMessage = await ctx.channel.send(tuid + "\nSorry, you don't have that many coins. \n**Balance:** "
+ str(newBalance) + ' ' + CoinName)
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
elif float(bet) > MaxDiceBet:
botMessage = await ctx.channel.send(tuid + "\nSorry, the max bet for Dice is " + str(MaxDiceBet) + ' ' + CoinName)
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
elif float(bet) < MinDiceBet:
botMessage = await ctx.channel.send(tuid + "\nSorry, the minimum bet for Dice is " + str(MinDiceBet) + ' ' + CoinName)
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
for i in existingUsers:
userAddy = i[2]
dice1 = random.randint(1, 6)
dice2 = random.randint(1, 6)
roll = dice1 + dice2
if int(under) == 2:
payout = float(bet) * 6
if int(under) == 3:
payout = float(bet) * 4
if int(under) == 4:
payout = float(bet) * 3
if int(under) == 5:
payout = float(bet) * 2.4
if int(under) == 6:
payout = float(bet) * 2
if int(under) == 7:
payout = float(bet) * 1.71
if int(under) == 8:
payout = float(bet) * 1.5
if int(under) == 9:
payout = float(bet) * 1.33
if int(under) == 10:
payout = float(bet) * 1.2
if int(under) == 11:
payout = float(bet) * 1.09
elif int(under) > 11:
botMessage = await ctx.channel.send(tuid + "\nRoll Under value must be less than or equal to 11. ")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
elif int(under) < 2:
botMessage = await ctx.channel.send(tuid + "\nRoll Under value must be greater than or equal to 3. ")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
return
if roll == 2 and int(under) == 2:
botMessage = await ctx.channel.send(tuid + "\n**Snake Eyes!** \n**You Won " + str(payout) + ' ' +CoinName + '**' +
"\nDice One: " + str(dice1) + "\nDice Two: " + str(dice2) + "\n**Total:** " + str(roll))
sendCoins(myUid, userAddy, payout)
updateBalances()
botMessage = await ctx.channel.send("**Please wait 5 seconds before placing a new bet**")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
botMessage = await ctx.channel.send("You can now place a new bet.")
await ctx.channel.purge(limit=3)
return
elif roll < int(under):
botMessage = await ctx.channel.send(tuid + "\n**You Won " + str(payout) + ' ' +CoinName + '**' +
"\nDice One: " + str(dice1) + "\nDice Two: " + str(dice2) + "\n**Total:** " + str(roll))
sendCoins(myUid, userAddy, payout)
updateBalances()
botMessage = await ctx.channel.send("**Please wait 5 seconds before placing a new bet**")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
await ctx.channel.purge(limit=3)
botMessage = await ctx.channel.send("You can now place a new bet.")
return
elif roll >= int(under):
botMessage = await ctx.channel.send(tuid + "\n**You Lost " + str(bet) + ' ' +CoinName + '**' +
"\nDice One: " + str(dice1) + "\nDice Two: " + str(dice2) + "\n**Total:** " + str(roll))
sendCoins(uid, LostBetsAddy, bet)
updateBalances()
botMessage = await ctx.channel.send("**Please wait 5 seconds before placing a new bet**")
time.sleep(5)
await botMessage.delete()
await ctx.message.delete()
await ctx.channel.purge(limit=3)
botMessage = await ctx.channel.send("You can now place a new bet.")
return
@bot.event
async def on_command_error(error, ctx):
if error.guild is None:
return
else:
tuid = "<@" + str(error.author.id) + ">"
botMessage = await error.channel.send(tuid + "\n**Error:** Improper format or command does not exist.\nPlease enter **$help** for a list of available commands.")
time.sleep(5)
await botMessage.delete()
await error.message.delete()
bot.run(secret)