Skip to content

Commit

Permalink
styles: remove extra spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
SlavyanDesu committed Apr 23, 2023
1 parent 2c8cc84 commit 17c3071
Showing 1 changed file with 54 additions and 54 deletions.
108 changes: 54 additions & 54 deletions message/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const { weeaboo, downloader } = require('../lib')
const { uploadImages } = require('../tools/fetcher')
// eslint-disable-next-line no-unused-vars
const { eng, ind } = require('./text/lang/')
const { daily, level, register, afk, reminder, premium, limit , quizizz } = require('../function')
const { daily, level, register, afk, reminder, premium, limit, quizizz } = require('../function')
const cd = 4.32e+7
const limitCount = 25
const errorImg = 'https://i.ibb.co/jRCpLfn/user.png'
Expand Down Expand Up @@ -140,7 +140,7 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
if (levelRole >= 10) {
role = 'Copper III'
}
if(levelRole >= 15) {
if (levelRole >= 15) {
role = 'Copper II'
}
if (levelRole >= 20) {
Expand Down Expand Up @@ -230,9 +230,9 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {

// Anti virtext by: @VideFrelan
if (isGroupMsg && !isGroupAdmins && isBotGroupAdmins && !isOwner) {
if (chats.length >= 5000) {
await bocchi.sendTextWithMentions(from, `@${sender.id} is detected sending a virtext.\nYou will be kicked!`)
await bocchi.removeParticipant(groupId, sender.id)
if (chats.length >= 5000) {
await bocchi.sendTextWithMentions(from, `@${sender.id} is detected sending a virtext.\nYou will be kicked!`)
await bocchi.removeParticipant(groupId, sender.id)
}
}

Expand Down Expand Up @@ -282,7 +282,7 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
if (isGroupMsg && isAutoStickerOn && isMedia && isVideo && !isCmd) {
const mediaData = await decryptMedia(message)
const videoBase64 = `data:${mimetype};base64,${mediaData.toString('base64')}`
await bocchi.sendMp4AsSticker(from, videoBase64, { stickerMetadata: true, pack: packWm, author: authorWm, fps: 30, startTime: '00:00:00.0', endTime : '00:00:05.0', crop: false, loop: 0 })
await bocchi.sendMp4AsSticker(from, videoBase64, { stickerMetadata: true, pack: packWm, author: authorWm, fps: 30, startTime: '00:00:00.0', endTime: '00:00:05.0', crop: false, loop: 0 })
console.log(`Sticker processed for ${processTime(t, moment())} seconds`)
}

Expand Down Expand Up @@ -385,7 +385,7 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
case 'leaderboard':
if (!isRegistered) return await bocchi.reply(from, eng.notRegistered(), id)
if (!isLevelingOn) return await bocchi.reply(from, eng.levelingNotOn(), id)
if (!isGroupMsg) return await bocchi.reply(from. eng.groupOnly(), id)
if (!isGroupMsg) return await bocchi.reply(from.eng.groupOnly(), id)
const resp = _level
_level.sort((a, b) => (a.xp < b.xp) ? 1 : -1)
let leaderboard = '*── 「 LEADERBOARDS 」 ──*\n\n'
Expand All @@ -395,61 +395,61 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
if (resp[i].level >= 5) {
roles = 'Copper IV'
}
if (resp[i].level >= 10) {
if (resp[i].level >= 10) {
roles = 'Copper III'
}
if (resp[i].level >= 15) {
if (resp[i].level >= 15) {
roles = 'Copper II'
}
if (resp[i].level >= 20) {
if (resp[i].level >= 20) {
roles = 'Copper I'
}
if (resp[i].level >= 25) {
if (resp[i].level >= 25) {
roles = 'Silver V'
}
if (resp[i].level >= 30) {
if (resp[i].level >= 30) {
roles = 'Silver IV'
}
if (resp[i].level >= 35) {
if (resp[i].level >= 35) {
roles = 'Silver III'
}
if (resp[i].level >= 40) {
if (resp[i].level >= 40) {
roles = 'Silver II'
}
if (resp[i].level >= 45) {
if (resp[i].level >= 45) {
roles = 'Silver I'
}
if (resp[i].level >= 50) {
if (resp[i].level >= 50) {
roles = 'Gold V'
}
if (resp[i].level >= 55) {
if (resp[i].level >= 55) {
roles = 'Gold IV'
}
if (resp[i].level >= 60) {
if (resp[i].level >= 60) {
roles = 'Gold III'
}
if (resp[i].level >= 65) {
if (resp[i].level >= 65) {
roles = 'Gold II'
}
if (resp[i].level >= 70) {
if (resp[i].level >= 70) {
roles = 'Gold I'
}
if (resp[i].level >= 75) {
if (resp[i].level >= 75) {
roles = 'Platinum V'
}
if (resp[i].level >= 80) {
if (resp[i].level >= 80) {
roles = 'Platinum IV'
}
if (resp[i].level >= 85) {
if (resp[i].level >= 85) {
roles = 'Platinum III'
}
if (resp[i].level >= 90) {
if (resp[i].level >= 90) {
roles = 'Platinum II'
}
if (resp[i].level >= 95) {
if (resp[i].level >= 95) {
roles = 'Platinum I'
}
if (resp[i].level > 100) {
if (resp[i].level > 100) {
roles = 'Exterminator'
}
leaderboard += `${i + 1}. wa.me/${_level[i].id.replace('@c.us', '')}\n➸ *XP*: ${_level[i].xp} *Level*: ${_level[i].level}\n➸ *Role*: ${roles}\n\n`
Expand Down Expand Up @@ -754,11 +754,11 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
if (quotedMsg) {
const textos = quotedMsg.body
const languagets = args[0]
translate(textos, {to: languagets}).then(ress => {bocchi.reply(from, ress.text, id)})
translate(textos, { to: languagets }).then(ress => { bocchi.reply(from, ress.text, id) })
} else {
const texto = q.substring(0, q.indexOf('|') - 1)
const languaget = q.substring(q.lastIndexOf('|') + 2)
translate(texto, {to: languaget}).then(res => {bocchi.reply(from, res.text, id)})
translate(texto, { to: languaget }).then(res => { bocchi.reply(from, res.text, id) })
}
break
case 'bass':
Expand Down Expand Up @@ -804,13 +804,13 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
await bocchi.reply(from, eng.wait(), id)
if (!q) return await bocchi.reply(from, eng.wrongFormat(), id)
quizizz(q)
.then(async (result) => {
const ResultText = `Quizizz Hack Berhasil\n\nSilahkan Cek Jawabannya Di Link ${result.url}`
await bocchi.sendLinkWithAutoPreview(from, result.url, ResultText, null, id)
})
.catch(async () => {
await bocchi.sendText(from, 'Link Quizizz Tidak Di Temukan atau Api Sedang Error' , id)
})
.then(async (result) => {
const ResultText = `Quizizz Hack Berhasil\n\nSilahkan Cek Jawabannya Di Link ${result.url}`
await bocchi.sendLinkWithAutoPreview(from, result.url, ResultText, null, id)
})
.catch(async () => {
await bocchi.sendText(from, 'Link Quizizz Tidak Di Temukan atau Api Sedang Error', id)
})
break
case 'nightcore':
if (!isRegistered) return await bocchi.reply(from, eng.notRegistered(), id)
Expand Down Expand Up @@ -931,7 +931,7 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
if (!isBotGroupAdmins) return await bocchi.reply(from, eng.botNotAdmin(), id)
if (isGroupAdmins) {
await bocchi.deleteMessage(quotedMsgObj.chatId, quotedMsgObj.id, false)
} else {
} else {
if (!quotedMsgObj.fromMe) return await bocchi.reply(from, eng.wrongFormat(), id)
await bocchi.deleteMessage(quotedMsgObj.chatId, quotedMsgObj.id, false)
}
Expand Down Expand Up @@ -1079,7 +1079,7 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
.then(() => console.log('Success sending wallpaper image!'))
.catch(async (err) => {
console.error(err)
await bocchi.reply(from, 'Error!', id )
await bocchi.reply(from, 'Error!', id)
})
break
case 'kemono':
Expand Down Expand Up @@ -1242,7 +1242,7 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
.on('progress', (progress) => console.log(color('[FFmpeg]', 'green'), progress))
.on('end', async () => {
console.log(color('[FFmpeg]', 'green'), 'Processing finished!')
await bocchi.sendMp4AsSticker(from, fileOutputPath, { fps: 30, startTime: '00:00:00.0', endTime : '00:00:05.0', loop: 0 })
await bocchi.sendMp4AsSticker(from, fileOutputPath, { fps: 30, startTime: '00:00:00.0', endTime: '00:00:05.0', loop: 0 })
console.log(color('[WAPI]', 'green'), 'Success sending GIF!')
setTimeout(() => {
fs.unlinkSync(fileInputPath)
Expand Down Expand Up @@ -1348,7 +1348,7 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
const encryptMedia = isQuotedImage ? quotedMsg : message
const mediaData = await decryptMedia(encryptMedia)
await bocchi.sendImageAsSticker(from, mediaData, { author: authorWm, pack: packWm, removebg: true })
console.log(`Sticker processed for ${processTime(t, moment())} seconds`)
console.log(`Sticker processed for ${processTime(t, moment())} seconds`)
} else {
await bocchi.reply(from, eng.wrongFormat(), id)
}
Expand Down Expand Up @@ -1383,9 +1383,9 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
limit.addLimit(sender.id, _limit, isPremium, isOwner)
await bocchi.reply(from, eng.wait(), id)
const top = q.substring(0, q.indexOf('|') - 1)
const topp = top.replace('', '_').replace('\n','%5Cn').replace('?', '~q').replace('%', '~p').replace('#', '~h').replace('/', '~s')
const topp = top.replace('', '_').replace('\n', '%5Cn').replace('?', '~q').replace('%', '~p').replace('#', '~h').replace('/', '~s')
const bottom = q.substring(q.lastIndexOf('|') + 2)
const bottomm = bottom.replace('', '_').replace('\n','%5Cn').replace('?', '~q').replace('%', '~p').replace('#', '~h').replace('/', '~s')
const bottomm = bottom.replace('', '_').replace('\n', '%5Cn').replace('?', '~q').replace('%', '~p').replace('#', '~h').replace('/', '~s')
const encryptMedia = isQuotedImage ? quotedMsg : message
const mediaData = await decryptMedia(encryptMedia)
const getUrl = await uploadImages(mediaData, `meme.${sender.id}`)
Expand Down Expand Up @@ -1438,10 +1438,10 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
await bocchi.reply(from, eng.wait(), id)
try {
const encryptMedia = isQuotedGif || isQuotedVideo ? quotedMsg : message
const mediaData = await decryptMedia(encryptMedia)
const _mimetype = isQuotedVideo || isQuotedGif ? quotedMsg.mimetype : mimetype
const videoBase64 = `data:${_mimetype};base64,${mediaData.toString('base64')}`
await bocchi.sendMp4AsSticker(from, videoBase64, null, { stickerMetadata: true, author: authorWm, pack: packWm, keepScale: true, fps: 30, startTime: '00:00:00.0', endTime : '00:00:05.0', crop: false, loop: 0 })
const mediaData = await decryptMedia(encryptMedia)
const _mimetype = isQuotedVideo || isQuotedGif ? quotedMsg.mimetype : mimetype
const videoBase64 = `data:${_mimetype};base64,${mediaData.toString('base64')}`
await bocchi.sendMp4AsSticker(from, videoBase64, null, { stickerMetadata: true, author: authorWm, pack: packWm, keepScale: true, fps: 30, startTime: '00:00:00.0', endTime: '00:00:05.0', crop: false, loop: 0 })
.then(() => {
console.log(`Sticker processed for ${processTime(t, moment())} seconds`)
})
Expand Down Expand Up @@ -1591,18 +1591,18 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
await bocchi.reply(from, eng.daily(time), id)
} else if (isOwner || isPremium) {
let txt = '╔══✪〘 *EVERYONE* 〙✪══\n'
for (let i = 0; i < groupMem.length; i++) {
txt += '╠➥'
txt += ` @${groupMem[i].id.replace(/@c.us/g, '')}\n`
}
for (let i = 0; i < groupMem.length; i++) {
txt += '╠➥'
txt += ` @${groupMem[i].id.replace(/@c.us/g, '')}\n`
}
txt += '╚═〘 *B O C C H I B O T* 〙'
await bocchi.sendTextWithMentions(from, txt)
} else {
let txt = '╔══✪〘 *EVERYONE* 〙✪══\n'
for (let i = 0; i < groupMem.length; i++) {
txt += '╠➥'
txt += ` @${groupMem[i].id.replace(/@c.us/g, '')}\n`
}
for (let i = 0; i < groupMem.length; i++) {
txt += '╠➥'
txt += ` @${groupMem[i].id.replace(/@c.us/g, '')}\n`
}
txt += '╚═〘 *B O C C H I B O T* 〙'
await bocchi.sendTextWithMentions(from, txt)
daily.addLimit(sender.id, _daily)
Expand Down Expand Up @@ -1871,7 +1871,7 @@ module.exports = msgHandler = async (bocchi = new Client(), message) => {
_ban.splice(mentionedJidList[0], 1)
fs.writeFileSync('./database/bot/banned.json', JSON.stringify(_ban))
await bocchi.reply(from, eng.ok(), id)
} else{
} else {
_ban.splice(args[1] + '@c.us', 1)
fs.writeFileSync('./database/bot/banned.json', JSON.stringify(_ban))
await bocchi.reply(from, eng.ok(), id)
Expand Down

0 comments on commit 17c3071

Please sign in to comment.