Support displaying players' and guilds' data' #2
1 changed files with 21 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
import { createFederation, Service, Application, Image } from "@fedify/fedify"
|
||||
import { createFederation, Person, Application, Image, PropertyValue } from "@fedify/fedify"
|
||||
import { kv } from "./redis.ts"
|
||||
import { getLogger } from "https://jsr.io/@logtape/logtape/0.6.3/logtape/logger.ts"
|
||||
import { doQueryPlayer } from "./graphql/stratz.ts"
|
||||
|
@ -45,7 +45,7 @@ async function actorDispatcher(ctx: any, handle: string) {
|
|||
return null
|
||||
}
|
||||
|
||||
return new Service({
|
||||
return new Person({
|
||||
id,
|
||||
preferredUsername: id.href,
|
||||
// Akkoma expects URL to be equal to ID
|
||||
|
@ -59,7 +59,25 @@ async function actorDispatcher(ctx: any, handle: string) {
|
|||
icon: new Image({
|
||||
url: new URL(player.avatar),
|
||||
mediaType: "image/jpeg"
|
||||
})
|
||||
}),
|
||||
attachments: [
|
||||
new PropertyValue({
|
||||
name: "Steam",
|
||||
value: `<a href="https://steamcommunity.com/profiles/[U:1:${player.id}]">https://steamcommunity.com/profiles/[U:1:${player.id}]</a>`,
|
||||
}),
|
||||
new PropertyValue({
|
||||
name: "Dota profile",
|
||||
value: `<a href="https://stratz.com/players/${player.id}">https://stratz.com/players/${player.id}</a>`,
|
||||
}),
|
||||
new PropertyValue({
|
||||
name: "OpenDota",
|
||||
value: `<a href="https://www.opendota.com/players/${player.id}">https://www.opendota.com/players/${player.id}</a>`,
|
||||
}),
|
||||
new PropertyValue({
|
||||
name: "DOTABUFF",
|
||||
value: `<a href="https://www.dotabuff.com/players/${player.id}">https://www.dotabuff.com/players/${player.id}</a>`,
|
||||
}),
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue