removed files

This commit is contained in:
2024-12-06 10:46:47 +09:00
parent 1aa387aa59
commit fc1c0d6405
13979 changed files with 0 additions and 2057817 deletions

View File

Binary file not shown.

Binary file not shown.

View File

@@ -1,3 +0,0 @@
from django.contrib import admin
# Register your models here.

View File

@@ -1,6 +0,0 @@
from django.apps import AppConfig
class BotConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'bot'

View File

@@ -1,39 +0,0 @@
from telegram import Update
from telegram.ext import Updater, CommandHandler, CallbackContext
from users.models import User, UserConfirmation
import uuid
def start(update: Update, context: CallbackContext):
user_id = update.message.from_user.id
chat_id = update.message.chat_id
user, created = User.objects.get_or_create(telegram_id=user_id, defaults={'chat_id': chat_id})
if not user.confirmed:
confirmation_code = str(uuid.uuid4())
UserConfirmation.objects.create(user=user, confirmation_code=confirmation_code)
update.message.reply_text(f"Ваш код подтверждения: {confirmation_code}")
else:
update.message.reply_text("Вы уже зарегистрированы!")
def confirm(update: Update, context: CallbackContext):
user_id = update.message.from_user.id
code = ' '.join(context.args)
try:
confirmation = UserConfirmation.objects.get(user__telegram_id=user_id, confirmation_code=code)
confirmation.user.confirmed = True
confirmation.user.save()
confirmation.delete()
update.message.reply_text("Регистрация подтверждена!")
except UserConfirmation.DoesNotExist:
update.message.reply_text("Неверный код подтверждения!")
def main():
updater = Updater("YOUR_TELEGRAM_BOT_TOKEN")
dispatcher = updater.dispatcher
dispatcher.add_handler(CommandHandler("start", start))
dispatcher.add_handler(CommandHandler("confirm", confirm))
updater.start_polling()
updater.idle()

View File

@@ -1,3 +0,0 @@
from django.db import models
# Create your models here.

View File

@@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.

View File

View File

@@ -1,3 +0,0 @@
from django.shortcuts import render
# Create your views here.