Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use default discord_client_id #73

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,24 @@
<a href="https://github.com/afonsojramos/discrakt/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
</p>


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.

<p align="center"><img src="./images/demo/member-list.png" width="260px"><p>

<p align="center"><img src="./images/demo/profile-status.png" width="260px"><p>
<p align="center"><img src="./images/demo/profile-status.png" width="260px" alt="Profile Status"><p>

**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`).
Expand Down
3 changes: 0 additions & 3 deletions credentials.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ OAuthAccessToken =
OAuthRefreshToken =
OAuthRefreshTokenExpiresAt =

[Discord]
discordClientID = 457098328950423

[TMDB API]
tmdbToken = exampletoken
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{thread::sleep, time::Duration};
fn main() -> Result<(), Box<dyn std::error::Error>> {
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,
Expand Down
6 changes: 2 additions & 4 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"),
Expand Down
Loading