{"id":20333688,"url":"https://github.com/davidegalilei/markinim","last_synced_at":"2025-04-09T16:20:34.454Z","repository":{"id":37587276,"uuid":"448548912","full_name":"DavideGalilei/markinim","owner":"DavideGalilei","description":"Markinim Telegram bot source code","archived":false,"fork":false,"pushed_at":"2024-04-21T19:07:42.000Z","size":1109,"stargazers_count":88,"open_issues_count":1,"forks_count":18,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T18:37:32.337Z","etag":null,"topics":["bot","markov-chain","nim","telegram"],"latest_commit_sha":null,"homepage":"","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DavideGalilei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-16T12:34:15.000Z","updated_at":"2025-03-06T08:30:02.000Z","dependencies_parsed_at":"2023-01-29T22:45:27.782Z","dependency_job_id":"309fe568-8966-42e3-9aa6-2caf663fb52a","html_url":"https://github.com/DavideGalilei/markinim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavideGalilei%2Fmarkinim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavideGalilei%2Fmarkinim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavideGalilei%2Fmarkinim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavideGalilei%2Fmarkinim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavideGalilei","download_url":"https://codeload.github.com/DavideGalilei/markinim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065281,"owners_count":21041872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","markov-chain","nim","telegram"],"created_at":"2024-11-14T20:32:53.527Z","updated_at":"2025-04-09T16:20:34.427Z","avatar_url":"https://github.com/DavideGalilei.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Markinim\nThis is the @MarkinimBot Telegram bot's source code. It's a bit messy (it was never meant to be open source at the beginning) so it needs a cleanup, but it works. Memory usage and performance are pretty good. It uses sqlite.\n\n# Deploy\n\u003e For docker instructions, [skip here](#deploy-with-docker)\n\nInstall required dependencies:\n\n```shell\n$ nimble install\n```\n\nThen create a `secret.ini` file which looks like this, where admin is your Telegram user id, and token is the bot token obtainable from @BotFather.\n\n```ini\n[config]\ntoken = \"1234:abcdefg\"\nadmin = 123456\nlogging = 1\n```\n\nYou can also add a `keeplast = 1500` parameter to the configuration, to avoid ram overloads by processing a maximum of keeplast messages per session (default: `1500`)\n\n```shell\n$ nim c -o:markinim src/markinim.nim\n$ ./markinim\n```\n## Deploy (with docker)\n- Copy `.env.sample` to `.env`\n- Edit `BOT_TOKEN` and `ADMIN_ID`\n- If needed, edit `KEEP_LAST` (default: `1500`. Read above)\n- Build and run the image with `docker compose up -d --build`\n- Run the bot with `docker compose up -d`\n\n### Old instructions\n\u003e ⚠️ **WARNING**: deprecated. Use the docker compose instructions above instead.\n- Build the image with `docker build -t markinim .`\n- Run the bot using `docker run -itd -v=\"${pwd}/data\":/code/data:z --env-file=.env --restart=unless-stopped --name=markinimbot markinim`\n\n## Backups\n\u003e ⚠️ **WARNING**: This is an experimental backup script. It's not well-tested yet. Use it at your own risk. I am not responsible for any data loss. I don't know if it works.\n- Setup [`syncthing`](https://syncthing.net/) if you want to sync the backups to another device\n- Copy `tools/backup_script.example.sh` to `tools/backup_script.sh` and edit it to set the correct values for `root_dir`, `backup_directory` and `backup_filename`\n- Optionally, edit `TELEGRAM_ID` to receive a notification when the backup is done\n- Copy `tools/backup.example.sh` to `tools/backup.sh` and edit it if you want to change the container name\n- Run a cronjob to run `tools/backup.sh` every 4h (or whatever you want)\n  - Open crontab with `crontab -e`\n  - Add `0 */4 * * * /path/to/markinim/tools/backup.sh`\n  - Save and exit\n- Done! Now you should have a backup every 4h in the specified directory\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidegalilei%2Fmarkinim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidegalilei%2Fmarkinim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidegalilei%2Fmarkinim/lists"}