function handleImages(contentObj) { contentObj('figure noscript').each((index, elm) => { let imgHtml = contentObj(elm).html(); if (imgHtml.match('<')) { imgHtml = htmlEntities.decode(imgHtml); } const figObj = contentObj(elm).closest("figure"); const figCaption = contentObj(figObj).children('figcaption'); figObj.html(imgHtml); contentObj(figObj).children('img').removeAttr('class'); figObj.append(figCaption); }); }
Ansi.box(` ${Ansi.joinLines([Ansi.box(votes, 'votes'.red, true, true), Ansi.box(thinBody, 'text'.red, false, true)])} ${Ansi.joinLines([Ansi.box(tags.map(t => t.bold).join(', '), 'tags'.green, false, true), Ansi.box(user.underline, 'user'.green, false, true), Ansi.box(terminalLink(id.toString().underline, url), 'qID'.green, true, true)])} `, `${entities.decode(site).bold} - ${entities.decode(thinTitle).blue}`, false, true)
doTransform() { return entities.decode(this._value); }
function doHangmanHint(channel, answer) { var id = channel.id; // Verify that the game is still running and that it's the same game. if(typeof game[id] === "undefined" || !game[id].inRound || answer !== game[id].answer) { return; } answer = entities.decode(answer); // If the total string is too small, skip showing a hint. if(answer.length < 4) { return; } var hintStr = createObscuredAnswer(answer, true); Trivia.send(channel, void 0, {embed: { color: Trivia.embedCol, description: `Hint: ${hintStr}` }}); }
entities.decode(root.querySelector('.quote').childNodes.filter(node => !node.rawAttributes || !node.rawAttributes.hasOwnProperty('rel')).map(node => node.rawText).join('').replace(/\n/g, ' ').replace('—', ''))
async run(message, args, level, settings, texts) { // eslint-disable-line no-unused-vars let query = args.join(" "); if (!query) return message.channel.send("You must provide a query to search NASA's image database for."); else query = encodeURIComponent(args.join(" ")); fetch(`https://images-api.nasa.gov/search?q=${query}&media_type=image`) .then(res => res.json()) .then(body => { const images = body.collection.items; if (!images.length || images.length === 0) return message.channel.send("No results found."); const data = images.random(); const description = h.decode(data.data[0].description); message.channel.send(description.length > 1997 ? description.substring(0, 1997) + "..." : description.substring(0, 2000) + " <:NASA:476079744857931796>", { file: data.links[0].href }); }) .catch(error => { this.client.logger.error(error); message.channel.send(texts.general.error.replace(/{{err}}/g, error)); }); }
let val = JSON.parse(entities.decode($('#waybill_list_val_box').val()))
var qnaMakerResult = args; session.dialogData.qnaMakerResult = qnaMakerResult; var questionOptions = qnaMakerResult.answers.map(function (qna) { return htmlentities.decode(qna.questions[0]); }); var promptOptions = { listStyle: builder.ListStyle.button }; builder.Prompts.choice(session, 'Escolha abaixo' , questionOptions, promptOptions); function (session, results) { var qnaMakerResult = session.dialogData.qnaMakerResult; var filteredResult = qnaMakerResult.answers.filter(function (qna) { return htmlentities.decode(qna.questions[0]) === results.response.entity; }); var selectedQnA = filteredResult[0]; session.send(selectedQnA.answer);
const choices = quiz.incorrect_answers.map(ans => h.decode(ans)); choices.push(h.decode(quiz.correct_answer)); .setDescription(stripIndents` ${h.decode(quiz.question)} ${h.decode(quiz.category)} | ${h.decode(quiz.difficulty.toProperCase())} `) .setFooter("Reply with the correct letter within 60 seconds!", message.author.displayAvatarURL); if (choice === h.decode(quiz.correct_answer)) return message.channel.send("Well done, your answer is correct!\nTrivia session ended."); else return message.channel.send(`Unfortunately, that's the wrong answer. The correct answer was **${h.decode(quiz.correct_answer)}**, and you chose **${choice}**.\nTrivia session ended.`);
Trivia.send(channel, author, {embed: { color: game[id].color, description: `*${categoryString}*\n**${entities.decode(question.question)}**\n${answerString}${infoString}` }}, (msg, err) => { if(err) {