diff options
20 files changed, 160 insertions, 2 deletions
@@ -5,6 +5,7 @@ name = "pypi" [packages] "discord.py" = {ref = "rewrite", git = "https://github.com/Rapptz/discord.py"} +pynacl = "*" [dev-packages] "flake8" = "*" diff --git a/Pipfile.lock b/Pipfile.lock index 8d330b8d..0c5f9524 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "4ea08ef13815b0819e975097df6bb77d74d756524db2ad106ec93873fd1594de" + "sha256": "e03524b8f202c99f589b48669be2d8f0431f47c452cacc2396b5a40bcbe268b6" }, "pipfile-spec": 6, "requires": { @@ -16,9 +16,86 @@ ] }, "default": { + "cffi": { + "hashes": [ + "sha256:151b7eefd035c56b2b2e1eb9963c90c6302dc15fbd8c1c0a83a163ff2c7d7743", + "sha256:1553d1e99f035ace1c0544050622b7bc963374a00c467edafac50ad7bd276aef", + "sha256:1b0493c091a1898f1136e3f4f991a784437fac3673780ff9de3bcf46c80b6b50", + "sha256:2ba8a45822b7aee805ab49abfe7eec16b90587f7f26df20c71dd89e45a97076f", + "sha256:3bb6bd7266598f318063e584378b8e27c67de998a43362e8fce664c54ee52d30", + "sha256:3c85641778460581c42924384f5e68076d724ceac0f267d66c757f7535069c93", + "sha256:3eb6434197633b7748cea30bf0ba9f66727cdce45117a712b29a443943733257", + "sha256:495c5c2d43bf6cebe0178eb3e88f9c4aa48d8934aa6e3cddb865c058da76756b", + "sha256:4c91af6e967c2015729d3e69c2e51d92f9898c330d6a851bf8f121236f3defd3", + "sha256:57b2533356cb2d8fac1555815929f7f5f14d68ac77b085d2326b571310f34f6e", + "sha256:770f3782b31f50b68627e22f91cb182c48c47c02eb405fd689472aa7b7aa16dc", + "sha256:79f9b6f7c46ae1f8ded75f68cf8ad50e5729ed4d590c74840471fc2823457d04", + "sha256:7a33145e04d44ce95bcd71e522b478d282ad0eafaf34fe1ec5bbd73e662f22b6", + "sha256:857959354ae3a6fa3da6651b966d13b0a8bed6bbc87a0de7b38a549db1d2a359", + "sha256:87f37fe5130574ff76c17cab61e7d2538a16f843bb7bca8ebbc4b12de3078596", + "sha256:95d5251e4b5ca00061f9d9f3d6fe537247e145a8524ae9fd30a2f8fbce993b5b", + "sha256:9d1d3e63a4afdc29bd76ce6aa9d58c771cd1599fbba8cf5057e7860b203710dd", + "sha256:a36c5c154f9d42ec176e6e620cb0dd275744aa1d804786a71ac37dc3661a5e95", + "sha256:a6a5cb8809091ec9ac03edde9304b3ad82ad4466333432b16d78ef40e0cce0d5", + "sha256:ae5e35a2c189d397b91034642cb0eab0e346f776ec2eb44a49a459e6615d6e2e", + "sha256:b0f7d4a3df8f06cf49f9f121bead236e328074de6449866515cea4907bbc63d6", + "sha256:b75110fb114fa366b29a027d0c9be3709579602ae111ff61674d28c93606acca", + "sha256:ba5e697569f84b13640c9e193170e89c13c6244c24400fc57e88724ef610cd31", + "sha256:be2a9b390f77fd7676d80bc3cdc4f8edb940d8c198ed2d8c0be1319018c778e1", + "sha256:ca1bd81f40adc59011f58159e4aa6445fc585a32bb8ac9badf7a2c1aa23822f2", + "sha256:d5d8555d9bfc3f02385c1c37e9f998e2011f0db4f90e250e5bc0c0a85a813085", + "sha256:e55e22ac0a30023426564b1059b035973ec82186ddddbac867078435801c7801", + "sha256:e90f17980e6ab0f3c2f3730e56d1fe9bcba1891eeea58966e89d352492cc74f4", + "sha256:ecbb7b01409e9b782df5ded849c178a0aa7c906cf8c5a67368047daab282b184", + "sha256:ed01918d545a38998bfa5902c7c00e0fee90e957ce036a4000a88e3fe2264917", + "sha256:edabd457cd23a02965166026fd9bfd196f4324fe6032e866d0f3bd0301cd486f", + "sha256:fdf1c1dc5bafc32bc5d08b054f94d659422b05aba244d6be4ddc1c72d9aa70fb" + ], + "markers": "python_version != '3.0.*' and python_version != '3.1.*' and python_version != '3.2.*' and python_version >= '2.7' and python_version != '3.3.*'", + "version": "==1.11.5" + }, "discord.py": { "git": "https://github.com/Rapptz/discord.py", - "ref": "1da696258095d5c1171a1cdbe75f56c535c6683e" + "ref": "860d6a9ace8248dfeec18b8b159e7b757d9f56bb" + }, + "pycparser": { + "hashes": [ + "sha256:a988718abfad80b6b157acce7bf130a30876d27603738ac39f140993246b25b3" + ], + "markers": "python_version != '3.0.*' and python_version != '3.1.*' and python_version != '3.2.*' and python_version >= '2.7' and python_version != '3.3.*'", + "version": "==2.19" + }, + "pynacl": { + "hashes": [ + "sha256:05c26f93964373fc0abe332676cb6735f0ecad27711035b9472751faa8521255", + "sha256:0c6100edd16fefd1557da078c7a31e7b7d7a52ce39fdca2bec29d4f7b6e7600c", + "sha256:0d0a8171a68edf51add1e73d2159c4bc19fc0718e79dec51166e940856c2f28e", + "sha256:1c780712b206317a746ace34c209b8c29dbfd841dfbc02aa27f2084dd3db77ae", + "sha256:2424c8b9f41aa65bbdbd7a64e73a7450ebb4aa9ddedc6a081e7afcc4c97f7621", + "sha256:2d23c04e8d709444220557ae48ed01f3f1086439f12dbf11976e849a4926db56", + "sha256:30f36a9c70450c7878053fa1344aca0145fd47d845270b43a7ee9192a051bf39", + "sha256:37aa336a317209f1bb099ad177fef0da45be36a2aa664507c5d72015f956c310", + "sha256:4943decfc5b905748f0756fdd99d4f9498d7064815c4cf3643820c9028b711d1", + "sha256:57ef38a65056e7800859e5ba9e6091053cd06e1038983016effaffe0efcd594a", + "sha256:5bd61e9b44c543016ce1f6aef48606280e45f892a928ca7068fba30021e9b786", + "sha256:6482d3017a0c0327a49dddc8bd1074cc730d45db2ccb09c3bac1f8f32d1eb61b", + "sha256:7d3ce02c0784b7cbcc771a2da6ea51f87e8716004512493a2b69016326301c3b", + "sha256:a14e499c0f5955dcc3991f785f3f8e2130ed504fa3a7f44009ff458ad6bdd17f", + "sha256:a39f54ccbcd2757d1d63b0ec00a00980c0b382c62865b61a505163943624ab20", + "sha256:aabb0c5232910a20eec8563503c153a8e78bbf5459490c49ab31f6adf3f3a415", + "sha256:bd4ecb473a96ad0f90c20acba4f0bf0df91a4e03a1f4dd6a4bdc9ca75aa3a715", + "sha256:e2da3c13307eac601f3de04887624939aca8ee3c9488a0bb0eca4fb9401fc6b1", + "sha256:f67814c38162f4deb31f68d590771a29d5ae3b1bd64b75cf232308e5c74777e0" + ], + "index": "pypi", + "version": "==1.3.0" + }, + "six": { + "hashes": [ + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" + ], + "version": "==1.11.0" } }, "develop": { diff --git a/bot/cogs/spookysound.py b/bot/cogs/spookysound.py new file mode 100644 index 00000000..99c1ae24 --- /dev/null +++ b/bot/cogs/spookysound.py @@ -0,0 +1,39 @@ +import random +from pathlib import Path + +import discord +from discord.ext import commands + +HACKTOBERBOT_VOICE_CHANNEL_ID = 101010 # Replace with actual channel ID + + +class SpookySound: + + def __init__(self, bot): + self.bot = bot + self.sound_files = list(Path("./bot/resources/spookysounds").glob("*.mp3")) + self.channel = None + + async def on_ready(self): + self.channel = self.bot.get_channel(HACKTOBERBOT_VOICE_CHANNEL_ID) + + @commands.cooldown(rate=1, per=120) + @commands.command(brief="Play a spooky sound, restricted to once per 2 mins") + async def spookysound(self, ctx): + """ + Connect to the Hacktoberbot voice channel, play a random spooky sound, then disconnect. Cannot be used more than + once in 2 minutes. + """ + await ctx.send("Initiating spooky sound...") + voice = await self.channel.connect() + file_path = random.choice(self.sound_files) + src = discord.FFmpegPCMAudio(str(file_path.resolve())) + + async def disconnect(): + await voice.disconnect() + + voice.play(src, after=lambda e: self.bot.loop.create_task(disconnect())) + + +def setup(bot): + bot.add_cog(SpookySound(bot)) diff --git a/bot/resources/spookysounds/109710__tomlija__horror-gate.mp3 b/bot/resources/spookysounds/109710__tomlija__horror-gate.mp3 Binary files differnew file mode 100644 index 00000000..495f2bd1 --- /dev/null +++ b/bot/resources/spookysounds/109710__tomlija__horror-gate.mp3 diff --git a/bot/resources/spookysounds/126113__klankbeeld__laugh.mp3 b/bot/resources/spookysounds/126113__klankbeeld__laugh.mp3 Binary files differnew file mode 100644 index 00000000..538feabc --- /dev/null +++ b/bot/resources/spookysounds/126113__klankbeeld__laugh.mp3 diff --git a/bot/resources/spookysounds/133674__klankbeeld__horror-laugh-original-132802-nanakisan-evil-laugh-08.mp3 b/bot/resources/spookysounds/133674__klankbeeld__horror-laugh-original-132802-nanakisan-evil-laugh-08.mp3 Binary files differnew file mode 100644 index 00000000..17f66698 --- /dev/null +++ b/bot/resources/spookysounds/133674__klankbeeld__horror-laugh-original-132802-nanakisan-evil-laugh-08.mp3 diff --git a/bot/resources/spookysounds/14570__oscillator__ghost-fx.mp3 b/bot/resources/spookysounds/14570__oscillator__ghost-fx.mp3 Binary files differnew file mode 100644 index 00000000..5670657c --- /dev/null +++ b/bot/resources/spookysounds/14570__oscillator__ghost-fx.mp3 diff --git a/bot/resources/spookysounds/168650__0xmusex0__doorcreak.mp3 b/bot/resources/spookysounds/168650__0xmusex0__doorcreak.mp3 Binary files differnew file mode 100644 index 00000000..42f9e9fd --- /dev/null +++ b/bot/resources/spookysounds/168650__0xmusex0__doorcreak.mp3 diff --git a/bot/resources/spookysounds/171078__klankbeeld__horror-scream-woman-long.mp3 b/bot/resources/spookysounds/171078__klankbeeld__horror-scream-woman-long.mp3 Binary files differnew file mode 100644 index 00000000..1cdb0f4d --- /dev/null +++ b/bot/resources/spookysounds/171078__klankbeeld__horror-scream-woman-long.mp3 diff --git a/bot/resources/spookysounds/193812__geoneo0__four-voices-whispering-6.mp3 b/bot/resources/spookysounds/193812__geoneo0__four-voices-whispering-6.mp3 Binary files differnew file mode 100644 index 00000000..89150d57 --- /dev/null +++ b/bot/resources/spookysounds/193812__geoneo0__four-voices-whispering-6.mp3 diff --git a/bot/resources/spookysounds/237282__devilfish101__frantic-violin-screech.mp3 b/bot/resources/spookysounds/237282__devilfish101__frantic-violin-screech.mp3 Binary files differnew file mode 100644 index 00000000..b5f85f8d --- /dev/null +++ b/bot/resources/spookysounds/237282__devilfish101__frantic-violin-screech.mp3 diff --git a/bot/resources/spookysounds/249686__cylon8472__cthulhu-growl.mp3 b/bot/resources/spookysounds/249686__cylon8472__cthulhu-growl.mp3 Binary files differnew file mode 100644 index 00000000..d141f68e --- /dev/null +++ b/bot/resources/spookysounds/249686__cylon8472__cthulhu-growl.mp3 diff --git a/bot/resources/spookysounds/35716__analogchill__scream.mp3 b/bot/resources/spookysounds/35716__analogchill__scream.mp3 Binary files differnew file mode 100644 index 00000000..a0614b53 --- /dev/null +++ b/bot/resources/spookysounds/35716__analogchill__scream.mp3 diff --git a/bot/resources/spookysounds/413315__inspectorj__something-evil-approaches-a.mp3 b/bot/resources/spookysounds/413315__inspectorj__something-evil-approaches-a.mp3 Binary files differnew file mode 100644 index 00000000..38374316 --- /dev/null +++ b/bot/resources/spookysounds/413315__inspectorj__something-evil-approaches-a.mp3 diff --git a/bot/resources/spookysounds/60571__gabemiller74__breathofdeath.mp3 b/bot/resources/spookysounds/60571__gabemiller74__breathofdeath.mp3 Binary files differnew file mode 100644 index 00000000..f769d9d8 --- /dev/null +++ b/bot/resources/spookysounds/60571__gabemiller74__breathofdeath.mp3 diff --git a/bot/resources/spookysounds/Female_Monster_Growls_.mp3 b/bot/resources/spookysounds/Female_Monster_Growls_.mp3 Binary files differnew file mode 100644 index 00000000..8b04f0f5 --- /dev/null +++ b/bot/resources/spookysounds/Female_Monster_Growls_.mp3 diff --git a/bot/resources/spookysounds/Male_Zombie_Roar_.mp3 b/bot/resources/spookysounds/Male_Zombie_Roar_.mp3 Binary files differnew file mode 100644 index 00000000..964d685e --- /dev/null +++ b/bot/resources/spookysounds/Male_Zombie_Roar_.mp3 diff --git a/bot/resources/spookysounds/Monster_Alien_Growl_Calm_.mp3 b/bot/resources/spookysounds/Monster_Alien_Growl_Calm_.mp3 Binary files differnew file mode 100644 index 00000000..9e643773 --- /dev/null +++ b/bot/resources/spookysounds/Monster_Alien_Growl_Calm_.mp3 diff --git a/bot/resources/spookysounds/Monster_Alien_Grunt_Hiss_.mp3 b/bot/resources/spookysounds/Monster_Alien_Grunt_Hiss_.mp3 Binary files differnew file mode 100644 index 00000000..ad99cf76 --- /dev/null +++ b/bot/resources/spookysounds/Monster_Alien_Grunt_Hiss_.mp3 diff --git a/bot/resources/spookysounds/sources.txt b/bot/resources/spookysounds/sources.txt new file mode 100644 index 00000000..7df03c2e --- /dev/null +++ b/bot/resources/spookysounds/sources.txt @@ -0,0 +1,41 @@ +Female_Monster_Growls_ +Male_Zombie_Roar_ +Monster_Alien_Growl_Calm_ +Monster_Alien_Grunt_Hiss_ +https://www.youtube.com/audiolibrary/soundeffects + +413315__inspectorj__something-evil-approaches-a +https://freesound.org/people/InspectorJ/sounds/413315/ + +133674__klankbeeld__horror-laugh-original-132802-nanakisan-evil-laugh-08 +https://freesound.org/people/klankbeeld/sounds/133674/ + +35716__analogchill__scream +https://freesound.org/people/analogchill/sounds/35716/ + +249686__cylon8472__cthulhu-growl +https://freesound.org/people/cylon8472/sounds/249686/ + +126113__klankbeeld__laugh +https://freesound.org/people/klankbeeld/sounds/126113/ + +14570__oscillator__ghost-fx +https://freesound.org/people/oscillator/sounds/14570/ + +60571__gabemiller74__breathofdeath +https://freesound.org/people/gabemiller74/sounds/60571/ + +168650__0xmusex0__doorcreak +https://freesound.org/people/0XMUSEX0/sounds/168650/ + +193812__geoneo0__four-voices-whispering-6 +https://freesound.org/people/geoneo0/sounds/193812/ + +109710__tomlija__horror-gate +https://freesound.org/people/Tomlija/sounds/109710/ + +171078__klankbeeld__horror-scream-woman-long +https://freesound.org/people/klankbeeld/sounds/171078/ + +237282__devilfish101__frantic-violin-screech +https://freesound.org/people/devilfish101/sounds/237282/ |