-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsingletons.py
82 lines (61 loc) · 1.7 KB
/
singletons.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
import discord
from econ.items import items
from saveload import saveload
import datetime
def print_colored(text, color):
colors = {
"red": "\033[31m",
"green": "\033[32m",
"yellow": "\033[33m",
"blue": "\033[34m",
"magenta": "\033[35m",
"cyan": "\033[36m",
"reset": "\033[0m"
}
print(f"{colors[color]}{text}{colors['reset']}")
# Discord Essential variables
start_time = datetime.datetime.now() # Start time of the bot
class Client(discord.Client):
async def Save(self):
# Save accounts before closing
await saveload.SaveUserDict()
print_colored("--- Client disconnected ---", "red")
exit(0)
async def close(self):
# Perform cleanup before closing
await self.async_cleanup()
# Call the parent class's close method
await super().close()
async def async_cleanup(self):
await self.Save()
intents = discord.Intents.all()
client = Client(intents=intents)
# Full Item list
item_list = [
items.ComplementBag(quantity=1),
items.Coffee(quantity=1),
items.EnergyDrink(quantity=1),
items.LotteryTicket(quantity=1),
items.InsultBag(quantity=1),
items.Adderall(quantity=1),
]
# Market
market = [
items.ComplementBag(quantity=1),
items.Coffee(quantity=1),
items.EnergyDrink(quantity=1),
items.LotteryTicket(quantity=1)
]
market_pages = [
[], # Page 0
]
# Black Market
black_market = [
items.InsultBag(quantity=1),
items.Adderall(quantity=1),
]
black_market_pages = [
[], # Page 0
]
user_dict = {} # {serverid : list[user.User], serverid : list[user.User] }
active_roulettes = {} # serverid : roulette object