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',
|
name: 'audio',
|
||||||
aliases: ['aud'],
|
aliases: ['aud'],
|
||||||
metadata: {
|
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'],
|
examples: ['aud'],
|
||||||
category: 'search',
|
category: 'search',
|
||||||
usage: 'audio <media>'
|
usage: 'audio'
|
||||||
},
|
},
|
||||||
run: async (context) => {
|
run: async (context) => {
|
||||||
context.triggerTyping();
|
context.triggerTyping();
|
||||||
|
|
|
@ -41,6 +41,8 @@ module.exports = {
|
||||||
try{
|
try{
|
||||||
let search = await bingImages(context, args.query, context.channel.nsfw)
|
let search = await bingImages(context, args.query, context.channel.nsfw)
|
||||||
search = search.response
|
search = search.response
|
||||||
|
|
||||||
|
if(search.body.status == 2) return editOrReply(context, {embeds:[createEmbed("error", context, search.body.message)]})
|
||||||
|
|
||||||
let pages = []
|
let pages = []
|
||||||
for(const res of search.body.results){
|
for(const res of search.body.results){
|
||||||
|
|
|
@ -38,6 +38,8 @@ module.exports = {
|
||||||
let search = await bing(context, args.query, context.channel.nsfw)
|
let search = await bing(context, args.query, context.channel.nsfw)
|
||||||
search = search.response
|
search = search.response
|
||||||
|
|
||||||
|
if(search.body.status == 2) return editOrReply(context, {embeds:[createEmbed("error", context, search.body.message)]})
|
||||||
|
|
||||||
let pages = []
|
let pages = []
|
||||||
for(const res of search.body.results){
|
for(const res of search.body.results){
|
||||||
pages.push(createSearchResultPage(context, res))
|
pages.push(createSearchResultPage(context, res))
|
||||||
|
|
|
@ -42,6 +42,8 @@ module.exports = {
|
||||||
let search = await googleImages(context, args.query, context.channel.nsfw)
|
let search = await googleImages(context, args.query, context.channel.nsfw)
|
||||||
search = search.response
|
search = search.response
|
||||||
|
|
||||||
|
if(search.body.status == 2) return editOrReply(context, {embeds:[createEmbed("error", context, search.body.message)]})
|
||||||
|
|
||||||
let pages = []
|
let pages = []
|
||||||
for(const res of search.body.results){
|
for(const res of search.body.results){
|
||||||
pages.push(createImageResultPage(context, res))
|
pages.push(createImageResultPage(context, res))
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const Hosts = Object.freeze({
|
const Hosts = Object.freeze({
|
||||||
prod: "https://labscore-v2.vercel.app",
|
prod: "https://labscore-v2.vercel.app",
|
||||||
local: "http://localhost:3000",
|
local: "http://localhost",
|
||||||
emoji: "https://derpystuff.gitlab.io/webstorage3/container/",
|
emoji: "https://derpystuff.gitlab.io/webstorage3/container/",
|
||||||
statics: "https://derpystuff.gitlab.io/webstorage4/v2/"
|
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) {
|
async function request(path, type, headers, args, host) {
|
||||||
let timing = Date.now();
|
let timing = Date.now();
|
||||||
url = Api.HOST + path
|
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
|
if(host) url = host + path
|
||||||
|
|
||||||
// apply default headers
|
// apply default headers
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue