Skip to content

Commit 21a9e3b

Browse files
author
abdullayev96
committed
change bot
0 parents  commit 21a9e3b

10 files changed

+472
-0
lines changed

.gitignore

+174
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/django
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=django
3+
/.vscode
4+
/.idea
5+
6+
.idea/
7+
.vscode/
8+
9+
### Django ###
10+
*.log
11+
*.pot
12+
*.pyc
13+
__pycache__/
14+
local_settings.py
15+
db.sqlite3
16+
db.sqlite3-journal
17+
media
18+
/post/test
19+
/static/
20+
/staticfiles/
21+
/media/
22+
/mediafiles/
23+
# environment variables in .env
24+
.env
25+
/env
26+
# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/
27+
# in your Git repository. Update and uncomment the following line accordingly.
28+
# <django-project-name>/staticfiles/
29+
30+
### Django.Python Stack ###
31+
# Byte-compiled / optimized / DLL files
32+
*.py[cod]
33+
*$py.class
34+
35+
# C extensions
36+
*.so
37+
38+
# Distribution / packaging
39+
.Python
40+
# build/
41+
develop-eggs/
42+
dist/
43+
downloads/
44+
eggs/
45+
.eggs/
46+
parts/
47+
sdist/
48+
var/
49+
wheels/
50+
pip-wheel-metadata/
51+
share/python-wheels/
52+
*.egg-info/
53+
.installed.cfg
54+
*.egg
55+
MANIFEST
56+
57+
# PyInstaller
58+
# Usually these files are written by a python script from a template
59+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
60+
*.manifest
61+
*.spec
62+
63+
# Installer logs
64+
pip-log.txt
65+
pip-delete-this-directory.txt
66+
67+
# Unit test / coverage reports
68+
htmlcov/
69+
.tox/
70+
.nox/
71+
.coverage
72+
.coverage.*
73+
.cache
74+
nosetests.xml
75+
coverage.xml
76+
*.cover
77+
*.py,cover
78+
.hypothesis/
79+
.pytest_cache/
80+
pytestdebug.log
81+
82+
# Translations
83+
*.mo
84+
85+
# Django stuff:
86+
87+
# Flask stuff:
88+
instance/
89+
.webassets-cache
90+
91+
# Scrapy stuff:
92+
.scrapy
93+
94+
# Sphinx documentation
95+
docs/_build/
96+
doc/_build/
97+
98+
# PyBuilder
99+
target/
100+
101+
# Jupyter Notebook
102+
.ipynb_checkpoints
103+
104+
# IPython
105+
profile_default/
106+
ipython_config.py
107+
108+
# pyenv
109+
.python-version
110+
111+
# pipenv
112+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
113+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
114+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
115+
# install all needed dependencies.
116+
#Pipfile.lock
117+
118+
# poetry
119+
#poetry.lock
120+
121+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
122+
__pypackages__/
123+
124+
# Celery stuff
125+
celerybeat-schedule
126+
celerybeat.pid
127+
128+
# SageMath parsed files
129+
*.sage.py
130+
131+
# Environments
132+
# .env
133+
.env/
134+
.venv/
135+
env/
136+
venv/
137+
ENV/
138+
env.bak/
139+
venv.bak/
140+
pythonenv*
141+
142+
# Spyder project settings
143+
.spyderproject
144+
.spyproject
145+
146+
# Rope project settings
147+
.ropeproject
148+
149+
# mkdocs documentation
150+
/site
151+
152+
# mypy
153+
.mypy_cache/
154+
.dmypy.json
155+
dmypy.json
156+
157+
# Pyre type checker
158+
.pyre/
159+
160+
# pytype static type analyzer
161+
.pytype/
162+
163+
# operating system-related files
164+
# file properties cache/storage on macOS
165+
*.DS_Store
166+
# thumbnail cache on Windows
167+
Thumbs.db
168+
169+
# profiling data
170+
.prof
171+
172+
173+
# End of https://www.toptal.com/developers/gitignore/api/django
174+

buttons.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from telegram import KeyboardButton, ReplyKeyboardMarkup
2+
3+
4+
5+
6+
buttons = [
7+
[KeyboardButton(text="Tashkent shahar") ,KeyboardButton(text="Samarqand viloyat")],
8+
[KeyboardButton(text="Andijon viloyat"),
9+
KeyboardButton(text="Fargona viloyat")],
10+
[KeyboardButton(text="Namangan viloyat"),
11+
KeyboardButton(text="Jizzax viloyat")],
12+
[KeyboardButton(text="Sirdaryo viloyat"),
13+
KeyboardButton(text="Navoiy viloyat")],
14+
[KeyboardButton(text="Surxondaryo viloyat"),
15+
KeyboardButton(text="Qashqadaryo viloyat")],
16+
[KeyboardButton(text="Xorazm viloyat" ,),
17+
KeyboardButton(text="Qoraqolpoq" ,)],
18+
[KeyboardButton(text="Buxoro viloyat"), KeyboardButton(text="Tashkent viloyat")],
19+
]

database.db

12 KB
Binary file not shown.

database.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import sqlite3 as sq
2+
3+
class Database:
4+
def __init__(self, db_name):
5+
self.connect = sq.connect(db_name, check_same_thread=False)
6+
self.cursor = self.connect.cursor()
7+
8+
def create_user(self, chat_id):
9+
self.cursor.execute("""insert into user(chat_id) values (?)""", (chat_id, ))
10+
self.connect.commit()
11+
12+
def update_user_data(self, chat_id, key, value):
13+
self.cursor.execute(f"""update user set {key} = ? where chat_id = ?""", (value, chat_id))
14+
self.connect.commit()
15+
16+
def get_user_chat_by_id(self, chat_id):
17+
self.cursor.execute("""select * from user where chat_id = ?""", (chat_id, ))
18+
user = dict_fetchone(self.cursor)
19+
return user
20+
21+
22+
23+
def dict_fetchone(cursor):
24+
row = cursor.fetchone()
25+
if row is None:
26+
return False
27+
columns = [col[0] for col in cursor.description]
28+
return dict(zip(columns, row))
29+

database.sqbpro

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?xml version="1.0" encoding="UTF-8"?><sqlb_project><db path="D:/Bot_Projects/Image_save_bot/user_data.db" readonly="0" foreign_keys="1" case_sensitive_like="0" temp_store="0" wal_autocheckpoint="1000" synchronous="2"/><attached/><window><main_tabs open="structure browser pragmas query" current="1"/></window><tab_structure><column_width id="0" width="300"/><column_width id="1" width="0"/><column_width id="2" width="150"/><column_width id="3" width="2117"/><column_width id="4" width="0"/><expanded_item id="0" parent="1"/><expanded_item id="1" parent="1"/><expanded_item id="2" parent="1"/><expanded_item id="3" parent="1"/></tab_structure><tab_browse><current_table name="4,4:maingood"/><default_encoding codec=""/><browse_table_settings><table schema="main" name="good" show_row_id="0" encoding="" plot_x_axis="" unlock_view_pk="_rowid_"><sort/><column_widths><column index="1" value="61"/><column index="2" value="183"/><column index="3" value="263"/><column index="4" value="237"/><column index="5" value="222"/><column index="6" value="167"/></column_widths><filter_values/><conditional_formats/><row_id_formats/><display_formats/><hidden_columns/><plot_y_axes/><global_filter/></table><table schema="main" name="user" show_row_id="0" encoding="" plot_x_axis="" unlock_view_pk="_rowid_"><sort/><column_widths><column index="1" value="61"/><column index="2" value="260"/><column index="3" value="218"/><column index="4" value="117"/><column index="5" value="321"/><column index="6" value="227"/><column index="7" value="157"/></column_widths><filter_values/><conditional_formats/><row_id_formats/><display_formats/><hidden_columns/><plot_y_axes/><global_filter/></table></browse_table_settings></tab_browse><tab_sql><sql name="SQL 1"></sql><current_tab id="0"/></tab_sql></sqlb_project>

demo_814131561.jpg

65.8 KB
Loading

0 commit comments

Comments
 (0)