Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi chats support #13

Merged
merged 2 commits into from
Sep 17, 2019
Merged

Add multi chats support #13

merged 2 commits into from
Sep 17, 2019

Conversation

TheBlackArroVV
Copy link
Owner

This pr adds support for multi chats

@TheBlackArroVV TheBlackArroVV requested a review from yashka713 July 17, 2019 15:54
db/database.rb Outdated
def increase_karma(user_name)
user = users.where(user_name: user_name)
def increase_karma(user_name, chat_id)
user = users.where(user_name: user_name, chat_id: chat_id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it work with users, which already exist and do not have chat_id?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Now, but for now it used only in one chat, so i planned to just make a sql query which will fix it

Copy link
Owner Author

Choose a reason for hiding this comment

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

But i can create a data migration for it or rake task
What do you think, @yashka713 ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I work on it.
The best way is creating command for admin users.
By this command, the admin will update user fields.
For example, by replaying for the message with a command.

Screen Shot 2019-07-17 at 21 44 10

This allows you to get information about the user, check that command started by admin, and update user fields.
If you find a better way write it here

@yashka713 yashka713 temporarily deployed to superkarmabot July 24, 2019 13:54 Inactive
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.

2 participants