From b8b891d9db9363910ae6033adaa291735e8951b1 Mon Sep 17 00:00:00 2001 From: stringsplit <77242831+nbitzz@users.noreply.github.com> Date: Thu, 29 Dec 2022 12:43:16 -0800 Subject: [PATCH] wwwww --- README.md | 8 +++++++- package.json | 4 ++-- src/index.ts | 3 ++- src/lib/SlashCommandManager.ts | 0 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 src/lib/SlashCommandManager.ts diff --git a/README.md b/README.md index 778b7f6..873d1a5 100644 --- a/README.md +++ b/README.md @@ -3,5 +3,11 @@ File sharing via Discord
+## .env + +``` +TOKEN=KILL-YOURSELF.NOW +``` + ## Disclaimer! -This project does some stuff that can be considered questionable. Discord may not like you uploading files this way, and it's a grey area in Discord's TOS. We take no responsibility if Discord locks your account for API abuse. This was made out of pure boredom and wondering if it was even possible. +This project does some stuff that can be considered questionable. Discord may not like you uploading files this way, and it's a grey area in Discord's TOS. We take no responsibility if Discord locks your account for API abuse. diff --git a/package.json b/package.json index 1e9980c..65e68bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "monofile", - "version": "1.1.3", + "version": "1.1.4", "description": "", "main": "index.js", "scripts": { @@ -8,7 +8,7 @@ }, "keywords": [], "author": "", - "license": "ISC", + "license": "Unlicense", "engines": { "node": "v16" }, diff --git a/src/index.ts b/src/index.ts index 7ecaf99..a2587b3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -48,13 +48,14 @@ let uploadChannel:Discord.TextBasedChannel interface FileUploadSettings { name?: string, mime: string, + uploadId?: string } let uploadFile = (settings:FileUploadSettings,fBuffer:Buffer) => { return new Promise(async (resolve,reject) => { if (!settings.name || !settings.mime) {reject({status:400,message:"missing name/mime"});return} - let uploadId = Math.random().toString().slice(2) + let uploadId = settings.uploadId || Math.random().toString().slice(2) if (files[uploadId]) {reject({status:500,message:"please try again"});return} if (settings.name.length > 128) {reject({status:400,message:"name too long"}); return} diff --git a/src/lib/SlashCommandManager.ts b/src/lib/SlashCommandManager.ts new file mode 100644 index 0000000..e69de29