v3.1.0 #317
3 changed files with 13 additions and 8 deletions
|
@ -20,6 +20,11 @@ export default class Ignore extends Command {
|
||||||
if (isChannelIgnored) {
|
if (isChannelIgnored) {
|
||||||
const entity = await IgnoredChannel.FetchOneById(IgnoredChannel, interaction.guildId);
|
const entity = await IgnoredChannel.FetchOneById(IgnoredChannel, interaction.guildId);
|
||||||
|
|
||||||
|
if (!entity) {
|
||||||
|
await interaction.reply('Unable to find channel.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await IgnoredChannel.Remove(IgnoredChannel, entity);
|
await IgnoredChannel.Remove(IgnoredChannel, entity);
|
||||||
|
|
||||||
await interaction.reply('This channel will start being logged again.');
|
await interaction.reply('This channel will start being logged again.');
|
||||||
|
|
|
@ -34,22 +34,22 @@ export default class Audit extends BaseEntity {
|
||||||
@Column()
|
@Column()
|
||||||
ServerId: string;
|
ServerId: string;
|
||||||
|
|
||||||
public static async FetchAuditsByUserId(userId: string, serverId: string): Promise<Audit[] | undefined> {
|
public static async FetchAuditsByUserId(userId: string, serverId: string): Promise<Audit[] | null> {
|
||||||
const connection = getConnection();
|
const connection = getConnection();
|
||||||
|
|
||||||
const repository = connection.getRepository(Audit);
|
const repository = connection.getRepository(Audit);
|
||||||
|
|
||||||
const all = await repository.find({ UserId: userId, ServerId: serverId });
|
const all = await repository.find({ where: { UserId: userId, ServerId: serverId } });
|
||||||
|
|
||||||
return all;
|
return all;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async FetchAuditByAuditId(auditId: string, serverId: string): Promise<Audit | undefined> {
|
public static async FetchAuditByAuditId(auditId: string, serverId: string): Promise<Audit | null> {
|
||||||
const connection = getConnection();
|
const connection = getConnection();
|
||||||
|
|
||||||
const repository = connection.getRepository(Audit);
|
const repository = connection.getRepository(Audit);
|
||||||
|
|
||||||
const single = await repository.findOne({ AuditId: auditId, ServerId: serverId });
|
const single = await repository.findOne({ where: { AuditId: auditId, ServerId: serverId } });
|
||||||
|
|
||||||
return single;
|
return single;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ export default class IgnoredChannel extends BaseEntity {
|
||||||
|
|
||||||
const repository = connection.getRepository(IgnoredChannel);
|
const repository = connection.getRepository(IgnoredChannel);
|
||||||
|
|
||||||
const single = await repository.findOne(channelId);
|
const single = await repository.findOne({ where: { Id: channelId } });
|
||||||
|
|
||||||
return single != undefined;
|
return single != undefined;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue