mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-21 21:36:26 -08:00
wwwww
This commit is contained in:
parent
240d12d887
commit
b8b891d9db
|
@ -3,5 +3,11 @@ File sharing via Discord
|
|||
|
||||
<br>
|
||||
|
||||
## .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.
|
||||
|
|
|
@ -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"
|
||||
},
|
||||
|
|
|
@ -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<string>(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}
|
||||
|
|
0
src/lib/SlashCommandManager.ts
Normal file
0
src/lib/SlashCommandManager.ts
Normal file
Loading…
Reference in a new issue