Skip to main content

discordify

Downloads

A Python package to retrieve detailed Spotify album images for Discord integration.

example.py

import discord
from discord.ext import commands
from discordify import Spotify, emojify_image

bot = commands.Bot(
    command_prefix=",",
    intents=discord.Intents.all(),
    allowed_mentions=discord.AllowedMentions.none()
)

@bot.command(name="spotify")
async def _spotify(ctx: commands.Context, member: discord.Member = None):
    member = member or ctx.author
    client = Spotify(bot=bot, member=member)
    content, image, view = await client.get()
    await ctx.reply(content=content, file=image, view=view)


@bot.command(name="emojify")
async def _emojify(ctx, url: Union[discord.Member, str], size: int = 14):
    if not isinstance(url, str):
        url = url.display_avatar.url

    def get_emojified_image():
        r = requests.get(url, stream=True)
        image = Image.open(r.raw).convert("RGB")
        res = emojify_image(image, size)

        if size > 14:
            res = f"```{res}```"
        return res

    result = await bot.loop.run_in_executor(None, get_emojified_image)
    await ctx.send(result)

bot.run("token")

Comparision:

discord

discord

spotify mobile notification

notification

Emojify

Emojify is directly taken and modified from codewithswastik/emojify-bot

Metadata

Release files for discordify 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for discordify 0.1.2
File Size Uploaded
discordify-0.1.2.tar.gz 54.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for discordify 0.1.2
File Interpreter ABI Platform
discordify-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 107.0 kB

Release files / discordify-0.1.2.tar.gz

Download URL discordify-0.1.2.tar.gz
Size 54.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9fcaa6dd2ddbe1bfaf211bcd85a52362302cf189dacb800361c4cc6d051ec575
BLAKE2b-256 checksum
How to use checksums
eb4a350011dae94ed9c6a098f7a20c7f6e6b9615bb01fb2ffceb9a89967b06ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / discordify-0.1.2-py3-none-any.whl

Download URL discordify-0.1.2-py3-none-any.whl
Size 52.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a6a7e37c83ed0ff133698397e3ba79b959b55838411eb73bea4b45c007e951a
BLAKE2b-256 checksum
How to use checksums
b6f8ea99bd8dfc35f9e448764eb25530b74a98d87cb79c1802e6a1bc23ce3581
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page