Skip to content

Conversation

@balancy
Copy link
Owner

@balancy balancy commented Dec 29, 2020

Переимпортированы тикеры
Переделана работа с flask-sqlalchemy на sqlalchemy
Реализован прослушивающий новых пользователей бот, который из записывает в базу данных
Рассылающий бот рассылает новости тоько пользователям из базы данных

@balancy balancy requested a review from morgangt December 29, 2020 15:59
Copy link
Collaborator

@morgangt morgangt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В целом хороший рефакторинг

class BotUser(Base):
__tablename__ = "bot_user"
id = Column(Integer, primary_key=True)
username = Column(String(50))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

предлагаю добавить поле дата добавления (дата регистрации) и дату последнего сообщения - но это не обязательно, так как её можно достать из чата

def send_news(self):
users = BotUser.query.all()
for user in users:
self.send_message(chat_id=user.id, text=self.message, parse_mode=ParseMode.HTML)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

предлагаю подумать о том чтобы добавить проверку на отправку сообщений одному пользователю - когда последний раз отправляли сообщение. чтобы не спамить user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants