Can you help me for embeds?


#1

if i run this code :

    if (msg.content.startsWith(`${PREFIX}help`)) {
		const helpcmd = {
			"title": "Help",
			"description": "__***Liste des commendes***__ :",
			"color": 65437,
			"timestamp": "2018-12-03T19:33:15.746Z",
			"footer": {
			  "icon_url": "https://cdn.discordapp.com/avatars/518912322581037057/e6aec65c3c941863a92723aa32d1c57f.png",
			  "text": "Help"
			},
			"thumbnail": {
			  "url": "https://github.com/NaNonnI/musicbot/blob/master/%EF%BC%9F.png?raw=true"
			},
			"author": {
			  "name": "By NaNo",
			  "icon_url": "https://cdn.discordapp.com/avatars/511682139646066689/16e696bbdde1e27ba311b41710c98d8e.png"
			},
			"fields": [
			  {
				"name": "**-** __*m!help*__",
				"value": "*Montrer ce message*"
			  },
			  {
				"name": " **-** __*m!play*__",
				"value": "*Pour lire une musique* **(usage correcte : m!play** ***lien/nom*** **)**"
			  },
			  {
				"name": "**-** __*m!pause*__",
				"value": "*Mettre en pause la musique en lecture*"
			  },
			  {
				"name": "**-** __*m!resume*__",
				"value": "*Reprendre la lecture de la musique mit en pause*"
			  },
			  {
				"name": "**-** __*m!volume*__",
				"value": "*Pour lire une musique* **(usage correcte : m!volume** ***pourcentage sur 10*** **)**"
			  },
			  {
				"name": "**-** __*m!np*__",
				"value": "*Voir quelle musique est en train de ce lire*"
			  },
			  {
				"name": "**-** __*m!credit*__",
				"value": "*Voir le créateur du bot* ***:)***"
			  }
			]
		  };
		  channel.send({ helpcmd });
    }

i have this error

(node:25479) UnhandledPromiseRejectionWarning: ReferenceError: channel is not defined
    at Client.client.on (/home/DiscordBot/PMusicBot/MusicBot.js:84:5)
    at Client.emit (events.js:182:13)
    at MessageCreateHandler.handle (/home/DiscordBot/PMusicBot/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (/home/DiscordBot/PMusicBot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (/home/DiscordBot/PMusicBot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (/home/DiscordBot/PMusicBot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
    at WebSocket.onMessage (/home/DiscordBot/PMusicBot/node_modules/ws/lib/event-target.js:120:16)
    at WebSocket.emit (events.js:182:13)
    at Receiver._receiver.onmessage (/home/DiscordBot/PMusicBot/node_modules/ws/lib/websocket.js:137:47)
    at Receiver.dataMessage (/home/DiscordBot/PMusicBot/node_modules/ws/lib/receiver.js:409:14)
(node:25479) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:25479) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

help me please.


#2

Should that be msg.channel.send?


#3

Is this a Meteor question?


#4
(node:27859) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message
    at item.request.gen.end (/home/DiscordBot/PMusicBot/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:79:15)
    at then (/home/DiscordBot/PMusicBot/node_modules/snekfetch/src/index.js:215:21)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:27859) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:27859) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.