{"id":13566332,"url":"https://github.com/okp4/discord-bot","last_synced_at":"2025-04-04T00:30:28.530Z","repository":{"id":50933650,"uuid":"517682866","full_name":"okp4/discord-bot","owner":"okp4","description":"🤖 Discord bot used @okp4 to bridge the Dataverse!","archived":false,"fork":false,"pushed_at":"2024-01-26T04:16:24.000Z","size":786,"stargazers_count":10,"open_issues_count":16,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-01-26T05:11:54.224Z","etag":null,"topics":["blockchain","cosmos-sdk","cryptocurrency","discord-bot"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/okp4.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}},"created_at":"2022-07-25T13:45:09.000Z","updated_at":"2024-04-15T06:31:11.792Z","dependencies_parsed_at":"2023-10-11T09:12:50.304Z","dependency_job_id":"84528022-1a11-4d65-9663-47bddd30204d","html_url":"https://github.com/okp4/discord-bot","commit_stats":{"total_commits":391,"total_committers":9,"mean_commits":43.44444444444444,"dds":"0.45012787723785164","last_synced_commit":"8417047a8d691c243053edd66df7a91f38bc4ff7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":"okp4/template-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Fdiscord-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Fdiscord-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Fdiscord-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Fdiscord-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okp4","download_url":"https://codeload.github.com/okp4/discord-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247103305,"owners_count":20884023,"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":["blockchain","cosmos-sdk","cryptocurrency","discord-bot"],"created_at":"2024-08-01T13:02:07.355Z","updated_at":"2025-04-04T00:30:28.216Z","avatar_url":"https://github.com/okp4.png","language":"Rust","funding_links":[],"categories":["Tools","Rust"],"sub_categories":["Bots"],"readme":"# 🤖 Discord bot\n\n\u003e Discord bot used @okp4 to bridge the Dataverse!\n\n[![version](https://img.shields.io/github/v/release/okp4/discord-bot?style=for-the-badge\u0026logo=github)](https://github.com/okp4/discord-bot/releases)\n[![build](https://img.shields.io/github/actions/workflow/status/okp4/discord-bot/build.yml?branch=main\u0026label=build\u0026style=for-the-badge\u0026logo=github)](https://github.com/okp4/discord-bot/actions/workflows/build.yml)\n[![lint](https://img.shields.io/github/actions/workflow/status/okp4/discord-bot/lint.yml?branch=main\u0026label=lint\u0026style=for-the-badge\u0026logo=github)](https://github.com/okp4/discord-bot/actions/workflows/lint.yml)\n[![test](https://img.shields.io/github/actions/workflow/status/okp4/discord-bot/test.yml?branch=main\u0026label=test\u0026style=for-the-badge\u0026logo=github)](https://github.com/okp4/discord-bot/actions/workflows/test.yml)\n[![codecov](https://img.shields.io/codecov/c/github/okp4/discord-bot?style=for-the-badge\u0026token=K5CYM8TQQY\u0026logo=codecov)](https://codecov.io/gh/okp4/discord-bot)\n[![conventional commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=for-the-badge\u0026logo=conventionalcommits)](https://conventionalcommits.org)\n[![contributor covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg?style=for-the-badge)](https://github.com/okp4/.github/blob/main/CODE_OF_CONDUCT.md)\n[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg?style=for-the-badge)](https://opensource.org/licenses/BSD-3-Clause)\n\n## ✨ Purpose\n\nThis project is a general-purpose Discord bot around the [Cosmos ecosystem](https://cosmos.network) that bridges Discord and the blockchains of that ecosystem.\n\nThe aim of the bot is to cover a wide range of features:\n\n- requesting tokens for a testnet Cosmos (aka as Faucet feature) ;\n- consultation of blockchain transactions ;\n- consultation of wallet balances ;\n- consultation of application states of modules or smart contracts ;\n- interaction with smart-contracts ;\n- ...\n\nThis bot is currently used for the [OKP4 Discord](https://discord.gg/okp4) server, providing the many features that help us keep the server running smoothly while providing many services to our community. The aim is to provide the following range of features:\n\n- consultation of data spaces, including governance rules\n- consultation of the progress of a workflow execution\n- consultation of dataset and service metadata\n- ...\n\n## 📄 How to use\n\n### Command `start`\n\n#### CLI\n\nBoot 🚀 the discord bot.\n\n```sh\n./discord_bot start --help\n```\n\n```sh\ndiscord_bot-start \nBoot the discord bot\n\nUSAGE:\n    discord_bot start [OPTIONS]\n\nOPTIONS:\n    -g, --guild-id \u003cGUILD_ID\u003e\n            The guild ID (Server ID)\n\n    -h, --help\n            Print help information\n\n    -p, --prometheus-endpoint \u003cPROMETHEUS_ENDPOINT\u003e\n            The prometheus endpoint. Optional. Configures an HTTP exporter that functions as a\n            scrape endpoint for prometheus. The value is an IPv4 or IPv6 address and a port number,\n            separated by a colon. For instance: 0.0.0.0:9000\n\n    -t, --token \u003cTOKEN\u003e\n            The discord token\n```\n\n#### Example\n\n```sh\n start -t MTIzNDU2Nzg5MDEyMzQ1Njc4OQ.Zm9vYmFy.Fa_SK4L9Sdk4Ndk4Sl5ZLkrjs4fk456DHKsqED -g 1234567890123456789\n```\n\n#### Configuration\n\nThe bot is configured using a `toml` configuration file. Here is an example that configures the chain and the faucet (to be adapted to your needs):\n\n```toml\n[chain]\nchain_id = \"okp4-nemeton-1\"\ndenom = \"uknow\"\ngrpc_address = \"https://grpc.testnet.okp4.network\"\nprefix = \"okp4\"\nbatch_transaction_window = { secs = 15, nanos = 0 }\n\n[faucet]\nchannel_id = 1034483599996620820\namount_send = 1000000\nfee_amount = 0\ngas_limit = 200000\nmemo = \"Sent by økp4 discord bot 🤑\"\nexplorer_url = \"https://explore.okp4.network/okp4%20testnet/tx/{txhash}\"\n```\n\n#### Prometheus Metrics\n\nIf you want to expose Prometheus metrics you need to set the `-p \u003cPROMETHEUS_ENDPOINT\u003e` to the command line:\n\n```sh\n start -t MTIzNDU2Nzg5MDEyMzQ1Njc4OQ.Zm9vYmFy.Fa_SK4L9Sdk4Ndk4Sl5ZLkrjs4fk456DHKsqED -g 1234567890123456789 -p 127.0.0.1:9000\n```\n\n##### `discord_interactions_total`\n\n- type: `counter`\n- description: The total number of interactions received by the bot from Discord, labeled with: interaction, command.\n- example:\n\n```text\ndiscord_interactions_total{interaction=\"application-command\",command=\"ping\"} 96\n```\n\n##### `discord_interactions_duration`\n\n- type: `histogram`\n- description: Timing statistics (percentiles) for Discord interaction processing durations, labeled with: interaction, command, quantile.\n- example:\n\n```text\ndiscord_interactions_duration{interaction=\"application-command\",command=\"ping\",quantile=\"0\"} 0.36191104\ndiscord_interactions_duration{interaction=\"application-command\",command=\"ping\",quantile=\"0.5\"} 0.3619316097353429\ndiscord_interactions_duration{interaction=\"application-command\",command=\"ping\",quantile=\"0.9\"} 0.3619316097353429\ndiscord_interactions_duration{interaction=\"application-command\",command=\"ping\",quantile=\"0.95\"} 0.3619316097353429\ndiscord_interactions_duration{interaction=\"application-command\",command=\"ping\",quantile=\"0.99\"} 0.3619316097353429\ndiscord_interactions_duration{interaction=\"application-command\",command=\"ping\",quantile=\"0.999\"} 0.3619316097353429\ndiscord_interactions_duration{interaction=\"application-command\",command=\"ping\",quantile=\"1\"} 0.36191104\n```\n\n## Prerequisites\n\nBe sure you have [Rust](https://www.rust-lang.org/tools/install) properly installed with [cargo-make](https://github.com/sagiegurari/cargo-make).\n\n## Build\n\n```sh\ncargo make\n```\n\n## Docker image 🐳\n\nA docker image is also available. Usage example :\n\n```bash\ndocker run okp4/discord-bot:latest start -t $TOKEN -g $GUILD_ID\n```\n\n## You want to get involved? 😍\n\nPlease check out OKP4 health files :\n\n- [Contributing](https://github.com/okp4/.github/blob/main/CONTRIBUTING.md)\n- [Code of conduct](https://github.com/okp4/.github/blob/main/CODE_OF_CONDUCT.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokp4%2Fdiscord-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokp4%2Fdiscord-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokp4%2Fdiscord-bot/lists"}