Skip to content

Commit 269ebdd

Browse files
author
xyzjesper
committed
Fixed Welcome & Leave Database and Welcome Message.
1 parent eab72e4 commit 269ebdd

File tree

11 files changed

+9451
-222
lines changed

11 files changed

+9451
-222
lines changed

prisma/schema.prisma

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,13 +542,13 @@ model GuildLeaveSetup {
542542

543543
// UPDATE SOON
544544
model GuildWelcomeSetup {
545-
id String @id @default(auto()) @map("_id") @db.ObjectId
545+
id String @id @default(auto()) @map("_id") @db.ObjectId
546546
MessageTemplateId String
547547
ChannelId String
548548
Image Boolean
549-
ImageData WelcomeLeaveImageData
550-
GuildId String @unique
551-
Guilds Guilds @relation(fields: [GuildId], references: [GuildId])
549+
ImageData WelcomeLeaveImageData?
550+
GuildId String @unique
551+
Guilds Guilds @relation(fields: [GuildId], references: [GuildId])
552552
}
553553

554554
type WelcomeLeaveImageData {

src/modules/welcome/events/guildMemberAdd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default {
2626
});
2727
if (!toggleData?.WecomeEnabled) return;
2828

29-
const data = await database.guildLeaveSetup.findFirst({
29+
const data = await database.guildWelcomeSetup.findFirst({
3030
where: {GuildId: guild.id}
3131
});
3232
if (!data?.ChannelId) return;

src/modules/welcome/modals/welcome-image-create.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export default {
2828
if (!data) {
2929
await database.guildWelcomeSetup.create({
3030
data: {
31-
GuildId: interaction.guild?.id,
31+
Guilds: {
32+
connect: {
33+
GuildId: interaction.guild?.id,
34+
}
35+
},
3236
ChannelId: interaction.fields.getTextInputValue(
3337
"welcome-message-create-channel"
3438
),

src/modules/welcome/modals/welcome-message-create.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ export default {
2222
if (!data) {
2323
await database.guildWelcomeSetup.create({
2424
data: {
25-
GuildId: interaction.guild?.id,
25+
Guilds: {
26+
connect: {
27+
GuildId: interaction.guild?.id,
28+
}
29+
},
2630
MessageTemplateId: interaction.fields.getTextInputValue(
2731
"welcome-message-create-name"
2832
),

src/prisma/edge.js

Lines changed: 69 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/prisma/index-browser.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,67 @@ exports.Prisma.GuildYoutubeNotificationsScalarFieldEnum = {
827827
GuildId: 'GuildId'
828828
};
829829

830+
exports.Prisma.LevelSettingsScalarFieldEnum = {
831+
id: 'id',
832+
LevelUpChannelId: 'LevelUpChannelId',
833+
LevelUoMessageTemplateId: 'LevelUoMessageTemplateId',
834+
LeaderboardMessageTemplateId: 'LeaderboardMessageTemplateId',
835+
LeaderboardDisplayAmount: 'LeaderboardDisplayAmount',
836+
RequiredXPForFirstLevel: 'RequiredXPForFirstLevel',
837+
Format: 'Format',
838+
MessageXP: 'MessageXP',
839+
MessageXPRange: 'MessageXPRange',
840+
MesssageXPCooldown: 'MesssageXPCooldown',
841+
MessageXPType: 'MessageXPType',
842+
VoiceXP: 'VoiceXP',
843+
VoiceXPRange: 'VoiceXPRange',
844+
VoiceXPCooldown: 'VoiceXPCooldown',
845+
ExcludedChannelIds: 'ExcludedChannelIds',
846+
ExcludeUserIds: 'ExcludeUserIds',
847+
ExcludeRoleIds: 'ExcludeRoleIds',
848+
GuildId: 'GuildId'
849+
};
850+
851+
exports.Prisma.XPDropsScalarFieldEnum = {
852+
id: 'id',
853+
GuildId: 'GuildId',
854+
XPRange: 'XPRange',
855+
ClaimType: 'ClaimType',
856+
TimeToRespawn: 'TimeToRespawn',
857+
ChannelIds: 'ChannelIds'
858+
};
859+
860+
exports.Prisma.XPStreaksScalarFieldEnum = {
861+
id: 'id',
862+
Days: 'Days',
863+
Nickname: 'Nickname',
864+
BonusLevels: 'BonusLevels',
865+
BonusXP: 'BonusXP',
866+
ChannelId: 'ChannelId',
867+
MessageTemplateId: 'MessageTemplateId',
868+
Multiplier: 'Multiplier',
869+
RoleRewardIds: 'RoleRewardIds',
870+
GuildId: 'GuildId'
871+
};
872+
873+
exports.Prisma.LevelRolesScalarFieldEnum = {
874+
id: 'id',
875+
Level: 'Level',
876+
Multiplier: 'Multiplier',
877+
Type: 'Type',
878+
RoleId: 'RoleId',
879+
GuildId: 'GuildId'
880+
};
881+
882+
exports.Prisma.LevelsScalarFieldEnum = {
883+
id: 'id',
884+
XP: 'XP',
885+
RequiredXp: 'RequiredXp',
886+
Level: 'Level',
887+
UserId: 'UserId',
888+
GuildId: 'GuildId'
889+
};
890+
830891
exports.Prisma.UsersScalarFieldEnum = {
831892
id: 'id',
832893
Username: 'Username',
@@ -989,6 +1050,11 @@ exports.Prisma.ModelName = {
9891050
GuildFeatureToggles: 'GuildFeatureToggles',
9901051
GuildTwitchNotifications: 'GuildTwitchNotifications',
9911052
GuildYoutubeNotifications: 'GuildYoutubeNotifications',
1053+
LevelSettings: 'LevelSettings',
1054+
XPDrops: 'XPDrops',
1055+
XPStreaks: 'XPStreaks',
1056+
LevelRoles: 'LevelRoles',
1057+
Levels: 'Levels',
9921058
Users: 'Users',
9931059
Apis: 'Apis',
9941060
GuildBackups: 'GuildBackups',

0 commit comments

Comments
 (0)