fix(discord-bot): only send lowercased text

This commit is contained in:
GramingFoxTeam
2022-11-16 18:09:42 +03:00
parent 92571085b7
commit 78037580dc
5 changed files with 6 additions and 5 deletions

View File

@@ -45,7 +45,7 @@ export default {
collector.on('collect', (i) => {
i.client.helper.sendTrainData(
interaction.targetMessage.content,
interaction.targetMessage.content.toLowerCase(),
i.values[0].toUpperCase()
);

View File

@@ -8,6 +8,8 @@ export default {
if (!response) return;
if (Number(aiRes.predictions[0].score) >= response.threshold) {
if (!response.text) return;
const ids = aiRes.id.split('/');
let channel = global.client.channels.cache.get(ids[0]);

View File

@@ -1,7 +1,6 @@
export default {
command: /\/train/,
async execute(msg) {
console.log(msg);
if (msg.reply_to_message.message_id === msg.message_thread_id)
return global.bot.sendMessage(msg.chat.id, 'Please reply to a message!', {
message_thread_id: msg.message_thread_id,

View File

@@ -10,6 +10,8 @@ export default {
if (Number(aiRes.predictions[0].score) >= response.threshold) {
const ids = aiRes.id.split('/');
if (!response.text) return;
global.bot.sendMessage(ids[0], response.text, {
message_thread_id: ids[1],
reply_to_message_id: ids[2]

View File

@@ -3,9 +3,7 @@ export default {
once: false,
async execute(cb) {
const admins = await global.bot.getChatAdministrators(cb.message.chat.id);
const isAdmin = admins.find(
(admin) => admin.user.id === cb.from.id
);
const isAdmin = admins.find((admin) => admin.user.id === cb.from.id);
if (!isAdmin)
return global.bot.sendMessage(