Skip to content

Commit

Permalink
fix: gif option not working
Browse files Browse the repository at this point in the history
  • Loading branch information
idlist committed May 8, 2021
1 parent f2ed78c commit 31ff0f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ module.exports.apply = (ctx, config) => {
if (!species) return '未指定物种。'
if (!SpeciesList.includes(species)) return '没有此物种的图。'

const api = Random.pick(SpeciesAPI[species])
let apiList = [...SpeciesAPI[species]]
if (options.gif) {
let filteredList = apiList.filter(api => api.gif != '')
if (filteredList) apiList = filteredList
}

const api = Random.pick(apiList)
const apiUrl = api.url + (options.gif ? api.gif : '')

const reqLimit = config.requestLimit
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "koishi-plugin-animal-picture",
"version": "0.2.0",
"version": "0.2.1",
"description": "Send animal pictures via koishi.js",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 31ff0f3

Please sign in to comment.