An abstraction build on top of discord-rich-presence that makes possible to use it in a more declarative way

Overview

Declarative Discord Rich Presence

This library is an abstraction build on top of discord-rich-presence crate that allows you to use it in a more declarative way.

When created it starts an infinite loop on a new thread that will constantly try to reconnect the client if it's enabled.

For more information, please also read the original library documentation: discord-rich-presence

Example

use declarative_discord_rich_presence::DeclarativeDiscordIpcClient;
use declarative_discord_rich_presence::activity::Activity;

fn main() -> Result<(), Box<dyn std::error::Error>>{

    let mut client = DeclarativeDiscordIpcClient::new("771124766517755954");

    client.enable();

    client.set_activity(Activity::new()
        .state("Hello world!")
        .details("Hello world!")
    )?;

    std::thread::sleep(std::time::Duration::from_secs(10));

    client.clear_activity()?;

    client.disable();

    Ok(())
}
You might also like...
◉ Arbitrary Protocols on top of Bitcoin (Bitcoin NFTs/Ordinals & Bitcoin Identities/Usernames)

◉ arb arb is a command-line wallet, index, and explorer interface that implements the arb protocol, which enables arbitrary protocols on top of Bitcoi

Display strings in a safe platform-appropriate way

os_display Printing strings can be tricky. They may contain control codes that mess up the message or the whole terminal. On Unix even filenames can c

kindly is a simple Rust implementation of a set-user-ID-root program, similar to sudo but in a much reduced way.

kindly is a simple Rust implementation of a set-user-ID-root program, similar to sudo but in a much reduced way.

Advent of Code 2015, done entirely in Rust both for the challenge and as a way to learn

Advent of Code 2015 In preparation for Advent of Code 2021, I wanted to go back and try some of the older challenges. I figured it made the most sense

qn (quick note) is a simple, fast and user-friendly way to save notes 🦀⚙️
qn (quick note) is a simple, fast and user-friendly way to save notes 🦀⚙️

Quick Note qn Install This is currently for my personal use. I may push breaking changes at any time. If you want to use it, bring down the code and r

Provide expansion of proc-macros, in a way that rustc directs you directly to the issues at hand

expander Expands a proc-macro into a file, and uses a include! directive in place. Advantages Only expands a particular proc-macro, not all of them. I

Rust Keeper bots that run various functions, from liquidations, to orderbook cranks, and more.

The zo-keeper (pronounced "zoo keeper") repository runs large scale instructions that secure the 01 network, and allow it to operate in a fully decentralized manner.

Rust bindings for libjuice. Look at datachannel-rs if you need more batteries.

Rust bindings for libjuice. Look at datachannel-rs if you need more batteries.

Utility to quickly setup Starcraft Broodwar matches between 2 or more bots

BWAIShotgun Utility to quickly setup Starcraft Broodwar matches between 2 or more bots Be aware that all bots will be executed directly, without any l

Owner
null
A cross-platform application for custom presence on Discord.

Discord Presence ⚠️ macOS is NOT supported. This is due the package for setting the presence being broken on mac. It may work for some people (only wh

Tofix.js 2 Dec 30, 2022
A Discord bot focused on addressing the inherent problems with Discord, to allow a more socialist/anarchist organization of servers.

ACABot A Discord bot focused on addressing the inherent problems with Discord, to allow a more socialist/anarchist organization of servers (or "guilds

null 4 May 3, 2022
The simplest way to de-Google your life and business: Inbox, Calendar, Files, Contacts & much more

Bloom The all-in-one private workspace Try it for free! You no longer trust tech monopolies with your data? You are done with your privacy invaded by

Sylvain Kerkour 1.6k Dec 26, 2022
Milho (corn in portuguese) is a toy dialect of Lisp written as a way to learn more about compilers

Milho (corn in portuguese) is a toy dialect of Lisp written as a way to learn more about compilers. There are implementations in rust and go

Celso Bonutti 27 May 4, 2022
A simply better way to make Discord bots.

Cognite ?? A simple blazingly fast language agnostic microservice driven Discord bot framework made in rust that leverages Apache Kafka and KeyDB to t

Eludris 5 Aug 26, 2022
A rust(serenity) based discord bot for the hacksquad discord server

A Discord Bot for Hacksquad How to Deploy? Requirements Docker Docker Compose Steps To Run Copy the docker-compose.yml and .env.example files to your

HackSquad 5 Jan 4, 2023
A Monte Carlo simulation of getting all possible outcomes of loot boxes opening

lootboxes_monte_carlo A monte-carlo simulation of the number of "lootboxes" to open to get at least one of each possible outcome I wondered how many l

Adssx 2 Dec 1, 2022
The easiest way to use BotiCord API in Rust

The easiest way to use BotiCord API in Rust · Docs Usage [dependencies]

BotiCord 6 Feb 14, 2022
A high-level Rust crate around the Discord API, aimed to be easy and straight-forward to use.

rs-cord A high-level Rust crate around the Discord API, aimed to be easy and straight-forward to use. Documentation • Crates.io • Discord Navigation M

Jay3332 4 Sep 24, 2022
Powerfull Discord Raid Bot written in Rust, use VPN / Proxy because creating 200 channels in 10s Will ratelimit you.

Harakiri-Rust This the first Discord Raid Bot made in RustLang I recommend you use with a VPN or a Proxy to evade Discord Ratelimit. If bot doesn't st

Marco 6 May 1, 2023