constants.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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> : This will show as <b>bold</b> text.
  13. <code>~~strike~~</code>: This will show as <strike>strike</strike> text.
  14. <code>__italic__</code>: This will show as <i>italic</i> text.
  15. <code>--underline--</code>: This will show as <u>underline</u> text.
  16. <code>`code words`</code>: This will show as <code>code</code> text.
  17. <code>||spoiler||</code>: This will show as <spoiler>Spoiler</spoiler> text.
  18. <code>[hyperlink](google.com)</code>: This will create a <a href='https://www.google.com'>hyperlink</a> text.
  19. <b>Note:</b> You can use both markdown & html tags.
  20. <u>Button formatting:</u>
  21. -> text ~ [button text, button link]
  22. <u>Example:</u>
  23. <b>example</b> <i>button with markdown</i> <code>formatting</code> ~ [button text, https://google.com]
  24. """
  25. @app.on_message(command("markdownhelp") & ~edited)
  26. async def mkdwnhelp(_, m: Message):
  27. keyb = InlineKeyboardMarkup(
  28. [
  29. [
  30. InlineKeyboardButton(
  31. text="Click Here!",
  32. url=f"http://t.me/{BOT_USERNAME}?start=mkdwn_help",
  33. )
  34. ]
  35. ]
  36. )
  37. if m.chat.type != "private":
  38. await m.reply(
  39. "Click on the below button to get markdown usage syntax in pm!",
  40. reply_markup=keyb,
  41. )
  42. else:
  43. await m.reply(
  44. MARKDOWN, parse_mode="html", disable_web_page_preview=True
  45. )
  46. return