Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsarda committed Sep 15, 2022
1 parent 3c106eb commit 80d65b5
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 173 deletions.
1 change: 0 additions & 1 deletion .github/husky/pre-commit

This file was deleted.

2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
. "$(dirname -- "$0")/_/husky.sh"

npm run pretty-quick --staged
npx lint-staged

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,5 @@
"hooks": {
"pre-commit": "pretty-quick --staged"
}
},
"lint-staged": {
"*.ts": "eslint"
}
}
119 changes: 54 additions & 65 deletions src/commands/anime/contextmenu.ts
Original file line number Diff line number Diff line change
@@ -1,164 +1,153 @@
import { Discord, ContextMenu } from "discordx";
import type {
UserContextMenuCommandInteraction,
MessageContextMenuCommandInteraction
} from "discord.js";
import type { UserContextMenuCommandInteraction, MessageContextMenuCommandInteraction } from "discord.js";
import { ApplicationCommandType } from "discord.js";
import respond from "../../structures/respond.js";
import actions from "../../lib/anime/index.js";

@Discord()
export class Anime {


@ContextMenu({
name: "bonk",
type: ApplicationCommandType.Message,
})
async bonk(interaction: MessageContextMenuCommandInteraction): Promise<void> {
if(!interaction.inCachedGuild()) return;
if (!interaction.inCachedGuild()) return;
await interaction.deferReply();

respond(interaction,{
respond(interaction, {
authorName: `${interaction.member.displayName} bonked ${interaction.targetMessage.member}`,
authorIconUrl: interaction.member.displayAvatarURL(),
imageURL: await actions.bonk()
})
imageURL: await actions.bonk(),
});
}


@ContextMenu({
name: "bonk",
type: ApplicationCommandType.User,
})
async bonkUser(interaction: UserContextMenuCommandInteraction): Promise<void> {
if(!interaction.inCachedGuild()) return;
if (!interaction.inCachedGuild()) return;
await interaction.deferReply();
respond(interaction,{

respond(interaction, {
title: `${interaction.member.displayName} bonked ${interaction.targetMember.displayName}`,
imageURL: await actions.bonk()
})
imageURL: await actions.bonk(),
});
}

@ContextMenu({
name: "bully",
type: ApplicationCommandType.Message,
})
async bully(interaction: MessageContextMenuCommandInteraction): Promise<void> {
if(!interaction.inCachedGuild()) return;
if (!interaction.inCachedGuild()) return;
await interaction.deferReply();

respond(interaction,{
respond(interaction, {
authorName: `${interaction.member.displayName} is a bully :(`,
authorIconUrl: interaction.member .displayAvatarURL(),
imageURL: await actions.bully()
})
authorIconUrl: interaction.member.displayAvatarURL(),
imageURL: await actions.bully(),
});
}


@ContextMenu({
name: "bully",
type: ApplicationCommandType.User,
})
async bullyUser(interaction: UserContextMenuCommandInteraction): Promise<void> {
if(!interaction.inCachedGuild()) return;
if (!interaction.inCachedGuild()) return;
await interaction.deferReply();

respond(interaction,{
title: `${interaction.targetMember .displayName} is a bully :(`,
imageURL: await actions.bully()
})
respond(interaction, {
title: `${interaction.targetMember.displayName} is a bully :(`,
imageURL: await actions.bully(),
});
}

@ContextMenu({
name: "confused",
type: ApplicationCommandType.Message,
})
async confused(interaction: MessageContextMenuCommandInteraction): Promise<void> {
if(!interaction.inCachedGuild()) return;
if (!interaction.inCachedGuild()) return;
await interaction.deferReply();

respond(interaction,{
authorName: `${interaction.member .displayName} is confused`,
authorIconUrl: interaction.member .displayAvatarURL(),
imageURL: await actions.confused()
})
respond(interaction, {
authorName: `${interaction.member.displayName} is confused`,
authorIconUrl: interaction.member.displayAvatarURL(),
imageURL: await actions.confused(),
});
}


@ContextMenu({
name: "confused",
type: ApplicationCommandType.User,
})
async confusedUser(interaction: UserContextMenuCommandInteraction): Promise<void> {
if(!interaction.inCachedGuild()) return;
if (!interaction.inCachedGuild()) return;
await interaction.deferReply();

respond(interaction,{
title: `${interaction.targetMember .displayName} is confused`,
imageURL: await actions.confused()
})
respond(interaction, {
title: `${interaction.targetMember.displayName} is confused`,
imageURL: await actions.confused(),
});
}


@ContextMenu({
name: "goodnight",
type: ApplicationCommandType.Message,
})
async goodnight(interaction: MessageContextMenuCommandInteraction): Promise<void> {
if(!interaction.inCachedGuild()) return;
if (!interaction.inCachedGuild()) return;
await interaction.deferReply();

respond(interaction,{
respond(interaction, {
authorName: `${interaction.member} is saying goodnight`,
authorIconUrl: interaction.member .displayAvatarURL(),
imageURL: await actions.goodnight()
})
authorIconUrl: interaction.member.displayAvatarURL(),
imageURL: await actions.goodnight(),
});
}


@ContextMenu({
name: "goodnight",
type: ApplicationCommandType.User,
})
async goodnightUser(interaction: UserContextMenuCommandInteraction): Promise<void> {
if(!interaction.inCachedGuild()) return;
if (!interaction.inCachedGuild()) return;
await interaction.deferReply();

respond(interaction,{
title: `${interaction.targetMember .displayName} is saying goodnight`,
imageURL: await actions.goodnight()
})
respond(interaction, {
title: `${interaction.targetMember.displayName} is saying goodnight`,
imageURL: await actions.goodnight(),
});
}

@ContextMenu({
name: "happy",
type: ApplicationCommandType.Message,
})
async happy(interaction: MessageContextMenuCommandInteraction): Promise<void> {
if(!interaction.inCachedGuild()) return;
if (!interaction.inCachedGuild()) return;
await interaction.deferReply();

respond(interaction,{
respond(interaction, {
authorName: `${interaction.member} is happy []~( ̄▽ ̄)~*`,
authorIconUrl: interaction.member .displayAvatarURL(),
imageURL: await actions.happy()
})
authorIconUrl: interaction.member.displayAvatarURL(),
imageURL: await actions.happy(),
});
}


@ContextMenu({
name: "happy",
type: ApplicationCommandType.User,
})
async happyUser(interaction: UserContextMenuCommandInteraction): Promise<void> {
if(!interaction.inCachedGuild()) return;
if (!interaction.inCachedGuild()) return;
await interaction.deferReply();

respond(interaction,{
title: `${interaction.targetMember .displayName} is happy []~( ̄▽ ̄)~*`,
imageURL: await actions.happy()
})
respond(interaction, {
title: `${interaction.targetMember.displayName} is happy []~( ̄▽ ̄)~*`,
imageURL: await actions.happy(),
});
}
}
}
Loading

0 comments on commit 80d65b5

Please sign in to comment.