mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Button show answer always, show message image
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "119.30.0",
|
||||
"version": "119.30.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user