Skip to content

Instantly share code, notes, and snippets.

@LordOfPolls
Last active August 5, 2021 13:16
Show Gist options
  • Save LordOfPolls/8bf1bac70ab8fa2190de203a7a2b5bd0 to your computer and use it in GitHub Desktop.
Save LordOfPolls/8bf1bac70ab8fa2190de203a7a2b5bd0 to your computer and use it in GitHub Desktop.
import random
import time
from pypresence import Presence
print("Connecting to client...")
client_id = "834696811729125417" # the app ID you're playing
RPC = Presence(client_id=client_id)
RPC.connect()
buttons = [
{"label": "⭐ View The Repo", "url": "https://github.com/LordOfPolls/dis_snek"},
{"label": "💬 Join Our Server", "url": "https://discord.gg/hpfNhH8BsY"},
]
lines = [
"Reject d.py, embrace snek",
"snek time",
"Discord API V9",
"Interaction Support",
"Fully Slotted And Ready To Go",
"__init__? nah attrs",
"but its not pythonic",
"fully interactive",
"Slash commands are better",
]
while True:
print("Updating Presence")
RPC.update(
details=random.choice(lines),
state="🔨 Working on the API",
large_image="snek",
large_text="A happy snek",
buttons=buttons,
)
# keep alive
time.sleep(15)
@LordOfPolls
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment