Skip to content

Commit

Permalink
Minor formatting and typings fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rjt-rockx committed Nov 17, 2022
1 parent f6c4573 commit efe28d6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bot/commands/start.ts
Original file line number Diff line number Diff line change
@@ -1,5 1,5 @@
import { Session } from "@prisma/client";
import { time } from "discord.js";
// import { time } from "discord.js";
import { CommandContext, CommandOptionType, SlashCommand, SlashCreator } from "slash-create";

import db from "../classes/database";
Expand Down
26 changes: 15 additions & 11 deletions bot/commands/stop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 56,7 @@ export default class Stop extends SlashCommand<BotClient> {

const startHintFields: APIEmbedField[] = [];
if (startCommandId)
startHintFields.push({
startHintFields.push({
name: "Want to browse the web together?",
value: `Use </start:${startCommandId}> and share the link. It's that easy!`,
});
Expand All @@ -74,7 74,7 @@ export default class Stop extends SlashCommand<BotClient> {
style: 5,
url: process.env.VITE_DISCORD_SUPPORT_SERVER,
},
]
];

if (sessions.length) {
for (const session of sessions) {
Expand Down Expand Up @@ -121,19 121,21 @@ export default class Stop extends SlashCommand<BotClient> {
}
}

const requestFeedbackField = {
name: "Let us know how it went!",
value: "Your feedback helps us improve the bot.",
};

await ctx.send({
embeds: [
{
title: sessions.length
? `Stopped ${sessions.length > 1 ? `${sessions.length} multiplayer browsers` : "multiplayer browser"}`
: "No multiplayer browser was active",
fields: !sessions.length ? startHintFields : [{
name: "Let us know how it went!",
value: "Your feedback helps us improve the bot.",
}],
fields: !sessions.length ? startHintFields : [requestFeedbackField],
},
],
components: [{ type: 1, components: sessions.length ? feedbackButtons:supportButtons }],
components: [{ type: 1, components: sessions.length ? feedbackButtons : supportButtons }],
ephemeral: true,
});

Expand All @@ -147,10 149,12 @@ export default class Stop extends SlashCommand<BotClient> {
description: "Join the support server to suggest new features, talk to the developers and more.",
},
],
components: [{
type: 1,
components: supportButtons,
}],
components: [
{
type: 1,
components: supportButtons,
},
],
});
sessions.forEach(async (session) => {
await database.session.update({
Expand Down
2 changes: 0 additions & 2 deletions env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 4,13 @@ declare global {
DISCORD_CLIENT_ID: string;
DISCORD_CLIENT_SECRET: string;
DISCORD_BOT_TOKEN: string;
VITE_DISCORD_INVITE_URL: string;
VITE_DISCORD_SUPPORT_SERVER: string;
VITE_GITHUB_URL: string;
HB_API_KEY: string;
HB_API_ENV: string;
VITE_CLIENT_ID: string;
VITE_CLIENT_PORT: string;
VITE_CLIENT_BASE_URL: string;
VITE_CLIENT_SOCKET_URL: string;
VITE_API_SERVER_PORT: string;
VITE_API_SERVER_BASE_URL: string;
DATABASE_URL: string;
Expand Down

0 comments on commit efe28d6

Please sign in to comment.