some-fixes
This commit is contained in:
parent
071b7739f2
commit
4be2dc3a45
8
.idea/.gitignore
vendored
8
.idea/.gitignore
vendored
|
@ -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
|
|
@ -1,6 +0,0 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
|
@ -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>
|
|
@ -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>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -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>
|
|
@ -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()
|
||||
|
||||
|
||||
|
|
|
@ -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():
|
||||
|
|
|
@ -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")
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
sanic==19.6.0
|
||||
requests
|
||||
redis
|
||||
asyncio
|
||||
aiohttp
|
Loading…
Reference in New Issue
Block a user