-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically upload files in help channels to a bin service #21
Comments
I'd like it, but as a context menu command to not clutter the chat |
|
What about https://srcshare.io/? They also have an API: https://api.wornoffkeys.com/v1/srcshare |
That link's broken for me. // 20231009211137
// https://api.wornoffkeys.com/v1/srcshare
{
"errorType": "Runtime.UnhandledPromiseRejection",
"errorMessage": "CastError: Cast to ObjectId failed for value \"\" (type string) at path \"_id\" for model \"srcshare-code\"",
"trace": [
"Runtime.UnhandledPromiseRejection: CastError: Cast to ObjectId failed for value \"\" (type string) at path \"_id\" for model \"srcshare-code\"",
" at process.<anonymous> (file:///var/runtime/index.mjs:1250:17)",
" at process.emit (node:events:513:28)",
" at emit (node:internal/process/promises:140:20)",
" at processPromiseRejections (node:internal/process/promises:274:27)",
" at processTicksAndRejections (node:internal/process/task_queues:97:32)"
]
} |
Yeah, not sure what that's about but I've used it, I just made a fetch request, something like this: fetch("https://api.wornoffkeys.com/v1/srcshare", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
tabs: [
{
name: "Code",
content: `${code}`,
},
{
name: "Error",
content: `${error}`,
},
],
language: `${language}`,
title: `${title}`,
description: `${description}`,
}),
}); |
As mentioned in the
/tag query: bin
command, users should upload large code snippets to a bin service instead of uploading them as files. Some reasons include:Possible Solution
Upon detecting a message in a help channel with a
.txt
/.js
/.ts
file, upload the contents of the file to a bin service. Then, silently reply to the message with the link to the bin.As for which bin service to use, I think sourcebin is the most popular but I can't find if they have a public API or not. Pastebin is a close contender.
Concept
The text was updated successfully, but these errors were encountered: