mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Portal allows attachments
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
const { stripInvites } = require('../../util/Util');
|
const { stripInvites } = require('../../util/Util');
|
||||||
|
const { stripIndents } = require('common-tags');
|
||||||
const { PORTAL_EMOJI_ID, PORTAL_EMOJI_NAME } = process.env;
|
const { PORTAL_EMOJI_ID, PORTAL_EMOJI_NAME } = process.env;
|
||||||
|
|
||||||
module.exports = class PortalSendCommand extends Command {
|
module.exports = class PortalSendCommand extends Command {
|
||||||
@@ -38,7 +39,11 @@ module.exports = class PortalSendCommand extends Command {
|
|||||||
const channel = channels.random();
|
const channel = channels.random();
|
||||||
try {
|
try {
|
||||||
const displayName = msg.guild ? msg.guild.name : 'DM';
|
const displayName = msg.guild ? msg.guild.name : 'DM';
|
||||||
await channel.send(`**${this.portalEmoji} ${msg.author.tag} (${displayName}):** ${message}`);
|
const attachments = msg.attachments.size ? msg.attachments.map(a => a.url).join('\n') : null;
|
||||||
|
await channel.send(stripIndents`
|
||||||
|
**${this.portalEmoji} ${msg.author.tag} (${displayName}):** ${message}
|
||||||
|
${attachments || ''}
|
||||||
|
`);
|
||||||
return msg.say(`Message sent to **${channel.name}** in **${channel.guild.name}**!`);
|
return msg.say(`Message sent to **${channel.name}** in **${channel.guild.name}**!`);
|
||||||
} catch {
|
} catch {
|
||||||
return msg.reply('Failed to send the message. Try again later!');
|
return msg.reply('Failed to send the message. Try again later!');
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "119.9.0",
|
"version": "119.9.1",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user