Fixing broken chat API
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import { coWebsiteManager } from "../WebRtc/CoWebsiteManager";
|
||||
import { playersStore } from "../Stores/PlayersStore";
|
||||
import { chatMessagesStore } from "../Stores/ChatStore";
|
||||
import type { ChatEvent } from "./Events/ChatEvent";
|
||||
|
||||
class ScriptUtils {
|
||||
public openTab(url: string) {
|
||||
@@ -16,6 +19,11 @@ class ScriptUtils {
|
||||
public closeCoWebSite() {
|
||||
coWebsiteManager.closeCoWebsite();
|
||||
}
|
||||
|
||||
public sendAnonymousChat(chatEvent: ChatEvent) {
|
||||
const userId = playersStore.addFacticePlayer(chatEvent.author);
|
||||
chatMessagesStore.addExternalMessage(userId, chatEvent.message);
|
||||
}
|
||||
}
|
||||
|
||||
export const scriptUtils = new ScriptUtils();
|
||||
|
||||
Reference in New Issue
Block a user