constants.py 1.8 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. * will be more soon!
  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 for formatting and can use\
  19. telegram's native formatter to format a text and can do a lot of experimental stuffs!
  20. <u>Button formatting:</u>
  21. -> text ~ [button text, button link]
  22. <b>Example:</b>
  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("Click on the below button to get markdown usage syntax in pm!", reply_markup=keyb)
  39. else:
  40. await m.reply(MARKDOWN, parse_mode="html")
  41. return