Wish good morning to a user with /goodmorning @user you can also convey you additonal message in the footer which is optional :)
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let user = context.params.event.data.options[0].value;
let amsg = context.params.event.data.options[0]
? context.params.event.data.options[1].value
: null;
await lib.discord.users['@0.1.5'].dms.create({
recipient_id: `${user}`,
content: `<@!${context.params.event.member.user.id}> Wished You good morning:sunrise_over_mountains:`,
embed: {
type: 'rich',
title: `Good Morning ${context.params.event.member.user.username}#${context.params.event.member.user.discriminator}!`,
description: `A refreshing way to start your day good is **"A Cup of Coffee:coffee:"**`,
color: 0xff0000,
"image": {
"url": `https://thumbs.dreamstime.com/b/coffee-espresso-cup-36310917.jpg`,
"height": 0,
"width": 0
},
footer: {
text:
`${amsg}` ||
`**/morning** <@user> (optional)😃`,
},
},
});
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `Wished Good Morning to ${user} successfully:thumbsup:`,
embed: {
type: 'rich',
title: `Command Successful`,
description: `I conveyed your "Good Morning" to ${user}! he might wish you back soon!:slight_smile:`,
color: 0xff0000,
},
});