Skip to content

Commit

Permalink
Fixed feed_name_autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
geirawsm committed Oct 9, 2024
1 parent c1f792c commit 2274cb0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sausage_bot/cogs/rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ async def feed_name_autocomplete(
feeds = []
for feed in db_feeds:
feeds.append((feed[0], feed[1], feed[2], feed[3]))
length_counter = 87
length_counter -= len(str(feed[1]))
length_counter -= len(str(feed[3]))
log.debug(f'feeds: {feeds}')
length_counter = 90
length_counter = 87
length_counter -= len(str(feed[1]))
length_counter -= len(str(feed[3]))
return [
discord.app_commands.Choice(
name='{feed_name}: #{channel} ({url})'.format(
feed_name=feed[1], channel=feed[3],
url='{}...'.format(
str(feed[2])[0:length_counter]
) if len(feed[2]) > length_counter else str(feed[2]),
), value=str(feed[1])
feed_name=feed[1], channel=feed[3], url=str(feed[2])
)[0:length_counter], value=str(feed[1])
)
for feed in feeds if current.lower() in feed[0].lower()
]
Expand Down

0 comments on commit 2274cb0

Please sign in to comment.