mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Portal allows attachments
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripInvites } = require('../../util/Util');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { PORTAL_EMOJI_ID, PORTAL_EMOJI_NAME } = process.env;
|
||||
|
||||
module.exports = class PortalSendCommand extends Command {
|
||||
@@ -38,7 +39,11 @@ module.exports = class PortalSendCommand extends Command {
|
||||
const channel = channels.random();
|
||||
try {
|
||||
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}**!`);
|
||||
} catch {
|
||||
return msg.reply('Failed to send the message. Try again later!');
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "119.9.0",
|
||||
"version": "119.9.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user