Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async def lifespan(_application: FastAPI) -> AsyncGenerator:
)
await tgbot_app.application.initialize()

# flush all redis keys on startup for debug
# flush all redis keys on startup for debug
# await redis.redis_client.flushall()

# if is_webhook: # all gunicorn workers will call this and hit rate limit
Expand Down
2 changes: 1 addition & 1 deletion src/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from typing import Optional

import orjson
import redis.asyncio as aioredis

import redis.asyncio as aioredis
from src.config import settings
from src.models import CustomModel

Expand Down
15 changes: 7 additions & 8 deletions src/tgbot/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from telegram import (
Update,
)
from telegram import Update
from telegram.ext import (
AIORateLimiter,
Application,
CallbackQueryHandler,
ChatBoostHandler,
Expand All @@ -11,7 +10,6 @@
InlineQueryHandler,
MessageHandler,
PreCheckoutQueryHandler,
AIORateLimiter,
filters,
)

Expand All @@ -24,12 +22,9 @@
MEME_SOURCE_SET_LANG_REGEXP,
MEME_SOURCE_SET_STATUS_REGEXP,
POPUP_BUTTON_CALLBACK_DATA_REGEXP,
TELEGRAM_CHANNEL_EN_CHAT_ID,
TELEGRAM_CHANNEL_RU_CHAT_ID,
TELEGRAM_CHAT_EN_CHAT_ID,
TELEGRAM_CHAT_RU_CHAT_ID,
TELEGRAM_FEEDBACK_CHAT_ID,
TELEGRAM_MODERATOR_CHAT_ID,
)
from src.tgbot.handlers import (
alerts,
Expand All @@ -55,6 +50,7 @@
)
from src.tgbot.handlers.chat.chat import handle_chat_message
from src.tgbot.handlers.chat.chat_member import handle_chat_member_update

# from src.tgbot.handlers.chat.explain_meme import explain_meme_en, explain_meme_ru
from src.tgbot.handlers.chat.feedback import (
handle_feedback_message,
Expand Down Expand Up @@ -267,7 +263,10 @@ def add_handlers(application: Application) -> None:
# TODO: turn in when I'll have more free ChatGPT credits (probably never)
# application.add_handler(
# MessageHandler(
# filters=filters.Chat([TELEGRAM_CHAT_RU_CHAT_ID, TELEGRAM_MODERATOR_CHAT_ID])
# filters=filters.Chat([
# TELEGRAM_CHAT_RU_CHAT_ID,
# TELEGRAM_MODERATOR_CHAT_ID,
# ])
# & filters.PHOTO
# & filters.UpdateType.MESSAGE,
# callback=explain_meme_ru,
Expand Down
8 changes: 1 addition & 7 deletions src/tgbot/handlers/chat/chat_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
from typing import Optional, Tuple

from telegram import Chat, ChatMember, ChatMemberUpdated, Update
from telegram.ext import (
ContextTypes,
)

from src.tgbot.handlers import (
block,
)
from telegram.ext import ContextTypes


def extract_status_change(
Expand Down
4 changes: 2 additions & 2 deletions src/tgbot/handlers/upload/upload_meme.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ async def handle_message_with_meme(
return await update.message.reply_text(
"""
You already uploaded lots of memes today. Try again tomorrow.
Think about quality, not quantity: your goal is to get as many likes as possible.
Analyse your /uploads
Think about quality, not quantity: your goal is to get as many likes as possible.
Analyse your /uploads
"""
)

Expand Down
Loading