I have a logging system in my discord bot, and I want to make a system which allows you to ignore channels, but I'm stuck with it. Currently I have this code:
cursor=db.cursor(dictionary=True)
cursor.execute(f"SELECT * FROM `logexclude` WHERE server={int(before.guild.id)}")
excluded = cursor.fetchall()
for i in excluded:
if before.channel.id in i[1]: return
excluded
is a list and it looks like this:
[{'server': 890248334542008321, 'channel_ids': 890248758875533322, 'user_ids': 0, 'role_ids': 0}]
However, when I try to access it's first element (excluded[0]
), it just gives me an error:
if before.channel.id in i[1]: return
TypeError: 1