From fb1d7874f2c99d7e5b75f01055ec865d4044dc95 Mon Sep 17 00:00:00 2001 From: night0721 Date: Wed, 8 Sep 2021 08:02:18 +0800 Subject: [PATCH] removing redundant files --- app.js | 14 -------------- inlinereply.js | 51 -------------------------------------------------- 2 files changed, 65 deletions(-) delete mode 100644 app.js delete mode 100644 inlinereply.js diff --git a/app.js b/app.js deleted file mode 100644 index c5dd813..0000000 --- a/app.js +++ /dev/null @@ -1,14 +0,0 @@ -const express = require("express"); -const app = express(); -const route1 = require("./api/api"); -const cors = require("cors"); -const port = process.env.PORT || 3001; -app.use(cors()); -app.use(express.json()); -app.use("/api", route1); -app.use("/", async (req, res) => { - res.send(""); -}); -app.listen(port, () => { - console.log(`Listen on PORT ${port}`); -}); diff --git a/inlinereply.js b/inlinereply.js deleted file mode 100644 index eba1f6d..0000000 --- a/inlinereply.js +++ /dev/null @@ -1,51 +0,0 @@ -const { APIMessage, Structures } = require("discord.js"); - -class Message extends Structures.get("Message") { - async inlineReply(content, options) { - const mentionRepliedUser = - typeof ((options || content || {}).allowedMentions || {}).repliedUser === - "undefined" - ? true - : (options || content).allowedMentions.repliedUser; - delete ((options || content || {}).allowedMentions || {}).repliedUser; - - const apiMessage = - content instanceof APIMessage - ? content.resolveData() - : APIMessage.create(this.channel, content, options).resolveData(); - Object.assign(apiMessage.data, { - message_reference: { message_id: this.id }, - }); - - if ( - !apiMessage.data.allowed_mentions || - Object.keys(apiMessage.data.allowed_mentions).length === 0 - ) - apiMessage.data.allowed_mentions = { - parse: ["users", "roles", "everyone"], - }; - if (typeof apiMessage.data.allowed_mentions.replied_user === "undefined") - Object.assign(apiMessage.data.allowed_mentions, { - replied_user: mentionRepliedUser, - }); - - if (Array.isArray(apiMessage.data.content)) { - return Promise.all( - apiMessage - .split() - .map(x => { - x.data.allowed_mentions = apiMessage.data.allowed_mentions; - return x; - }) - .map(this.inlineReply.bind(this)) - ); - } - - const { data, files } = await apiMessage.resolveFiles(); - return this.client.api.channels[this.channel.id].messages - .post({ data, files }) - .then(d => this.client.actions.MessageCreate.handle(d).message); - } -} - -Structures.extend("Message", () => Message);