Skip to content

Commit

Permalink
Merge pull request #3 from Hidden-Warden/dev
Browse files Browse the repository at this point in the history
✨ Add discord RPC
  • Loading branch information
Ahhj93 committed May 26, 2023
2 parents 5fe78ff + c07b79d commit 5fc60d9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
23 changes: 20 additions & 3 deletions MyCards.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,26 @@
import random # Librairie #6
import webbrowser # Librairie #7
import tkinter.font as font # Librairie #8
from tkinter import * # Librairie #9
from settings import * # .py #10
from language_modules import * # .py #11
import time # Librairie #9
from tkinter import * # Librairie #10
from settings import * # .py #11
from language_modules import * # .py #12

# Start- Discord RPC
try:
from pypresence import Presence
cliend_id = "1111771604746244117"
RPC = Presence(cliend_id)
RPC.connect()
RPC.update(
state = "Learn vocabulary",
start = time.time(),
large_image = "logo",
buttons = [{"label": "GitHub", "url": "https://github.com/Hidden-Warden/MyCards"}]
)
except:
print("module pypresence not found so the Discord RPC is not working")
# End- Discord RPC

## ///DEF\\\##
def language(input_language):
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
|--|--|
|![LightMode](https://user-images.githubusercontent.com/70717127/166895375-186bdaa9-780f-4a6f-92f6-8ac3e7dbd331.png)|![DarkMode](https://user-images.githubusercontent.com/70717127/166895388-a46eaa57-f200-4a52-8fed-d1217b223841.png)|

## Prerequisite
You need to install pypresence with the following commands if you want to use the Discord Rich Presence:
```sh
pip install pypresence
```

## You are free to personalise it!
In the `settings.py` file, you can:
* Change the language. (s_language=)
Expand Down

0 comments on commit 5fc60d9

Please sign in to comment.