Allow mentions in "!clean user"; fix some clean command bugs
This commit is contained in:
parent
9687359105
commit
22c515be38
2 changed files with 6 additions and 2 deletions
|
@ -83,6 +83,7 @@ export class GuildSavedMessages extends BaseRepository {
|
|||
.where("guild_id = :guild_id", { guild_id: this.guildId })
|
||||
.andWhere("channel_id = :channel_id", { channel_id: channelId })
|
||||
.andWhere("is_bot = 1")
|
||||
.andWhere("deleted_at IS NULL")
|
||||
.orderBy("id", "DESC")
|
||||
.limit(limit)
|
||||
.getMany();
|
||||
|
@ -94,6 +95,7 @@ export class GuildSavedMessages extends BaseRepository {
|
|||
.where("guild_id = :guild_id", { guild_id: this.guildId })
|
||||
.andWhere("channel_id = :channel_id", { channel_id: channelId })
|
||||
.andWhere("id < :beforeId", { beforeId })
|
||||
.andWhere("deleted_at IS NULL")
|
||||
.orderBy("id", "DESC")
|
||||
.limit(limit)
|
||||
.getMany();
|
||||
|
@ -105,6 +107,7 @@ export class GuildSavedMessages extends BaseRepository {
|
|||
.where("guild_id = :guild_id", { guild_id: this.guildId })
|
||||
.andWhere("channel_id = :channel_id", { channel_id: channelId })
|
||||
.andWhere("user_id = :user_id", { user_id: userId })
|
||||
.andWhere("deleted_at IS NULL")
|
||||
.orderBy("id", "DESC")
|
||||
.limit(limit)
|
||||
.getMany();
|
||||
|
@ -116,7 +119,8 @@ export class GuildSavedMessages extends BaseRepository {
|
|||
.where("guild_id = :guild_id", { guild_id: this.guildId })
|
||||
.andWhere("user_id = :user_id", { user_id: userId })
|
||||
.andWhere("channel_id = :channel_id", { channel_id: channelId })
|
||||
.andWhere("id > :afterId", { afterId });
|
||||
.andWhere("id > :afterId", { afterId })
|
||||
.andWhere("deleted_at IS NULL");
|
||||
|
||||
if (limit != null) {
|
||||
query = query.limit(limit);
|
||||
|
|
|
@ -178,7 +178,7 @@ export class UtilityPlugin extends Plugin {
|
|||
}, CLEAN_COMMAND_DELETE_DELAY);
|
||||
}
|
||||
|
||||
@d.command("clean user", "<userId:string> <count:number>")
|
||||
@d.command("clean user", "<userId:userid> <count:number>")
|
||||
@d.permission("clean")
|
||||
async cleanUserCmd(msg: Message, args: { userId: string; count: number }) {
|
||||
if (args.count > MAX_CLEAN_COUNT || args.count <= 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue