From f66abe9a8755faf9e444ec7e63ef46937db4e0da Mon Sep 17 00:00:00 2001 From: brandons209 Date: Sat, 27 Jun 2020 23:22:16 -0400 Subject: [PATCH] allow editing volume and cost of sfx --- sfx/sfx.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/sfx/sfx.py b/sfx/sfx.py index 8044042..7af4310 100644 --- a/sfx/sfx.py +++ b/sfx/sfx.py @@ -79,6 +79,36 @@ class SFX(commands.Cog): """ pass + @sfxset.command(name="vol") + @commands.guild_only() + async def sfxset_vol(self, ctx, vol: int, *, name: str): + """ + Change volume of sfx sound + """ + async with self.config.guild(ctx.guild).saysounds() as saysounds: + try: + saysounds[name]["volume"] = vol + except: + await ctx.send(error("Sound not found, try again!")) + return + + await ctx.tick() + + @sfxset.command(name="cost") + @commands.guild_only() + async def sfxset_cost(self, ctx, cost: int, *, name: str): + """ + Change cost of sfx sound + """ + async with self.config.guild(ctx.guild).saysounds() as saysounds: + try: + saysounds[name]["cost"] = cost + except: + await ctx.send(error("Sound not found, try again!")) + return + + await ctx.tick() + @sfxset.command(name="add") @commands.guild_only() async def sfxset_add(self, ctx, cost: int, vol: int, *, name: str):