Skip to content

Commit

Permalink
Removed group registration feature
Browse files Browse the repository at this point in the history
  • Loading branch information
PikaBotz authored Dec 15, 2024
1 parent ee8c73e commit 117f862
Showing 1 changed file with 0 additions and 145 deletions.
145 changes: 0 additions & 145 deletions lib/plugins/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,148 +309,3 @@ anya({
});
}
)

//เผบโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€เผป

anya({
name: "setresname",
react: "๐Ÿ‘ค",
category: "general",
desc: "Edit your name from group registration",
rule: 5,
need: "name",
filename: __filename
}, async (anyaV2, pika, { args, prefix, command }) => {
const text = args.join(" ");
if (!args[0]) return pika.reply(`Please enter your name, type like โœ๐Ÿป:\n\n\`${prefix + command} YOUR_NAME\`\n\n_AID: QA26_`);
const regex = /^[A-Za-z ]+$/;
if (!regex.test(text)) return pika.reply(`โš ๏ธ Symbols or special characters not allowed! Try again.`);
const user = db.User.find(v => v.id === pika.sender.split("@")[0]) || await new User({ id: pika.sender.split("@")[0] }).save();
if (text.toLowerCase() === user.name.toLowerCase()) return pika.reply(`โ˜‘๏ธ This name is already registered, try another.`);
await User.findOneAndUpdate({ id: pika.sender.split("@")[0] }, { $set: { name: text.toLowerCase() } }, { new: true });
return pika.reply(`โœ… Edited your name as \`${text}\` now.`);
}
)

//เผบโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€เผป

anya({
name: "setresage",
react: "โš™๏ธ",
category: "general",
desc: "Edit your age from group registration",
rule: 5,
need: "number",
filename: __filename
}, async (anyaV2, pika, { args, prefix, command }) => {
if (!args[0]) {
return await anyaV2.sendButtonText(pika.chat, {
text: `โ†˜๏ธ Choose your \`gender\` below!`,
footer: Config.footer,
buttons: [
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"11 or below\",\"id\":\"${Config.prefa}setresage 11\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"12 years\",\"id\":\"${Config.prefa}setresage 12\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"13 years\",\"id\":\"${Config.prefa}setresage 13\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"14 years\",\"id\":\"${Config.prefa}setresage 14\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"15 years\",\"id\":\"${Config.prefa}setresage 15\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"16 years\",\"id\":\"${Config.prefa}setresage 16\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"17 years\",\"id\":\"${Config.prefa}setresage 17\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"18 years\",\"id\":\"${Config.prefa}setresage 18\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"19 years\",\"id\":\"${Config.prefa}setresage 19\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"20 years\",\"id\":\"${Config.prefa}setresage 20\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"21 years\",\"id\":\"${Config.prefa}setresage 21\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"22 years\",\"id\":\"${Config.prefa}setresage 22\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"23 years\",\"id\":\"${Config.prefa}setresage 23\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"24 years\",\"id\":\"${Config.prefa}setresage 24\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"25 years\",\"id\":\"${Config.prefa}setresage 25\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"26 years\",\"id\":\"${Config.prefa}setresage 26\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"27 years\",\"id\":\"${Config.prefa}setresage 27\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"28 years\",\"id\":\"${Config.prefa}setresage 28\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"29 years\",\"id\":\"${Config.prefa}setresage 29\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"30 or above\",\"id\":\"${Config.prefa}setresage 30\"}` },
],
contextInfo: {
mentionedJid: [pika.sender],
forwardingScore: 999,
isForwarded: true,
forwardedNewsletterMessageInfo: {
newsletterJid: '120363193293157965@newsletter',
newsletterName: Config.botname,
serverMessageId: 143
}
}
}, { quoted: pika });
}
const userAge = Number(args[0]);
if (!userAge) return pika.reply(`โŒ Invalid age!`);
if (userAge < 10) return pika.reply(`โŒ Age should be more than 10 years`);
if (userAge > 50) return pika.reply(`โŒ Age should be less than 50 years`);
const user = db.User.find(v => v.id === pika.sender.split("@")[0]) || await new User({ id: pika.sender.split("@")[0] }).save();
if (userAge === user.age) return pika.reply(`โ˜‘๏ธ This age is already registered.`);
await User.findOneAndUpdate({ id: pika.sender.split("@")[0] }, { $set: { age: userAge } }, { new: true });
return pika.reply(`โœ… Edited your age as \`${userAge} years old\` now.`);
}
)

//เผบโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€เผป

anya({
name: "setresgender",
react: "๐Ÿ†",
category: "general",
desc: "Edit your gender identity from group registration",
rule: 5,
filename: __filename
}, async (anyaV2, pika, { args, prefix, command }) => {
const text = args.join(" ");
if (!args[0]) {
return await anyaV2.sendButtonText(pika.chat, {
text: `โ†˜๏ธ Choose your \`gender\` below!`,
footer: Config.footer,
buttons: [
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"Male โ™‚๏ธ\",\"id\":\"${Config.prefa}setresgender male\"}` },
{ "name": "quick_reply", "buttonParamsJson": `{\"display_text\":\"Female โ™€๏ธ\",\"id\":\"${Config.prefa}setresgender female\"}` },
],
contextInfo: {
mentionedJid: [pika.sender],
forwardingScore: 999,
isForwarded: true,
forwardedNewsletterMessageInfo: {
newsletterJid: '120363193293157965@newsletter',
newsletterName: Config.botname,
serverMessageId: 143
}
}
}, { quoted: pika });
}
const regex = /^[A-Za-z ]+$/;
if (!regex.test(text)) return pika.reply(`โš ๏ธ Symbols or special characters not allowed! Try again.`);
if (!/male|female/.test(args[0])) return pika.reply(`โš ๏ธ Invalid gender name`);
const user = db.User.find(v => v.id === pika.sender.split("@")[0]) || await new User({ id: pika.sender.split("@")[0] }).save();
if (text.toLowerCase() === user.gender.toLowerCase()) return pika.reply(`โ˜‘๏ธ This gender is already registered.`);
await User.findOneAndUpdate({ id: pika.sender.split("@")[0] }, { $set: { gender: args[0].toLowerCase() } }, { new: true });
return pika.reply(`โœ… Edited your gender as \`${text}\` now.`);
}
)

//เผบโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€เผป

anya({
name: "setresstate",
react: "๐ŸŒ",
category: "general",
desc: "Edit your state location name from group registration",
rule: 5,
need: "name",
filename: __filename
}, async (anyaV2, pika, { args, prefix, command }) => {
const text = args.join(" ");
if (!args[0]) return pika.reply(`Please enter your state name, type like โœ๐Ÿป:\n\n\`${prefix + command} YOUR_STATE_NAME\`\n\n_AID: QA27_`);
// const regex = /^[A-Za-z ]+$/;
// if (!regex.test(text)) return pika.reply(`โš ๏ธ Symbols or special characters not allowed! Try again.`);
const user = db.User.find(v => v.id === pika.sender.split("@")[0]) || await new User({ id: pika.sender.split("@")[0] }).save();
if (text.toLowerCase() === user.state.toLowerCase()) return pika.reply(`โ˜‘๏ธ This state location is already registered, try another.`);
await User.findOneAndUpdate({ id: pika.sender.split("@")[0] }, { $set: { state: text.toLowerCase() } }, { new: true });
return pika.reply(`โœ… Edited your state location as \`${text}\` now.`);
}
)

0 comments on commit 117f862

Please sign in to comment.