mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
fix(discord-bot): only send lowercased text
This commit is contained in:
@@ -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()
|
||||
);
|
||||
|
||||
|
||||
@@ -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]);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user