Skip to content

Commit

Permalink
remove polls (wooooooo)
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed May 30, 2024
1 parent 8cc2360 commit d2c5396
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 788 deletions.
14 changes: 0 additions & 14 deletions lang/en-US/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,6 @@
"description": "`%CHOICE%` is not a valid FAQ keyword! Have you made a typo?"
}
},
"poll": {
"ended": "This poll has ended!",
"suggestion": "Use /poll to make a poll!",
"vote": {
"counted": "Your vote has been counted!",
"counted_suggestion": "You can remove your vote by reacting again.",
"removed": "Your vote has been removed!",
"removed_suggestion": "You can add a new vote by reacting again."
},
"timeout": {
"no_type_given": "The given timeout doesn't specify which length it is!",
"example_types": "Example: `30s`, `1 min`, `10 hours`, `1 day`, `1 week`, `1 month`, `1 year`"
}
},
"stats": {
"usage": "%COMMAND% has run %USE% times.",
"top_ten": "Top 10 most used commands:",
Expand Down
1 change: 1 addition & 0 deletions lang/en-US/errors.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"suggestion": "Make sure you uploaded an image, replied to a valid image, used a valid image URL, or are in the correct channel."
},
"command": "One of my developers made an error while making this command! Don't worry, the error is not on your side. Please contact <@360249987927638016>, <@473860522710794250>, or <@173336582265241601> if this keeps occurring.",
"polls_removed": "CompliBot polls have been made redundant by the native Discord feature and have thus been removed.",
"permission": {
"notice": "You don't have permission to do that!",
"role_locked": "Only %TYPE%s can use this.",
Expand Down
43 changes: 0 additions & 43 deletions src/client/automation.ts

This file was deleted.

15 changes: 6 additions & 9 deletions src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from "discord.js";
import {
Message,
Automation,
StringSelectMenuInteraction,
ButtonInteraction,
ModalSubmitInteraction,
Expand All @@ -23,7 +22,6 @@ import { EmittingCollection } from "@helpers/emittingCollection";
import { setData, getData } from "@utility/handleJSON";
import { handleError } from "@functions/handleError";
import { err, info, success } from "@helpers/logger";
import { Poll } from "@helpers/poll";

import { join } from "path";
import chalk from "chalk";
Expand All @@ -41,9 +39,8 @@ export const paths = {
menus: join(__dirname, "..", "components", "menus"),
modals: join(__dirname, "..", "components", "modals"),
},
polls: "polls.json",
commandsProcessed: "commandsProcessed.json",
};
} as const;

export const errors = [
{ displayName: "Disconnect", error: "disconnect" },
Expand Down Expand Up @@ -82,7 +79,6 @@ export class ExtendedClient<Ready extends boolean = boolean> extends Client<Read
public verbose = false;
public firstStart = true; // used for prettier restarting in dev mode
public readonly tokens: Tokens;
public readonly automation = new Automation(this);

public readonly logs: Log[] = [];
private readonly maxLogs = 50;
Expand All @@ -92,7 +88,6 @@ export class ExtendedClient<Ready extends boolean = boolean> extends Client<Read
public readonly modals = new Collection<string, Component<ModalSubmitInteraction>>();
public readonly slashCommands = new Collection<string, SlashCommand>();

public polls = new EmittingCollection<string, Poll>();
public commandsProcessed = new EmittingCollection<string, number>();

constructor(data: ClientOptions & { tokens: Tokens }, firstStart = true) {
Expand Down Expand Up @@ -122,8 +117,6 @@ export class ExtendedClient<Ready extends boolean = boolean> extends Client<Read
this.loadEvents();
this.loadComponents();
this.loadCollections();

this.automation.start();
});

// all error types
Expand All @@ -133,6 +126,11 @@ export class ExtendedClient<Ready extends boolean = boolean> extends Client<Read
}),
);

// uptime kuma heartbeat for production bot
if (this.tokens.status) {
setInterval(() => fetch(this.tokens.status + this.ws.ping).catch(() => {}), 600000); // 10 minutes
}

return this;
}

Expand Down Expand Up @@ -168,7 +166,6 @@ export class ExtendedClient<Ready extends boolean = boolean> extends Client<Read
*/
private loadCollections() {
if (this.verbose) console.log(`${info}Loading collection data...`);
this.loadCollection(this.polls, paths.polls, paths.json);
this.loadCollection(this.commandsProcessed, paths.commandsProcessed, paths.json);
return this;
}
Expand Down
1 change: 0 additions & 1 deletion src/client/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export { ExtendedClient as Client } from "./client";
export { ExtendedEmbedBuilder as EmbedBuilder } from "./embed";
export * from "./message";
export * from "./automation";
export * from "./interaction";
140 changes: 0 additions & 140 deletions src/commands/bot/poll.ts

This file was deleted.

40 changes: 0 additions & 40 deletions src/components/buttons/poll/pollDelete.ts

This file was deleted.

51 changes: 0 additions & 51 deletions src/components/buttons/poll/pollVote.ts

This file was deleted.

Loading

0 comments on commit d2c5396

Please sign in to comment.