add duckduckgo

This commit is contained in:
bignutty 2025-02-27 23:00:28 +01:00
parent dbab603e7b
commit 8657b8c93b
5 changed files with 293 additions and 0 deletions

View file

@ -38,6 +38,7 @@ const Api = Object.freeze({
SEARCH_BING: '/search/bing',
SEARCH_BING_IMAGES: '/search/bing-images',
SEARCH_DUCKDUCKGO: '/search/duckduckgo',
SEARCH_GOOGLE: '/search/google',
SEARCH_GOOGLE_IMAGES: '/search/google-images',
SEARCH_GOOGLE_NEWS: '/search/google-news',

View file

@ -196,6 +196,13 @@ module.exports.bingImages = async function(context, query, nsfw){
})
}
module.exports.duckduckgo = async function(context, query, nsfw){
return await request(Api.SEARCH_DUCKDUCKGO, "GET", {}, {
q: query,
nsfw: nsfw
})
}
module.exports.reverseImageSearch = async function(context, url){
return await request(Api.SEARCH_REVERSE_IMAGE, "GET", {}, {
url: url

View file

@ -64,6 +64,10 @@ const Statics = Object.freeze({
file: "brands/chatgpt.png",
revision: 1
},
duckduckgo: {
file: "brands/duckduckgo.png",
revision: 0
},
emojipedia: {
file: "brands/emojipedia.png",
revision: 3
@ -255,6 +259,7 @@ module.exports.STATICS = Object.freeze({
bard: staticAsset(Statics.brands.bard),
bing: staticAsset(Statics.brands.bing),
chatgpt: staticAsset(Statics.brands.chatgpt),
duckduckgo: staticAsset(Statics.brands.duckduckgo),
genius: staticAsset(Statics.brands.genius),
google: staticAsset(Statics.brands.google),
googlelens: staticAsset(Statics.brands.googlelens),