Skip to content

Commit

Permalink
Use latest 500 moderations for completions
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianVennen committed Jul 6, 2024
1 parent f143efe commit f359732
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commands/user/UserCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ export default class UserCommand extends Command {

const options = await database.queryAll(
'SELECT value, COUNT(*) AS count FROM (' +
`SELECT ${database.escapeId(column)} AS value FROM moderations WHERE moderator = ? AND guildid = ? AND action = ? LIMIT 500` +
`SELECT ${database.escapeId(column)} AS value FROM moderations ` +
'WHERE moderator = ? AND guildid = ? AND action = ? ORDER BY created DESC LIMIT 500' +
') AS results WHERE value LIKE CONCAT(\'%\', ?, \'%\') AND LENGTH(value) <= ? ' +
'GROUP BY value ORDER BY count DESC LIMIT 5;',
interaction.user.id, interaction.guild.id, this.getName(), focussed.value, AUTOCOMPLETE_NAME_LIMIT);
Expand Down

0 comments on commit f359732

Please sign in to comment.