mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
feat: platform specific responses
This commit is contained in:
@@ -27,7 +27,20 @@
|
||||
{
|
||||
"label": "DOWNLOAD",
|
||||
"threshold": 0.85,
|
||||
"text": "you wanted peevanced"
|
||||
"responses": [
|
||||
{
|
||||
"p": "discord",
|
||||
"text": "you wanted peevanced"
|
||||
},
|
||||
{
|
||||
"p": "telegram",
|
||||
"text":"you wanted peevanced, on telegram"
|
||||
},
|
||||
{
|
||||
"p": "reddit",
|
||||
"text": "you wanted peevanced, on reddit"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ export default {
|
||||
if (!response) return;
|
||||
|
||||
if (Number(aiRes.predictions[0].score) >= response.threshold) {
|
||||
if (!response.text) return;
|
||||
if (!response.responses[0]) return;
|
||||
|
||||
const ids = aiRes.id.split('/');
|
||||
let channel = client.channels.cache.get(ids[0]);
|
||||
@@ -24,8 +24,10 @@ export default {
|
||||
await channel.messages.fetch(ids[1]);
|
||||
message = channel.messages.cache.get(ids[1]);
|
||||
}
|
||||
|
||||
message.reply(response.text);
|
||||
|
||||
const replyMsg = response.responses.find(res => res.p === 'discord').text;
|
||||
|
||||
message.reply(replyMsg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10,16 +10,18 @@ export default {
|
||||
if (Number(aiRes.predictions[0].score) >= response.threshold) {
|
||||
const ids = aiRes.id.split('/');
|
||||
|
||||
if (!response.text) return;
|
||||
if (!response.responses[0]) return;
|
||||
|
||||
const replyMsg = response.responses.find(res => res.p === 'reddit').text;
|
||||
|
||||
switch (ids[0]) {
|
||||
case 'comment': {
|
||||
client.getComment(ids[1]).reply(response.text);
|
||||
client.getComment(ids[1]).reply(replyMsg);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'post': {
|
||||
client.getSubmission(ids[1]).reply(response.text);
|
||||
client.getSubmission(ids[1]).reply(replyMsg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,11 @@ export default {
|
||||
if (Number(aiRes.predictions[0].score) >= response.threshold) {
|
||||
const ids = aiRes.id.split('/');
|
||||
|
||||
if (!response.text) return;
|
||||
if (!response.responses[0]) return;
|
||||
|
||||
bot.sendMessage(ids[0], response.text, {
|
||||
const replyMsg = response.responses.find(res => res.p === 'telegram').text;
|
||||
|
||||
bot.sendMessage(ids[0], replyMsg, {
|
||||
message_thread_id: ids[1],
|
||||
reply_to_message_id: ids[2]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user