-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
73 lines (65 loc) · 2.08 KB
/
config.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
import os
CREATOR_ID = 236965366
GROUP_ID_TEST = os.getenv("GROUP_ID_TEST")
GROUP_ID = os.getenv("GROUP_ID")
API_KEY_TEST = os.getenv("API_KEY_TEST")
API_KEY = os.getenv("API_KEY")
OSU_API_KEY = os.getenv("OSU_API_KEY")
OSU_MATCHMAKING_KEY = os.getenv("OSU_MATCHMAKING_KEY")
RESTRICTED_HIGHLIGHTS = ["@all", "@online", "@тут", "@все"]
DATABASE_INIT = """
CREATE TABLE IF NOT EXISTS "users" (
"id" INTEGER,
"name" TEXT,
"server" TEXT,
"username" TEXT,
"role" INTEGER DEFAULT 1,
PRIMARY KEY("id")
);
CREATE TABLE IF NOT EXISTS "users_experience" (
"chat_id" INTEGER,
"user_id" INTEGER,
"experience" FLOAT DEFAULT 0,
"level" INTEGER DEFAULT 1,
FOREIGN KEY(user_id) REFERENCES "users"("id")
);
CREATE TABLE IF NOT EXISTS "osu" (
"id" INTEGER NOT NULL UNIQUE,
"main_server" TEXT,
"bancho_username" TEXT,
"gatari_username" TEXT,
FOREIGN KEY("id") REFERENCES "users"("id") ON UPDATE CASCADE ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS "weather" (
"id" INTEGER NOT NULL UNIQUE,
"city" TEXT,
FOREIGN KEY("id") REFERENCES "users"("id") ON UPDATE CASCADE
);
CREATE TABLE IF NOT EXISTS "donators" (
"id" int,
"expires" INTEGER,
"role" text,
FOREIGN KEY("id") REFERENCES "users"("id") ON UPDATE CASCADE ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS "commands" (
"key" INTEGER NOT NULL UNIQUE,
"message" TEXT,
"attachment" TEXT,
"author" INTEGER NOT NULL
);
CREATE TABLE IF NOT EXISTS "beatmapsets" (
"beatmapset_id" INTEGER NOT NULL UNIQUE,
"artist" TEXT,
"title" TEXT,
"background_url" TEXT,
PRIMARY KEY("beatmapset_id")
);
CREATE TABLE IF NOT EXISTS "beatmaps" (
"beatmapset_id" INTEGER,
"beatmap_id" INTEGER,
"version" TEXT,
"max_combo" INTEGER,
PRIMARY KEY("beatmap_id"),
FOREIGN KEY("beatmapset_id") REFERENCES "beatmapsets"("beatmapset_id")
);
"""