diff --git a/src/federation.ts b/src/federation.ts index 3eaa5ad..66ae0cf 100644 --- a/src/federation.ts +++ b/src/federation.ts @@ -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: `https://steamcommunity.com/profiles/[U:1:${player.id}]`, + }), + new PropertyValue({ + name: "Dota profile", + value: `https://stratz.com/players/${player.id}`, + }), + new PropertyValue({ + name: "OpenDota", + value: `https://www.opendota.com/players/${player.id}`, + }), + new PropertyValue({ + name: "DOTABUFF", + value: `https://www.dotabuff.com/players/${player.id}`, + }), + ] }) }