Skip to content

Commit

Permalink
Merge pull request #227 from pandaninjas/master-1
Browse files Browse the repository at this point in the history
Make CI stop failing
  • Loading branch information
TheSpookyCat committed Aug 19, 2023
2 parents 3d328b5 + a7e04a4 commit 31718fb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install --upgrade pip wheel
- run: pip install --upgrade pip wheel setuptools
- run: pip install bandit black codespell flake8 isort mypy pytest pyupgrade safety
- run: bandit --recursive --skip B101,B311 .
- run: black --check . || true
Expand Down
1 change: 0 additions & 1 deletion docs/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,3 @@
# -- Extension configuration -------------------------------------------------

extensions = ['sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinx.ext.autodoc']

12 changes: 8 additions & 4 deletions examples/rich-presence-get-request.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@


def get_presence_data():
with requests.get('https://somewebsite.com/api/status') as resp:
data = resp.json()
# Use the data in whatever way you want, and return kwargs for the Presence.update() method
return {'state': data['online'].title(), 'details': 'SomeWebsite Status', 'start': data['start']}
try:
with requests.get('https://somewebsite.com/api/status', timeout=5) as resp:
data = resp.json()
# Use the data in whatever way you want, and return kwargs for the Presence.update() method
return {'state': data['online'].title(), 'details': 'SomeWebsite Status', 'start': data['start']}
except Exception:
# update failed data
return {'state': 'SomeWebsite status is down!'}


def run():
Expand Down
10 changes: 8 additions & 2 deletions examples/rich-presence-gifs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
RPC.connect()


RPC.update(state="Custom gifs",details="Using pypresence",large_image=("https://media.tenor.com/9c83g4VPctQAAAAi/shaking-eyes-eyes-shaking.gif"), large_text="Watching!",
small_image=("https://media.giphy.com/media/4UjV5LeD66EPruSG18/giphy.gif"), small_text="Spinning")
RPC.update(
state="Custom gifs",
details="Using pypresence",
large_image=("https://media.tenor.com/9c83g4VPctQAAAAi/shaking-eyes-eyes-shaking.gif"),
large_text="Watching!",
small_image=("https://media.giphy.com/media/4UjV5LeD66EPruSG18/giphy.gif"), small_text="Spinning"
)

while True:
time.sleep(1)

0 comments on commit 31718fb

Please sign in to comment.