{"id":39534427,"url":"https://github.com/lmartinking/duckbot","last_synced_at":"2026-01-18T06:32:06.939Z","repository":{"id":136806411,"uuid":"502791985","full_name":"lmartinking/duckbot","owner":"lmartinking","description":"Discord Channel \u0026 User Statistics Bot (uses kdb+)","archived":false,"fork":false,"pushed_at":"2025-12-12T13:41:58.000Z","size":599,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-12T16:52:22.791Z","etag":null,"topics":["discord-bot","kdb","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lmartinking.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-06-13T03:22:34.000Z","updated_at":"2025-10-19T12:51:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"b07a19a4-8e71-44e6-bba0-62c0b911e8c1","html_url":"https://github.com/lmartinking/duckbot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lmartinking/duckbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmartinking%2Fduckbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmartinking%2Fduckbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmartinking%2Fduckbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmartinking%2Fduckbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmartinking","download_url":"https://codeload.github.com/lmartinking/duckbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmartinking%2Fduckbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28531997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["discord-bot","kdb","python"],"created_at":"2026-01-18T06:32:06.880Z","updated_at":"2026-01-18T06:32:06.928Z","avatar_url":"https://github.com/lmartinking.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Duckbot: Discord Chat Stats Bot\n\n## Features\n\n * Stats per user (message counts; word counts including _nouns, verbs and adjectives_) \n * Stats per channel (message counts; chatty users)\n * Stats per server (message counts; chatty users)\n * [CapyCoin](https://github.com/lmartinking/capycoin) integration (optional!)\n\n## Screenshots\n\n![User Stats](docs/user_stats.png)\n\n![Channel Stats](docs/channel_stats.png)\n\n![Server Stats](docs/server_stats.png)\n\n## Privacy\n\nThis bot records statistics and does **NOT** record whole messages.\n\nHowever, it will tokenise messages into words and classify them, and store\nthose tokens and a count (per user). These are stored in the `userwords` table.\n\nThe bot maintains a `users` table and a `channels` table which contains\nthe ID and name of those discord objects.\n\nThe `messages` table contains the Message ID, Channel ID, User ID and\nTimestamp of the message.\n\n## Requirements\n\n * Python 3.8+\n * Poetry \u003chttps://python-poetry.org/docs\u003e\n * KX kdb+ (Personal use licences are available free of charge from\n   \u003chttps://code.kx.com/q/learn/licensing\u003e)\n\n 1. Run `python -m venv .venv` to create a virtualenv\n 2. Run `poetry install`\n 3. Run `source .venv/bin/activate`\n 4. Run `python -m spacy download en_core_web_md`\n\n\n## Discord Bot Setup\n\nYou should follow the steps provided by `discord.py` to set up a\nDiscord application and token: \u003chttps://discordpy.readthedocs.io/en/stable/discord.html#discord-intro\u003e\n\nThese instructions are quite involved, and it is recommended you invite the\nbot into a personal testing server first.\n\nPlease do not add this bot into a server without understanding the privacy\nimplications. Even though a discord server could be considered a public forum,\nit is good manners to obtain an understanding from the server community before\nadding this bot.\n\n## Configuration\n\nConfiguration is via environment variables. By default `run-bot.sh` and `run-kdb.sh`\nwill source `.env` as part of their startup.\n\n * `DUCKBOT_TOKEN`: Discord bot token.\n * `DUCKBOT_LANG_MODEL`: If you wish to use a different spacy language model,\n   you can set this. Defaults to `en_core_web_md`. This model is fairly simple\n   but it is also compact in terms of memory/disk usage.\n\n * `KDB_HOST`: kdb+ server host (defaults to `localhost`)\n * `KDB_PORT`: kdb+ server IPC port (defaults to `5000`) \n * `KDB_USER`: kdb+ auth user (defaults to _None_)\n * `KDB_PASS`: kdb+ auth password (defaults to _None_)\n\n * `KDB_Q_PATH`: Path to kdb+ `q` binary. Used by `run-kdb.sh`.\n\n * `FORTUNE_PATH`: Path to `fortune` binary. Defaults to `/usr/games/fortune`.\n\n * `CAPYCOIN_HOST`: URL to a CapyCoin gateway. See: https://github.com/lmartinking/capycoin\n * `CAPYCOIN_USERS_DB_PATH`: Path for SQLite database file used for Discord User\n   to CapyCoin account ID mapping\n\n## Quickstart\n\n 1. Set up discord application (per above). Invite bot to server(s).\n 2. Follow instructions under [requirements](#requirements) (in a terminal)\n 3. Copy `env.example` to `.env` and edit\n 4. `$ ./run-kdb.sh` (in one terminal)\n 5. `$ ./run-bot.sh` (in another terminal)\n\n## Commands\n\n * `@duckbot help` - the bot will print a help overview to the channel\n * `@duckbot stats @user` - print stats for a particular user\n * `@duckbot stats #channel` - print stats for a particular channel\n * `@duckbot stats server` - print stats for the whole server\n * `@duckbot fortune` - send a fortune to the current channel\n * `@duckbot ping` - the bot will respond \"pong\" to the user\n\n## CapyCoin Commands\n\nThese commands are only enabled when `CAPYCOIN_HOST` is set.\n\n * `@duckbot coin signup` - sign up for a CapyCoin account\n * `@duckbot coin send @user {amount}` - send coin to a user\n * `@duckbot coin funds` - show your account funds\n\n## Licence\n\nThis code is licenced under the GPLv2.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmartinking%2Fduckbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmartinking%2Fduckbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmartinking%2Fduckbot/lists"}