Skip to content

Commit

Permalink
Moved log_to_bot_channel, but forgot to update references
Browse files Browse the repository at this point in the history
  • Loading branch information
geirawsm committed Jun 20, 2024
1 parent cbff9a5 commit 6dcaba6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions sausage_bot/cogs/rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions sausage_bot/cogs/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
)
Expand All @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion sausage_bot/util/db_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions sausage_bot/util/feeds_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'] = []
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions sausage_bot/util/net_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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]
Expand Down

0 comments on commit 6dcaba6

Please sign in to comment.