constants.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # New file
  2. from wbb import app, BOT_USERNAME
  3. from pyrogram.filters import command, edited
  4. from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
  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. <b>Example:</b>
  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("Click on the below button to get markdown usage syntax in pm!", reply_markup=keyb)
  38. else:
  39. await m.reply(MARKDOWN, parse_mode="html")
  40. return