From a43b00906031e9895f7d30b2314479b4e2aa3c13 Mon Sep 17 00:00:00 2001 From: Afonso Jorge Ramos Date: Wed, 6 Mar 2024 00:57:54 +0000 Subject: [PATCH] feat: use default `discord_client_id` --- README.md | 5 ++--- credentials.ini | 3 --- src/main.rs | 2 +- src/utils.rs | 6 ++---- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 2c51b5c..e31ef32 100644 --- a/README.md +++ b/README.md @@ -9,25 +9,24 @@

- A simple app that acts as a bridge between [Discord](https://discord.com/) and [Trakt](https://trakt.tv) (and maybe even [Plex](https://www.plex.tv/)), allowing for the display of the watch status as [Discord's Rich Presence](https://discord.com/rich-presence). Essentially, it's a Trakt/Plex Discord Rich Presence.

-

+

Profile Status

**Protip**: If you are already using Plex, and would like to link it with Trakt, you can use the [Plex-Trakt-Scrobbler](https://github.com/trakt/Plex-Trakt-Scrobbler) plugin. If you already know **Trakt** and how awesome it is this is definitely the best option, as it works **more reliably** and with some extra benefits over the other implementations, such as registering your watch status **wherever you are watching** (TV, phone, across the world, etc.), **in whatever app you are watching on** (Netflix, Roku, Plex, HBO Max), as long as you have a single device running **Discord** and **Discrakt**. Plex Rich Presence alternatives: + - [discord-rich-presence-plex](https://github.com/Phineas05/discord-rich-presence-plex) - [plex-rich-presence](https://github.com/Ombrelin/plex-rich-presence) ## Setup 1. Create an API Application on [Trakt.tv](https://trakt.tv/oauth/applications/new) (with scrobble capabilities and `urn:ietf:wg:oauth:2.0:oob` as the redirect uri) -2. Create an API Application on [Discord](https://discord.com/developers/applications). 2. Create an API Application on [themoviedb.org](https://www.themoviedb.org/documentation/api). 3. Edit the `credentials.ini` file with the required API keys (Cliend IDs) and Trakt username. 4. In the [Discord Developer Dashboard](https://discord.com/developers/applications), within your application and under **Rich Presence** -> **Art Assets**, upload the application images, either the ones located in `/images` or ones that you choose to submit (as long as the keys for those images stay `shows` and `movies`). diff --git a/credentials.ini b/credentials.ini index a62f39e..49dd057 100644 --- a/credentials.ini +++ b/credentials.ini @@ -7,8 +7,5 @@ OAuthAccessToken = OAuthRefreshToken = OAuthRefreshTokenExpiresAt = -[Discord] -discordClientID = 457098328950423 - [TMDB API] tmdbToken = exampletoken \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 2f21b99..8274477 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ use std::{thread::sleep, time::Duration}; fn main() -> Result<(), Box> { let mut cfg = load_config(); cfg.check_oauth(); - let mut discord = Discord::new(cfg.discord_token); + let mut discord = Discord::new(cfg.discord_client_id); let mut trakt = Trakt::new( cfg.trakt_client_id, cfg.trakt_username, diff --git a/src/utils.rs b/src/utils.rs index d101fee..739b22a 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -17,7 +17,7 @@ pub struct TraktAccessToken { use crate::trakt::TraktWatchingResponse; pub struct Env { - pub discord_token: String, + pub discord_client_id: String, pub trakt_username: String, pub trakt_client_id: String, pub trakt_oauth_enabled: bool, @@ -146,9 +146,7 @@ pub fn load_config() -> Env { config.load("credentials.ini").unwrap(); Env { - discord_token: config - .get("Discord", "discordClientID") - .expect("discordClientID not found"), + discord_client_id: "826189107046121572".to_string(), trakt_username: config .get("Trakt API", "traktUser") .expect("traktUser not found"),