mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-29 06:01:02 +00:00
feat: GODEL AI
This commit is contained in:
@@ -2,24 +2,13 @@ export default {
|
||||
name: 'aiResponse',
|
||||
once: false,
|
||||
async execute(bot, config, aiRes) {
|
||||
const response = config.responses.find(
|
||||
(res) => res.label === aiRes.predictions[0].label
|
||||
);
|
||||
if (!response) return;
|
||||
const ids = aiRes.id.split('/');
|
||||
|
||||
if (Number(aiRes.predictions[0].score) >= response.threshold) {
|
||||
const ids = aiRes.id.split('/');
|
||||
bot.sendMessage(ids[0], aiRes.response, {
|
||||
message_thread_id: ids[1],
|
||||
reply_to_message_id: ids[2]
|
||||
});
|
||||
|
||||
if (!response.responses[0]) return;
|
||||
|
||||
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]
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user