Skip to content

Commit

Permalink
Cleaning code and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
geirawsm committed Jul 13, 2024
1 parent de85316 commit b6dd33b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions sausage_bot/cogs/log_maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ async def log_maintenance():
select=('value'),
where=('setting', 'limit')
)
settings_limit = int(settings_limit)
log.debug(f'Got `settings_limit`: {settings_limit}')
log.debug(
f'Log limit is {settings_limit} in {settings_type}'
Expand Down
4 changes: 4 additions & 0 deletions sausage_bot/cogs/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,10 @@ async def add_reaction_message(
)
]
)
await interaction.followup.send(
'Message added', ephemeral=True
)
return
return

@commands.check_any(
Expand Down
2 changes: 0 additions & 2 deletions sausage_bot/util/db_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,6 @@ async def get_output(
out = out[0]
else:
out = await out.fetchall()
while len(out) == 1 and isinstance(out, (list, tuple)):
out = out[0]
return out
except aiosqlite.OperationalError as e:
log.error(f'Error: {e}')
Expand Down
7 changes: 5 additions & 2 deletions sausage_bot/util/feeds_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
from uuid import uuid4
import discord


from sausage_bot.util import envs, datetime_handling, file_io, discord_commands
from sausage_bot.util import net_io, db_helper, config
from sausage_bot.util import net_io, db_helper

from .log import log

Expand Down Expand Up @@ -216,6 +217,7 @@ async def remove_feed_from_db(feed_type, feed_name):
where=[('feed_name', feed_name)],
single=True
)
log.debug(f'`uuid_from_db` is {uuid_from_db}')
removal = await db_helper.del_row_by_AND_filter(
feed_db,
where=('uuid', uuid_from_db)
Expand Down Expand Up @@ -324,6 +326,7 @@ def split_list(lst, chunk_size):
('feed_name', 'ASC')
]
)
log.debug(f'`feeds_out` is {feeds_out}')
# Return None if empty db
if feeds_out is None:
log.log('No feeds in database')
Expand Down Expand Up @@ -590,7 +593,7 @@ async def process_links_for_posting_or_editing(
if FEED_POSTS is None:
log.debug('`FEED_POSTS` is None')
return None
for item in FEED_POSTS:
for item in FEED_POSTS[0:3]:
log.verbose(f'Got this item:\n{item}')
if isinstance(item, str):
feed_link = item
Expand Down

0 comments on commit b6dd33b

Please sign in to comment.