This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import win32print | |
import win32ui | |
from PIL import Image, ImageWin | |
PHYSICALWIDTH = 110 | |
PHYSICALHEIGHT = 111 | |
printer_name = win32print.GetDefaultPrinter () | |
file_name = "new.jpg" |