|
@@ -78,9 +78,17 @@ export default class Fortune {
|
|
|
for await (const event of this._mastodonStreamingClient.user.notification.subscribe()) {
|
|
|
switch(event.event) {
|
|
|
case "notification":
|
|
|
- const {id, createdAt, url, content} = event.payload.status ?? {};
|
|
|
- console.log("Event received\n", { id, createdAt, url, content });
|
|
|
- await this.reply(event.payload.status?.id, event.payload.account.displayName, Math.floor(Math.random() * 10));
|
|
|
+ if (event.payload.type == "mention") {
|
|
|
+ const {id, createdAt, url, content} = event.payload.status ?? {};
|
|
|
+
|
|
|
+ if (config.DEVELOP) {
|
|
|
+ console.log("Event received\n", event.payload);
|
|
|
+ } else {
|
|
|
+ console.log("Event received\n", { id, createdAt, url, content });
|
|
|
+ }
|
|
|
+
|
|
|
+ await this.reply(event.payload.status?.id, event.payload.account.displayName, Math.floor(Math.random() * 10));
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
};
|