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