Move poll-star-avatar file endpoint

This commit is contained in:
Cadence Ember
2026-02-11 02:57:45 +13:00
parent d1b0fa48cf
commit c8b20719db
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ async function endPoll(closeMessage) {
if (combinedVotes !== totalVotes) { // This means some votes were cast on Matrix. Now that we've corrected the vote totals, we can get the results again and post them to Discord. if (combinedVotes !== totalVotes) { // This means some votes were cast on Matrix. Now that we've corrected the vote totals, we can get the results again and post them to Discord.
return { return {
username: "Total results including Matrix votes", username: "Total results including Matrix votes",
avatar_url: `${reg.ooye.bridge_origin}/discord/poll-star-avatar.png`, avatar_url: `${reg.ooye.bridge_origin}/download/file/poll-star-avatar.png`,
content: messageString, content: messageString,
flags: DiscordTypes.MessageFlags.SuppressEmbeds flags: DiscordTypes.MessageFlags.SuppressEmbeds
} }
+2 -2
View File
@@ -12,7 +12,7 @@ const pollComponents = sync.require("../../m2d/converters/poll-components")
const {reg} = require("../../matrix/read-registration") const {reg} = require("../../matrix/read-registration")
/** /**
* @param {number} percentc * @param {number} percent
*/ */
function barChart(percent) { function barChart(percent) {
const width = 12 const width = 12
@@ -69,7 +69,7 @@ async function* _interact({data}, {api}) {
embeds: [{ embeds: [{
author: { author: {
name: "Current results including Matrix votes", name: "Current results including Matrix votes",
icon_url: `${reg.ooye.bridge_origin}/discord/poll-star-avatar.png` icon_url: `${reg.ooye.bridge_origin}/download/file/poll-star-avatar.png`
}, },
description: messageString description: messageString
}], }],
+1 -1
View File
@@ -667,7 +667,7 @@ async function eventToMessage(event, guild, channel, di) {
pollMessages.push(pollComponents.getPollComponentsFromDatabase(di.pollEnd.messageID)) pollMessages.push(pollComponents.getPollComponentsFromDatabase(di.pollEnd.messageID))
pollMessages.push({ pollMessages.push({
...await pollComponents.getPollEndMessageFromDatabase(channel.id, di.pollEnd.messageID), ...await pollComponents.getPollEndMessageFromDatabase(channel.id, di.pollEnd.messageID),
avatar_url: `${reg.ooye.bridge_origin}/discord/poll-star-avatar.png` avatar_url: `${reg.ooye.bridge_origin}/download/file/poll-star-avatar.png`
}) })
} else { } else {
+1 -1
View File
@@ -70,7 +70,7 @@ as.router.get("/icon.png", defineEventHandler(event => {
return fs.promises.readFile(join(__dirname, "../../docs/img/icon.png")) return fs.promises.readFile(join(__dirname, "../../docs/img/icon.png"))
})) }))
as.router.get("/discord/poll-star-avatar.png", defineEventHandler(event => { as.router.get("/download/file/poll-star-avatar.png", defineEventHandler(event => {
handleCacheHeaders(event, {maxAge: 86400}) handleCacheHeaders(event, {maxAge: 86400})
return fs.promises.readFile(join(__dirname, "../../docs/img/poll-star-avatar.png")) return fs.promises.readFile(join(__dirname, "../../docs/img/poll-star-avatar.png"))
})) }))