Skip to content

Commit

Permalink
big update, commands, formats, more tips and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lajbel committed Mar 18, 2022
1 parent 3186f82 commit 7ef82fd
Show file tree
Hide file tree
Showing 16 changed files with 143 additions and 204 deletions.
14 changes: 12 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
{
"compilerOptions": {
"noImplicitAny": false
},
"lint": {
"rules": {
"exclude": [
"no-explicit-any"
]
}
},
"fmt": {
"files": {
"exclude": [
"velociraptor.yaml",
"src/deps/"
"src/deps.ts"
]
},
"options": {
"useTabs": true,
"lineWidth": 80,
"lineWidth": 90,
"indentWidth": 4,
"singleQuote": false,
"proseWrap": "preserve"
Expand Down
56 changes: 27 additions & 29 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
export {
ActivityTypes,
addRole,
ApplicationCommandOptionTypes,
ApplicationCommandTypes,
ButtonStyles,
channelOverwriteHasPermission,
createApplicationCommand,
createBot,
deleteMessage,
editBotStatus,
getMember,
getUser,
InteractionResponseTypes,
MessageComponentTypes,
OverwriteTypes,
removeRole,
sendInteractionResponse,
sendMessage,
startBot,
} from "https://deno.land/x/[email protected]/mod.ts";
ActivityTypes,
addRole,
ApplicationCommandOptionTypes,
ApplicationCommandTypes,
ButtonStyles,
createApplicationCommand,
createBot,
deleteMessage,
editBotStatus,
getMember,
getUser,
InteractionResponseTypes,
MessageComponentTypes,
OverwriteTypes,
removeRole,
sendInteractionResponse,
sendMessage,
startBot,
} from "https://deno.land/x/[email protected]/mod.ts";

export type {
Bot,
CreateGlobalApplicationCommand,
DiscordenoInteraction,
DiscordenoMember,
DiscordenoMessage,
Embed,
GuildMember,
} from "https://deno.land/x/[email protected]/mod.ts";
Bot,
DiscordenoInteraction,
DiscordenoMember,
DiscordenoMessage,
Embed,
GuildMember,
} from "https://deno.land/x/[email protected]/mod.ts";

export { config } from "https://deno.land/x/dotenv/mod.ts";
export { config as dotenv } from "https://deno.land/x/dotenv/mod.ts";

export type { DotenvConfig } from "https://deno.land/x/dotenv/mod.ts";
9 changes: 8 additions & 1 deletion src/buttons/announcements.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { addRole, Bot, DiscordenoInteraction, InteractionResponseTypes, removeRole, sendInteractionResponse } from "../deps/discordeno.ts";
import {
addRole,
Bot,
DiscordenoInteraction,
InteractionResponseTypes,
removeRole,
sendInteractionResponse,
} from "../../deps.ts";

export default () => {
return {
Expand Down
9 changes: 8 additions & 1 deletion src/buttons/helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { addRole, Bot, DiscordenoInteraction, InteractionResponseTypes, removeRole, sendInteractionResponse } from "../deps/discordeno.ts";
import {
addRole,
Bot,
DiscordenoInteraction,
InteractionResponseTypes,
removeRole,
sendInteractionResponse,
} from "../../deps.ts";

export default () => {
return {
Expand Down
55 changes: 0 additions & 55 deletions src/commands/help.ts

This file was deleted.

20 changes: 16 additions & 4 deletions src/commands/hi.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { ApplicationCommandOptionTypes, Bot, DiscordenoInteraction, getUser, InteractionResponseTypes, sendInteractionResponse } from "../deps/discordeno.ts";
import {
ApplicationCommandOptionTypes,
Bot,
DiscordenoInteraction,
getUser,
InteractionResponseTypes,
sendInteractionResponse,
} from "../../deps.ts";

export default () => {
return {
name: "hi",
description: "Oh hi",
description: "ohhi",
options: [
{
type: ApplicationCommandOptionTypes.User,
Expand All @@ -13,12 +20,17 @@ export default () => {
},
],
exe: async (bot: Bot, interaction: DiscordenoInteraction) => {
const member = interaction?.data?.resolved?.members?.first() || interaction?.member;
const member = interaction?.data?.resolved?.members?.first() ||
interaction?.member;
const user = await getUser(bot, member?.id!);

sendInteractionResponse(bot, interaction.id, interaction.token, {
type: InteractionResponseTypes.ChannelMessageWithSource,
data: { content: `Oh hi ${member?.nick ?? user?.username}` },
data: {
content: `<:oh:952678706927775784><:hi:952678717526798398> ${
member?.nick ?? user?.username
}`,
},
});
},
};
Expand Down
9 changes: 7 additions & 2 deletions src/commands/kaboom.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { Bot, DiscordenoInteraction, InteractionResponseTypes, sendInteractionResponse } from "../deps/discordeno.ts";
import {
Bot,
DiscordenoInteraction,
InteractionResponseTypes,
sendInteractionResponse,
} from "../../deps.ts";

export default () => {
return {
name: "kaboom",
description: "KaBoom!!!",
description: "make a ka-boom!!!",
options: [],
exe: (bot: Bot, interaction: DiscordenoInteraction) => {
const funnyKaboom = [
Expand Down
30 changes: 18 additions & 12 deletions src/commands/roles.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import {
Bot,
ButtonStyles,
DiscordenoInteraction,
InteractionResponseTypes,
MessageComponentTypes,
sendInteractionResponse
import {
Bot,
ButtonStyles,
DiscordenoInteraction,
InteractionResponseTypes,
MessageComponentTypes,
sendInteractionResponse,
} from "../../deps.ts";

export default () => {
return {
name: "roles",
description: "Get a ka-role",
description: "get a ka-role",
options: [],
exe: (bot: Bot, interaction: DiscordenoInteraction) => {
const embed = {
color: 0xffe359,
title: "Roles of Kaboom Discord",
description:
"<@&901298683906240582> - <:minimark:883793329647652934> - You will be mentioned by people who need help\n<@&901533627802873876> - <:cowmark:884789264745897994> - You will be mentioned for announcements",
"<@&901298683906240582> - You will be mentioned by people who need help\n<@&901533627802873876> - You will be mentioned for announcements",
};

sendInteractionResponse(bot, interaction.id, interaction.token, {
Expand All @@ -34,14 +34,20 @@ export default () => {
label: "Helper",
customId: "helper_button",
style: ButtonStyles.Primary,
emoji: { id: "884813519961342002", name: "kbmhearth" },
emoji: {
id: "884813519961342002",
name: "kbmhearth",
},
},
{
type: MessageComponentTypes.Button,
label: "Announcements",
customId: "announcements_button",
style: ButtonStyles.Primary,
emoji: { id: "14611006838284310", name: "kbm_pineapple" },
style: ButtonStyles.Secondary,
emoji: {
id: "914611006838284310",
name: "kbm_pineapple",
},
},
],
},
Expand Down
22 changes: 17 additions & 5 deletions src/commands/tip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,36 @@ import {
Embed,
InteractionResponseTypes,
sendInteractionResponse,
} from "../deps/discordeno.ts";
} from "../../deps.ts";

export default () => {
return {
name: "tip",
description: "Get a tip of the Kaboom World",
description: "get a tip about the Kaboom World",
options: [],
exe: (bot: Bot, interaction: DiscordenoInteraction) => {
const tips = [
{ t: "npm i kaboom@next", img: null },
{ t: "kaboom({\nburp: true})", img: null },
{
t: "`npm i kaboom@next`",
img: null,
},
{
t: "```js\nkaboom({\n burp: true,\n});```",
img: null,
},
{
t: "mention <@&901298683906240582> for get <#883782079802908772> about kaboom",
},
{
t: "you can use these fonts in your kaboom game without import anything: `apl386`, `apl386o`, `sink`, `sinko`",
},
];

const tip = tips[Math.floor(Math.random() * tips.length)];

const embed: Embed = {
color: 0xffe359,
title: "TIP",
title: "Kaboom TIP",
description: tip.t,
};

Expand Down
31 changes: 0 additions & 31 deletions src/deps/discordeno.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/deps/dotenv.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/events/interactionCreate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { buttonsActions, commands } from "../mod.ts";
import { Bot, DiscordenoInteraction } from "../deps/discordeno.ts";
import { Bot, DiscordenoInteraction } from "../../deps.ts";

export function interactionCreate(
bot: Bot,
Expand Down
Loading

0 comments on commit 7ef82fd

Please sign in to comment.