GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — PyrogramBot/PyrogramBot/modules/fun.py at Alpha · TheCodents/PyrogramBot Expand file tree/ Copy pathfun.pyMore file actions 37 lines (27 loc) · 1.43 KB / Copy pathfun.pyFile metadata and controls37 lines (27 loc) · 1.43 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 import pyjokes from quoters import Quote from pyrogram import filters from PyrogramBot import app __MODULE__ = "Fun" __HELP__ = """/quote - Get Quotes\n/joke - Get Jokes\n**Lastly:**\n**Press F** replying someone and check Yourself Okay!""" #Using External Modules like 'pyjokes' and 'quoters' # ShortCut for Long Codes with Repeating Functions jokes = pyjokes.get_joke # You can use this when you have to use the same thing over and over again sometimes, Like For Example, pyjokes.get_joke(language="hi", category="neutral"), pyjokes.get_joke(language="en", category="neutral"), Then Instead of writting 'pyjokes.get_joke' you use your pre-defined function 'jokes' in place of that. @app.on_message(filters.command(["joke"])) async def crackjoke(_, message): joke = jokes(language="en", category="neutral") await message.reply_text(joke) # Simple way for short codes with single use functions @app.on_message(filters.command(["quote"])) async def quoter(_, message): quote = Quote.print() await message.reply_text(quote) # Example Of Simple Regex Use From @SupMeta_Bot @app.on_message(filters.regex(["(?i)f"])) async def f(_, message): if (len(message.text) != 1): return if message.reply_to_message: await message.reply_to_message.reply_text("**Press F** To Pay Respect to This **LeJhand**", parse_mode="markdown") else: await message.reply_text("Pay Respect to Whom??, Reply to Someone's Message!") |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |