constants.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # New file
  2. from pyrogram.filters import command, edited
  3. from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
  4. from wbb import BOT_USERNAME, app
  5. MARKDOWN = """
  6. Read the below text carefully to find out how formatting works!
  7. <u>Supported Fillings:</u>
  8. <code>{name}</code> - This will mention the user with their name.
  9. <code>{chat}</code> - This will fill with the current chat name.
  10. NOTE: Fillings only works in greetings module.
  11. <u>Supported formatting:</u>
  12. <code>**Bold**</code> : Creates <b>bold</b> text.
  13. <code>~~strike~~</code>: Creates <strike>striked</strike> text.
  14. <code>__italic__</code>: Creates <i>italic</i> text.
  15. <code>--underline--</code>: Creates <u>underline</u> text.
  16. <code>`code words`</code>: Creates <code>code words</code> text.
  17. <code>[hyperlink](google.com)</code>: Creates <a href='https://www.google.com'>hyperlink</a> text.
  18. <b>Note:</b> You can use both markdown & html tags.
  19. <u>Button formatting:</u>
  20. -> text ~ [button text, button link]
  21. <u>Example:</u>
  22. <b>example</b> <i>button with markdown</i> <code>formatting</code> ~ [button text, https://google.com]
  23. """
  24. @app.on_message(command("markdownhelp") & ~edited)
  25. async def mkdwnhelp(_, m: Message):
  26. keyb = InlineKeyboardMarkup(
  27. [
  28. [
  29. InlineKeyboardButton(
  30. text="Click Here!",
  31. url=f"http://t.me/{BOT_USERNAME}?start=mkdwn_help",
  32. )
  33. ]
  34. ]
  35. )
  36. if m.chat.type != "private":
  37. await m.reply(
  38. "Click on the below button to get markdown usage syntax in pm!",
  39. reply_markup=keyb,
  40. )
  41. else:
  42. await m.reply(MARKDOWN, parse_mode="html")
  43. return