@averagehelper/corde
Version:
A simple library for Discord bot tests. (Republished fork to demonstrate a bugfix)
46 lines (45 loc) • 1.67 kB
TypeScript
import { Message, MessageEmbed } from "discord.js";
import { messageType, MinifiedEmbedMessage } from "../../../types";
declare class MessageUtilsManager {
messagesMatches(returnedMessage: Message, expectation: string | number | boolean | MessageEmbed): boolean;
/**
* Format Discord responses
*
* @param answer Discord response for a message sent
*
* @param type Type expected of that message
*
* @description Discord adds some attributes that are not present in embed message before it is sent
*
* This is data **before** send to Discord
*
* ```javascript
* "image": {
* "url": "https://i.imgur.com/wSTFkRM.png"
* },
* "thumbnail": {
* "url": "https://i.imgur.com/wSTFkRM.png"
* }
* ```
*
* And this is part of embed message **after** get from Discord
*
* ```javascript
* "image": {
* "height": 0,
* "proxyURL": "https://images-ext-2.discordapp.net/external/DoAGN014Q46B7iDBr2VJyHUL59QLSWdEAZ5wOoWe8CY/https/i.imgur.com/wSTFkRM.png",
* "url": "https://i.imgur.com/wSTFkRM.png",
* "width": 0
* },
* "thumbnail": {
* "height": 0,
* "proxyURL": "https://images-ext-2.discordapp.net/external/DoAGN014Q46B7iDBr2VJyHUL59QLSWdEAZ5wOoWe8CY/https/i.imgur.com/wSTFkRM.png",
* "url": "https://i.imgur.com/wSTFkRM.png",
* "width": 0
* }
* ```
*/
getMessageByType(answer: Message, type: messageType): Message | MinifiedEmbedMessage;
}
declare const MessageUtils: MessageUtilsManager;
export default MessageUtils;