Compare commits

..

No commits in common. "1a0341b3dd000fdcdfb9432258fcef0ec53f8fca" and "6ffae054c0126a1e2f3ab3af22eb2c4a1582628d" have entirely different histories.

6 changed files with 2 additions and 28 deletions

View File

@ -1,3 +1,3 @@
en:
start: "Hello, {message.from_user.full_name}"
help: "Just simple bot, which greets the user. Use /start"
help: ""

View File

@ -3,7 +3,6 @@ from telebot.storage import StateMemoryStorage, StateRedisStorage
from .handlers import register_handlers
from .middlewares import setup_middlewares
from .filters import add_custom_filters
def create_bot(config, logger, i18n):
@ -30,7 +29,4 @@ def create_bot(config, logger, i18n):
logger.debug("Registering handlers")
register_handlers(bot)
logger.debug("Adding custom filters")
add_custom_filters(bot, config)
return bot

View File

@ -21,7 +21,7 @@ class Config:
# state storage
SS_TYPE: str = os.getenv("SS_TYPE", "memory").lower()
SS_REDIS_HOST: str = os.getenv("SS_REDIS_HOST")
SS_REDIS_PORT: int = int(os.getenv("SS_REDIS_PORT", 6379))
SS_REDIS_PORT: int = int(os.getenv("SS_REDIS_PORT"), 6379)
SS_REDIS_DB: int = int(os.getenv("SS_REDIS_DB", 0))
SS_REDIS_PASS: str = os.getenv("SS_REDIS_PASS")

View File

@ -1,9 +0,0 @@
from telebot import TeleBot
from telebot.custom_filters import StateFilter
from .isowner import IsOwnerFilter
def add_custom_filters(bot: TeleBot, config):
bot.add_custom_filter(StateFilter(bot))
bot.add_custom_filter(IsOwnerFilter(config.OWNER_ID))

View File

@ -1,12 +0,0 @@
from telebot.custom_filters import SimpleCustomFilter
from telebot.types import Message
class IsOwnerFilter (SimpleCustomFilter):
key = "is_owner"
def __init__(self, owner_id: int):
self.owner_id: int = owner_id
def check(self, message: Message):
return message.from_user.id == self.owner_id

View File

@ -1 +0,0 @@
# keyboards will be defined here