A Python wrapper for Discord RPC API

Overview

Visistors Discord PyPI - Downloads PyPI PyPI - Status GitHub commit activity

Discord RPC

An Python wrapper for Discord RPC API. Allow you to make own custom RPC

Changelog

Install

  • PyPI
pip install discord-rpc

Quick example

import DiscordRPC
import time 

rpc = DiscordRPC.RPC.Set_ID(app_id=12345678910)

rpc.set_activity(
      state="Rank : Radiant",
      details="Competitive",
      timestamp=rpc.timestamp()
    )

while True:
    time.sleep(600) # to update the RPC, recommended: every 10 minutes or 600 seconds

More examples here

Other

Plan
  • -

Join our Discord server here

Comments
  • Occasional crash

    Occasional crash

    Copy of #4 since @LyQuid12 won't reopen it.

    Sometimes when RPC.set_activity is called, the script crashes with error

        if output['evt'] == "ERROR":
    KeyError: 'evt'
    

    Adding debug print for RPC.output, the error is

    {'code': 1003, 'message': 'data size does not match what was received'}
    

    Seems to happen regardless of what the activity is set to.

    wontfix 
    opened by otta8634 2
  • Allow details and state to be null and disabling the logger

    Allow details and state to be null and disabling the logger

    The details and state fields are not actually required by Discord and it was a bit annoying being required to set them. As for the logger, most people probably won't want extra logging in their apps.

    merged 
    opened by Kale-Ko 2
  • Occasional crash

    Occasional crash

    Sometimes when RPC.set_activity is called, the script crashes with error

        if output['evt'] == "ERROR":
    KeyError: 'evt'
    

    Adding debug print for RPC.output, the error is

    {'code': 1003, 'message': 'data size does not match what was received'}
    

    Seems to happen regardless of what the activity is set to.

    opened by otta8634 2
  • Fixing bug for text and temporarily removing one function

    Fixing bug for text and temporarily removing one function

    I also temporarily removed GCAR because it caused issues on my end. And the small_text and large_text is now not shown as "null" in Discord if it did not got set.

    merged 
    opened by Pukimaa 2
  • What is the app_id and how to get it?

    What is the app_id and how to get it?

    https://github.com/LyQuid12/Discord-RPC/blob/main/examples/rpc-with-button.py#L3

    What is RPC and how it works?

    I have a bot written in python, but I'm not sure how to setup.

    The only thing I care about is custom buttons when opening bot's profile on Discord.

    Does activity have to be set to gaming? or other activities also can show the buttons or images?

    Is Discord-RPC like a second bot that other bots contact to receive information such as buttons and images?

    app_id seems like to mean client_id of a bot.

    Sorry, I'm really confused about how it all works.

    image

    opened by BoQsc 1
  • Explain rpc.run()

    Explain rpc.run()

    rpc.run() is only required to keep the application alive, which isn't explained in README.md. If another module or task or whatnot is keeping the script running, running rpc.run() will just cause the other script to stop functioning, if not threaded.

    merged 
    opened by otta8634 1
  • Error when compiled with pyinstaller

    Error when compiled with pyinstaller

    image

    I'm getting this error when trying to use your package after being compiled into an exe by pyinstaller.

    Here is my code

    rpc = DiscordRPC.RPC.Set_ID('Example')
    button = DiscordRPC.button(button_one_label='Server Invite', button_one_url="https://discord.gg/batch", button_two_label='Website', button_two_url='https://sped.lol')
    rpc.set_activity(state='test', details='test', large_image='WORKING_LARGE_IMAGE_KEY', large_text='test', buttons=button, timestamp=rpc.timestamp())
    rpc.run()
    

    It works perfectly fine as just a py file but when compiled it breaks

    opened by KDot227 1
  • Improvements

    Improvements

    So I've been trying to add a single button through this package and when I looked through the code I saw that there were some problems in it like, when we gave a single button it threw an error. So I myself decided to edit them and these are the things I edited:

    1. Support for single button.
    2. State and Details can now be ignored.
    3. Also Large_image, Small_Image, Small_Text and Large_Text can now be ignored.
    opened by INFINITE31 0
Releases(3.5)
  • 3.5(May 31, 2022)

  • 3.0(Jan 22, 2022)

    Stable

    New :

    • Added GCAR method. GCAR : Get Current Application Running. Basically, you can switch your rpc status (state/details) automatically to the application you're running (Example here)
    Source code(tar.gz)
    Source code(zip)
  • 2.0(Dec 14, 2021)

    Stable

    v2.0 has been released to PyPI, and has gone through the process of checking, testing and has been confirmed to be stable

    New & Updates :

    • Added button (Example here)
    • RPC output (Example here)
    • RPC still running even though "large_text" and "small_text" are not set
    • The message when RPC is running successfully is now working fine, and an error will appear if the RPC is not set properly
    Source code(tar.gz)
    Source code(zip)
  • 1.2(Dec 13, 2021)

Owner
LyQuid :3
Wibu
LyQuid :3
Telephus is a connection pooled, low-level client API for Cassandra in Twisted python.

Telephus Son of Heracles who loved Cassandra. He went a little crazy, at one point. One might almost say he was twisted. Description Telephus is a con

Brandon Williams 93 Apr 29, 2021
With this simple app you can customize your presence in Discord.

Discord Rich Presence This a simple console app which can customize your Discord Presence easily, with only one config file! Setup Go to Discord Devel

Mai 1 Jan 06, 2022
Simple script to ban bots at Twitch chats using a text file as a source.

AUTOBAN 🇺🇸 English version Simple script to ban bots at Twitch chats using a text file as a source. How to use Windows Go to releases for further in

And Paiva 5 Feb 06, 2022
Red-mail - Advanced email sending library for Python

Red Mail Next generation email sender What is it? Red Mail is an advanced email

Mikael Koli 313 Jan 08, 2023
A stock information collector and parser for Taiwan and US market. Automatically send LINE message if the pre-defined rules are triggered.

agastock 開發動機 就在海運飆漲的2021年7月,差點跪在地上喜迎財富自由的當下,EPS超高好消息不斷的長榮竟然套在202元一去不回,有圖有真相(哭) 忽然體會到追高殺低不是辦法,魯蛇我得靠邏輯分析也能出頭天,經過三個月無數個不出門的周末,產出簡單的爬蟲和分析工具。 上過金融研訓院的量化交易

Gavin Lee 12 Nov 16, 2022
OSINT tool to get information from a Github and Gitlab profile and find user's email addresses leaked on commits.

gitrecon OSINT tool to get information from a Github or Gitlab profile and find user's email addresses leaked on commits. 📚 How does this work? GitHu

GOΠZO 211 Dec 17, 2022
Lending-Club-Loans - Using TensorFlow to create an ANN model to predict whether people would charge off or pay back their loans.

Lending Club Loans: Brief Introduction LendingClub is a US peer-to-peer lending company, headquartered in San Francisco, California.[3] It was the fir

Ali Akram 1 Jan 03, 2022
A Python library for the Buildkite API

PyBuildkite A Python library and client for the Buildkite API. Usage To get the package, execute: pip install pybuildkite Then set up an instance of

Peter Yasi 29 Nov 30, 2022
🐍 The official Python client library for Google's discovery based APIs.

Google API Client This is the Python client library for Google's discovery based APIs. To get started, please see the docs folder. These client librar

Google APIs 6.2k Jan 08, 2023
A python script that can send notifications to your phone via SMS text

Discord SMS Notification A python script that help you send text message to your phone one of your desire discord channel have a new message. The proj

2 Apr 25, 2022
A telegram bot writen in python for mirroring files on the internet to our beloved Google Drive

[] Mirror Bot This is a telegram bot writen in python for mirroring files on the internet to our beloved Google Drive. Deploying on Heroku Give Star &

43 Mar 06, 2022
Python API Client for Twitter API v2

🐍 Python Client For Twitter API v2 🚀 Why Twitter Stream ? Twitter-Stream.py a python API client for Twitter API v2 now supports FilteredStream, Samp

Twitivity 31 Nov 19, 2022
Simple integrate of API musixmatch.com with python

Python Musixmatch Simple integrate of API musixmatch.com with python Quick start $ pip install pymusixmatch or $ python setup.py install Authenticatio

Hudson Brendon 79 Dec 20, 2022
Discord bot for calculating basic operations and formulas. (Early Development)

MathBot Discord bot for calculating basic operations and formulas. (Early Development) Commits Feel free to contribute to this bot by forking and pull

4 Jul 14, 2022
Most Simple & Powefull web3 Trade Bot (WINDOWS LINUX) Suport BSC ETH

Most Simple & Powefull Trade Bot (WINDOWS LINUX) What Are Some Pros And Cons Of Owning A Sniper Bot? While having a sniper bot is typically an advanta

GUI BOT 6 Jan 30, 2022
Block Telegram's new

Telegram Channel Blocker Bot Channel go away! This bot is used to delete and ban message sent by channel How this appears? The reason this appears ple

16 Feb 15, 2022
Userbot Telegram dengan Telethon

FLICKS - UBOT Repo FLICKS UBOT Repo Yang Dibuat Oleh Rizzz Dari beberapa Repo Yang Ada Di Github. Generate String Using Replit ⤵️ DEPLOY TO HEROKU Sup

FJ_GAMING 14 May 16, 2022
A powerful application to automatically deploy GitHub Release.

A powerful application to automatically deploy GitHub Release.

Fentaniao 43 Sep 17, 2022
A really easy way to display your spotify listening status on spotify.

Spotify playing README A really easy way to display your spotify listening status on READMEs and Websites too! Demo Here's the embed from the site. Cu

Sunrit Jana 21 Nov 06, 2022
Group Chat Spammer For Discord

Group Chat Spammer For Discord Free and public gc spammer

Dreamy 20 Dec 27, 2022