Move the button objects into their relevant files
This commit is contained in:
parent
e49bc76e20
commit
0eca255f33
4 changed files with 32 additions and 0 deletions
|
|
@ -1,6 +1,14 @@
|
||||||
import { db } from "@/main";
|
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> {
|
export async function countVotes(data: any): Promise<object> {
|
||||||
let gID = data.guild_id;
|
let gID = data.guild_id;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,14 @@
|
||||||
import { db } from "@/main";
|
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> {
|
export async function deleteVote(data: any): Promise<object> {
|
||||||
let userID = data.member.user.id;
|
let userID = data.member.user.id;
|
||||||
let gID = data.guild_id;
|
let gID = data.guild_id;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,13 @@
|
||||||
import { db } from "@/main";
|
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> {
|
export async function showUserVote(data: any): Promise<object> {
|
||||||
let gID = data.guild_id;
|
let gID = data.guild_id;
|
||||||
let vote = db[gID].bracket.users[data.member.user.id];
|
let vote = db[gID].bracket.users[data.member.user.id];
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,14 @@
|
||||||
import { db } from "@/main";
|
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> {
|
export async function viewDB(data: any): Promise<object> {
|
||||||
let gID = data.guild_id;
|
let gID = data.guild_id;
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue