mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 14:13:02 -04:00
adds no search result errors
This commit is contained in:
parent
c09a24ce9d
commit
52d2bbbc2d
6 changed files with 10 additions and 4 deletions
|
@ -13,10 +13,10 @@ module.exports = {
|
|||
name: 'audio',
|
||||
aliases: ['aud'],
|
||||
metadata: {
|
||||
description: 'video audio detection',
|
||||
description: '**audio detection**\nusing the audio command without replying to a message will try to identify the song in the most recent video\n\n**music platform links**\n__replying__ to a message while using this command will return a list of music platforms the provided music (link) is available on',
|
||||
examples: ['aud'],
|
||||
category: 'search',
|
||||
usage: 'audio <media>'
|
||||
usage: 'audio'
|
||||
},
|
||||
run: async (context) => {
|
||||
context.triggerTyping();
|
||||
|
|
|
@ -42,6 +42,8 @@ module.exports = {
|
|||
let search = await bingImages(context, args.query, context.channel.nsfw)
|
||||
search = search.response
|
||||
|
||||
if(search.body.status == 2) return editOrReply(context, {embeds:[createEmbed("error", context, search.body.message)]})
|
||||
|
||||
let pages = []
|
||||
for(const res of search.body.results){
|
||||
pages.push(createImageResultPage(context, res))
|
||||
|
|
|
@ -38,6 +38,8 @@ module.exports = {
|
|||
let search = await bing(context, args.query, context.channel.nsfw)
|
||||
search = search.response
|
||||
|
||||
if(search.body.status == 2) return editOrReply(context, {embeds:[createEmbed("error", context, search.body.message)]})
|
||||
|
||||
let pages = []
|
||||
for(const res of search.body.results){
|
||||
pages.push(createSearchResultPage(context, res))
|
||||
|
|
|
@ -42,6 +42,8 @@ module.exports = {
|
|||
let search = await googleImages(context, args.query, context.channel.nsfw)
|
||||
search = search.response
|
||||
|
||||
if(search.body.status == 2) return editOrReply(context, {embeds:[createEmbed("error", context, search.body.message)]})
|
||||
|
||||
let pages = []
|
||||
for(const res of search.body.results){
|
||||
pages.push(createImageResultPage(context, res))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const Hosts = Object.freeze({
|
||||
prod: "https://labscore-v2.vercel.app",
|
||||
local: "http://localhost:3000",
|
||||
local: "http://localhost",
|
||||
emoji: "https://derpystuff.gitlab.io/webstorage3/container/",
|
||||
statics: "https://derpystuff.gitlab.io/webstorage4/v2/"
|
||||
})
|
||||
|
|
|
@ -5,7 +5,7 @@ const { Api, Static, Hosts } = require('./endpoints')
|
|||
async function request(path, type, headers, args, host) {
|
||||
let timing = Date.now();
|
||||
url = Api.HOST + path
|
||||
if(process.env.USE_LOCAL_API) url = Hosts.local + path
|
||||
if(process.env.USE_LOCAL_API) url = Hosts.local + ":" + process.env.USE_LOCAL_API + path
|
||||
if(host) url = host + path
|
||||
|
||||
// apply default headers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue