19 inherit pname version;
22 src = fetchFromGitHub {
25 rev = "refs/tags/v${version}";
26 hash = "sha256-GIwXx7bRCH2+G3zlilJ/Tb8el50SDbxGGX2/1bqL3+U=";
29 build-system = [ setuptools ];
31 dependencies = [ aiohttp ] ++ lib.optionals withVoice [ pynacl ];
33 patchPhase = lib.optionalString withVoice ''
34 substituteInPlace "discord/opus.py" \
35 --replace-fail "ctypes.util.find_library('opus')" "'${libopus}/lib/libopus${stdenv.hostPlatform.extensions.sharedLibrary}'"
37 substituteInPlace "discord/player.py" \
38 --replace-fail "executable: str = 'ffmpeg'" "executable: str = '${lib.getExe ffmpeg}'"
41 # Only have integration tests with discord
44 pythonImportsCheck = [
49 "discord.app_commands"
50 "discord.ext.commands"
55 description = "Python wrapper for the Discord API";
56 homepage = "https://discordpy.rtfd.org/";
57 changelog = "https://github.com/Rapptz/discord.py/blob/v${version}/docs/whats_new.rst";
58 license = lib.licenses.mit;
59 maintainers = with lib.maintainers; [ getpsyched ];