Skip to content

Commit

Permalink
v4.0.0
Browse files Browse the repository at this point in the history
- Reflected for self-hosting only
- Updated to work with discord.js v14 (breaking changes)
  • Loading branch information
shikhir-arora committed Aug 24, 2022
1 parent bf05212 commit a78e373
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ client.on('messageCreate', async (message) => {
console.error(e)
}
}
/** TODO

const clean = (text) => {
if (typeof (text) === 'string') { return text.replace(/`/g, '`' + String.fromCharCode(8203)).replace(/@/g, '@' + String.fromCharCode(8203)) } else { return text }
}
Expand All @@ -159,14 +159,14 @@ client.on('messageCreate', async (message) => {
if (clean(evaled).length > 1800) {
await gist(clean(evaled))
.then(res => {
const embed = new Discord.MessageEmbed()
const embed = new EmbedBuilder()
.setTitle('Eval output exceeds 2000 characters. View on Gist.')
.setURL(`${res.html_url}`)
.setColor(randomColor())
.setDescription(`Eval output exceeds 2000 characters. View Gist [here](${res.html_url}).`)
.setFooter('Eval Output')
.setTimestamp()
message.channel.send({ embed }).catch((e) => message.channel.send(e.message))
.setFooter('Eval Output')
message.channel.send({ embeds: [embed] }).catch((e) => message.channel.send(e.message))
})
} else {
message.channel.send(clean(evaled), {
Expand Down Expand Up @@ -194,17 +194,17 @@ client.on('messageCreate', async (message) => {
.setURL(`${res.html_url}`)
.setColor(randomColor())
.setDescription(`Console output exceeds 2000 characters. View Gist [here](${res.html_url}).`)
.setFooter('Exec Output')
.setTimestamp()
message.channel.send({ embed }).catch((e) => message.channel.send(e.message))
.setFooter('Exec Output')
message.channel.send({ embeds: [embed] }).catch((e) => message.channel.send(e.message))
})
} else {
stdout && message.channel.send(`\`INFO:\`\n\n\`\`\`fix\n${stdout}\`\`\``)
stderr && message.channel.send(`\`ERRORS:\`\n\n\`\`\`fix\n${stderr}\`\`\``)
if (!stderr && !stdout) { message.react('\u2705') }
}
})
} **/
}
})


Expand Down

0 comments on commit a78e373

Please sign in to comment.