mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-01 08:21:27 +03:00
Select menu question type and finally fix logging diff
This commit is contained in:
@@ -4,8 +4,9 @@ const {
|
||||
} = require('discord.js');
|
||||
const { diff: getDiff } = require('object-diffy');
|
||||
|
||||
const uuidRegex = /[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}/g;
|
||||
|
||||
const exists = thing => (typeof thing === 'string' && thing.length > 0) && (thing !== null && thing !== undefined);
|
||||
const exists = thing => typeof thing === 'string' ? thing.length > 0 : thing !== null && thing !== undefined;
|
||||
|
||||
const arrToObj = obj => {
|
||||
for (const key in obj) {
|
||||
@@ -29,7 +30,7 @@ function makeDiff({
|
||||
const to = exists(diff[key].to) ? `+ ${String(diff[key].to).replace(/\n/g, '\\n')}\n` : '';
|
||||
fields.push({
|
||||
inline: true,
|
||||
name: key,
|
||||
name: key.replace(uuidRegex, $1 => $1.split('-')[0]),
|
||||
value: `\`\`\`diff\n${cleanCodeBlockContent(from + to)}\n\`\`\``,
|
||||
});
|
||||
}
|
||||
|
@@ -42,10 +42,12 @@ module.exports.get = fastify => ({
|
||||
label: true,
|
||||
maxLength: true,
|
||||
minLength: true,
|
||||
options: true,
|
||||
order: true,
|
||||
placeholder: true,
|
||||
required: true,
|
||||
style: true,
|
||||
type: true,
|
||||
value: true,
|
||||
},
|
||||
},
|
||||
@@ -91,10 +93,12 @@ module.exports.patch = fastify => ({
|
||||
label: true,
|
||||
maxLength: true,
|
||||
minLength: true,
|
||||
options: true,
|
||||
order: true,
|
||||
placeholder: true,
|
||||
required: true,
|
||||
style: true,
|
||||
type: true,
|
||||
value: true,
|
||||
},
|
||||
},
|
||||
|
@@ -19,6 +19,7 @@ module.exports.get = () => ({
|
||||
avatar: client.user.avatarURL(),
|
||||
discriminator: client.user.discriminator,
|
||||
id: client.user.id,
|
||||
portal: process.env.PORTAL || null,
|
||||
stats: {
|
||||
activatedUsers: users.length,
|
||||
archivedMessages: users.reduce((total, user) => total + user.messageCount, 0), // don't count archivedMessage table rows, they get deleted
|
||||
|
Reference in New Issue
Block a user