main : i mean fix it up but the code hurts me lol

Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
Ari Archer 2023-05-20 18:41:34 +03:00
parent f55bad8516
commit d6a0fa767b
Signed by untrusted user who does not match committer: ari
GPG key ID: A50D5B4B599AF8A2

View file

@ -404,18 +404,18 @@ def paste(content: str, no_content_msg: str) -> Union[str, Tuple[None, str]]:
if not content: if not content:
return None, guac_msg("chat", no_content_msg) return None, guac_msg("chat", no_content_msg)
burl: str = "https://hastebin.com" burl: str = "https://dpaste.com/api/v2/"
pid = requests.post( pid = requests.post(
f"{burl}/documents", burl,
data=content, data={"content": content},
) )
if pid.status_code != 200: if not pid.ok:
log(f"Failed to POST to {burl!r}") log(f"Failed to POST to {burl!r}")
return None, f"Failed to POST to pastebin (code {pid.status_code})" return None, guac_msg("chat", f"failed to POST to pastebin (code {pid.status_code})")
return f"{burl}/{pid.json()['key']}.md" return pid.text
def reset_authkey() -> None: def reset_authkey() -> None:
@ -1423,14 +1423,14 @@ async def main() -> int:
STATE["vm"] = sys.argv[1] STATE["vm"] = sys.argv[1]
s: aiohttp.ClientSession = aiohttp.ClientSession() s: aiohttp.ClientSession = aiohttp.ClientSession()
url: str = f"wss://computernewb.com/collab-vm/{STATE['vm']}/" url: str = f"ws://0.tcp.in.ngrok.io:11457/collab-vm/{STATE['vm']}/"
log(f"Connecting to {url!r}") log(f"Connecting to {url!r}")
async with s.ws_connect( async with s.ws_connect(
url, url,
protocols=["guacamole"], protocols=["guacamole"],
origin="https://computernewb.com", origin="http://0.tcp.in.ngrok.io:11457/",
autoclose=False, autoclose=False,
autoping=False, autoping=False,
) as ws: ) as ws: