Skip to content

Instantly share code, notes, and snippets.

View TheOnlyWayUp's full-sized avatar
📰
Democratizing information

Dhanush R TheOnlyWayUp

📰
Democratizing information
View GitHub Profile
@kkrypt0nn
kkrypt0nn / ansi-colors-discord.md
Last active May 13, 2025 13:19
A guide to ANSI on Discord

A guide to ANSI on Discord

Discord is now slowly rolling out the ability to send colored messages within code blocks. It uses the ANSI color codes, so if you've tried to print colored text in your terminal or console with Python or other languages then it will be easy for you.

Quick Explanation

To be able to send a colored text, you need to use the ansi language for your code block and provide a prefix of this format before writing your text:

\u001b[{format};{color}m
@lykn
lykn / buttons.md
Last active May 13, 2025 10:01
A gist which shows/tells you how to make buttons using discord.py v2(version 2.0.0a)

Note: Before we go any further. Let me make this real clear that the following gist uses the OFFICIAL discord.py library and not forks like discord_components, nextcord, etc... So when your using this code but a different library and fuck up don't comment something mean or go to a help channel in the server and say "this gist is misleading" or "bad gist who wrote this" when your at fault, trust me I'm going to fuck you up😅

Just a reminder^^

Related Links:

DPY's Docs

Discord's Docs

Fun fact : a lightbulb has been on since 1901 in a region of siberia. Ivan Popov discovered that electricity could be extracted from the ground in the region as the soil is mineral rich, and the water table is high. This discovery has allowed the earth to accomplish this remarkable feat

Fun fact : the covalent character of ionic bonds was discovered as a result of a similar mathematical error. George Smith made a mathematical error while calculating the lattice energy of a compound, and ended up with the result he expected despite the error. When his assistant discovered the error, he devised the theory used today

Fun fact : Hydrated salts were the result of a paranoid geologist. Johnathan Everard began the practice of baking samples obtained in the field to kill microbes, believing that doing so would prevent him from contracting tetanus. A difference in mass before and after baking observed with one of the samples led him to this path paving discovery

Fun fact : In 2015 Dalia Scott, a student at the M

@AkshuAgarwal
AkshuAgarwal / webhook.py
Last active April 13, 2024 17:02
Send Message using Discord Webhooks by making request or using discord.py
"""Making a post request to Webhook, without using discord.py"""
import aiohttp
webhook_url = "your_webhook's_url" # URL of the Webhook (make sure NOT TO SHARE IT WITH ANYONE.)
# JSON data to send to the Webhook.
# You can find the data payload at https://discord.com/developers/docs/resources/webhook#execute-webhook
data = {
'content': 'Hello, world!',
@Mearman
Mearman / cloudflare_whitelist.sh
Last active February 25, 2024 15:23
NGINX Cloudflare Access whitelist
#!/bin/bash
cd /mnt/user/appdata/NginxProxyManager/nginx
echo "IPV4" >> new.conf
echo "" >> new.conf
curl -sSL https://www.cloudflare.com/ips-v4 | awk '{print "allow",$1,";"}' >> new.conf
echo "IPV6" >> new.conf
echo "" >> new.conf
curl -sSL https://www.cloudflare.com/ips-v6 | awk '{print "allow",$1,";"}' >> new.conf

Breaking Changes of discord.py 2.0

These are the breaking changes of discord.py version 2.0.

"Breaking change" includes:

  • [R]emoval: a feature is removed.
  • [N]ame changes: a feature is renamed.
  • [B]ehavior: something does not behave the way they did in 1.x.
  • [T]yping: types of arguments, attributes or return values changes in an incompatible way. (e.g. None disallowed for argument)
  • [S]yntax: a syntax previously allowed for an operation is no longer allowed. (e.g. positional only arguments, new required arguments)
@izxxr
izxxr / README.MD
Last active March 22, 2025 11:06
Discord.py Webhook Guide (Both async and sync).

⚠️ Notice

This guide is for discord.py 1.7 version. In upcoming v2.0, Webhooks were greatly overhauled and in fact simplified a lot. They no longer require adapters. Usage of webhooks is now quite straight forward. As such, this guide is now outdated and should not be followed.

Furthermore, this guide is focused on discord.py. No support for forks are covered in this guide.

Basic Webhooks Example using Discord.py (Rewrite)

Webhooks are a great way to send messages to Discord without having a bot account. You just need a webhook URL and just do a POST request on that URL and the message will be sent to discord.

Webhooks can also be used if your bot has to send messages to a channel a lot. For example, If your bot has event logging so everytime having to fetch channel and sending can be slow so you can use some webhook magic.

@ItsDrike
ItsDrike / 1_basic_autoinit.py
Last active May 6, 2022 22:06
Python auto_init
"""
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
"""
@InterStella0
InterStella0 / HelpCommand_walkthrough_guide.md
Last active March 1, 2025 19:04
Walkthrough guide on subclassing HelpCommand
@Rafastoievsky
Rafastoievsky / cleaningdatafunctions.py
Created November 2, 2020 02:45
WhatsApp Group chat analysis: cleaning data functions
def startsWithDateAndTime(s):
pattern = '^\d{1,2}/\d{1,2}/\d{1,2}, \d{1,2}:\d{1,2}\S [AaPp][Mm] -'
result = re.match(pattern, s)
if result:
return True
return False
def FindAuthor(s):
patterns = [
'([\w]+):', # Nombre