-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
β
πππππππππππππβ
- Loading branch information
1 parent
3741130
commit 5431b40
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
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
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; |