Skip to content

Instantly share code, notes, and snippets.

// This is a hack, a quick and dirty console script for RT/tweets (with replies) removal w/o API
// To be used in: https://twitter.com/Username/with_replies
// Set your username (without @) below (case-sensitive) to correctly trigger the right Menu
const tweetUser = 'Username'
// BUG, With above we still trigger Menu on some replies but relatively harmless.
// @Hack Implement simple has() for querySelector
const querySelectorHas = function( parent, child ){
#!/usr/bin/env python3
# Recursively generate index.html files for
# all subdirectories in a directory tree
##########################################################################
## ❗️❗️❗️ WARNING: This version is outdated and unmaintained!
## For an up-to-date version with cleaner CSS styling see:
## https://gist.github.com/glowinthedark/625eb4caeca12c5aa52778a3b4b0adb4
##########################################################################
@AwSkies
AwSkies / cooldown_with_whitelist.py
Last active April 13, 2023 17:59
commands with whitelisted cooldowns for discord.py rewrite
import discord
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
bot = commands.Bot(command_prefix = "your prefix here")
token = 'token goes here'
#on ready login message
@bot.event
async def on_ready():
@wilfreddv
wilfreddv / discord_py_cookbook.md
Last active November 2, 2021 20:32
A cookbook for getting started with discord.py rewrite

This is not being maintained and might be outdated. Use at your own risk.

Cookbook for discord.py rewrite

This document contains snippets that I've used and tested. It's not meant to be an official guide, but rather a document for looking up small snippets of code. For an extensive reference on the API, please visit the official documentation.

Contents

@MPThLee
MPThLee / enableDiscordExperiments.js
Last active November 14, 2024 22:15
This code doesn't work anymore. I just decided to remove this code. You can check working code on comments.
/**
* !!!! This code doesn't work anymore !!!!
*
* - You can check working code on comments. I won't update this code anymore.
*
* Also, I just decided to remove this code. You can check revisions for old code.
* Since this code was made for discord client that almost 5 years ago, It seems like doesn't work anymore.
* I don't want people keep arguing in the comments, i decided to remove this code.
*
* Note: This code is now fulfilled with Javascript comments. This code won't work even if you pasted to console. doesn't do anything.
@stewartadam
stewartadam / main.py
Last active September 9, 2024 12:41 — forked from gear11/main.py
Simple Python proxy server based on Flask and Requests with support for GET and POST requests.
"""
A simple proxy server, based on original by gear11:
https://gist.github.com/gear11/8006132
Modified from original to support both GET and POST, status code passthrough, header and form data passthrough.
Usage: http://hostname:port/p/(URL to be proxied, minus protocol)
For example: http://localhost:5000/p/www.google.com
"""
import re
@Bilka2
Bilka2 / webhook.py
Last active October 12, 2024 18:57
Simple discord webhook with python
import requests # dependency
url = "<your url>" # webhook url, from here: https://i.imgur.com/f9XnAew.png
# for all params, see https://discordapp.com/developers/docs/resources/webhook#execute-webhook
data = {
"content" : "message content",
"username" : "custom username"
}
@EvieePy
EvieePy / music.py
Last active July 22, 2024 16:49
Basic music with playlist support on Rewrite
"""
Please understand Music bots are complex, and that even this basic example can be daunting to a beginner.
For this reason it's highly advised you familiarize yourself with discord.py, python and asyncio, BEFORE
you attempt to write a music bot.
This example makes use of: Python 3.6
For a more basic voice example please read:
https://github.com/Rapptz/discord.py/blob/rewrite/examples/basic_voice.py
@theonlytruegod
theonlytruegod / Quizlet Match Hack Code (use tampermonkey chrome extension)
Last active June 30, 2024 13:59
MOST LIKELY NOT WORKING, I AM NO LONGER UPDATING THIS!!!
// ==UserScript==
// @name Quizlet Match Hack
// @namespace Gabe B. Talafous
// @version 1.6
// @description The time will freeze at 0.5 and the answers will be the same color
// @author You
// @match https://quizlet.com/*/*
// @grant none
// @license MIT
// ==/UserScript==
@Painezor
Painezor / Checks.py
Last active November 1, 2024 18:21
Built-in Checks for the commands extension of discord py
@commands.guild_only()
# Command cannot be used in private messages.
@commands.dm_only()
# Command can only be used in private messages.
@commands.is_owner()
# Command can only be used by the bot owner.
@commands.is_nsfw()