diff --git a/sausage_bot/cogs/rss.py b/sausage_bot/cogs/rss.py index 4a34929..0103510 100755 --- a/sausage_bot/cogs/rss.py +++ b/sausage_bot/cogs/rss.py @@ -162,7 +162,7 @@ async def rss_add( await feeds_core.add_to_feed_db( 'spotify', str(feed_name), str(feed_link), channel.name, AUTHOR ) - await log.log_to_bot_channel( + await discord_commands.log_to_bot_channel( envs.RSS_ADDED_BOT.format( AUTHOR, feed_name, feed_link, channel.name ) @@ -197,7 +197,7 @@ async def rss_remove( feed_type='rss', feed_name=feed_name ) if removal: - await log.log_to_bot_channel( + await discord_commands.log_to_bot_channel( envs.RSS_REMOVED_BOT.format(feed_name, AUTHOR) ) await interaction.followup.send( @@ -209,7 +209,7 @@ async def rss_remove( envs.RSS_COULD_NOT_REMOVE.format(feed_name) ) # Also log and send error to bot-channel - await log.log_to_bot_channel( + await discord_commands.log_to_bot_channel( envs.RSS_TRIED_REMOVED_BOT.format(AUTHOR, feed_name) ) return @@ -467,7 +467,7 @@ async def post_feeds(): log.debug(f'Got this for `FEED_POSTS`: {FEED_POSTS}') if FEED_POSTS is None: log.log(envs.RSS_FEED_POSTS_IS_NONE.format(FEED_NAME)) - await log.log_to_bot_channel( + await discord_commands.log_to_bot_channel( envs.RSS_FEED_POSTS_IS_NONE.format(FEED_NAME) ) else: diff --git a/sausage_bot/cogs/youtube.py b/sausage_bot/cogs/youtube.py index cae5368..1f36aac 100755 --- a/sausage_bot/cogs/youtube.py +++ b/sausage_bot/cogs/youtube.py @@ -7,7 +7,7 @@ from yt_dlp import YoutubeDL from sausage_bot.util import config, envs, feeds_core, file_io -from sausage_bot.util import db_helper +from sausage_bot.util import db_helper, discord_commands from sausage_bot.util.log import log @@ -130,7 +130,7 @@ async def youtube_manage( 'youtube', str(feed_name), str(yt_link), channel.name, AUTHOR, yt_info['channel_id'] ) - await log.log_to_bot_channel( + await discord_commands.log_to_bot_channel( envs.YOUTUBE_ADDED_BOT.format( AUTHOR, feed_name, yt_link, channel.name ) @@ -157,7 +157,7 @@ async def youtube_manage( feed_type='youtube', feed_name=feed_name ) if removal: - await log.log_to_bot_channel( + await discord_commands.log_to_bot_channel( envs.YOUTUBE_REMOVED_BOT.format(feed_name, AUTHOR) ) await interaction.followup.send( @@ -169,7 +169,7 @@ async def youtube_manage( envs.YOUTUBE_COULD_NOT_REMOVE.format(feed_name) ) # Also log and send error to either a bot-channel or admin - await log.log_to_bot_channel( + await discord_commands.log_to_bot_channel( envs.YOUTUBE_TRIED_REMOVED_BOT.format(AUTHOR, feed_name) ) return @@ -277,7 +277,7 @@ async def post_videos(): log.debug(f'Got this for `FEED_POSTS`: {FEED_POSTS}') if FEED_POSTS is None: log.log(envs.YOUTUBE_FEED_POSTS_IS_NONE.format(feed)) - await log.log_to_bot_channel( + await discord_commands.log_to_bot_channel( envs.YOUTUBE_FEED_POSTS_IS_NONE.format(FEED_NAME) ) else: diff --git a/sausage_bot/util/db_helper.py b/sausage_bot/util/db_helper.py index fc5178a..49bd198 100755 --- a/sausage_bot/util/db_helper.py +++ b/sausage_bot/util/db_helper.py @@ -78,7 +78,7 @@ async def prep_table( 'Inserts given, but db file already has input. ' 'This should be looked into, so messaging the bot-dump' ) - await log.log_to_bot_channel( + await discord_commands.log_to_bot_channel( content_in='Want to insert info from old json into ' f'{table_name}, but something is wrong' '({} vs {})'.format( diff --git a/sausage_bot/util/feeds_core.py b/sausage_bot/util/feeds_core.py index 2c93165..4b8bb18 100755 --- a/sausage_bot/util/feeds_core.py +++ b/sausage_bot/util/feeds_core.py @@ -463,7 +463,7 @@ async def review_feeds_status(feed_type: str = None): _url_e_msg = f'Error when getting feed for {FEED_NAME}'\ f' (strike {envs.FEEDS_URL_ERROR_LIMIT})' log.error(_url_e_msg) - log.log_to_bot_channel(_url_e_msg) + discord_commands.log_to_bot_channel(_url_e_msg) if URL_STATUS != envs.FEEDS_URL_ERROR: if 'status_url' not in db_updates: db_updates['status_url'] = [] @@ -506,7 +506,7 @@ async def review_feeds_status(feed_type: str = None): db_updates['status_channel'].append( ('uuid', UUID, envs.CHANNEL_STATUS_ERROR) ) - await log.log_to_bot_channel( + await discord_commands.log_to_bot_channel( f'{FEED_NAME} skal poste i #{CHANNEL} men den finnes ikke' ) if len(db_updates) == 0: diff --git a/sausage_bot/util/net_io.py b/sausage_bot/util/net_io.py index 288af8c..49c7154 100755 --- a/sausage_bot/util/net_io.py +++ b/sausage_bot/util/net_io.py @@ -61,7 +61,7 @@ async def check_spotify_podcast(url): if _spotipy is None: _spotipy_error = 'Spotipy has no credentials. Check README' log.log(_spotipy_error) - await log.log_to_bot_channel(_spotipy_error) + await discord_commands.log_to_bot_channel(_spotipy_error) return None pod_id = re.search(r'.*/show/([a-zA-Z0-9]+).*', url).group(1) try: @@ -77,7 +77,7 @@ async def get_spotify_podcast_links(feed): if _spotipy is None: _spotipy_error = 'Spotipy has no credentials. Check README' log.log(_spotipy_error) - await log.log_to_bot_channel(_spotipy_error) + await discord_commands.log_to_bot_channel(_spotipy_error) return None UUID = feed[0] URL = feed[2]