mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-24 23:42:40 +08:00
fix(route/kemono): sort discord messages newest first and fix image urls (#19922)
* fix(route/kemono): sort discord messages newest first and fix image urls * feat(radar): add radar for kemono discord route --------- Co-authored-by: AiraNadih <AiraNadih@users.noreply.github.com>
This commit is contained in:
@@ -46,6 +46,10 @@ export const route: Route = {
|
||||
source: ['kemono.cr/:source/user/:id/fancards'],
|
||||
target: '/:source/:id/fancards',
|
||||
},
|
||||
{
|
||||
source: ['kemono.cr/discord/server/:id'],
|
||||
target: '/discord/:id',
|
||||
},
|
||||
],
|
||||
name: 'Posts',
|
||||
maintainers: ['nczitzk', 'AiraNadih'],
|
||||
@@ -197,6 +201,7 @@ async function processDiscordMessages(channels: any[], limit: number) {
|
||||
|
||||
return channelResponse.data
|
||||
.filter((message: DiscordMessage) => message.content || message.attachments)
|
||||
.sort((a, b) => b.id.localeCompare(a.id))
|
||||
.slice(0, limit)
|
||||
.map((message: DiscordMessage) => ({
|
||||
title: message.content || 'Discord Message',
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
{{ if i.attachments }}
|
||||
{{ each i.attachments a }}
|
||||
<img src="{{ a.path }}">
|
||||
<img src="https://img.kemono.cr/thumbnail/data{{ a.path }}">
|
||||
{{ /each }}
|
||||
{{ /if }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user