aly / discord bot to retrieve fuel data from racq and provide links
0 likes
0 forks
2 files
Last active
uses https://github.com/alyssadev/python-discord-bot
| 1 | #!/usr/bin/env python3 |
| 2 | from requests import get |
| 3 | from interactions import slash_command, SlashContext, Client, slash_option, OptionType, auto_defer, Embed, check, AutocompleteContext, listen |
| 4 | from os import environ |
| 5 | |
| 6 | suburbs = {f"{d['locality']} {d['state']}": d for d in get("https://www.matthewproctor.com/Content/postcodes/australian_postcodes.json").json()} |
| 7 | |
| 8 | bot = Client(token=environ["BOT_TOKEN"]) |
| 9 | guilds = [353071720342487040] |
aly / xivstatus.py
0 likes
0 forks
1 files
Last active
A script that runs (for me) every 5 minutes, updating category and channel names to indicate FFXIV server status
| 1 | #!/usr/bin/env python3 |
| 2 | import requests |
| 3 | from datetime import datetime, timedelta |
| 4 | |
| 5 | t = '\u2705' |
| 6 | f = '\u274c' |
| 7 | up = True |
| 8 | |
| 9 | class Channel: |
| 10 | category = ("1063529720538484786", "status") |
aly / fixsunshine.py
0 likes
0 forks
1 files
Last active
A small script to run whenever Windows changes the numbering of my displays, to ensure that the 1080p display is always selected for streaming
| 1 | from requests import post |
| 2 | from requests.exceptions import ConnectionError |
| 3 | from subprocess import check_output |
| 4 | |
| 5 | dxgi = check_output(r'C:\Program Files\Sunshine\tools\dxgi-info.exe').decode("utf-8").split("\r\n") |
| 6 | displays = dict(zip((d.split()[-1] for d in dxgi if "Resolution" in d),(d.split()[-1] for d in dxgi if "DISPLAY" in d))) |
| 7 | post("https://localhost:47990/api/config", json={"output_name":displays["1920x1080"]}, auth=("sunshine", password), verify=False) |
| 8 | try: |
| 9 | post("https://localhost:47990/api/restart", auth=("sunshine", password), verify=False) |
| 10 | except ConnectionError: |