mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 06:33:05 -04:00
clean up some todos, add favicon helper
This commit is contained in:
parent
22e9b463a2
commit
7153c3ddaa
13 changed files with 32 additions and 31 deletions
|
@ -1,11 +1,11 @@
|
|||
const { google } = require('#api');
|
||||
const { paginator } = require('#client');
|
||||
const { PERMISSION_GROUPS } = require('#constants');
|
||||
const { format } = require('#utils/ansi');
|
||||
|
||||
const { format } = require('#utils/ansi');
|
||||
const { createEmbed, formatPaginationEmbeds, page } = require('#utils/embed');
|
||||
const { acknowledge } = require('#utils/interactions');
|
||||
const { link, citation, icon, codeblock, pill, smallPill } = require('#utils/markdown')
|
||||
const { link, citation, icon, codeblock, pill, smallPill, favicon} = require('#utils/markdown')
|
||||
const { editOrReply } = require('#utils/message')
|
||||
const { STATICS } = require('#utils/statics')
|
||||
|
||||
|
@ -22,8 +22,6 @@ function renderFooter(context, doodle){
|
|||
}
|
||||
|
||||
// These have to be synced with the backend (search_service/endpoints/google).
|
||||
|
||||
|
||||
const SEARCH_CARD_TYPES = {
|
||||
UNKNONW: 0,
|
||||
SEARCH_RESULT: 1,
|
||||
|
@ -44,14 +42,13 @@ const SEARCH_CARD_TYPES = {
|
|||
PIVOT_IMAGES: 100
|
||||
}
|
||||
|
||||
// TODO: create a favicon() util
|
||||
function createSearchResultPage(context, result, doodle){
|
||||
let res;
|
||||
switch(result.type){
|
||||
case SEARCH_CARD_TYPES.SEARCH_RESULT:
|
||||
res = createEmbed("default", context, {
|
||||
author: {
|
||||
iconUrl: `https://www.google.com/s2/favicons?domain=${encodeURIComponent(result.url)}&sz=256`,
|
||||
iconUrl: favicon(result.url),
|
||||
name: result.title,
|
||||
url: result.url
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue