Bot say to who the message have been sent
This commit is contained in:
parent
05612d2a64
commit
fbb8d3ce40
1 changed files with 8 additions and 10 deletions
|
@ -10,30 +10,28 @@ module.exports = class dmCommand extends Command {
|
|||
ownerOnly: true,
|
||||
args: [
|
||||
{
|
||||
key: 'id',
|
||||
key: 'user',
|
||||
prompt: 'Wich user would you like to dm?',
|
||||
type: 'string',
|
||||
type: 'user',
|
||||
},
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'Wich user would you like to dm?',
|
||||
prompt: 'What do you want to say to the user',
|
||||
type: 'string',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, { id, text }) {
|
||||
async run(message, { user, text }) {
|
||||
let Attachment = (message.attachments).array();
|
||||
const user = this.client.users.get(id);
|
||||
if (Attachment[0]) {
|
||||
user.send(`**Message from the dev**\n${text}\n${Attachment[0].url}`)
|
||||
message.say('DM sent')
|
||||
user.send(`**Message from the dev:**\n${text}\n${Attachment[0].url}`)
|
||||
message.say(`DM sent to ${user.username}`)
|
||||
}
|
||||
else {
|
||||
user.send(`**Message from the dev**\n${text}`)
|
||||
message.say('DM sent')
|
||||
user.send(`**Message from the dev:**\n${text}`)
|
||||
message.say(`DM sent to ${user.username}`)
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue