#how to make messages in schema

3 messages · Page 1 of 1 (latest)

tall gull

Are you asking how to store them? Or how to create one? Or what? You already have string there, that looks perfectly fine

create and findOneAndUpdate are both methods of mongoose models. Do you need help how to use them? Or with another part?

fathom sluice

@tough jetty

Have a command which accepts a string option for example, and then you can use something like this,

const updated = await <schema>.findOneAndUpdate(
    {
      Guild: <GuildId>,
      Channel: <ChannelId>
    },
    {
      WelcomeMsg: <welcomeMsg>,
      ByeMsg: <ByeMsg>
    },
    { 
      upsert: true
    }
)

upsert: true adds a new document with that information if a document was not found originally