misc.py 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. from pyrogram.types import Message
  2. from wbb import app
  3. from wbb.utils import cust_filter, random_line
  4. __MODULE__ = "Misc"
  5. __HELP__ = "/commit - Generate Funny Commit Messages\n" \
  6. "/runs - Idk Test Yourself\n" \
  7. "/quote - Get Random Linux Quotes\n" \
  8. "/id - Get Chat_ID or User_ID\n" \
  9. "/dev - Forward Anything To Developers [SPAM = GBAN]"
  10. @app.on_message(cust_filter.command(commands=("commit")))
  11. async def commit(client, message: Message):
  12. await message.reply_text((await random_line('wbb/utils/commit.txt')))
  13. @app.on_message(cust_filter.command(commands=("runs")))
  14. async def runs(client, message: Message):
  15. await message.reply_text((await random_line('wbb/utils/runs.txt')))
  16. @app.on_message(cust_filter.command(commands=("quote")))
  17. async def quote(client, message: Message):
  18. await message.reply_text((await random_line('wbb/utils/quotes.txt')))
  19. @app.on_message(cust_filter.command(commands=("id")))
  20. async def get_id(client, message: Message):
  21. app.set_parse_mode("markdown")
  22. if message.text != '/id':
  23. username = message.text.replace('/id', '')
  24. user_id = (await app.get_users(username)).id
  25. msg = f"{username}'s ID is `{user_id}`"
  26. await message.reply_text(msg)
  27. elif message.text == '/id' and not bool(message.reply_to_message):
  28. chat_id = message.chat.id
  29. msg = f"{message.chat.title}'s ID is `{chat_id}`"
  30. await message.reply_text(msg)
  31. elif message.text == '/id' and bool(message.reply_to_message):
  32. from_user_id = message.reply_to_message.from_user.id
  33. from_user_mention = message.reply_to_message.from_user.mention
  34. msg = f"{from_user_mention}'s ID is `{from_user_id}`"
  35. await message.reply_text(msg)
  36. @app.on_message(cust_filter.command(commands=("dev")))
  37. async def dev(client, message: Message):
  38. app.set_parse_mode("markdown")
  39. await message.reply_to_message.forward('WBBSupport')
  40. await app.send_message("WBBSupport",
  41. f"Forwarded By: `{message.from_user.id}` | {message.from_user.mention}\n"
  42. f"Forwarded From: `{message.chat.id}` | {message.chat.title}")
  43. await message.reply_text("Your Message Has Been Forward To Devs,"
  44. + " Any Missuse Of This Feature Will Not"
  45. + " Be Tolerated And You Will Be"
  46. + " Gbanned instantaneously!")