mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-25 15:06:26 -08:00
wwwww
This commit is contained in:
parent
240d12d887
commit
b8b891d9db
|
@ -3,5 +3,11 @@ File sharing via Discord
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
## .env
|
||||||
|
|
||||||
|
```
|
||||||
|
TOKEN=KILL-YOURSELF.NOW
|
||||||
|
```
|
||||||
|
|
||||||
## Disclaimer!
|
## 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.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "monofile",
|
"name": "monofile",
|
||||||
"version": "1.1.3",
|
"version": "1.1.4",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "Unlicense",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "v16"
|
"node": "v16"
|
||||||
},
|
},
|
||||||
|
|
|
@ -48,13 +48,14 @@ let uploadChannel:Discord.TextBasedChannel
|
||||||
interface FileUploadSettings {
|
interface FileUploadSettings {
|
||||||
name?: string,
|
name?: string,
|
||||||
mime: string,
|
mime: string,
|
||||||
|
uploadId?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
let uploadFile = (settings:FileUploadSettings,fBuffer:Buffer) => {
|
let uploadFile = (settings:FileUploadSettings,fBuffer:Buffer) => {
|
||||||
return new Promise<string>(async (resolve,reject) => {
|
return new Promise<string>(async (resolve,reject) => {
|
||||||
if (!settings.name || !settings.mime) {reject({status:400,message:"missing name/mime"});return}
|
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 (files[uploadId]) {reject({status:500,message:"please try again"});return}
|
||||||
if (settings.name.length > 128) {reject({status:400,message:"name too long"}); return}
|
if (settings.name.length > 128) {reject({status:400,message:"name too long"}); return}
|
||||||
|
|
0
src/lib/SlashCommandManager.ts
Normal file
0
src/lib/SlashCommandManager.ts
Normal file
Loading…
Reference in a new issue