Skip to content

Instantly share code, notes, and snippets.

View 4Kaylum's full-sized avatar

Kae Bartlett 4Kaylum

View GitHub Profile
@4Kaylum
4Kaylum / python_discord_pixels.py
Last active May 26, 2021 17:42
A small UI for the Python Discord server's pixels event
import time
import typing
from datetime import datetime as dt, timedelta
import json
import sys
import multiprocessing
from tkinter.colorchooser import askcolor
import requests
import pygame
@4Kaylum
4Kaylum / PerksHandler.py
Last active November 2, 2020 22:36
Some kind of perks handler code for a thing I thought I would use
class flag_value(object):
"""
Define a flag value for the bot
"""
def __init__(self, func):
v = func(None)
flag_value, bit_offset = v
self.flag = flag_value << bit_offset
self.bit_offset = bit_offset
@4Kaylum
4Kaylum / JavaAPIExample.java
Created October 25, 2020 18:35
A lil example on using Java to make REST requests
import com.google.gson.Gson;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
// Let's make this class to represent our response from random.cat
class ImageObject {
public String file;
import math
import re as regex
from datetime import timedelta
from discord.ext import commands
class InvalidTimeDuration(commands.BadArgument):
"""A conversion error for time durations"""
@4Kaylum
4Kaylum / Penance.md
Last active September 3, 2021 08:06

Penance

Penance is a smallo Discord bot made with the intention of helping out your Ark: Survival Evolved server.

The prefix for the bot is configurable via the prefix command, but for all the command examples here, the default prefix (p.) will be shown. Any channels or roles that are mentioned are configurable in the bot via the p.setup command:

A screenshot of the bot's setup command

User Info

@4Kaylum
4Kaylum / trivia.py
Created September 6, 2019 22:29
A bot that gives you a set of random trivia questions
"""A bot that gives you random trivia questions and you have to vote on an answer"""
import random
import asyncio
import html
import discord
from discord.ext import commands
from cogs import utils
@4Kaylum
4Kaylum / christian_minecraft_server.py
Created September 6, 2019 22:29
A bot that, when a user uses a curse word, deletes their message and says "no swearing on my Christian Minecraft server"
"""No swearing on my Christian Minecraft server"""
import json
import discord
from cogs import utils
class ChristianMinecraftServer(utils.Cog):
@4Kaylum
4Kaylum / thanos_snap.py
Created September 6, 2019 22:27
A bot that, when it joins a server, will ban 50% of the population
"""When the bot joins the server, it bans 50% of the population"""
import random
import discord
from cogs import utils
class ThanosSnap(utils.Cogs):
@4Kaylum
4Kaylum / big_ben.py
Created September 6, 2019 22:26
A bot that says "bong" on the hour every hour
"""A bot that says "bong" on the hour every hour"""
from datetime import datetime as dt
import discord
from discord.ext import commands
from discord.ext import tasks
from cogs import utils
@4Kaylum
4Kaylum / everyone_ping.py
Created September 6, 2019 22:25
A cog that pings everyone on the server every 10 seconds
"""Make a bot that pings everyone on the server every 10 seconds"""
import discord
from discord.ext import commands
from discord.ext import tasks
from cogs import utils
class EveryonePing(utils.Cog):