Nurutomo / wabot-aq

WhatsApp Bot
GNU General Public License v3.0
709 stars 1.38k forks source link

Owner ask command #443

Closed bilal-08 closed 3 years ago

bilal-08 commented 3 years ago

a feature : If someone wants to ask something to owner so that he can gets his answer without actually contacting the owner himself like

user send !ownerask I want to add bot to my group and the bot will get this msg to The declared owner. and the owner can answer its question by tagging that msgs like owner : okay send your group link to Bot dm ~ owner

ariffb25 commented 3 years ago
let handler = async (m, { conn, text, usedPrefix, command }) => {
    if (!text) throw `example:\n${usedPrefix + command} hello owner!`
        if (text.length > 200) throw `Max. 200 character!`
        let teks = `*SOMEONE ASKING TO YOU*\n\nFrom: *@${m.sender.split`@`[0]}*\n\nMessage: ${text}`
        conn.reply('62831********@s.whatsapp.net', teks, null, { // set your number here
            contextInfo: {
                    mentionedJid: [m.sender]
            }
        })
        m.reply(`_Success._`)
}
handler.help = ['ownerask'].map(v => v + ' <text>')
handler.tags = ['info']
handler.command = /^ownerask$/i
module.exports = handler
ariffb25 commented 3 years ago
let handler = m => m
handler.before = async function (m, {conn, text}) {
if (!m.quoted || !m.quoted.fromMe || !m.quoted.isBaileys || !/SOMEONE ASKING TO YOU/i.test(m.quoted.text)) return !0

conn.reply(m.quoted.mentionedJid[0], 'Owner: ' + text, null)

}
module.exports = handler

i havent try it :v

bilal-08 commented 3 years ago
let handler = m => m
handler.before = async function (m, {conn, text}) {
if (!m.quoted || !m.quoted.fromMe || !m.quoted.isBaileys || !/SOMEONE ASKING TO YOU/i.test(m.quoted.text)) return !0

conn.reply(m.quoted.mentionedJid[0], 'Owner: ' + text, null)

}
module.exports = handler

i havent try it :v

Bagus akan mencoba dan mengatakan apa yang terjadi

KazukoGans commented 3 years ago
let handler = m => m
handler.before = async function (m, {conn, text}) {
if (!m.quoted || !m.quoted.fromMe || !m.quoted.isBaileys || !/SOMEONE ASKING TO YOU/i.test(m.quoted.text)) return !0

conn.reply(m.quoted.mentionedJid[0], 'Owner: ' + text, null)

}
module.exports = handler

i havent try it :v

Owner: undefined

ariffb25 commented 3 years ago
let handler = m => m
handler.before = async function (m, {conn, text}) {
if (!m.quoted || !m.quoted.fromMe || !m.quoted.isBaileys || !/SOMEONE ASKING TO YOU/i.test(m.quoted.text)) return !0

conn.reply(m.quoted.mentionedJid[0], 'Owner: ' + text, null)

}
module.exports = handler
let handler = m => m
handler.before = async function (m, {conn}) {
if (!m.quoted || !m.quoted.fromMe || !m.quoted.isBaileys || !/SOMEONE ASKING TO YOU/i.test(m.quoted.text)) return !0

conn.reply(m.quoted.mentionedJid[0], 'Owner: ' + m.text, null)

}
module.exports = handler
Nurutomo commented 3 years ago

this feature is annoying :p

github-actions[bot] commented 3 years ago

stale issue