mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 05:51:35 +02:00
Format better
This commit is contained in:
@@ -53,7 +53,7 @@ module.exports = class EshopCommand extends Command {
|
||||
? data.game_category_ref.length ? data.game_category_ref[0].title : data.game_category_ref.title
|
||||
: '???', true)
|
||||
.addField('❯ Release Date',
|
||||
data.release_date ? moment.utc(data.release_date).format('MMM Do, YYYY [at] hh:mm:ss A') : '???', true)
|
||||
data.release_date ? moment.utc(data.release_date).format('MMM Do, YYYY') : '???', true)
|
||||
.addField('❯ Player Count', data.number_of_players || '???', true)
|
||||
.addField('❯ DLC?', data.dlc === 'true' ? 'Yes' : 'No', true)
|
||||
.addField('❯ Demo?', data.demo === 'true' ? 'Yes' : 'No', true)
|
||||
|
||||
@@ -47,8 +47,8 @@ module.exports = class GithubCommand extends Command {
|
||||
.addField('❯ Forks', body.forks, true)
|
||||
.addField('❯ Issues', body.open_issues, true)
|
||||
.addField('❯ Language', body.language || '???', true)
|
||||
.addField('❯ Creation Date', moment.utc(body.created_at).format('MMM Do, YYYY [at] hh:mm:ss A'), true)
|
||||
.addField('❯ Modification Date', moment.utc(body.updated_at).format('MMM Do, YYYY [at] hh:mm:ss A'), true);
|
||||
.addField('❯ Creation Date', moment.utc(body.created_at).format('MM/DD/YYYY @ hh:mm:ss A'), true)
|
||||
.addField('❯ Modification Date', moment.utc(body.updated_at).format('MM/DD/YYYY @ hh:mm:ss A'), true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
if (err.status === 404) return msg.say('Could not find any results.');
|
||||
|
||||
@@ -52,7 +52,7 @@ module.exports = class ItunesCommand extends Command {
|
||||
.setTitle(data.trackName)
|
||||
.addField('❯ Artist', data.artistName, true)
|
||||
.addField('❯ Album', data.collectionName, true)
|
||||
.addField('❯ Release Date', moment.utc(data.releaseDate).format('MMM Do, YYYY [at] hh:mm:ss A'), true)
|
||||
.addField('❯ Release Date', moment.utc(data.releaseDate).format('MMM Do, YYYY'), true)
|
||||
.addField('❯ Genre', data.primaryGenreName, true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
|
||||
@@ -44,8 +44,8 @@ module.exports = class KickstarterCommand extends Command {
|
||||
.addField('❯ Pledged', `$${data.pledged}`, true)
|
||||
.addField('❯ Backers', data.backers_count, true)
|
||||
.addField('❯ Creator', data.creator.name, true)
|
||||
.addField('❯ Creation Date', moment.utc(data.created_at * 1000).format('MMM Do, YYYY [at] hh:mm:ss A'), true)
|
||||
.addField('❯ Deadline', moment.utc(data.deadline * 1000).format('MMM Do, YYYY [at] hh:mm:ss A'), true);
|
||||
.addField('❯ Creation Date', moment.utc(data.created_at * 1000).format('MM/DD/YYYY @ hh:mm:ss A'), true)
|
||||
.addField('❯ Deadline', moment.utc(data.deadline * 1000).format('MM/DD/YYYY @ hh:mm:ss A'), true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
|
||||
@@ -40,10 +40,8 @@ module.exports = class KitsuAnimeCommand extends Command {
|
||||
.setDescription(shorten(data.synopsis))
|
||||
.addField('❯ Type', `${data.showType} - ${data.status}`, true)
|
||||
.addField('❯ Episodes', data.episodeCount || '???', true)
|
||||
.addField('❯ Start Date',
|
||||
data.startDate ? moment.utc(data.startDate).format('MMM Do, YYYY [at] hh:mm:ss A') : '???', true)
|
||||
.addField('❯ End Date',
|
||||
data.endDate ? moment.utc(data.endDate).format('MMM Do, YYYY [at] hh:mm:ss A') : '???', true);
|
||||
.addField('❯ Start Date', data.startDate ? moment.utc(data.startDate).format('MMM Do, YYYY') : '???', true)
|
||||
.addField('❯ End Date', data.endDate ? moment.utc(data.endDate).format('MMM Do, YYYY') : '???', true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
|
||||
@@ -40,10 +40,8 @@ module.exports = class KitsuMangaCommand extends Command {
|
||||
.setDescription(shorten(data.synopsis))
|
||||
.addField('❯ Type', `${data.subtype} - ${data.status}`, true)
|
||||
.addField('❯ Volumes / Chapters', `${data.volumeCount || '???'} / ${data.chapterCount || '???'}`, true)
|
||||
.addField('❯ Start Date',
|
||||
data.startDate ? moment.utc(data.startDate).format('MMM Do, YYYY [at] hh:mm:ss A') : '???', true)
|
||||
.addField('❯ End Date',
|
||||
data.endDate ? moment.utc(data.endDate).format('MMM Do, YYYY [at] hh:mm:ss A') : '???', true);
|
||||
.addField('❯ Start Date', data.startDate ? moment.utc(data.startDate).format('MMM Do, YYYY') : '???', true)
|
||||
.addField('❯ End Date', data.endDate ? moment.utc(data.endDate).format('MMM Do, YYYY') : '???', true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
|
||||
@@ -41,8 +41,8 @@ module.exports = class NPMCommand extends Command {
|
||||
.addField('❯ Version', body['dist-tags'].latest, true)
|
||||
.addField('❯ License', body.license || 'None', true)
|
||||
.addField('❯ Author', body.author ? body.author.name : '???', true)
|
||||
.addField('❯ Creation Date', moment.utc(body.time.created).format('MMM Do, YYYY [at] hh:mm:ss A'), true)
|
||||
.addField('❯ Modification Date', moment.utc(body.time.modified).format('MMM Do, YYYY [at] hh:mm:ss A'), true)
|
||||
.addField('❯ Creation Date', moment.utc(body.time.created).format('MM/DD/YYYY @ hh:mm:ss A'), true)
|
||||
.addField('❯ Modification Date', moment.utc(body.time.modified).format('MM/DD/YYYY @ hh:mm:ss A'), true)
|
||||
.addField('❯ Main File', version.main || 'index.js', true)
|
||||
.addField('❯ Dependencies', dependencies && dependencies.length ? dependencies.join(', ') : 'None')
|
||||
.addField('❯ Maintainers', maintainers.join(', '));
|
||||
|
||||
@@ -48,9 +48,9 @@ module.exports = class StackOverflowCommand extends Command {
|
||||
.addField('❯ Asker', `[${data.owner.display_name}](${data.owner.link})`, true)
|
||||
.addField('❯ Views', data.view_count, true)
|
||||
.addField('❯ Score', data.score, true)
|
||||
.addField('❯ Creation Date', moment.utc(data.creation_date * 1000).format('MMM Do, YYYY [at] hh:mm:ss A'), true)
|
||||
.addField('❯ Creation Date', moment.utc(data.creation_date * 1000).format('MM/DD/YYYY @ hh:mm:ss A'), true)
|
||||
.addField('❯ Last Activity',
|
||||
moment.utc(data.last_activity_date * 1000).format('MMM Do, YYYY [at] hh:mm:ss A'), true);
|
||||
moment.utc(data.last_activity_date * 1000).format('MM/DD/YYYY @ hh:mm:ss A'), true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
|
||||
@@ -44,7 +44,7 @@ module.exports = class StocksCommand extends Command {
|
||||
.addField('❯ High', `$${data['2. high']}`, true)
|
||||
.addField('❯ Low', `$${data['3. low']}`, true)
|
||||
.addField('❯ Last Updated',
|
||||
moment.utc(body['Meta Data']['3. Last Refreshed']).format('MMM Do, YYYY [at] hh:mm:ss A'), true);
|
||||
moment.utc(body['Meta Data']['3. Last Refreshed']).format('MM/DD/YYYY @ hh:mm:ss A'), true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
|
||||
@@ -54,7 +54,7 @@ module.exports = class TwitterCommand extends Command {
|
||||
.addField('❯ Following', body.friends_count, true)
|
||||
.addField('❯ Protected?', body.protected ? 'Yes' : 'No', true)
|
||||
.addField('❯ Verified?', body.verified ? 'Yes' : 'No', true)
|
||||
.addField('❯ Creation Date', moment.utc(body.created_at).format('MMM Do, YYYY [at] hh:mm:ss A'), true)
|
||||
.addField('❯ Creation Date', moment.utc(body.created_at).format('MM/DD/YYYY @ hh:mm:ss A'), true)
|
||||
.addField('❯ Latest Tweet', latest);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
|
||||
@@ -45,7 +45,7 @@ module.exports = class VocaDBCommand extends Command {
|
||||
.setDescription(data.lyrics.length ? shorten(data.lyrics[0].value) : 'No lyrics available.')
|
||||
.setThumbnail(data.thumbUrl)
|
||||
.addField('❯ Artist', data.artistString)
|
||||
.addField('❯ Publish Date', moment.utc(data.publishDate).format('MMM Do, YYYY [at] hh:mm:ss A'), true);
|
||||
.addField('❯ Publish Date', moment.utc(data.publishDate).format('MMM Do, YYYY'), true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
|
||||
@@ -42,7 +42,7 @@ module.exports = class WattpadCommand extends Command {
|
||||
.setTitle(data.title)
|
||||
.setDescription(shorten(data.description))
|
||||
.setThumbnail(data.cover)
|
||||
.addField('❯ Creation Date', moment.utc(data.createDate).format('MMM Do, YYYY [at] hh:mm:ss A'), true)
|
||||
.addField('❯ Creation Date', moment.utc(data.createDate).format('MM/DD/YYYY @ hh:mm:ss A'), true)
|
||||
.addField('❯ Author', data.user.name, true)
|
||||
.addField('❯ Chapters', data.numParts, true)
|
||||
.addField('❯ Reads', data.readCount, true)
|
||||
|
||||
@@ -44,7 +44,7 @@ module.exports = class YoutubeCommand extends Command {
|
||||
.setURL(`https://www.youtube.com/watch?v=${data.id.videoId}`)
|
||||
.setThumbnail(data.snippet.thumbnails.default ? data.snippet.thumbnails.default.url : null)
|
||||
.addField('❯ ID', data.id.videoId, true)
|
||||
.addField('❯ Publish Date', moment.utc(data.snippet.publishedAt).format('MMM Do, YYYY [at] hh:mm:ss A'), true)
|
||||
.addField('❯ Publish Date', moment.utc(data.snippet.publishedAt).format('MM/DD/YYYY @ hh:mm:ss A'), true)
|
||||
.addField('❯ Channel', data.snippet.channelTitle, true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user