MCPcopy Create free account
hub / github.com/TechifyBots/File-Stream-Bot / do_unban

Function do_unban

biisal/bot/plugins/commands.py:168–189  ·  view source on GitHub ↗
(bot ,  message)

Source from the content-addressed store, hash-verified

166
167@StreamBot.on_message(filters.command('unban') & filters.user(Var.OWNER_ID))
168async def do_unban(bot , message):
169 userid = message.text.split(" ", 2)[1] if len(message.text.split(" ", 1)) > 1 else None
170 if not userid:
171 return await message.reply('ɢɪᴠᴇ ᴍᴇ ᴀɴ ɪᴅ\nᴇx : <code>/unban 1234567899<code>')
172 text = await message.reply("<b>ʟᴇᴛ ᴍᴇ ᴄʜᴇᴄᴋ 🥱</b>")
173 unban_chk = await db.is_unbanned(userid)
174 if unban_chk == True:
175 await text.edit(text=f'<b><code>{userid}</code> ɪs ᴜɴʙᴀɴɴᴇᴅ\nSʜᴏᴜʟᴅ I sᴇɴᴅ ᴛʜᴇ ʜᴀᴘᴘʏ ɴᴇᴡs ᴀʟᴇʀᴛ ᴛᴏ ᴛʜᴇ ᴜɴʙᴀɴɴᴇᴅ ᴜsᴇʀ?</b>',
176 reply_markup=InlineKeyboardMarkup(
177 [
178 [
179 InlineKeyboardButton("ʏᴇs ✅", callback_data=f"sendUnbanAlert_{userid}"),
180 InlineKeyboardButton("ɴᴏ ❌", callback_data=f"NoUnbanAlert_{userid}"),
181 ],
182 ]
183 ),
184)
185
186 elif unban_chk==False:
187 await text.edit('<b>ᴜsᴇʀ ɪs ɴᴏᴛ ʙᴀɴɴᴇᴅ ʏᴇᴛ.</b>')
188 else :
189 await text.edit(f"<b>ғᴀɪʟᴇᴅ ᴛᴏ ᴜɴʙᴀɴ ᴜsᴇʀ/ᴄʜᴀɴɴᴇʟ.\nʀᴇᴀsᴏɴ : {unban_chk}</b>")
190
191@StreamBot.on_callback_query()
192async def cb_handler(client, query):

Callers

nothing calls this directly

Calls 1

is_unbannedMethod · 0.80

Tested by

no test coverage detected