Function for idv3 and bugfix

This commit is contained in:
2025-01-08 11:34:40 +01:00
parent 0f596cbdba
commit 85d276f2d4
2 changed files with 43 additions and 0 deletions
+7
View File
@@ -1,4 +1,7 @@
import logging
# define an asynchronous generator
LOGGER = logging.getLogger("discord")
async def async_iterator_generator(range_of_iterable):
"""
Generate asynchronouse iterator.
@@ -87,8 +90,10 @@ async def get_stats(client, ctx, history_limit):
async def discord_friendly_reply(ctx, message_content, file=None):
if len(message_content) < 999:
LOGGER.info("Wiadomosci ponizej 999 znakow")
await ctx.reply(message_content)
else:
LOGGER.info("Wiadomosci powyzej 999 znakow")
while len(message_content) > 999:
await ctx.reply(message_content[:999])
message_content = message_content[999:]
@@ -97,8 +102,10 @@ async def discord_friendly_reply(ctx, message_content, file=None):
async def discord_friendly_send(ctx, message_content, file=None):
if len(message_content) < 999:
LOGGER.info("Wiadomosci ponizej 999 znakow")
await ctx.send(message_content)
else:
LOGGER.info("Wiadomosci powyzej 999 znakow")
while len(message_content) > 999:
await ctx.send(message_content[:999])
message_content = message_content[999:]