0
0
Fork 0

Add the ability to link to the history site in a button

This commit is contained in:
Oliver-Akins 2021-09-30 01:36:22 -06:00
parent 14df79139a
commit 60a83eef3d
4 changed files with 18 additions and 0 deletions

View file

@ -8,6 +8,7 @@ import { deleteVoteButton } from "@/utils/components/buttons/delete_vote";
import { showUserVoteButton } from "@/utils/components/buttons/my_vote";
import { viewDBButton } from "@/utils/components/buttons/view_db";
import { countVotesButton } from "@/utils/components/buttons/count_votes";
import { historyLinkButton } from "@/utils/components/buttons/history_site";
export default {
method: `POST`, path: `/{guild_id}/bracket`,
@ -135,6 +136,10 @@ export default {
components: [],
};
if (extra_buttons.includes(`historyLink`)) {
actionRow.components.push(historyLinkButton(gID));
};
if (extra_buttons.includes(`DB`)) {
actionRow.components.push(viewDBButton);
};

View file

@ -23,6 +23,7 @@ interface config {
server: {
host: string;
port: number;
history_site_base: string;
};
guilds: {
[index: string]: channel_config;

View file

@ -28,5 +28,6 @@ interface button {
interface link_button {
type: 2;
style: 5;
label: string;
url: string;
}

View file

@ -0,0 +1,11 @@
import { config } from "@/main";
export const historyLinkButton = (guild_id: string): link_button => {
return {
type: 2,
style: 5,
label: `Bracket History`,
url: `${config.server.history_site_base}?gid=${guild_id}`
};
};