Skip to content

Commit

Permalink
β˜…ππ”πŒππ‹π„ππ„π„πŸππŽπ“β˜…
Browse files Browse the repository at this point in the history
  • Loading branch information
Khalid-official authored Feb 1, 2025
1 parent 3741130 commit 5431b40
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions plugins/owner-setusername.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
let handler = async (m, { conn, args, isOwner, command, isGroup }) => {
if (command === 'setdesc' || command === 'setdesk') {
if (!isGroup) return m.reply('*[❗ERROR❗] This command can only be used in groups!*');
await conn.groupUpdateDescription(m.chat, `${args.join(" ")}`);
m.reply('https://github.com/Khalid-official *[❗INFO❗] Successfully changed the group description*');
} else if (command === 'setusername') {
if (!isOwner) return m.reply('*[❗ERROR❗] Only the bot owner can use this command!*');
let newName = args.join(" ");
if (!newName) return m.reply('*[❗ERROR❗] Please provide a new username!*');

try {
await conn.updateProfileName(newName);
m.reply(`*[βœ… SUCCESS]* Bot username updated to: *${newName}*`);
} catch (e) {
m.reply('*[❌ ERROR]* Failed to update bot username. Make sure the bot has the necessary permissions.');
}
}
};

handler.help = ['setdesc <text>', 'setusername <new_name>'];
handler.tags = ['group', 'owner'];
handler.command = /^setdesk|setdesc|setusername$/i;
handler.group = false; // `setdesc` works only in groups
handler.owner = true; // `setusername` is for owner use only

export default handler;

0 comments on commit 5431b40

Please sign in to comment.