0

So I was wondering how to make a welcome command. When using /welcome (text you want to display on users join). I want to store that text in json or database so every guild would have their welcome message.

rez
  • 311
  • 2
  • 17
  • Welcome to stackoverflow! please read [how to ask a good question](https://stackoverflow.com/help/how-to-ask). To be able to properly answer your question, please consider adding more details and especially what you've tried and what your code looks so far. – Chase Jun 14 '20 at 12:49
  • 1
    use quick.db not json – Internal Jun 14 '20 at 19:55

1 Answers1

0

you can compose your message like that in json :

"guild"{
  "000000000000000001": //guild id here   
    {
      "content": "your message here"
    },
  "000000000000000001":
    {
      "embeds": [
        {
          "title": "an embed",
          "description": "with description"
        }
     ]
   }
}

after that in your bot code you can do that

const welcomeMessage = require('myjson');

and when you need to display your welcome message you juste need to acces at your json like that

chanToSend.send(welcomeMessage.myserveurid);

for json editing thing I send you into this question here

MrSolarius
  • 599
  • 11
  • 28