sudo apt install nanosudo pacman -S nano| from asyncio import sleep, get_event_loop, get_running_loop | |
| from multiprocessing import Process | |
| # Simple callback function | |
| async def my_callback_func(): | |
| print(f"Doing something in the background!") | |
| await sleep(1) | |
| # Run the callback function in a loop as you need to use async / await |
| import requests | |
| def get_spam_unicode_char_count(text): | |
| req = requests.get(f"https://nexa-apis.herokuapp.com/unicode?text={text}").json() | |
| if req["status"] == "Ok": | |
| return req["data"] | |
| else: | |
| return None | |
| uc = get_spam_unicode_char_count("Is this even a spam?")["count"] |
| import requests | |
| def search_ud(q): | |
| req = requests.get(f"https://nexa-apis.herokuapp.com/ud?query={q}").json() | |
| if req["status"] == "Ok": | |
| return req["data"] | |
| else: | |
| return None | |
| def_txt = """ |
| import requests | |
| def search_and_get_wallpapers(q="aesthetic"): | |
| """ | |
| q - The name (query) you want to search about | |
| """ | |
| if q: | |
| req = requests.get(f"https://nexa-apis.herokuapp.com/wallpaper?query={q}").json() | |
| else: | |
| req = requests.get("https://nexa-apis.herokuapp.com/wallpaper").json() |
| import requests | |
| def search_reddit_posts(q, sub_reddit=None): | |
| if sub_reddit: | |
| req = requests.get(f"https://nexa-apis.herokuapp.com/reddit?query={q}&subreddit={sub_reddit}").json() | |
| else: | |
| req = requests.get(f"https://nexa-apis.herokuapp.com/reddit?query={q}").json() | |
| if req["status"] == "Ok": | |
| return req["data"] | |
| else: |
| import requests | |
| def get_random_anime_wallpaper(q=None): | |
| """ | |
| q - The name (query) you want to search about | |
| """ | |
| if q: | |
| req = requests.get(f"https://nexa-apis.herokuapp.com/anime_wall?query={q}").json() | |
| else: | |
| req = requests.get("https://nexa-apis.herokuapp.com/anime_wall").json() |
| import requests | |
| def translate_text(text, dest): | |
| req = requests.get(f"https://nexa-apis.herokuapp.com/tr?text={text}&dest_lang={dest}").json() | |
| if req["status"] == "Ok": | |
| return req["data"] | |
| else: | |
| return None | |
| trans = translate_text("Hi!", "es") |
| ======= In Ubuntu ======= | |
| apt install ffmpeg |
| # Simple Plugin to Remove Forward tag From a Message. Powered by Pyrogram | |
| # Idea by - https://github.com/lntechnical2 | |
| from pyrogram import Client, filters | |
| from pyrogram.types import Message | |
| @Client.on_message(filters.command("rm_tag") & ~filters.edited & filters.private) | |
| async def rmforwdtag(client: Client, message: Message): | |
| replied_msg = message.reply_to_message | |
| rmtag_chat = message.chat.id |