Skip to content

Instantly share code, notes, and snippets.

View Themis3000's full-sized avatar

Themi Megas Themis3000

  • Minneapolis, MN
View GitHub Profile
@Themis3000
Themis3000 / spotify_playlist_retriever.py
Last active September 19, 2021 00:07
Retrieves playlists from spotify with no user auth in python
import requests
def get_current_milliseconds():
dt = datetime.now(timezone.utc).replace(tzinfo=timezone.utc)
return dt.timestamp() / 1000
class Spotify:
def __init__(self):
self.access_token = ""
self.access_token_expiration = 0
@Painezor
Painezor / Checks.py
Last active April 18, 2024 05:22
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()
@EvieePy
EvieePy / bot_example.py
Last active April 24, 2024 09:30
A Cogs Example for the rewrite version of - discord.py
import discord
from discord.ext import commands
import sys, traceback
"""This is a multi file example showcasing many features of the command extension and the use of cogs.
These are examples only and are not intended to be used as a fully functioning bot. Rather they should give you a basic
understanding and platform for creating your own bot.
These examples make use of Python 3.6.2 and the rewrite version on the lib.
@buptxge
buptxge / print_with_win32print.py
Created April 7, 2016 08:38
Print image using win32print and PIL
import win32print
import win32ui
from PIL import Image, ImageWin
PHYSICALWIDTH = 110
PHYSICALHEIGHT = 111
printer_name = win32print.GetDefaultPrinter ()
file_name = "new.jpg"