mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 02:15:10 +02:00
Idiot => Baka
This commit is contained in:
+1
-1
@@ -86,7 +86,7 @@ client.on('messageReactionAdd', (reaction, user) => {
|
|||||||
if (user.id === msg.author.id) {
|
if (user.id === msg.author.id) {
|
||||||
if (msg.channel.permissionsFor(client.user).has('MANAGE_MESSAGES'))
|
if (msg.channel.permissionsFor(client.user).has('MANAGE_MESSAGES'))
|
||||||
reaction.remove(user);
|
reaction.remove(user);
|
||||||
return msg.reply('You cannot star your own messages, idiot.');
|
return msg.reply('You cannot star your own messages, baka.');
|
||||||
}
|
}
|
||||||
client.registry.resolveCommand('random:star').run(msg, { id: msg.id }, true);
|
client.registry.resolveCommand('random:star').run(msg, { id: msg.id }, true);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ module.exports = class StarCommand extends Command {
|
|||||||
try {
|
try {
|
||||||
const message = await msg.channel.fetchMessage(id);
|
const message = await msg.channel.fetchMessage(id);
|
||||||
if (!reaction && msg.author.id === message.author.id)
|
if (!reaction && msg.author.id === message.author.id)
|
||||||
return msg.reply('You cannot star your own messages, idiot.');
|
return msg.reply('You cannot star your own messages, baka.');
|
||||||
const embed = new RichEmbed()
|
const embed = new RichEmbed()
|
||||||
.setColor(0xFFFF00)
|
.setColor(0xFFFF00)
|
||||||
.setAuthor(message.author.tag, message.author.displayAvatarURL)
|
.setAuthor(message.author.tag, message.author.displayAvatarURL)
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
const { Command } = require('discord.js-commando');
|
||||||
|
const { RichEmbed } = require('discord.js');
|
||||||
|
const snekfetch = require('snekfetch');
|
||||||
|
|
||||||
|
module.exports = class RedditCommand extends Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: 'reddit',
|
||||||
|
group: 'search',
|
||||||
|
memberName: 'reddit',
|
||||||
|
description: 'Gets a random post from a subreddit.',
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
key: 'subreddit',
|
||||||
|
prompt: 'What subreddit should the post come from?',
|
||||||
|
type: 'string',
|
||||||
|
parse: query => encodeURIComponent(query)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async 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 { subreddit } = args;
|
||||||
|
try {
|
||||||
|
const { body } = await snekfetch
|
||||||
|
.get(``)
|
||||||
|
.query({
|
||||||
|
limit: 1,
|
||||||
|
includeRelated: false,
|
||||||
|
useCanonical: false,
|
||||||
|
api_key: WORDNIK_KEY
|
||||||
|
});
|
||||||
|
if (!body.length) throw new Error('No Results.');
|
||||||
|
const embed = new RichEmbed()
|
||||||
|
.setColor(0x9797FF)
|
||||||
|
.setTitle(body[0].word)
|
||||||
|
.setDescription(body[0].text);
|
||||||
|
return msg.embed(embed);
|
||||||
|
} catch (err) {
|
||||||
|
return msg.say(`${err.name}: ${err.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiaobot",
|
"name": "xiaobot",
|
||||||
"version": "21.4.5",
|
"version": "21.4.6",
|
||||||
"description": "A Discord Bot",
|
"description": "A Discord Bot",
|
||||||
"main": "Shard.js",
|
"main": "Shard.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user