diff --git a/changelog.d/791.misc b/changelog.d/791.misc new file mode 100644 index 00000000..5c94a713 --- /dev/null +++ b/changelog.d/791.misc @@ -0,0 +1 @@ +Sort feed list alphabetically in bot command response diff --git a/src/Connections/SetupConnection.ts b/src/Connections/SetupConnection.ts index f33fbdbf..27232bb5 100644 --- a/src/Connections/SetupConnection.ts +++ b/src/Connections/SetupConnection.ts @@ -290,7 +290,9 @@ export class SetupConnection extends CommandConnection { if (feeds.length === 0) { return this.client.sendHtmlNotice(this.roomId, md.renderInline('Not subscribed to any feeds')); } else { - const feedDescriptions = feeds.map(feed => { + const feedDescriptions = feeds.sort( + (a, b) => (a.label ?? a.url).localeCompare(b.label ?? b.url) + ).map(feed => { if (feed.label) { return `[${feed.label}](${feed.url})`; }