MCPcopy Create free account
hub / github.com/TechifyBots/Rename-Bot / remove_premium

Function remove_premium

plugins/admin.py:96–109  ·  view source on GitHub ↗
(bot, message)

Source from the content-addressed store, hash-verified

94
95@Client.on_message(filters.command("removepremium") & filters.user(Config.ADMIN))
96async def remove_premium(bot, message):
97 if not bot.premium:
98 return await message.reply_text("premium mode disabled ✅")
99 if len(message.command) == 2:
100 user_id = int(message.command[1]) # Convert the user_id to integer
101 user = await bot.get_users(user_id)
102 if await digital_botz.has_premium_access(user_id):
103 await digital_botz.remove_premium(user_id)
104 await message.reply_text(f"ʜᴇʏ {user.mention}, ᴘʀᴇᴍɪᴜᴍ ᴘʟᴀɴ sᴜᴄᴄᴇssғᴜʟʟʏ ʀᴇᴍᴏᴠᴇᴅ.", quote=True)
105 await bot.send_message(chat_id=user_id, text=f"<b>ʜᴇʏ {user.mention},\n\n✨ ʏᴏᴜʀ ᴀᴄᴄᴏᴜɴᴛ ʜᴀs ʙᴇᴇɴ ʀᴇᴍᴏᴠᴇᴅ ᴛᴏ ᴏᴜʀ ᴘʀᴇᴍɪᴜᴍ ᴘʟᴀɴ\n\nᴄʜᴇᴄᴋ ʏᴏᴜʀ ᴘʟᴀɴ ʜᴇʀᴇ /myplan</b>")
106 else:
107 await message.reply_text("ᴜɴᴀʙʟᴇ ᴛᴏ ʀᴇᴍᴏᴠᴇ ᴘʀᴇᴍɪᴜᴍ ᴜꜱᴇʀ !\nᴀʀᴇ ʏᴏᴜ ꜱᴜʀᴇ, ɪᴛ ᴡᴀꜱ ᴀ ᴘʀᴇᴍɪᴜᴍ ᴜꜱᴇʀ ɪᴅ ?", quote=True)
108 else:
109 await message.reply_text("ᴜꜱᴀɢᴇ : /removepremium ᴜꜱᴇʀ ɪᴅ", quote=True)
110
111
112@Client.on_message(filters.private & filters.command("restart") & filters.user(Config.ADMIN))

Callers

nothing calls this directly

Calls 2

has_premium_accessMethod · 0.80
remove_premiumMethod · 0.80

Tested by

no test coverage detected