Skip to content

Commit

Permalink
SILVA MD BOT
Browse files Browse the repository at this point in the history
  • Loading branch information
SilvaTechB authored Nov 1, 2024
1 parent b5ab205 commit c8d07c8
Show file tree
Hide file tree
Showing 50 changed files with 2,476 additions and 0 deletions.
21 changes: 21 additions & 0 deletions silvaXlab/Bingwa.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export async function all(m) {
if (
(m.mtype === 'bingwasokoni' ||
m.text.startsWith('Bingwa') ||
m.text.startsWith('safaricom') ||
m.text.startsWith('sokoni') ||
m.text.startsWith('Sokoni') ||
m.text.startsWith('bingwa') ||
m.text.startsWith('Data')) &&
!m.isBaileys &&
!m.isGroup
) {
this.sendButton(m.chat, `*WELCOME TO BINGWA SOKONI*
HELLO @${m.sender.split('@')[0]}
THIS IS BINGWA SOKONI 😇\n\n *select your offer*\n\n> POWERED BY SAFARICOM✅\n> SELECT YOU CHOICE FOR TODAY📞\n> THANK YOU FOR BEING PART OF US📚\n\n\n> click the buttons to see more
`.trim(), igfg, null, [['Data 💀', '.data'],['Sms 😍', '.sms'],['Minutes 📚', '.minutes'],['Data & Minutes 📞', '.datamin'],['Data & Sms📞', '.datasms'],['All in one ✅', '.all'],['Home 🏠', 'Bingwa']] , m, { mentions: [m.sender] })
m.react('🤫')
}

return !0
}
28 changes: 28 additions & 0 deletions silvaXlab/Blackpink.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import fetch from 'node-fetch'

let bpink = []

fetch('https://raw.githubusercontent.com/arivpn/dbase/master/kpop/blekping.txt')
.then(res => res.text())

.then(txt => (bpink = txt.split('\n')))

let handler = async (m, { conn }) => {
let img = bpink[Math.floor(Math.random() * bpink.length)]

if (!img) throw img

await conn.sendFile(m.chat, img, '', 'made by silva tech inc', m, 0, {
thumbnail: await (await fetch(img)).buffer(),
})
}

handler.help = ['blackpink']

handler.tags = ['image']

handler.limit = false

handler.command = /^(bpink|bp|blackpink)$/i

export default handler
10 changes: 10 additions & 0 deletions silvaXlab/Chatpin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let handler = async (m, { conn, args }) => {
conn.reply(m.chat, 'Chat pinned 📌', m)
await conn.chatModify({ pin: true }, m.chat)
}

handler.help = ['pin']
handler.tags = ['owner']
handler.command = ['pin']
handler.owner = true
export default handler
23 changes: 23 additions & 0 deletions silvaXlab/Clearchat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
async function handler(m, { conn }) {



conn.chatModify({ delete: true, lastMessages: [{ key: m.key, messageTimestamp: m.messageTimestamp }] }, m.chat)

let a = await m.reply("silva md bot Successfully deleted this chat!")



}

handler.help = ['deletechat'],

handler.tags = ['owner'],

handler.command = /^(deletechat|delchat|dchat|clearchat|cleanchat)$/i

handler.owner = true

export default handler


17 changes: 17 additions & 0 deletions silvaXlab/audio-tomp3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { toAudio } from '../lib/converter.js'

let handler = async (m, { conn, usedPrefix, command }) => {
let q = m.quoted ? m.quoted : m
/* let mime = (m.quoted ? m.quoted : m.msg).mimetype || ''
if (!/video|audio/.test(mime)) throw `✳️ Reply to the video or voice note you want to convert to mp3 with the command :\n\n*${usedPrefix + command}*`*/
let media = await q.download?.()
if (!media) throw '❎ Failed to download media'
let audio = await toAudio(media, 'mp4')
if (!audio.data) throw '❎ Error converting'
conn.sendFile(m.chat, audio.data, 'audio.mp3', '', m, null, { mimetype: 'audio/mp4' })
}
handler.help = ['tomp3']
handler.tags = ['fun']
handler.command = /^to(mp3|a(udio)?)$/i

export default handler
19 changes: 19 additions & 0 deletions silvaXlab/audio-toptt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { toPTT } from '../lib/converter.js'

let handler = async (m, { conn, usedPrefix, command }) => {
let q = m.quoted ? m.quoted : m
let mime = (m.quoted ? m.quoted : m.msg).mimetype || ''
if (!/video|audio/.test(mime))
throw `✳️ Reply to the audio you want to convert to voice memo with :\n *${usedPrefix + command}*`
let media = await q.download?.()
if (!media) throw '❎ Failed to download media'
let audio = await toPTT(media, 'mp4')
if (!audio.data) throw '❎ Error converting'
conn.sendFile(m.chat, audio.data, 'audio.mp3', '', m, true, { mimetype: 'audio/mp4' })
}
handler.help = ['toav']
handler.tags = ['fun']

handler.command = ['toav', 'tovn']

export default handler
55 changes: 55 additions & 0 deletions silvaXlab/bible.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import fetch from 'node-fetch'
import { translate } from '@vitalets/google-translate-api'

const BASE_URL = 'https://bible-api.com'

let bibleChapterHandler = async (m, { conn }) => {
try {
// Extract the chapter number or name from the command text.
let chapterInput = m.text.split(' ').slice(1).join('').trim()

if (!chapterInput) {
throw new Error(`Please specify the chapter number or name. Example: -bible john 3:16`)
}

// Encode the chapterInput to handle special characters
chapterInput = encodeURIComponent(chapterInput)

// Make an API request to fetch the chapter information.
let chapterRes = await fetch(`${BASE_URL}/${chapterInput}`)

if (!chapterRes.ok) {
throw new Error(`Please specify the chapter number or name. Example: -bible john 3:16`)
}

let chapterData = await chapterRes.json()

let translatedChapterHindi = await translate(chapterData.text, { to: 'hi', autoCorrect: true })

let translatedChapterEnglish = await translate(chapterData.text, {
to: 'en',
autoCorrect: true,
})

let bibleChapter = `
📖 *The Holy Bible*\n
📜 *Chapter ${chapterData.reference}*\n
Type: ${chapterData.translation_name}\n
Number of verses: ${chapterData.verses.length}\n
🔮 *Chapter Content (English):*\n
${translatedChapterEnglish.text}\n
🔮 *Chapter Content (Hindi):*\n
${translatedChapterHindi.text}`

m.reply(bibleChapter)
} catch (error) {
console.error(error)
m.reply(`Error: ${error.message}`)
}
}

bibleChapterHandler.help = ['bible [chapter_number|chapter_name]']
bibleChapterHandler.tags = ['religion']
bibleChapterHandler.command = ['bible', 'chapter']

export default bibleChapterHandler
19 changes: 19 additions & 0 deletions silvaXlab/bingimg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import fetch from 'node-fetch'

let handler = async (m, { conn, text }) => {
if (!text) throw 'What do you want to create?'
m.react(rwait)
let msg = encodeURIComponent(text)
let res = await fetch(`https://aemt.me/bingimg?text=${msg}`)
let data = await res.json()
console.log(data)
let buffer = data.result
conn.sendFile(m.chat, buffer, 'image.png', `${text}`, m)
m.react(done)
}

handler.help = ['bingimg <query>']
handler.tags = ['AI']
handler.command = /^bingimg$/i

export default handler
24 changes: 24 additions & 0 deletions silvaXlab/bitly.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { bitly } from '@shizodevs/wabotmodule';

let handler = async (m, { conn, args }) => {
try {
const longURL = args[0];
if (!longURL) {
return conn.reply(m.chat, 'Please provide a long URL.', m);
}
const { shortURL, qrCode } = await bitly(longURL);
await conn.sendFile(m.chat, qrCode, 'qrcode.png', `Successfuly Shorted Your Link ✅
🏴‍☠️ *Original Link:* ${longURL}
🧟‍♂️ *Shorted Link:* ` + shortURL + `
📢 *Powered by:* Bit.ly
👨‍🎓 *Developer:* ${author}`, m);
} catch (error) {
console.error(error);
conn.reply(m.chat, 'Failed to create short URL and QR code.\n' + error, m);
}
};
handler.help = ['shortlink <longLink>', 'bitly <longlink>'];
handler.tags = ['tools'];
handler.command = /^(shortlink|bitly)$/i;

export default handler;
18 changes: 18 additions & 0 deletions silvaXlab/cmd-del.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//import db from '../lib/database.js'

let handler = async (m, { text }) => {
let hash = text
if (m.quoted && m.quoted.fileSha256) hash = m.quoted.fileSha256.toString('hex')
if (!hash) throw `✳️ Enter the command name`
let sticker = global.db.data.sticker
if (sticker[hash] && sticker[hash].locked) throw `✳️ You can not delete this command`
delete sticker[hash]
m.reply(`✅ Command eliminated`)
}

handler.help = ['cmd'].map(v => 'del' + v + ' <text>')
handler.tags = ['cmd']
handler.command = ['delcmd']
handler.owner = true

export default handler
33 changes: 33 additions & 0 deletions silvaXlab/cmd-list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//import db from '../lib/database.js'

let handler = async (m, { conn }) => {
conn.reply(
m.chat,
`
*LIST COMANDOS*
▢ *Info:* If it is in *bold* it is blocked
──────────────────
${Object.entries(global.db.data.sticker)
.map(
([key, value], index) =>
`${index + 1}. ${value.locked ? `(bloqueado) ${key}` : key} : ${value.text}`
)
.join('\n')}
`.trim(),
null,
{
mentions: Object.values(global.db.data.sticker)
.map(x => x.mentionedJid)
.reduce((a, b) => [...a, ...b], []),
}
)
}

handler.help = ['listcmd']
handler.tags = ['cmd']
handler.command = ['listcmd']

export default handler
19 changes: 19 additions & 0 deletions silvaXlab/devotional-ganpatti.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import fetch from 'node-fetch'

let handler = async (m, { conn }) => {

let msg = `Ganpati Bappa Morya !! 🙇`
let endpoint = `https://shizoapi.onrender.com/api/devotional/ganpati?apikey=${shizokeys}`
const response = await fetch(endpoint);
if (response.ok) {
const imageBuffer = await response.buffer();
await conn.sendFile(m.chat, imageBuffer, 'shizo.techie.error.png', msg, m, null, rpig);
} else {
throw bug
}
}

handler.tags = ['images']
handler.help = handler.command = ['ganpati', 'ganesh']

export default handler
19 changes: 19 additions & 0 deletions silvaXlab/devotional-mahadev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import fetch from 'node-fetch'

let handler = async (m, { conn }) => {

let msg = `Har Har Mahadev !! 🙇`
let endpoint = `https://shizoapi.onrender.com/api/devotional/mahadev?apikey=${shizokeys}`
const response = await fetch(endpoint);
if (response.ok) {
const imageBuffer = await response.buffer();
await conn.sendFile(m.chat, imageBuffer, 'shizo.techie.error.png', msg, m, null, rpig);
} else {
throw bug
}
}

handler.tags = ['images']
handler.help = handler.command = ['mahadev', 'shiva']

export default handler
19 changes: 19 additions & 0 deletions silvaXlab/devotional-shreeram.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import fetch from 'node-fetch'

let handler = async (m, { conn }) => {

let msg = `Jay Shree Ram !! 🚩🙇`
let endpoint = `https://shizoapi.onrender.com/api/devotional/ram?apikey=${shizokeys}`
const response = await fetch(endpoint);
if (response.ok) {
const imageBuffer = await response.buffer();
await conn.sendFile(m.chat, imageBuffer, 'shizo.techie.error.png', msg, m, null, rpig);
} else {
throw bug
}
}

handler.tags = ['images']
handler.help = handler.command = ['ram', 'shreeram']

export default handler
13 changes: 13 additions & 0 deletions silvaXlab/dl-StoryWhatsApp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const handler = async (m, { conn: conn }) => {
if ("status@broadcast" != m.quoted?.chat) throw "Quote Status message";
try {
let buffer = await (m.quoted?.download());
await conn.sendFile(m.chat, buffer, "", m.quoted?.text || "", null, !1, {
quoted: m
});
} catch (e) {
console.log(e), await conn.reply(m.chat, m.quoted?.text, m);
}
};
handler.help = ["downloadsw"], handler.tags = ["tools"], handler.command = /^((sw|status)(dl|download)|(dl|download)(sw|status))$/i;
export default handler;
40 changes: 40 additions & 0 deletions silvaXlab/dl-facebook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import fg from 'api-dylux'

const handler = async (m, { conn, args, usedPrefix, command }) => {
if (!args[0]) {
throw `✳️ Please send the link of a Facebook video\n\n📌 EXAMPLE :\n*${usedPrefix + command}* https://www.facebook.com/Ankursajiyaan/videos/981948876160874/?mibextid=rS40aB7S9Ucbxw6v`
}

const urlRegex =
/^(?:https?:\/\/)?(?:www\.)?(?:facebook\.com|fb\.watch)\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/i
if (!urlRegex.test(args[0])) {
throw '⚠️ PLEASE GIVE A VALID URL.'
}

m.react(rwait)

try {
const result = await fg.fbdl(args[0])
const tex = `
⊱ HERE IS YOUR VIDEO ⊰\n\n
↳ *VIDEO TITLE:* ${result.title}\n\n
⊱ THANKS FOR CHOOSING SILVA MD`

const response = await fetch(result.videoUrl)
const arrayBuffer = await response.arrayBuffer()
const videoBuffer = Buffer.from(arrayBuffer)

conn.sendFile(m.chat, videoBuffer, 'fb.mp4', tex, m)
m.react(done)
} catch (error) {
console.log(error)
m.reply('⚠️ An error occurred while processing the request. Please try again later.')
}
}

handler.help = ['facebook <url>']
handler.tags = ['downloader']
handler.command = /^((facebook|fb)(downloder|dl)?)$/i
handler.diamond = true

export default handler
Loading

0 comments on commit c8d07c8

Please sign in to comment.