@@ -10,7 +10,7 @@ def __init__(bot):
10
10
message_send (bot )
11
11
message_edit (bot )
12
12
message_delete (bot )
13
- on_command_error (bot )
13
+ # on_command_error(bot)
14
14
15
15
16
16
def join (bot ):
@@ -99,7 +99,7 @@ async def on_raw_message_edit(ctx):
99
99
except Exception as e :
100
100
print (e )
101
101
except :
102
- content = str (json .loads (json .dumps (ctx .data ))['embeds' ])
102
+ content = str (json .loads (json .dumps (ctx .data ))['embeds' ][ 0 ] )
103
103
if teapot .config .storage_type () == "mysql" :
104
104
try :
105
105
database = teapot .database .__init__ ()
@@ -129,15 +129,14 @@ async def on_message_delete(ctx):
129
129
130
130
def on_command_error (bot ):
131
131
@bot .event
132
- async def on_command_error (ctx , error ):
132
+ async def on_command_error (ctx , e ):
133
133
if teapot .config .storage_type () == "mysql" :
134
134
try :
135
135
database = teapot .database .__init__ ()
136
136
db = teapot .database .db (database )
137
137
db .execute (
138
- "INSERT INTO `guild_logs`(timestamp, guild_id, channel_id, message_id, user_id, action_type, message) VALUES(%s, %s, %s, %s, %s, %s, %s)" ,
139
- (teapot .time (), ctx .guild .id , ctx .message .channel .id , ctx .message .id , ctx .message .author .id ,
140
- "CMD_ERROR" , str (error )))
138
+ "INSERT INTO `bot_logs`(timestamp, type, class, message) VALUES(%s, %s, %s, %s)" ,
139
+ (teapot .time (), "CMD_ERROR" , __name__ , str (e )))
141
140
database .commit ()
142
141
except Exception as e :
143
142
print (e )
0 commit comments