mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 06:45:31 +02:00
msg
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const binary = (str) => {
|
||||
const pad = '00000000';
|
||||
return unescape(encodeURIComponent(str))
|
||||
.split('').map(str => {
|
||||
const binary = str.charCodeAt(0).toString(2);
|
||||
return `${pad.slice(binary.length)}${binary}`;
|
||||
return `${'00000000'.slice(binary.length)}${binary}`;
|
||||
}).join('');
|
||||
};
|
||||
|
||||
@@ -29,8 +28,8 @@ module.exports = class BinaryCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.say(text);
|
||||
return msg.say(text);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,8 +20,8 @@ module.exports = class CowsayCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.code(null, `< ${text} >\n \\ ^__^\n \\ (oO)\\_______\n (__)\\ )\\/\\\n U ||----w |\n || ||`);
|
||||
return msg.code(null, `< ${text} >\n \\ ^__^\n \\ (oO)\\_______\n (__)\\ )\\/\\\n U ||----w |\n || ||`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,16 +16,16 @@ module.exports = class EmbedCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { text } = args;
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor(message.author.username, message.author.displayAvatarURL)
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL)
|
||||
.setColor(0x00AE86)
|
||||
.setTimestamp()
|
||||
.setDescription(text);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,8 +23,8 @@ module.exports = class MorseCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.say(text);
|
||||
return msg.say(text);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,8 +23,8 @@ module.exports = class PirateCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.say(`\u180E${text}`);
|
||||
return msg.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,8 +16,8 @@ module.exports = class ReverseCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.say(`\u180E${text}`);
|
||||
return msg.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,11 +21,11 @@ module.exports = class SayCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
return message.say('This Command requires the `Manage Messages` Permission.');
|
||||
run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
return msg.say('This Command requires the `Manage Messages` Permission.');
|
||||
const { text } = args;
|
||||
message.delete();
|
||||
return message.say(`\u180E${text}`);
|
||||
msg.delete();
|
||||
return msg.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,8 +23,8 @@ module.exports = class TemmieCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.say(`\u180E${text}`);
|
||||
return msg.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,8 +21,8 @@ module.exports = class UpsideDownCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.say(text);
|
||||
return msg.say(text);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,12 +25,12 @@ module.exports = class WebhookCommand extends Command {
|
||||
return this.client.isOwner(msg.author);
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
return message.say('This Command requires the `Manage Messages` Permission.');
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
return msg.say('This Command requires the `Manage Messages` Permission.');
|
||||
const { text } = args;
|
||||
try {
|
||||
message.delete();
|
||||
msg.delete();
|
||||
await request
|
||||
.post(process.env.WEBHOOK_URL)
|
||||
.send({
|
||||
@@ -38,7 +38,7 @@ module.exports = class WebhookCommand extends Command {
|
||||
});
|
||||
return null;
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,8 +23,8 @@ module.exports = class ZalgoCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.say(`\u180E${text}`);
|
||||
return msg.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user