Created
December 17, 2020 23:47
-
-
Save phaticusthiccy/e8326176a979f6667ffe9ff281d7fb63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Codded by @phaticusthiccy | |
Telegram: t.me/phaticusthiccy | |
Instagram: www.instagram.com/kyrie.baran | |
*/ | |
const Asena = require('../events'); | |
const {MessageType, GroupSettingChange} = require('@adiwajshing/baileys'); | |
async function checkImAdmin(message, user = message.client.user.jid) { | |
var grup = await message.client.groupMetadata(message.jid); | |
var sonuc = grup['participants'].map((member) => { | |
if (member.id.split('@')[0] === user.split('@')[0] && member.isAdmin) return true; else; return false; | |
}); | |
return sonuc.includes(true); | |
} | |
Asena.addCommand({pattern: 'sessiz1', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*Admin Olmadan Grubu Nasıl Sessize Alabilirim ki?*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Grup 1 dakika süreyle susturuldu!*'); | |
await new Promise(r => setTimeout(r, 60000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Pekâlâ Patron. Sohbet tekrardan açılmıştır!*'); | |
})); | |
Asena.addCommand({pattern: 'quiet1', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*I am not admin this group.*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Group chat shut down for 1 minute!*'); | |
await new Promise(r => setTimeout(r, 60000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Well Boss. Chat opened again!*'); | |
})); | |
Asena.addCommand({pattern: 'sessiz2', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*Admin Olmadan Grubu Nasıl Sessize Alabilirim ki?*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Grup 2 dakika süreyle susturuldu!*'); | |
await new Promise(r => setTimeout(r, 120000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Pekâlâ Patron. Sohbet tekrardan açılmıştır!*'); | |
})); | |
Asena.addCommand({pattern: 'quiet2', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*I am not admin this group.*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Group chat shut down for 2 minute!*'); | |
await new Promise(r => setTimeout(r, 120000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Well Boss. Chat opened again!*'); | |
})); | |
Asena.addCommand({pattern: 'sessiz5', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*Admin Olmadan Grubu Nasıl Sessize Alabilirim ki?*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Grup 5 dakika süreyle susturuldu!*'); | |
await new Promise(r => setTimeout(r, 300000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Pekâlâ Patron. Sohbet tekrardan açılmıştır!*'); | |
})); | |
Asena.addCommand({pattern: 'quiet5', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*I am not admin this group.*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Group chat shut down for 5 minute!*'); | |
await new Promise(r => setTimeout(r, 300000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Well Boss. Chat opened again!*'); | |
})); | |
Asena.addCommand({pattern: 'sessiz10', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*Admin Olmadan Grubu Nasıl Sessize Alabilirim ki?*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Grup 10 dakika süreyle susturuldu!*'); | |
await new Promise(r => setTimeout(r, 600000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Pekâlâ Patron. Sohbet tekrardan açılmıştır!*'); | |
})); | |
Asena.addCommand({pattern: 'quiet10', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*I am not admin this group.*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Group chat shut down for 10 minute!*'); | |
await new Promise(r => setTimeout(r, 600000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Well Boss. Chat opened again!*'); | |
})); | |
Asena.addCommand({pattern: 'sessiz20', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*Admin Olmadan Grubu Nasıl Sessize Alabilirim ki?*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Grup 20 dakika süreyle susturuldu!*'); | |
await new Promise(r => setTimeout(r, 1200000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Pekâlâ Patron. Sohbet tekrardan açılmıştır!*'); | |
})); | |
Asena.addCommand({pattern: 'quiet20', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*I am not admin this group.*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Group chat shut down for 20 minute!*'); | |
await new Promise(r => setTimeout(r, 1200000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Well Boss. Chat opened again!*'); | |
})); | |
Asena.addCommand({pattern: 'sessiz30', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*Admin Olmadan Grubu Nasıl Sessize Alabilirim ki?*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Grup 30 dakika süreyle susturuldu!*'); | |
await new Promise(r => setTimeout(r, 1800000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Pekâlâ Patron. Sohbet tekrardan açılmıştır!*'); | |
})); | |
Asena.addCommand({pattern: 'quiet30', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*I am not admin this group.*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Group chat shut down for 30 minute!*'); | |
await new Promise(r => setTimeout(r, 1800000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Well Boss. Chat opened again!*'); | |
})); | |
Asena.addCommand({pattern: 'sessiz60', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*Admin Olmadan Grubu Nasıl Sessize Alabilirim ki?*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Grup 1 saat süreyle susturuldu!*'); | |
await new Promise(r => setTimeout(r, 3600000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Pekâlâ Patron. Sohbet tekrardan açılmıştır!*'); | |
})); | |
Asena.addCommand({pattern: 'quiet60', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*I am not admin this group.*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Group chat shut down for one hours!*'); | |
await new Promise(r => setTimeout(r, 3600000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Well Boss. Chat opened again!*'); | |
})); | |
Asena.addCommand({pattern: 'sessiz24', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*Admin Olmadan Grubu Nasıl Sessize Alabilirim ki?*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Grup 1 gün süreyle susturuldu!*'); | |
await new Promise(r => setTimeout(r, 8640000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Pekâlâ Patron. Sohbet tekrardan açılmıştır!*'); | |
})); | |
Asena.addCommand({pattern: 'quiet24', fromMe: true, onlyGroup: true}, (async (message, match) => { | |
var im = await checkImAdmin(message); | |
if (!im) return await message.sendMessage('*I am not admin this group.*'); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, true); | |
await message.sendMessage('*Group chat shut down for one day!*'); | |
await new Promise(r => setTimeout(r, 86400000)); | |
await message.client.groupSettingChange(message.jid, GroupSettingChange.messageSend, false); | |
await message.sendMessage('*Well Boss. Chat opened again!*'); | |
})); | |
Asena.addCommand({pattern: 'infomute', fromMe: true,}, (async (message, match) => { | |
await message.sendMessage('*Codded by @phaticusthiccy*\n🇹🇷 Grubu sessize alır.\n🇬🇧 Closes the chat.\n\n💻Usage: *.sessiz1* / *.quite1*\n💻Usage: *.sessiz2* / *.quite2*\n💻Usage: *.sessiz5* / *.quite5*\n💻Usage: *.sessiz10* / *.quite10*\n💻Usage: *.sessiz20* / *.quite20*\n💻Usage: *.sessiz30* / *.quite30*\n💻Usage: *.sessiz60* / *.quite60*\n💻Usage: *.sessiz24* / *.quite24*'); | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment