vylbot-app/src/vylbot.ts
Ethan Lane efb431ef3a
All checks were successful
continuous-integration/drone/push Build is passing
Fix nickname change event not working (#385)
# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

- Fix the nickname changed event not working
    - This was due to the default value not being set because of a typo
- Update the client to allow partials for guild members

#353

## Type of change

Please delete options that are not relevant.

- [x] Bug fix (non-breaking change which fixes an issue)

# How Has This Been Tested?

Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration.

- This has been tested locally by making sure the nickname change event fires when expected

# Checklist

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that provde my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules

Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/385
Reviewed-by: VylpesTester <tester@vylpes.com>
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
2023-12-16 16:50:26 +00:00

41 lines
865 B
TypeScript

import { CoreClient } from "./client/client";
import * as dotenv from "dotenv";
import registry from "./registry";
import { IntentsBitField, Partials } from "discord.js";
dotenv.config();
const requiredConfigs: string[] = [
"BOT_TOKEN",
"BOT_VER",
"BOT_AUTHOR",
"BOT_OWNERID",
"BOT_CLIENTID",
"DB_HOST",
"DB_PORT",
"DB_AUTH_USER",
"DB_AUTH_PASS",
"DB_SYNC",
"DB_LOGGING",
];
requiredConfigs.forEach(config => {
if (!process.env[config]) {
throw `${config} is required in .env`;
}
});
const client = new CoreClient([
IntentsBitField.Flags.Guilds,
IntentsBitField.Flags.GuildMessages,
IntentsBitField.Flags.GuildMembers,
IntentsBitField.Flags.MessageContent,
], [
Partials.GuildMember,
Partials.User,
]);
registry.RegisterCommands();
registry.RegisterEvents();
client.start();