junepark678 / GIRRewrite

Unnecessary parentheses after keyword PYL-C0325
Style
Minor
a year agoa year old
Unnecessary parens after 'if' keyword
156
157    def add_filtered_word(self, fw: FilterWord) -> None:
158        existing = self.get_guild().filter_words.filter(word=fw.word)
159        if(len(existing) > 0):160            return False
161
162        Guild.objects(_id=cfg.guild_id).update_one(push__filter_words=fw)
Unnecessary parens after 'if' keyword
141        
142    def add_raid_phrase(self, phrase: str) -> bool:
143        existing = self.get_guild().raid_phrases.filter(word=phrase)
144        if(len(existing) > 0):145            return False
146        Guild.objects(_id=cfg.guild_id).update_one(push__raid_phrases=FilterWord(word=phrase, bypass=5, notify=True))
147        return True
Unnecessary parens after 'if' keyword
127        pattern = re.compile(
128            r"(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*))")
129        link = pattern.search(msg.content)
130        if (link):131            if link.group(0):
132                link = link.group(0)
133
Unnecessary parens after 'not' keyword
1037        formatted_error = traceback.format_exc()
1038        if str(error) == loc["error"]["no_pm"]:
1039            return await ctx.send(loc["error"]["no_pm"])
1040        if not (str(error) == "Application Command raised an exception: AttributeError: 'NoneType' object has no attribute 'is_finished'"):1041            await ctx.send(loc["error"]["error_msg"].format(str(error)))
1042        if hasattr(ctx, "voice_state") and ctx.voice_state:
1043            if ctx.voice_state.debug["debug_log"]: