refactor(arabot): change storage of ids

This commit is contained in:
Anthony 2022-07-15 02:14:29 +01:00
parent 753fdfb57c
commit 5daba2ac3b
2 changed files with 27 additions and 13 deletions

View File

@ -61,13 +61,13 @@ export async function addExistingUser(user: GuildMember) {
} }
// Checks what roles the user has // Checks what roles the user has
const hasVegan = user.roles.cache.has(IDs.roles.vegan); const hasVegan = user.roles.cache.has(IDs.roles.vegan.vegan);
const hasActivist = user.roles.cache.has(IDs.roles.activist); const hasActivist = user.roles.cache.has(IDs.roles.vegan.activist);
const hasPlus = user.roles.cache.has(IDs.roles.plus); const hasPlus = user.roles.cache.has(IDs.roles.vegan.plus);
const hasVegCurious = user.roles.cache.has(IDs.roles.vegCurious); const hasVegCurious = user.roles.cache.has(IDs.roles.nonvegan.vegCurious);
const hasConvinced = user.roles.cache.has(IDs.roles.convinced); const hasConvinced = user.roles.cache.has(IDs.roles.nonvegan.convinced);
const hasTrusted = user.roles.cache.has(IDs.roles.trusted); const hasTrusted = user.roles.cache.has(IDs.roles.trusted);
const hasMuted = user.roles.cache.has(IDs.roles.trusted); const hasMuted = user.roles.cache.has(IDs.roles.restrictions.muted);
// Create the user in the database // Create the user in the database
await prisma.user.create({ await prisma.user.create({
@ -82,4 +82,7 @@ export async function addExistingUser(user: GuildMember) {
muted: hasMuted, muted: hasMuted,
}, },
}); });
// Close the database connection
await prisma.$disconnect();
} }

View File

@ -18,14 +18,25 @@
const IDs = { const IDs = {
roles: { roles: {
trusted: '731563158011117590',
nonvegan: {
nonvegan: '774763753308815400', nonvegan: '774763753308815400',
vegCurious: '832656046572961803',
convinced: '797132019166871612',
},
vegan: {
vegan: '788114978020392982', vegan: '788114978020392982',
activist: '730915638746546257', activist: '730915638746546257',
plus: '798682625619132428', plus: '798682625619132428',
vegCurious: '832656046572961803', },
convinced: '797132019166871612', restrictions: {
trusted: '731563158011117590', sus: '859145930640457729',
muted: '730924813681688596', muted: '730924813681688596',
restricted1: '809769217477050369',
restricted2: '872482843304001566',
restricted3: '856582673258774538',
restricted4: '872472182888992858',
},
}, },
}; };