Skip to content

Commit

Permalink
make prettier happy
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Mar 27, 2024
1 parent d8e9de9 commit 5c62bea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
24 changes: 14 additions & 10 deletions src/commands/moderation/migrate_warnings.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,32 @@ import prisma from '../../utils/prisma';
export const migrateWarningsCommand: Command = {
data: new SlashCommandBuilder()
.setName('migrate-warnings')
.setDescription("Migrate warnings to zeppelin")
.setDescription('Migrate warnings to zeppelin')
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers)
.setDMPermission(false),
async execute(interaction) {
if (!interaction.guild) return;

await interaction.deferReply()
await interaction.deferReply();

const warnings = await prisma.warning.findMany()
const warnings = await prisma.warning.findMany();

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
for (const warning of warnings) {
const date = Math.floor(new Date(warning.timestamp).getTime() / 1000);
const dateString: string = `<t:${date}>`
const date = Math.floor(
new Date(warning.timestamp).getTime() / 1000
);
const dateString: string = `<t:${date}>`;

if (interaction.guild !== null && interaction.channel !== null) {
const issuer = await interaction.guild.members.fetch(warning.issuerId);
await interaction.channel.send(`!note ${warning.userId} ${warning.reason} | Migrated warning, Originally created at ${dateString}, By ${issuer.user.username}`)
const issuer = await interaction.guild.members.fetch(
warning.issuerId
);
await interaction.channel.send(
`!note ${warning.userId} ${warning.reason} | Migrated warning, Originally created at ${dateString}, By ${issuer.user.username}`
);
}
}

await interaction.editReply("Finished going through all warnings!")
await interaction.editReply('Finished going through all warnings!');
},
};
2 changes: 1 addition & 1 deletion src/handlers/command.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const commandHandler: Handler = (client) => {
} catch (error) {
// in case of an error

console.log(error)
console.log(error);

if (interaction.isRepliable())
await interaction.reply({
Expand Down

0 comments on commit 5c62bea

Please sign in to comment.