mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-18 00:33:59 +00:00
fix(discord-bot): only send lowercased text
This commit is contained in:
@@ -45,7 +45,7 @@ export default {
|
|||||||
|
|
||||||
collector.on('collect', (i) => {
|
collector.on('collect', (i) => {
|
||||||
i.client.helper.sendTrainData(
|
i.client.helper.sendTrainData(
|
||||||
interaction.targetMessage.content,
|
interaction.targetMessage.content.toLowerCase(),
|
||||||
i.values[0].toUpperCase()
|
i.values[0].toUpperCase()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ export default {
|
|||||||
if (!response) return;
|
if (!response) return;
|
||||||
|
|
||||||
if (Number(aiRes.predictions[0].score) >= response.threshold) {
|
if (Number(aiRes.predictions[0].score) >= response.threshold) {
|
||||||
|
if (!response.text) return;
|
||||||
|
|
||||||
const ids = aiRes.id.split('/');
|
const ids = aiRes.id.split('/');
|
||||||
let channel = global.client.channels.cache.get(ids[0]);
|
let channel = global.client.channels.cache.get(ids[0]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
command: /\/train/,
|
command: /\/train/,
|
||||||
async execute(msg) {
|
async execute(msg) {
|
||||||
console.log(msg);
|
|
||||||
if (msg.reply_to_message.message_id === msg.message_thread_id)
|
if (msg.reply_to_message.message_id === msg.message_thread_id)
|
||||||
return global.bot.sendMessage(msg.chat.id, 'Please reply to a message!', {
|
return global.bot.sendMessage(msg.chat.id, 'Please reply to a message!', {
|
||||||
message_thread_id: msg.message_thread_id,
|
message_thread_id: msg.message_thread_id,
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ export default {
|
|||||||
if (Number(aiRes.predictions[0].score) >= response.threshold) {
|
if (Number(aiRes.predictions[0].score) >= response.threshold) {
|
||||||
const ids = aiRes.id.split('/');
|
const ids = aiRes.id.split('/');
|
||||||
|
|
||||||
|
if (!response.text) return;
|
||||||
|
|
||||||
global.bot.sendMessage(ids[0], response.text, {
|
global.bot.sendMessage(ids[0], response.text, {
|
||||||
message_thread_id: ids[1],
|
message_thread_id: ids[1],
|
||||||
reply_to_message_id: ids[2]
|
reply_to_message_id: ids[2]
|
||||||
|
|||||||
@@ -3,9 +3,7 @@ export default {
|
|||||||
once: false,
|
once: false,
|
||||||
async execute(cb) {
|
async execute(cb) {
|
||||||
const admins = await global.bot.getChatAdministrators(cb.message.chat.id);
|
const admins = await global.bot.getChatAdministrators(cb.message.chat.id);
|
||||||
const isAdmin = admins.find(
|
const isAdmin = admins.find((admin) => admin.user.id === cb.from.id);
|
||||||
(admin) => admin.user.id === cb.from.id
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!isAdmin)
|
if (!isAdmin)
|
||||||
return global.bot.sendMessage(
|
return global.bot.sendMessage(
|
||||||
|
|||||||
Reference in New Issue
Block a user