Skip to content

Commit

Permalink
fix(logs): only cut content on message type
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev committed Jun 22, 2022
1 parent 3a2b549 commit e255c6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion detector/logger.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module.exports = async ({ client, message, member, reaction, type }) => {
const database = client.db.prepare('SELECT level, logs FROM guilds WHERE id = ?').get(member.guild.id);
const channel = member.guild.channels.cache.get(database?.logs);
const content = message.content.length > 1024 ? `${message.content.substring(0, 1021).trimEnd()}...` : message.content;

const capitalizedLevelNames = ['Low', 'Medium', 'Hiqh'];

Expand All @@ -14,6 +13,8 @@ module.exports = async ({ client, message, member, reaction, type }) => {
switch (type) {
case 'Messaqe':
case 'Edited Messaqe':
const content = message.content.length > 1024 ? `${message.content.substring(0, 1021).trimEnd()}...` : message.content;

fields.push({ name: 'Channel', value: `${message.channel} (${message.channelId})` });
fields.push({ name: 'Content', value: content });
break;
Expand Down

0 comments on commit e255c6c

Please sign in to comment.