0
0
Fork 0

Move the button objects into their relevant files

This commit is contained in:
Oliver-Akins 2021-09-19 01:45:32 -06:00
parent e49bc76e20
commit 0eca255f33
4 changed files with 32 additions and 0 deletions

View file

@ -1,6 +1,14 @@
import { db } from "@/main";
export const countVotesButton: button = {
type: 2,
style: 2,
label: `See Count`,
custom_id: `showCount`,
};
export async function countVotes(data: any): Promise<object> {
let gID = data.guild_id;

View file

@ -1,6 +1,14 @@
import { db } from "@/main";
export const deleteVoteButton = {
type: 2,
style: 4,
label: `Remove Vote`,
custom_id: `deleteVote`
};
export async function deleteVote(data: any): Promise<object> {
let userID = data.member.user.id;
let gID = data.guild_id;

View file

@ -1,5 +1,13 @@
import { db } from "@/main";
export const showUserVoteButton = {
type: 2,
style: 1,
label: `What Did I Vote For?`,
custom_id: `showMyVote`,
};
export async function showUserVote(data: any): Promise<object> {
let gID = data.guild_id;
let vote = db[gID].bracket.users[data.member.user.id];

View file

@ -1,6 +1,14 @@
import { db } from "@/main";
export const viewDBButton = {
type: 2,
style: 1,
label: `See Database Object`,
custom_id: `viewDB`,
};
export async function viewDB(data: any): Promise<object> {
let gID = data.guild_id;
return {