{"id":13410892,"url":"https://github.com/mbenoukaiss/automate","last_synced_at":"2025-03-14T16:33:12.965Z","repository":{"id":62438390,"uuid":"208624351","full_name":"mbenoukaiss/automate","owner":"mbenoukaiss","description":"An asynchronous library to interact with Discord API","archived":false,"fork":false,"pushed_at":"2021-04-16T17:23:40.000Z","size":554,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-13T15:44:43.015Z","etag":null,"topics":["async","bot","discord-api","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/mbenoukaiss.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}},"created_at":"2019-09-15T16:41:00.000Z","updated_at":"2023-10-11T23:09:55.000Z","dependencies_parsed_at":"2022-11-01T21:45:58.147Z","dependency_job_id":null,"html_url":"https://github.com/mbenoukaiss/automate","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbenoukaiss%2Fautomate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbenoukaiss%2Fautomate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbenoukaiss%2Fautomate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbenoukaiss%2Fautomate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbenoukaiss","download_url":"https://codeload.github.com/mbenoukaiss/automate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243610534,"owners_count":20318983,"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":["async","bot","discord-api","rust"],"created_at":"2024-07-30T20:01:10.046Z","updated_at":"2025-03-14T16:33:12.582Z","avatar_url":"https://github.com/mbenoukaiss.png","language":"Rust","funding_links":[],"categories":["Libraries"],"sub_categories":["Rust"],"readme":"# Automate \u0026nbsp; [\u003cimg src=\"https://img.shields.io/github/workflow/status/mbenoukaiss/automate/Checks?style=for-the-badge\" alt=\"GitHub Workflow Status\" height=\"23\" /\u003e](https://github.com/mbenoukaiss/automate/actions) [\u003cimg src=\"https://img.shields.io/crates/v/automate?style=for-the-badge\" alt=\"Crates.io\" height=\"23\" /\u003e](https://crates.io/crates/automate) [\u003cimg src=\"https://img.shields.io/discord/609438031039954960?color=%237289DA\u0026label=Discord\u0026style=for-the-badge\" alt=\"Discord\" height=\"23\" /\u003e](https://discord.gg/invite/PGGYXy2) [\u003cimg src=\"https://img.shields.io/badge/docs-latest-blue?style=for-the-badge\" alt=\"Documentation\" height=\"23\" /\u003e](https://docs.rs/automate) [\u003cimg src=\"https://img.shields.io/crates/l/automate?style=for-the-badge\" alt=\"License\" height=\"23\" /\u003e](https://github.com/mbenoukaiss/automate/blob/master/LICENSE)\nAutomate is a low level and asynchronous rust library for interacting with the Discord API.\n\n# Getting started\nAutomate currently only works with Rust nightly starting from `1.45`. The usually tested version and the one used in CI is\n`nightly-2020-08-03`, you can use more recent versions but please swich back to this version \nif you get a compile error. Refer to [rust edition guide](https://doc.rust-lang.org/edition-guide/rust-2018/rustup-for-managing-rust-versions.html)\nto learn how to switch to rust nightly.\n\nIn order to use Automate in your project, add the following line to your `Cargo.toml` :\n```\n[dependencies]\nautomate = \"0.4.0\"\n```\n\nYou can then write the following in your `main.rs`. This simple example will respond Hello \u003cname of the user\u003e! to any\nuser posting a message in any channel while ignoring messages from bots.\nIn order for this example to work, you need to define the `DISCORD_API_TOKEN` environment variable. You can create a\nbot and generate a token on [Discord's developers portal](https://discordapp.com/developers/applications/).\n\n```rust\n#[macro_use]\nextern crate automate;\n\nuse automate::{Error, Configuration, Context, Automate};\nuse automate::gateway::MessageCreateDispatch;\nuse automate::http::CreateMessage;\n\n#[listener]\nasync fn say_hello(ctx: \u0026mut Context, data: \u0026MessageCreateDispatch) -\u003e Result\u003c(), Error\u003e {\n    let message = \u0026data.0;\n\n    if message.author.id != ctx.bot.id {\n        let content = Some(format!(\"Hello {}!\", message.author.username));\n\n        ctx.create_message(message.channel_id, CreateMessage {\n            content,\n            ..Default::default()\n        }).await?;\n    }\n\n    Ok(())\n}\n\nfn main() {\n    let config = Configuration::from_env(\"DISCORD_API_TOKEN\")\n        .register(stateless!(say_hello));\n\n    Automate::launch(config)\n}\n```\n\nFor examples with more details, see in the `examples` folder. You can also refer to the [documentation](https://docs.rs/automate).\n\n# Upcoming features\nWhile mature enough to make text bots, Automate is still missing some important features which will be implemented soon such as :\n- **Caching system**: necessary to avoid making API calls each time you need information about a member or a guild. You can still implement it manually, see the [levels example](examples/levels.rs).\n- **Voice**: it is possible to interact with members in voice channels (kicking, muting, deafening them...) but it is not possible to make the bot join a channel and receive or send sound.\n- **More [examples](examples)**: not a feature but necessary to properly show how the library works, feel free to make pull request if you want to submit one :)\n\n# Contributing\nAny kind of contribution is welcome, from issues to pull requests. For major changes, please open an issue first to discuss what you would like to change.\nPlease make sure to update documentation as appropriate.\n\nIf you need support, want to report a bug or contribute, you can join the library's discord server using this invite https://discord.gg/invite/PGGYXy2\n\n# License\nLicensed under the [MIT license](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbenoukaiss%2Fautomate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbenoukaiss%2Fautomate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbenoukaiss%2Fautomate/lists"}