Skip to content

Commit

Permalink
revert index
Browse files Browse the repository at this point in the history
  • Loading branch information
iernie committed Jul 31, 2024
1 parent cf92cc8 commit 0877a86
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,52 @@ Sentry.init({
});

(async () => {
try {
const app = initializeApp({
apiKey: process.env.apiKey,
authDomain: process.env.authDomain,
projectId: process.env.projectId,
});
getFirestore(app);
const app = initializeApp({
apiKey: process.env.apiKey,
authDomain: process.env.authDomain,
projectId: process.env.projectId,
});
getFirestore(app);

try {
await signInWithEmailAndPassword(getAuth(app), process.env.email!, process.env.password!);
console.log("Logged into firebase");
} catch (error) {
console.error(error);
}

const client = new Client({
partials: [Partials.Message, Partials.Channel, Partials.Reaction, Partials.ThreadMember],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessageReactions,
],
});
client.commands = new Collection<string, SlashCommand>();
const client = new Client({
partials: [Partials.Message, Partials.Channel, Partials.Reaction, Partials.ThreadMember],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessageReactions,
],
});
client.commands = new Collection<string, SlashCommand>();

const commandFiles = readdirSync("./commands");
for (const file of commandFiles.filter((el) => path.extname(el) === ".js")) {
const filePath = "./commands/" + file;
const command = (await import(filePath)).default as SlashCommand;
if ("data" in command && "execute" in command) {
client.commands.set(command.data.name, command);
} else {
console.error(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
}
const commandFiles = readdirSync("./commands");
for (const file of commandFiles.filter((el) => path.extname(el) === ".js")) {
const filePath = "./commands/" + file;
const command = (await import(filePath)).default as SlashCommand;
if ("data" in command && "execute" in command) {
client.commands.set(command.data.name, command);
} else {
console.error(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
}
}

const eventFiles = readdirSync("./events");
for (const file of eventFiles.filter((el) => path.extname(el) === ".js")) {
const filePath = "./events/" + file;
const event = (await import(filePath)).default as BotEvent<unknown>;
if (event.once) {
client.once(event.name, (arg) => event.execute(arg));
} else {
client.on(event.name, (arg) => event.execute(arg));
}
const eventFiles = readdirSync("./events");
for (const file of eventFiles.filter((el) => path.extname(el) === ".js")) {
const filePath = "./events/" + file;
const event = (await import(filePath)).default as BotEvent<unknown>;
if (event.once) {
client.once(event.name, (arg) => event.execute(arg));
} else {
client.on(event.name, (arg) => event.execute(arg));
}

client.login(process.env.token!);
} catch (error) {
console.info(error);
}

client.login(process.env.token!);
})();

0 comments on commit 0877a86

Please sign in to comment.