百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

discord-sdk

> 编程语言
开源

在 Rust 中开放的 Discord Game SDK 实现

175 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

在 Rust 中开放的 Discord Game SDK 实现

Why not use this?

  • This project is not official and is using a largely undocumented protocol that Discord could change/break at any time in the future.
  • There is already a Rust wrapper for the official Game SDK.
  • Your project is not also in Rust. We may add a C API for this crate in the future, but for now this is a Rust only project.

Why use this?

  • You use Rust for your project and want to integrate features such as rich presence/activities provided by Discord.
  • You don't want to have a dependency on a closed source, shared library.
  • You like to live dangerously (though this library does also have some automated tests!).

Implemented Features

Activities (Rich Presence)

Commands

  • Update Activity
  • Clear Activity
  • Send Join Request Reply
  • Send Invite
  • Accept Invite

Events

  • Join
  • Spectate
  • Join Request
  • Invite

Other

  • Application Registration (Windows, Linux, Mac)

Other

Overlay

NOTE: These are only tested insofar as the protocol is (probably) correct, however, the overlay is currently extremely limited, and so we were unable to test that the overlay commands actually function correctly since our primary project is Vulkan.

Note, there are a few other cases that overlay will not work with. The overlay is currently not supported for Mac, games with Vulkan support, and generally old games.

Also note, the SDK itself and its documentation uses the utterly confusing terminology of Un/Locked when talking about the overlay, this crate instead uses Visibility, as in Visible or Hidden.

Commands

  • Toggle Visibility
  • Open Activity Invite
  • Open Guild Invite
  • Open Voice Settings - NOTE: AFAICT, if your application does not have the overlay enabled (eg, because it is Vulkan or a CLI or whatnot), this will crash Discord.

Events

  • Overlay Update

Relationships

Commands

  • Get Relationships - NOTE: This command is not really exposed directly from the regular Game SDK, but is implicitly executed by the SDK during intialization.

Events

  • Relationship Update

Users

Commands

  • Get Current User
  • Get User

Events

  • Current User Update

Testing

Unfortunately Discord does not provide a convenient way to perform automated testing, as it requires an actual working Discord application to be running and logged in, which makes automated (particularly headless) testing...annoying.

For now, it's required that you manually spin up 2 different Discord applications (eg, Stable and Canary) and log in with separate accounts on the same machine, then run one test at a time.

Activities

bash
cargo test --features local-testing test_activity

Contribution

We welcome community contributions to this project.

Please read our Contributor Guide for more information on how to get started. Please also read our Contributor Terms before you make any contributions.

Any contribution intentionally submitted for inclusion in an Embark Studios project, shall comply with the Rust standard licensing model (MIT OR Apache 2.0) and therefore be dual licensed as described below, without any additional terms or conditions:

License

This contribution is dual licensed under EITHER OF

  • Apache License, Version 2.0, (LICENSE-APACHE or )
  • MIT license (LICENSE-MIT or )

at your option.

For clarity, "your" refers to Embark or any other licensee/user of the contribution.

Issues· 4 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言