quintodownbot

所属分类:聊天室
开发工具:GO
文件大小:0KB
下载次数:0
上传日期:2023-09-18 02:48:37
上 传 者sh-1993
说明:  五镇新闻电报机器人,
(Quintodown news telegram bot,)

文件列表:
.golangci.yml (409, 2023-12-12)
.mergify.yml (384, 2023-12-12)
LICENSE (11357, 2023-12-12)
Taskfile.yml (6647, 2023-12-12)
app.json (235, 2023-12-12)
cmd/ (0, 2023-12-12)
cmd/main.go (645, 2023-12-12)
go.mod (11195, 2023-12-12)
go.sum (134468, 2023-12-12)
internal/ (0, 2023-12-12)
internal/app/ (0, 2023-12-12)
internal/app/app.go (1161, 2023-12-12)
internal/app/app_test.go (4354, 2023-12-12)
internal/app/wire.go (7116, 2023-12-12)
internal/bot/ (0, 2023-12-12)
internal/bot/bot.go (3469, 2023-12-12)
internal/bot/bot_test.go (2419, 2023-12-12)
internal/bot/filters.go (508, 2023-12-12)
internal/bot/handlers.go (1902, 2023-12-12)
internal/bot/handlers_test.go (8933, 2023-12-12)
internal/bot/testdata/ (0, 2023-12-12)
internal/bot/testdata/test.png (123, 2023-12-12)
internal/clock/ (0, 2023-12-12)
internal/clock/clock.go (212, 2023-12-12)
internal/clock/clock_test.go (271, 2023-12-12)
internal/config/ (0, 2023-12-12)
internal/config/config.go (1095, 2023-12-12)
internal/config/config_test.go (3373, 2023-12-12)
internal/games/ (0, 2023-12-12)
internal/games/clients/ (0, 2023-12-12)
internal/games/clients/espn/ (0, 2023-12-12)
... ...

# Quintodownbot [![codecov](https://codecov.io/gh/quintodown/quintodownbot/branch/main/graph/badge.svg?token=Q15YVM2SMC)](https://codecov.io/gh/javiyt/tweetgram) [![Test](https://github.com/quintodown/quintodownbot/actions/workflows/ci.yml/badge.svg)](https://github.com/javiyt/tweetgram/actions/workflows/ci.yml) [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) Telegram bot to publish post to twitter ## How to set up the environment? First you need to install, if not installed on your machine, [Task](https://taskfile.dev/#/). Once installed you only need to run in your command line: ``` task setup ``` And you are done, it will generate the env files needed to run the bot and will download all dependencies, also run all code generation tools. ### Configuring the bot You can find a file inside cmd folder called env where you can adjust the variables, take into account the generated one are random values. The content of the env file will look like following: ``` BOT_TOKEN=1234567890:G8o4ATpRsfUtl0p7N1HW9S2IdIcxSRoSY67 ADMINS=123456789 BROADCAST_CHANNEL=-1234567890123 TWITTER_API_KEY=c7FU8EvL9smKN2k2IN0yur67k TWITTER_API_SECRET=LYzF53kJoVK46rp859rQCw6Dqw6TpQV668aemPb2KI9GUxTTU0 TWITTER_BEARER_TOKEN=hIlQI351HEPT6xbA4xHnYRfgOsF8jqcPT5m6Ec0VeCXtUyOY9Mzy6uFYevH%4ys86GL3KfO1ZRBwichZOlGDYyZ52Ht2BXh2WgUFvywJKbRq9lMH TWITTER_ACCESS_TOKEN=123456789-0xW7uNw2mEykTVTTKHS32y3oIXHab5hSh7POa0Wf TWITTER_ACCESS_SECRET=BWa9T8hkEEj5yCutPwJTs7Vk4f1wfj690Dq3UGCyf9YQB ENVIRONMENT=TEST LOG_FILE=/var/log/tweetgram.log ``` Env file variables are self-explanatory Check env.test file, you only need there all the variables that should be overridden in order to run a test instance of the bot. Take into account env.test file is not needed to run the test case they set up the appropriate variables to run them. Remove all not needed variables from env.test file ### Running a local instance of the bot You just need to run the following command: ``` task run-test ``` Remember all env variables will be overridden by the ones defined in env.test ## Deploying the bot There's an action called deploy that you can trigger to deploy the bot. Some [secrets should be added](https://docs.github.com/en/actions/security-guides/encrypted-secrets) to your account before running the deployment script. The variables that should be added are: | Variable | Description | |-------------------|---------------------------------------------------------------------| | ENV_FILE | cmd/env file content | | ENV_TEST_FILE | cmd/env.test file content | | HOST | Host of the server to deploy the bot | | USERNAME | User to connect to the server | | SSHKEY | SSH key of the user to login onto the server | | PORT | Port where the SSH server is running | | PASSPHRASE | Passphrase to decrypt the SSH key | | FOLDER | Folder to deploy the bot binary | | BINARY_NAME | Name for the generated binary | | BOT_NAME | Name given to the bot | | SERVICE_SYS | Name of service used to keep process running: systemd or supervisor | | SUPERVISOR_FOLDER | Folder where supervisor configuration files are stored |

近期下载者

相关文件


收藏者