A Cool Help Command - Full example of how it looks in action at the bottom
import discord, discord_colorize
from discord.ext import commands
def setup(bot): | |
bot.loadedCogs.append('cog name') | |
def teardown(bot): | |
bot.loadedCogs.remove('cog name') | |
# https://discordpy.readthedocs.io/en/stable/ext/commands/extensions.html?highlight=load#cleaning-up |
+Thanks for checking my profile out | |
+Contact me at TheOnlyWayUp#1231 |
domain = 'watermark' # just an example of how to use bytesio with PIL, works better if you know more about the images you're using instead of using random ones which can have random dimensions. | |
import aiohttp | |
from urllib.parse import unquote | |
from io import BytesIO | |
from PIL import Image, ImageDraw, ImageFont | |
async def returnRandomCat(): | |
async with aiohttp.ClientSession() as session: | |
async with session.get("https://aws.random.cat/meow") as resp: |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="keywords" content="{{ status_code }}, {{ detail }}"> | |
<meta charset="utf-8"> | |
<meta property="og:title" content=""> |
""" | |
This attempts to abstarct away the standard way of using `__init__`, | |
the problem it tries to solve is the repetetiveness of using init purely | |
to store it's parameters into the instance under the exactly same name, i.e.: | |
class Stock: | |
def __init__(name, shares, price): | |
self.name = name | |
self.shares = shares | |
self.price = price | |
""" |
The goal of this snippet is to help you figure out the email/identity of the person OAUthing to your application. Made this to help out anyone else that's trying to do the same thing.
main.py
- Just a short aiohttp snippet regarding what requests you need to make to get the access token, and the user's information.
example_usage.py
- A FastAPI implementation of this.
NOTE = You need to select the server based applications
option when creating your Application at Zoho's Console. Then you need to run a webserver, add that server's domain (you need to have a domain iirc) as an authorized redirect url. Think your_domain.com/callback
.
class UserList: | |
def __init__(self, initlist: list = []): | |
self.data = initlist | |
class FiboList(UserList): | |
def __init__(self): | |
super().__init__([0, 1]) | |
def __next__(self): | |
sum_ = sum(self.data) |
<script> | |
export let HTMLParent; <!-- Declares HTMLParent as a prop --> | |
let DataTheme = "business"; | |
HTMLParent.setAttribute('data-theme', DataTheme) <!-- Sets the data-theme attribute on the HTML Tag to the value of DataTheme, leading to `<HTML data-theme="business">`. | |
</script> | |
<!-- | |
That's it, we've managed to grab and modify the top-level <HTML> Tag. You can make further modifications to it by accessing the HTMLParent variable |
a[rel="noopener noreferrer"] { | |
background: url(get_sent_req_on_load_url); | |
background-color: slategray; | |
} | |
a[rel="noopener noreferrer"]:after { | |
background-color: blue; | |
content: '\AHi!'; | |
display: block; | |
} |