discord.io

Sending an image without the link showing with discord library

梦想与她 提交于 2019-12-11 00:55:54
问题 I would like my discord bot to send an image (from a url), but have the url be hidden from the message that is sent in chat. For sending messages, im using a switch statement that only uses the writing after an "!" case 'happy': bot.sendMessage({ to: channelID, message: 'https://pictureexample.jpg' }); How would I send messages without having the link show in chat? 回答1: As user4261590 wrote, you can use embeds to achieve this. Here's an example that might work for you: case 'happy': const

JavaScript TypeError: Cannot read property 'startsWith' of undefined - discord bot

折月煮酒 提交于 2019-12-02 11:34:31
问题 I must start this question by saying that I have very little knowledge of javascript (I'm practiced in Java) and just wanted to make a (somewhat) simple Discord bot that would say messages at random times. I Frankensteined 2 pieces of code from various tutorials together and currently have this: var Discord = require('discord.io'); var logger = require('winston'); var auth = require('./auth.json'); //random bot code var randomMessage; var randOn = false; var responseArray = [ //add more