summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--README.MD44
-rw-r--r--config.json22
-rw-r--r--pydii.py66
4 files changed, 134 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..bacca8e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+__pycache__/
+output/
diff --git a/README.MD b/README.MD
new file mode 100644
index 0000000..7ee6558
--- /dev/null
+++ b/README.MD
@@ -0,0 +1,44 @@
+# Pydii
+A simple and open source Discord custom RPC tool.
+
+## Usage
+To use this tool, all you need to do is;
+1. Download the latest [release](https://github.com/8cy/pydii/releases).
+2. Configure the provided `config.json`.
+3. Start up the Pydii executable!
+
+Alternatively, you can just clone or download the [repository](https://github.com/8cy/pydii) and run the `pydii.py` file.
+
+There are also extra features down below so check out the image.
+
+![](https://strelizia.cc/mvq3zLDLiXIlrHvPGQIjoUu7bU9eGDOg.png)
+
+# Config Explained
+- `client_id` - Your Discord Application's client ID
+- `details` - The first row of text under the applications name
+- `state` - The the row of text under the details
+- `time` - If this is left enabled, then you can choose to either set a custom start time or keep track of time.
+- `custom_time` - If this enabled, you can specify a custom start time in the `start` value.
+- `start` - Here you can set the custom start time if enabled
+- `end` - Here you can specify a custom end time. **Advanced users only**
+- `large_image` - Here you can specify the large image/ icon.
+- `large_text` - Here you can specify the text which is displayed when hovering over the `large_image`.
+- `small_image` - Here you can specify the small image/ icon in the bottom right corner of the `large_image`.
+- `small_text` - Here you can specify the text which is displayed when hovering over the `small_image`.
+- `party_id` - Here you can specify a party key for the application. **Advanced users only**
+- `party_size` - Here you can specify a party size for the application. **Advanced users only**
+- `join` - Here you can specify a join key for the application. **Advanced users only**
+- `spectate` - Here you can specify a spectate key for the application. **Advanced users only**
+- `match` - Here you can specify a match key for the application. **Advanced users only**
+- `instance` - Honestly I don't really remember what this does, I think it might control weather or not he instance of the RPC will even start or not, so... *Advanced users only**
+
+## TODO
+- Eventually make this an executable. I wanted to but for some reason my build wasn't working so plain old python file it was.
+
+## Development
+If you want to help witht the development process, feel free to clone or download this repository and/ or make pull requests as you see fit!
+
+If you want to work on this project, you are going to need to install the [pypresence](https://github.com/qwertyquerty/pypresence) library with pip via `pip install pypresence`.
+
+### License
+MIT
diff --git a/config.json b/config.json
new file mode 100644
index 0000000..0d1369b
--- /dev/null
+++ b/config.json
@@ -0,0 +1,22 @@
+{
+ "client_id": "723019872807813144",
+ "rpc": {
+ "state": "Made with love by Sin",
+ "details": "Cool, I have a custom status!",
+ "time": true,
+ "custom_time": false,
+ "start": "1",
+ "end": "",
+ "large_image": "icon",
+ "large_text": "Pydii",
+ "small_image": "profile",
+ "small_text": "v1.0.0",
+ "_comment": "Advanced users only below",
+ "party_id": "",
+ "party_size": "",
+ "join": "",
+ "spectate": "",
+ "match": "",
+ "instance": true
+ }
+}
diff --git a/pydii.py b/pydii.py
new file mode 100644
index 0000000..f36243f
--- /dev/null
+++ b/pydii.py
@@ -0,0 +1,66 @@
+from pypresence import Presence
+import time
+import json
+
+with open('./config.json') as f:
+ config = json.load(f)
+
+RPC = Presence(config['client_id'])
+print('Loaded client_id from config.json')
+RPC.connect()
+print('Connected to RPC.')
+
+if config['rpc']['time']:
+ if config['rpc']['custom_time']:
+ RPC.update(
+ state=config['rpc']['state'],
+ details=config['rpc']['details'],
+ start=config['rpc']['start'],
+ # end=config['rpc']['end']
+ large_image=config['rpc']['large_image'],
+ large_text=config['rpc']['large_text'],
+ small_image=config['rpc']['small_image'],
+ small_text=config['rpc']['small_text'],
+ # party_id=config['rpc']['party_id'],
+ # party_size=config['rpc']['party_size'],
+ # join=config['rpc']['join'],
+ # spectate=config['rpc']['spectate'],
+ # match=config['rpc']['match'],
+ # instance=config['rpc']['instance']
+ )
+ else:
+ RPC.update(
+ state=config['rpc']['state'],
+ details=config['rpc']['details'],
+ start=time.time(),
+ # end=config['rpc']['end']
+ large_image=config['rpc']['large_image'],
+ large_text=config['rpc']['large_text'],
+ small_image=config['rpc']['small_image'],
+ small_text=config['rpc']['small_text'],
+ # party_id=config['rpc']['party_id'],
+ # party_size=config['rpc']['party_size'],
+ # join=config['rpc']['join'],
+ # spectate=config['rpc']['spectate'],
+ # match=config['rpc']['match'],
+ # instance=config['rpc']['instance']
+ )
+else:
+ RPC.update(
+ state=config['rpc']['state'],
+ details=config['rpc']['details'],
+ large_image=config['rpc']['large_image'],
+ large_text=config['rpc']['large_text'],
+ small_image=config['rpc']['small_image'],
+ small_text=config['rpc']['small_text'],
+ # party_id=config['rpc']['party_id'],
+ # party_size=config['rpc']['party_size'],
+ # join=config['rpc']['join'],
+ # spectate=config['rpc']['spectate'],
+ # match=config['rpc']['match'],
+ # instance=config['rpc']['instance']
+ )
+print('Custom status set.')
+
+while True:
+ time.sleep(15)