mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +02:00
Vocaloid Upgrade, Steam Change, Fix Portal
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const songs = require('../../assets/json/vocaloid');
|
||||
|
||||
module.exports = class VocaloidCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'vocaloid',
|
||||
group: 'random-res',
|
||||
memberName: 'vocaloid',
|
||||
description: 'Responds with a random VOCALOID song.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const song = songs[Math.floor(Math.random() * songs.length)];
|
||||
return msg.say(song);
|
||||
}
|
||||
};
|
||||
@@ -26,7 +26,7 @@ module.exports = class PortalSendCommand extends Command {
|
||||
|
||||
async run(msg, args) {
|
||||
const { message } = args;
|
||||
const channels = this.client.channels.filter(c => c.guild.id !== msg.guild.id && c.type === 'text');
|
||||
const channels = this.client.channels.filter(c => c.type === 'text' && c.guild.id !== msg.guild.id);
|
||||
const channel = parseTopic(channels, 'portal', this.client.user).random();
|
||||
if (!channel) return msg.say('Aww... No channel has an open portal...');
|
||||
try {
|
||||
|
||||
@@ -35,9 +35,11 @@ module.exports = class SteamCommand extends Command {
|
||||
const price = current === original ? `$${current}` : `~~$${original}~~ $${current}`;
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x101D2F)
|
||||
.setAuthor(`Steam - ${body.items[0].name}`, 'https://i.imgur.com/vL8b4D5.png')
|
||||
.setAuthor('Steam', 'https://i.imgur.com/vL8b4D5.png')
|
||||
.setURL(`http://store.steampowered.com/app/${body.items[0].id}`)
|
||||
.setImage(body.items[0].tiny_image)
|
||||
.addField('❯ Title',
|
||||
body.items[0].name)
|
||||
.addField('❯ Price',
|
||||
price, true)
|
||||
.addField('❯ Metascore',
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const moment = require('moment');
|
||||
|
||||
module.exports = class VocaloidCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'vocaloid',
|
||||
aliases: ['vocadb'],
|
||||
group: 'search',
|
||||
memberName: 'vocaloid',
|
||||
description: 'Searches VocaDB for your query.',
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What song would you like to search for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const { body } = await snekfetch
|
||||
.get('http://vocadb.net/api/songs')
|
||||
.query({
|
||||
query,
|
||||
maxResults: 1,
|
||||
getTotalCount: true,
|
||||
sort: 'FavoritedTimes',
|
||||
preferAccurateMatches: true,
|
||||
nameMatchMode: 'Exact'
|
||||
});
|
||||
if (!body.totalCount) return msg.say('No Results.');
|
||||
const embed = new MessageEmbed()
|
||||
.setAuthor('VocaDB', 'https://i.imgur.com/MklQqa2.png')
|
||||
.setURL(`http://vocadb.net/S/${body.items[0].id}`)
|
||||
.addField('❯ Title',
|
||||
body.items[0].name)
|
||||
.addField('❯ Artist',
|
||||
body.items[0].artistString)
|
||||
.addField('❯ Publish Date',
|
||||
moment(body.items[0].publishDate).format('MMMM Do YYYY'), true)
|
||||
.addField('❯ Length',
|
||||
(body.items[0].lengthSeconds / 60).toFixed(2).replace(/\./g, ':'), true);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user