Baracchino-Della-Scuola / Bot

Do not use bare except, specify exception instead FLK-E722
Bug risk
Minor
4 months ago2 years old
do not use bare 'except'
44                password=self.password,
45            )
46            print("Connected to MySQL")
47        except:48            print("No sql for you, sorry")
49
50        for a in os.listdir("./cogs"):
do not use bare 'except'
62            value = stdout.getvalue()
63            try:
64                await ctx.message.add_reaction("\u2705")
65            except:66                pass
67
68            if ret is None:
do not use bare 'except'
 70            await user.send(
 71                f"😢 | You have been banned from {ctx.guild.name} for reason {reason}"
 72            )
 73        except: 74            pass
 75        ch = self.bot.get_channel(int(os.environ["STAFF_CHAT"]))
 76        await ch.send(f"{user} has been banned with reason {reason}")
do not use bare 'except'
 20            await user.send(
 21                f"😢 | You have been kicked from {ctx.guild.name} for reason {reason}"
 22            )
 23        except: 24            pass
 25        ch = self.bot.get_channel(int(os.environ["STAFF_CHAT"]))
 26        await ch.send(f"{user} has been kicked with reason {reason}")
do not use bare 'except'
20        try:
21            if data["error"]:
22                return await ctx.send("No lyrics found for {}".format(song))
23        except:24            pass
25
26        emb = discord.Embed(