some-fixes

This commit is contained in:
Untone 2023-09-11 21:40:24 +03:00
parent 071b7739f2
commit 4be2dc3a45
12 changed files with 9 additions and 58 deletions

8
.idea/.gitignore vendored
View File

@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (welcome-webhook-bot)" project-jdk-type="Python SDK" />
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/welcome-webhook-bot.iml" filepath="$PROJECT_DIR$/.idea/welcome-webhook-bot.iml" />
</modules>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="PLAIN" />
<option name="myDocStringFormat" value="Plain" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="py.test" />
</component>
</module>

View File

@ -1,5 +1,3 @@
from sanic import Sanic
from sanic.response import text
from bot.handlers.handle_feedback import handle_feedback, handle_answer
from bot.handlers.handle_members_change import handle_join, handle_left
from bot.handlers.handle_join_request import handle_join_request
@ -13,10 +11,11 @@ from bot.handlers.handle_startup import handle_startup
from bot.api import register_webhook, send_message
from bot.config import FEEDBACK_CHAT_ID
from bot.state import State
from sanic.app import Sanic
app = Sanic(name="welcomecenter")
app.config.LOGGING = True
app.config.REGISTERED = False
state = State()

View File

@ -5,7 +5,7 @@ import os
from bot.config import BOT_TOKEN, WEBHOOK
apiBase = f"https://api.telegram.org/bot{TOKEN}/"
apiBase = f"https://api.telegram.org/bot{BOT_TOKEN}/"
def register_webhook():

View File

@ -1,6 +1,6 @@
import os
BOT_TOKEN = os.environ.get('BOT_TOKEN') or ''
BOT_TOKEN = os.environ.get('BOT_TOKEN') or '5543739069:AAHCKC7C8vhFERw1KN2nCbg9olQ5UFBQWfE'
WEBHOOK = os.environ.get('VERCEL_URL') or 'http://localhost:8000'
REDIS_URL = os.environ.get('REDIS_URL') or 'redis://localhost:6379'
FEEDBACK_CHAT_ID = os.environ.get('FEEDBACK_CHAT_ID').replace("-", "-100")

View File

@ -1,4 +1,4 @@
from storage import scan, Profile
from bot.storage import scan, Profile
from bot.api import approve_chat_join_request, kick_member
from bot.handlers.callback_vouch import update_button
from bot.utils.mention import userdata_extract

View File

@ -1,11 +1,11 @@
import redis
from profile import Profile as ProfileObj
from redis import Redis
from bot.storage.profile import Profile as ProfileObj
from bot.config import REDIS_URL
import json
# сохраняет сессии, айди кнопок в чатах для удаления и пересылаемые сообщения между перезагрузками
storage = redis.from_url(REDIS_URL)
storage = Redis.from_url(REDIS_URL)
# хранение необходимой информации о пользователях
Profile = ProfileObj(storage)

View File

@ -1,4 +1,5 @@
sanic==19.6.0
requests
redis
asyncio
aiohttp