🧑💻 addGuildAndGuildOwner example
This commit is contained in:
parent
10283f911b
commit
770064cf32
1 changed files with 37 additions and 0 deletions
37
examples/addGuildAndGuildOwner.ts
Normal file
37
examples/addGuildAndGuildOwner.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
const ownerId = "SNOWFLAKE";
|
||||
const guildId = "SNOWFLAKE";
|
||||
|
||||
// Create guildMember object
|
||||
const createGuildMember = await prisma.guildMember.upsert({
|
||||
where: {
|
||||
userId_guildId: {
|
||||
userId: ownerId,
|
||||
guildId,
|
||||
},
|
||||
},
|
||||
update: {},
|
||||
create: {
|
||||
user: {
|
||||
connectOrCreate: {
|
||||
create: {
|
||||
id: ownerId,
|
||||
},
|
||||
where: {
|
||||
id: ownerId,
|
||||
},
|
||||
},
|
||||
},
|
||||
guild: {
|
||||
connectOrCreate: {
|
||||
create: {
|
||||
id: guildId,
|
||||
},
|
||||
where: {
|
||||
id: guildId,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
logger.silly(createGuildMember);
|
Loading…
Add table
Reference in a new issue