gem 'telegram-ruby'
gem 'leveldb-ruby'
- I defined some sample questions in
db/seeds.rb
file. You can runrake db:seed
- We use
sidekiq
+whenever
to run cronjob. CheckGemfile
for more detail. - We will need redis installed. Just follow this article:
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-redis-on-ubuntu-16-04
- You can update cronjob by running:
whenever --update-crontab
or view cronjob of system bycrontab -l
or remove cronjob bycrontab -r
- To run sidekiq
bundle exec sidekiq
- To view sidekiq web
localhost/sidekiq
Rake task is defined in lib/tasks/*.rake
There are three database
Sample data can be generated using rake qa:sample
Data can be fetched using rake qa:fetch
To flush data rake qa:flush
Data can be fetched using rake user:fetch
To flush data rake user:flush
Data can be fetched using rake data:fetch
To flush data rake data:flush
Please create a telegram bot first, or use mine
https://web.telegram.org/#/im?p=@third_colinvn_bot
Please do set your bot test API key in config/application.yml
For now, there's no polling job or webhook yet.
Run
rake telegram:update
to pull new updates from Telegram and send replies to Telegram users
On telegram, run:
/test
to get questions, or
/result KyberNetwork
To know today result
Source code are mainly in lib/tasks
and app/services