Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Nsfw System #560

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions message/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const { daily, level, register, afk, reminder, premium, limit, quizizz } = requi
const cd = 4.32e+7
const limitCount = 25
const errorImg = 'https://i.ibb.co/jRCpLfn/user.png'
let nsfwEnabled = false;
/********** END OF UTILS **********/

/********** DATABASES **********/
Expand Down Expand Up @@ -878,6 +879,8 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
await bocchi.sendText(from, eng.menuLeveling())
} else if (args[0] === '10') {
await bocchi.sendText(from, eng.menuAi())
} else if (args[0] === '11') {
await bocchi.sendText(from, eng.menuNsfw())
} else {
await bocchi.sendText(from, eng.menu(jumlahUser, levelMenu, xpMenu, role, pushname, reqXpMenu, isPremium ? 'YES' : 'NO'))
}
Expand Down Expand Up @@ -1172,6 +1175,46 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
})
break

// nsfw by staffFF6773
case 'nsfw':
if (!isRegistered) return await bocchi.reply(from, eng.notRegistered(), id);

// Check if NSFW is enabled
if (nsfwEnabled && !limit.isLimit(sender.id, _limit, limitCount, isPremium, isOwner)) {
limit.addLimit(sender.id, _limit, isPremium, isOwner);
await bocchi.reply(from, eng.wait(), id);

weeaboo.waifu(true)
.then(async ({ url }) => {
await bocchi.sendFileFromUrl(from, url, 'waifuNsfw.png', '', id)
.then(() => console.log('Success sending Nsfw!'));
})
.catch(async (err) => {
console.error(err);
await bocchi.reply(from, 'Error!', id);
});
} else {
await bocchi.reply(from, 'NSFW is currently disabled or you have reached the limit. Use `nsfwon` to enable it.', id);
}
break;

case 'nsfwon':
if (isOwner && isGroupAdmins) {
nsfwEnabled = true;
await bocchi.reply(from, 'NSFW has been enabled.', id);
} else {
await bocchi.reply(from, 'Only the owner can enable NSFW.', id);
}
break;

case 'nsfwoff':
if (isOwner && isGroupAdmins) {
nsfwEnabled = false;
await bocchi.reply(from, 'NSFW has been disabled.', id);
} else {
await bocchi.reply(from, 'Only the owner can disable NSFW.', id);
}
break;
// Fun
case 'profile':
case 'me':
Expand Down
24 changes: 24 additions & 0 deletions message/text/lang/eng.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ Total registered: *${jumlahUser}*
*[8]* Owner
*[9]* Leveling
*[10]* AI
*[11]* Nsfw

Type *${prefix}menu* index_number to open the selected page menu.

Expand Down Expand Up @@ -933,6 +934,29 @@ _Index of [10]_
`
}

exports.menuNsfw = () => {
return `
*── 「 NSFW 」 ──*

1. *${prefix}nsfw*
Send random waifu nsfw photos
Aliases: -
Usage: *${prefix}nsfw*

2. *${prefix}nsfwon*
enables the nsfw command in the group
Aliases: -
Usage: *${prefix}nsfwon*

3. *${prefix}nsfwoff*
disable the nsfw command in the group
Aliases: -
Usage: *${prefix}nsfwoff*

_Index of [11]_
`
}

exports.rules = () => {
return `
*── 「 RULES 」 ──*
Expand Down
52 changes: 0 additions & 52 deletions package.json

This file was deleted.