How to use the playsound.utils.checks.mod_or_permissions function in playsound

To help you get started, we’ve selected a few playsound examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tmercswims / tmerc-cogs / playsound / playsound.py View on Github external
    @checks.mod_or_permissions(administrator=True)
    async def _addsound(self, ctx: commands.Context, link: str=None):
        """Adds a new sound.

        Either upload the file as a Discord attachment and make your comment
        "[p]addsound", or use "[p]addsound direct-URL-to-file".
        """

        await self.bot.type()

        server = ctx.message.server

        if server.id not in os.listdir(self.sound_base):
            os.makedirs(os.path.join(self.sound_base, server.id))

        if server.id not in self.settings:
            self.settings[server.id] = {}
github tmercswims / tmerc-cogs / playsound / playsound.py View on Github external
    @checks.mod_or_permissions(administrator=True)
    async def _soundvol(self, ctx: commands.Context, soundname: str,
                        percent: int=None):
        """Sets the volume for the specified sound.

        If no value is given, the current volume for the sound is printed.
        """

        await self.bot.type()

        server = ctx.message.server

        if server.id not in os.listdir(self.sound_base):
            os.makedirs(os.path.join(self.sound_base, server.id))

        if server.id not in self.settings:
            self.settings[server.id] = {}