Skip to content

Instantly share code, notes, and snippets.

View Kanin's full-sized avatar
🦊
The day we have world peace is the day I will finish a project.

Kanin Kanin

🦊
The day we have world peace is the day I will finish a project.
View GitHub Profile
@Kanin
Kanin / keybase.md
Last active September 9, 2020 17:56
Gist for Keybase verification

Keybase proof

I hereby claim:

  • I am Kanin on github.
  • I am kanin (https://keybase.io/kanin) on keybase.
  • I have a public key whose fingerprint is 2B8D 0B2D 37E4 B57A DE05 317E 136F E8EB 26D2 CA71

To claim this, I am signing this object:

"enchantColours": [
"(Aqua Affinity|Flame|Piercing|Rainbow|Replenish|Silk Touch|Smelting Touch|Telekinesis|True Protection):\u003d:1:6",
"(Fire Aspect|Frost Walker|Knockback|Punch):\u003d:2:6",
"(Depth Strider|Fortune|Impaling|Respiration|Sugar Rush|Thorns):\u003d:3:6",
"(Chance|Experience|Snipe):\u003d:4:6",
"(Aiming|Big Brain|Blessing|Chance|Counter-Strike|Delicate|Dragon Hunter|Efficiency|First Strike|Life Steal|Looting|Overload|Rejuvenate|Respite|Scavenger|Smarty Pants|Syphon|Triple-Strike|Turbo-(Cacti|Cane|Carrot|Coco|Melon|Mushrooms|Potato|Pumpkin|Warts|Wheat)|Vicious):\u003d:5:6",
"(Angler|Caster|Cleave|Cubism|Dragon Tracer|Execute|Frail|Harvesting|Lethality|Luck of the Sea|Lure|Magnet|Prosecute|Spiked Hook|Thunderbolt|Thunderlord|Vampirism|Venomous):\u003d:6:6",
"Efficiency:\u003d:6:6",
"(Bane of Arthropods|Blast Protection|Critical|Ender Slayer|Fire Protection|Giant Killer|Growth|Luck|Power|Projectile Protection|Protection|Sharpness|Smite|Titan Kill
@tasks.loop(hours=1)
async def birthday_handler(self): # sourcery no-metrics
now = datetime.utcnow()
if self.day != now.day:
self.day = now.day
self.first = True
data = await self.bot.pool.fetch(
"SELECT * FROM birthdays WHERE extract(month from birthday) = $1 AND extract(day from birthday) = $2",
from datetime import datetime, timezone
import discord
from discord import Option, OptionChoice
from discord.ext import commands, tasks
from bot import Bot
month_choices = [
OptionChoice(name="January", value=1),
import asyncio
import re
from datetime import datetime, timedelta
import discord
from discord.ext import commands
from bot import Bot
from utils import checks
from utils.ctx import Context
@commands.command()
async def profile(self, ctx: Context, user: discord.Member = None):
user = user or ctx.author
canvas_size = (600, 600)
background = Editor(Canvas(canvas_size, color=(35, 35, 35)))
user_data = await self.bot.pool.fetchrow(
"""SELECT * FROM (
SELECT row_number() OVER (
ORDER BY text_xp + voice_xp DESC) AS rank, * FROM levels ORDER BY text_xp + voice_xp DESC)
AS _ WHERE user_id = $1""",
@commands.command()
async def profile(self, ctx: Context, user: discord.Member = None):
user = user or ctx.author
canvas_size = (600, 600)
background = Editor(Canvas(canvas_size, color=(35, 35, 35)))
user_data = await self.bot.pool.fetchrow(
"""SELECT * FROM (
SELECT row_number() OVER (
ORDER BY text_xp + voice_xp DESC) AS rank, * FROM levels ORDER BY text_xp + voice_xp DESC)
AS _ WHERE user_id = $1""",
__author__ = "Kanin (https://github.com/Kanin)"
__copyright__ = "Copyright (C) 2022 Kanin"
__license__ = "Public Domain"
__version__ = "1.0"
import os
from pathlib import Path
import discord
from PIL import Image