Button show answer always, show message image

This commit is contained in:
Dragon Fire
2020-10-19 13:52:42 -04:00
parent 3f9e09d7ac
commit 299f581e81
3 changed files with 9 additions and 3 deletions
@@ -3,7 +3,7 @@ const request = require('node-superfetch');
const Entities = require('html-entities').AllHtmlEntities;
const entities = new Entities();
const { stripIndents } = require('common-tags');
const { verify, formatNumber } = require('../../util/Util');
const { verify, formatNumber, formatNumberK } = require('../../util/Util');
module.exports = class WillYouPressTheButtonCommand extends Command {
constructor(client) {
@@ -38,7 +38,10 @@ module.exports = class WillYouPressTheButtonCommand extends Command {
const verification = await verify(msg.channel, msg.author);
if (verification === 0) {
this.client.games.delete(msg.channel.id);
return msg.reply('No response? Too bad.');
return msg.reply(stripIndents`
No response? Too bad.
Yes ${formatNumber(dilemma.yes)} - ${formatNumber(dilemma.no)} No
`);
}
await this.postResponse(dilemma.id, verification);
const totalVotes = dilemma.yes + dilemma.no;
+3
View File
@@ -1,5 +1,6 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const { null } = require('mathjs');
module.exports = class MessageCommand extends Command {
constructor(client) {
@@ -21,9 +22,11 @@ module.exports = class MessageCommand extends Command {
}
run(msg, { message }) {
const hasImage = message.attachments.size && message.attachments.first().width;
const embed = new MessageEmbed()
.setColor(message.member ? message.member.displayHexColor : 0x00AE86)
.setThumbnail(message.author.displayAvatarURL({ format: 'png', dynamic: true }))
.setImage(hasImage ? message.attachments.first().url : null)
.setAuthor(message.author.tag, message.author.displayAvatarURL({ format: 'png', dynamic: true }))
.setDescription(message.content)
.setTimestamp(message.createdAt)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "119.30.0",
"version": "119.30.1",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {