feat: add audit logging via webhook (#309)

* feat: add audit logging via webhook

* addd missing auditLogWebhook values in various places
This commit is contained in:
41666 2021-07-13 23:01:25 -04:00 committed by GitHub
parent 5671a408c1
commit acc604f83f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 488 additions and 22 deletions

View file

@ -128,17 +128,22 @@ export const updateGuildMemberRoles = async (
export const getGuildData = async (id: string): Promise<GuildDataT> => {
const guildData = await GuildData.get<GuildDataT>(id);
const empty = {
id,
message: '',
categories: [],
features: Features.None,
auditLogWebhook: null,
};
if (!guildData) {
return {
id,
message: '',
categories: [],
features: Features.None,
};
return empty;
}
return guildData;
return {
...empty,
...guildData,
};
};
const calculateRoleSafety = (role: Role | APIRole, highestBotRolePosition: number) => {