-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsql.py
More file actions
37 lines (25 loc) · 1.03 KB
/
sql.py
File metadata and controls
37 lines (25 loc) · 1.03 KB
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
import sqlite3
def create_wallets_table():
conn = sqlite3.connect('wallets.db')
c = conn.cursor()
c.execute('''CREATE TABLE IF NOT EXISTS wallets (username TEXT PRIMARY KEY, discordwallet TEXT, telegramwallet TEXT)''')
conn.commit()
conn.close()
def save_wallet_data(username, wallet1name, wallet2name):
conn = sqlite3.connect('wallets.db')
c = conn.cursor()
c.execute("INSERT OR REPLACE INTO wallets (username, wallet1name, wallet2name) VALUES (?, ?, ?)", (username, wallet1name, wallet2name))
conn.commit()
conn.close()
def create_otp_table():
conn = sqlite3.connect('wallets.db')
c = conn.cursor()
c.execute('''CREATE TABLE IF NOT EXISTS otp_data (user_name TEXT PRIMARY KEY,discord TEXT, otp TEXT)''')
conn.commit()
conn.close()
def save_otp_data(user_name, otp, discord):
conn = sqlite3.connect('otp.db')
c = conn.cursor()
c.execute("INSERT OR REPLACE INTO otp_data (user_name,discord, otp) VALUES (?, ?)", (user_name,discord, otp))
conn.commit()
conn.close()