mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 06:03:04 -04:00
big
This commit is contained in:
parent
0ea80b7452
commit
3432604c52
10 changed files with 79 additions and 9 deletions
|
@ -51,6 +51,7 @@ function createCommandPage(context, prefix, command){
|
|||
const categories = {
|
||||
"core": `${icon("house")} Core Commands`,
|
||||
"info": `${icon("info")} Information Commands`,
|
||||
"utils": `${icon("utils")} Utility Commands`,
|
||||
"image": `${icon("image")} Image Commands`,
|
||||
"mod": `${icon("moderation")} Moderation Commands`,
|
||||
"search": `${icon("search")} Search Commands`
|
||||
|
|
|
@ -9,7 +9,7 @@ module.exports = {
|
|||
name: 'safetylabels',
|
||||
metadata: {
|
||||
description: 'Image Safe Search Labels',
|
||||
examples: ['labels'],
|
||||
examples: ['safetylabels'],
|
||||
category: 'utils',
|
||||
usage: 'safetylabels <attachment>'
|
||||
},
|
||||
|
|
|
@ -4,8 +4,8 @@ const { createEmbed } = require('../../../labscore/utils/embed')
|
|||
const { editOrReply } = require('../../../labscore/utils/message')
|
||||
|
||||
module.exports = {
|
||||
name: 'guildicon',
|
||||
aliases: ["servericon","gi","si"],
|
||||
name: 'servericon',
|
||||
aliases: ["guildicon","gi","si"],
|
||||
metadata: {
|
||||
description: 'server icon',
|
||||
examples: ['gi'],
|
||||
|
|
|
@ -39,14 +39,13 @@ module.exports = {
|
|||
label: 'query',
|
||||
aliases: ['urban', 'ud'],
|
||||
metadata: {
|
||||
description: 'urban dictionary definitions (might be nsfw)',
|
||||
description: 'urban dictionary definitions (might be nsfw).\nproviding no search term returns random results.',
|
||||
examples: ['ud Flask'],
|
||||
category: 'search',
|
||||
usage: 'urbandictionary <query>'
|
||||
},
|
||||
run: async (context, args) => {
|
||||
context.triggerTyping();
|
||||
if(!args.query) return editOrReply(context, {embeds:[createEmbed("warning", context, `Missing Parameter (query).`)]})
|
||||
try{
|
||||
let search = await urbandictionary(context, args.query)
|
||||
search = search.response
|
||||
|
|
58
commands/message/search/wikihow.js
Normal file
58
commands/message/search/wikihow.js
Normal file
|
@ -0,0 +1,58 @@
|
|||
const { createEmbed, formatPaginationEmbeds } = require('../../../labscore/utils/embed')
|
||||
const { link, icon, highlight } = require('../../../labscore/utils/markdown')
|
||||
const { editOrReply } = require('../../../labscore/utils/message')
|
||||
const { STATICS } = require('../../../labscore/utils/statics')
|
||||
|
||||
const { paginator } = require('../../../labscore/client');
|
||||
const { wikihow } = require('../../../labscore/api');
|
||||
|
||||
function createWikiHowPage(context, result){
|
||||
let e = createEmbed("default", context, {
|
||||
description: `**${link(result.link, result.title)}**\n\n${result.snippet}`,
|
||||
footer: {
|
||||
iconUrl: STATICS.wikihow,
|
||||
text: `WikiHow • ${context.application.name}`
|
||||
}
|
||||
})
|
||||
if(result.image) e.image = {
|
||||
url: result.image
|
||||
}
|
||||
let res = {"embeds": [e]}
|
||||
return res;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
name: 'wikihow',
|
||||
label: 'query',
|
||||
aliases: ['wh', 'how'],
|
||||
metadata: {
|
||||
description: 'how do you survive??',
|
||||
examples: ['wh download'],
|
||||
category: 'search',
|
||||
usage: 'wikihow <query>'
|
||||
},
|
||||
run: async (context, args) => {
|
||||
context.triggerTyping();
|
||||
try{
|
||||
let search = await wikihow(context, args.query)
|
||||
search = search.response
|
||||
|
||||
let pages = []
|
||||
|
||||
if(search.body.data.length == 0) return editOrReply(context, {embeds:[createEmbed("error", context, `No results found.`)]})
|
||||
|
||||
for(const res of search.body.data){
|
||||
pages.push(createWikiHowPage(context, res))
|
||||
}
|
||||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const paging = await paginator.createPaginator({
|
||||
context,
|
||||
pages
|
||||
});
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
return editOrReply(context, {embeds:[createEmbed("error", context, `Unable to perform google search.`)]})
|
||||
}
|
||||
},
|
||||
};
|
|
@ -34,7 +34,7 @@ module.exports = {
|
|||
metadata: {
|
||||
description: 'Enlarge Emoji.',
|
||||
examples: ['enlarge 😀'],
|
||||
category: 'util',
|
||||
category: 'utils',
|
||||
usage: 'enlarge <emoji>'
|
||||
},
|
||||
args: [
|
||||
|
|
|
@ -9,7 +9,7 @@ module.exports = {
|
|||
metadata: {
|
||||
description: 'screenshot website',
|
||||
examples: ['ss google.com'],
|
||||
category: 'util',
|
||||
category: 'utils',
|
||||
usage: 'screenshot <url>'
|
||||
},
|
||||
run: async (context, args) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue