reddit command

This commit is contained in:
derpystuff 2022-07-04 22:53:06 +02:00
parent d0cb4ab67e
commit c3213c28d8
6 changed files with 113 additions and 2 deletions

View file

@ -32,6 +32,7 @@ const Api = Object.freeze({
SEARCH_GOOGLE: '/search/google',
SEARCH_GOOGLE_IMAGES: '/search/google-images',
SEARCH_LYRICS: '/search/lyrics',
SEARCH_REDDIT: '/search/reddit',
SEARCH_RULE34: '/search/booru',
SEARCH_TINEYE: '/search/tineye',
SEARCH_URBANDICTIONARY: '/search/urbandictionary',

View file

@ -116,6 +116,13 @@ module.exports.googleImages = async function(context, query){
})
}
module.exports.reddit = async function(context, query, nsfw = false){
return await request(Api.SEARCH_REDDIT, "GET", {}, {
q: query,
nsfw: nsfw
})
}
module.exports.rule34 = async function(context, query, site){
return await request(Api.SEARCH_RULE34, "GET", {}, {
q: query,