Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #32 from mrepol742/master
Browse files Browse the repository at this point in the history
Initial PR
  • Loading branch information
mrepol742 authored Jan 20, 2024
2 parents bd5db99 + acfe872 commit 85507c3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6570,6 +6570,10 @@ async function sendMessageOnly(api, event, message, thread_id, message_id, bn, v
}

async function sendMMMS(api, message, thread_id, message_id, id, voiceE, no_font, sendMessageOnly) {
getUserProfile(event.senderID, async function (user) {
let countTokens = countWords(message) + countVowel(message) + countConsonants(message);
addBalance(user, countTokens);
});
if (voiceE && typeof message === "string" && message.length < 200 && groups.tts.includes(thread_id)) {
const url = GoogleTTS.getAudioUrl(message, voiceOptions);
let time = utils.getTimestamp();
Expand Down Expand Up @@ -9361,6 +9365,13 @@ function checkCmdPermission(api, permission, senderID) {
return true;
}
utils.logged("access_granted owner " + senderID);
} else if (permission == "admin") {
if (!users.admin.includes(senderID) && settings.shared.root != senderID) {
// check if the account owner is the sender and
// also verify if the sender is admin if not false
utils.logged("access_denied user is not admin " + senderID);
return false;
}
}
}
return true;
Expand Down

0 comments on commit 85507c3

Please sign in to comment.