Hey any idea what im doing wrong here?
Ignoring exception in on_button_click
Traceback (most recent call last):
File "C:\Users\Jorda\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\Jorda\PycharmProjects\Ticket Support Bot\ticketsystem_with_buttons_working.py", line 300, in on_button_click
await log_ticket_history(interaction.guild,interaction.channel, interaction.author)
File "C:\Users\Jorda\PycharmProjects\Ticket Support Bot\ticketsystem_with_buttons_working.py", line 322, in log_ticket_history
for msg in ticket_channel.history(limit=None):
TypeError: 'HistoryIterator' object is not iterable
async def log_ticket_history(guild,ticket_channel,author):
date = datetime.now()
date = date.strftime('%d.%m.%y')
db = await connect_to_sql_db('BanditBot')
async with db.cursor() as cursor:
await cursor.execute(f"INSERT INTO message_history (guild_id, channel_name, channel_id, author_id, date) VALUES ('{guild.id}','{ticket_channel.name}','{ticket_channel.id}','{author.id}','{date}')")
await db.commit()
for msg in ticket_channel.history(limit=None):
await cursor.execute(f"UPDATE message_history WHERE channel_id = {ticket_channel.id}, SET chat_history = {msg.clean_content}")
await db.commit()
db.close()```
Ive been made aware not to use f-strings in SQL Query's my plan is to get this fixed then go through my entire code and fix it my bad 😄



