reformat/refactor

This commit is contained in:
2025-04-26 21:59:46 -04:00
parent 5bde6ac880
commit a433dc2fb5
14 changed files with 150 additions and 107 deletions

View File

@ -2,7 +2,6 @@ import traceback
import logging
from typing import Optional, Union
from regex import Pattern
import urllib
import discord
import regex
from util.sing_util import Utility
@ -30,10 +29,11 @@ class Sing(commands.Cog):
def predicate(ctx):
try:
if not ctx.channel.id in BOT_CHANIDS:
if ctx.channel.id not in BOT_CHANIDS:
logging.debug("%s not found in %s", ctx.channel.id, BOT_CHANIDS)
return ctx.channel.id in BOT_CHANIDS
except:
except Exception as e:
logging.debug("Exception: %s", str(e))
traceback.print_exc()
return False
@ -103,7 +103,7 @@ class Sing(commands.Cog):
search_result_wrapped_short: list[str] = search_result[
2
] # Third is short wrapped lyrics
if not ctx.channel.id in BOT_CHANIDS:
if ctx.channel.id not in BOT_CHANIDS:
short_lyrics = " ".join(
search_result_wrapped_short
) # Replace with shortened lyrics for non spamchans