discordify


Namediscordify JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/iayushanand/discordify
SummaryA Python package to retrieve detailed Spotify album images and emojify images for Discord integration.
upload_time2023-09-24 09:07:53
maintainer
docs_urlNone
authorAyu Itz
requires_python>=3.6
license
keywords discord spotify spotify-wrapper image
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # discordify

[![Downloads](https://static.pepy.tech/badge/cbvx)](https://pepy.tech/project/cbvx)

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



`example.py`
```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](https://media.discordapp.net/attachments/766518336329744415/1148991813399621773/IMG_20230906_201232.png?width=469&height=300)

`spotify mobile notification`
    
![notification](https://media.discordapp.net/attachments/766518336329744415/1148991813118595182/IMG_20230906_201113.jpg?width=541&height=406)


### Emojify

![](https://media.discordapp.net/attachments/743817386792058971/1152893621239021598/image.png?width=382&height=265)

*Emojify is directly taken and modified from [codewithswastik/emojify-bot](https://github.com/CodeWithSwastik/emojify-bot)*

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/iayushanand/discordify",
    "name": "discordify",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "discord spotify spotify-wrapper image",
    "author": "Ayu Itz",
    "author_email": "icontactayu@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/eb/4a/350011dae94ed9c6a098f7a20c7f6e6b9615bb01fb2ffceb9a89967b06ec/discordify-0.1.2.tar.gz",
    "platform": null,
    "description": "# discordify\n\n[![Downloads](https://static.pepy.tech/badge/cbvx)](https://pepy.tech/project/cbvx)\n\nA Python package to retrieve detailed Spotify album images for Discord integration.\n\n\n\n`example.py`\n```py\nimport discord\nfrom discord.ext import commands\nfrom discordify import Spotify, emojify_image\n\nbot = commands.Bot(\n    command_prefix=\",\",\n    intents=discord.Intents.all(),\n    allowed_mentions=discord.AllowedMentions.none()\n)\n\n@bot.command(name=\"spotify\")\nasync def _spotify(ctx: commands.Context, member: discord.Member = None):\n    member = member or ctx.author\n    client = Spotify(bot=bot, member=member)\n    content, image, view = await client.get()\n    await ctx.reply(content=content, file=image, view=view)\n\n\n@bot.command(name=\"emojify\")\nasync def _emojify(ctx, url: Union[discord.Member, str], size: int = 14):\n    if not isinstance(url, str):\n        url = url.display_avatar.url\n\n    def get_emojified_image():\n        r = requests.get(url, stream=True)\n        image = Image.open(r.raw).convert(\"RGB\")\n        res = emojify_image(image, size)\n\n        if size > 14:\n            res = f\"```{res}```\"\n        return res\n\n    result = await bot.loop.run_in_executor(None, get_emojified_image)\n    await ctx.send(result)\n\nbot.run(\"token\")\n```\n\n### Comparision:\n\n`discord`\n\n![discord](https://media.discordapp.net/attachments/766518336329744415/1148991813399621773/IMG_20230906_201232.png?width=469&height=300)\n\n`spotify mobile notification`\n    \n![notification](https://media.discordapp.net/attachments/766518336329744415/1148991813118595182/IMG_20230906_201113.jpg?width=541&height=406)\n\n\n### Emojify\n\n![](https://media.discordapp.net/attachments/743817386792058971/1152893621239021598/image.png?width=382&height=265)\n\n*Emojify is directly taken and modified from [codewithswastik/emojify-bot](https://github.com/CodeWithSwastik/emojify-bot)*\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A Python package to retrieve detailed Spotify album images and emojify images for Discord integration.",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/iayushanand/discordify"
    },
    "split_keywords": [
        "discord",
        "spotify",
        "spotify-wrapper",
        "image"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b6f8ea99bd8dfc35f9e448764eb25530b74a98d87cb79c1802e6a1bc23ce3581",
                "md5": "4e378805f7a08bb8cb96ccde32aa0319",
                "sha256": "4a6a7e37c83ed0ff133698397e3ba79b959b55838411eb73bea4b45c007e951a"
            },
            "downloads": -1,
            "filename": "discordify-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4e378805f7a08bb8cb96ccde32aa0319",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 52370,
            "upload_time": "2023-09-24T09:07:51",
            "upload_time_iso_8601": "2023-09-24T09:07:51.611700Z",
            "url": "https://files.pythonhosted.org/packages/b6/f8/ea99bd8dfc35f9e448764eb25530b74a98d87cb79c1802e6a1bc23ce3581/discordify-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eb4a350011dae94ed9c6a098f7a20c7f6e6b9615bb01fb2ffceb9a89967b06ec",
                "md5": "ab7efc8e4213539827361b7467d92f97",
                "sha256": "9fcaa6dd2ddbe1bfaf211bcd85a52362302cf189dacb800361c4cc6d051ec575"
            },
            "downloads": -1,
            "filename": "discordify-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "ab7efc8e4213539827361b7467d92f97",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 54655,
            "upload_time": "2023-09-24T09:07:53",
            "upload_time_iso_8601": "2023-09-24T09:07:53.450465Z",
            "url": "https://files.pythonhosted.org/packages/eb/4a/350011dae94ed9c6a098f7a20c7f6e6b9615bb01fb2ffceb9a89967b06ec/discordify-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-24 09:07:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "iayushanand",
    "github_project": "discordify",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "discordify"
}
        
Elapsed time: 0.11868s