Add the ability to link to the history site in a button
This commit is contained in:
parent
14df79139a
commit
60a83eef3d
4 changed files with 18 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ import { deleteVoteButton } from "@/utils/components/buttons/delete_vote";
|
||||||
import { showUserVoteButton } from "@/utils/components/buttons/my_vote";
|
import { showUserVoteButton } from "@/utils/components/buttons/my_vote";
|
||||||
import { viewDBButton } from "@/utils/components/buttons/view_db";
|
import { viewDBButton } from "@/utils/components/buttons/view_db";
|
||||||
import { countVotesButton } from "@/utils/components/buttons/count_votes";
|
import { countVotesButton } from "@/utils/components/buttons/count_votes";
|
||||||
|
import { historyLinkButton } from "@/utils/components/buttons/history_site";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
method: `POST`, path: `/{guild_id}/bracket`,
|
method: `POST`, path: `/{guild_id}/bracket`,
|
||||||
|
|
@ -135,6 +136,10 @@ export default {
|
||||||
components: [],
|
components: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (extra_buttons.includes(`historyLink`)) {
|
||||||
|
actionRow.components.push(historyLinkButton(gID));
|
||||||
|
};
|
||||||
|
|
||||||
if (extra_buttons.includes(`DB`)) {
|
if (extra_buttons.includes(`DB`)) {
|
||||||
actionRow.components.push(viewDBButton);
|
actionRow.components.push(viewDBButton);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
1
server/src/types/config.d.ts
vendored
1
server/src/types/config.d.ts
vendored
|
|
@ -23,6 +23,7 @@ interface config {
|
||||||
server: {
|
server: {
|
||||||
host: string;
|
host: string;
|
||||||
port: number;
|
port: number;
|
||||||
|
history_site_base: string;
|
||||||
};
|
};
|
||||||
guilds: {
|
guilds: {
|
||||||
[index: string]: channel_config;
|
[index: string]: channel_config;
|
||||||
|
|
|
||||||
|
|
@ -28,5 +28,6 @@ interface button {
|
||||||
interface link_button {
|
interface link_button {
|
||||||
type: 2;
|
type: 2;
|
||||||
style: 5;
|
style: 5;
|
||||||
|
label: string;
|
||||||
url: string;
|
url: string;
|
||||||
}
|
}
|
||||||
11
server/src/utils/components/buttons/history_site.ts
Normal file
11
server/src/utils/components/buttons/history_site.ts
Normal 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}`
|
||||||
|
};
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue