diff --git a/commands/analyze/severe-toxicity.js b/commands/analyze/severe-toxicity.js index 22e54cf0..47aa7c18 100644 --- a/commands/analyze/severe-toxicity.js +++ b/commands/analyze/severe-toxicity.js @@ -1,5 +1,6 @@ const Command = require('../../structures/Command'); const request = require('node-superfetch'); +const { Message } = require('discord.js'); const { GOOGLE_KEY } = process.env; module.exports = class SevereToxicityCommand extends Command { @@ -21,13 +22,14 @@ module.exports = class SevereToxicityCommand extends Command { { key: 'text', prompt: 'What text do you want to test the toxicity of?', - type: 'string' + type: 'message|string' } ] }); } async run(msg, { text }) { + if (text instanceof Message) text = text.content; try { const { body } = await request .post('https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze') diff --git a/commands/analyze/toxicity.js b/commands/analyze/toxicity.js index 0fdd8aa0..cbf51169 100644 --- a/commands/analyze/toxicity.js +++ b/commands/analyze/toxicity.js @@ -1,5 +1,6 @@ const Command = require('../../structures/Command'); const request = require('node-superfetch'); +const { Message } = require('discord.js'); const { GOOGLE_KEY } = process.env; module.exports = class ToxicityCommand extends Command { @@ -21,13 +22,14 @@ module.exports = class ToxicityCommand extends Command { { key: 'text', prompt: 'What text do you want to test the toxicity of?', - type: 'string' + type: 'message|string' } ] }); } async run(msg, { text }) { + if (text instanceof Message) text = text.content; try { const { body } = await request .post('https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze')