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

Function send_msg

plugins/admin.py:261–279  ·  view source on GitHub ↗
(user_id, message)

Source from the content-addressed store, hash-verified

259 await sts_msg.edit(f"Bʀᴏᴀᴅᴄᴀꜱᴛ Cᴏᴍᴩʟᴇᴛᴇᴅ: \nCᴏᴍᴩʟᴇᴛᴇᴅ Iɴ `{completed_in}`.\n\nTᴏᴛᴀʟ Uꜱᴇʀꜱ {total_users}\nCᴏᴍᴩʟᴇᴛᴇᴅ: {done} / {total_users}\nSᴜᴄᴄᴇꜱꜱ: {success}\nFᴀɪʟᴇᴅ: {failed}")
260
261async def send_msg(user_id, message):
262 try:
263 await message.copy(chat_id=int(user_id))
264 return 200
265 except FloodWait as e:
266 await asyncio.sleep(e.value)
267 return send_msg(user_id, message)
268 except InputUserDeactivated:
269 logger.info(f"{user_id} : Dᴇᴀᴄᴛɪᴠᴀᴛᴇᴅ")
270 return 400
271 except UserIsBlocked:
272 logger.info(f"{user_id} : Bʟᴏᴄᴋᴇᴅ Tʜᴇ Bᴏᴛ")
273 return 400
274 except PeerIdInvalid:
275 logger.info(f"{user_id} : Uꜱᴇʀ Iᴅ Iɴᴠᴀʟɪᴅ")
276 return 400
277 except Exception as e:
278 logger.error(f"{user_id} : {e}")
279 return 500

Callers 1

broadcast_handlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected