Add the agent scaffold, mobile web UI, voice auto-leave, and text notifications
This commit is contained in:
+50
-1
@@ -28,9 +28,34 @@ const messageEvent = {
|
||||
author: { id: authorId, username: "zzib", bot: false },
|
||||
content: mention ? `<@999> ${content}` : content,
|
||||
mentions: mention ? ["999"] : [],
|
||||
replyTo: process.env.TEST_TRIGGER_REPLY_TO
|
||||
? {
|
||||
id: process.env.TEST_TRIGGER_REPLY_TO,
|
||||
authorId: process.env.TEST_TRIGGER_REPLY_AUTHOR ?? "999",
|
||||
authorName: "mockuser",
|
||||
content: "the referenced message"
|
||||
}
|
||||
: null,
|
||||
timestamp: new Date().toISOString()
|
||||
};
|
||||
|
||||
const updateEvent = {
|
||||
type: "MESSAGE_UPDATE",
|
||||
id: process.env.TEST_TRIGGER_MESSAGE_ID ?? "400000000000000004",
|
||||
channelId: process.env.TEST_TRIGGER_CHANNEL ?? "200000000000000001",
|
||||
guildId: guildId ?? "100000000000000001",
|
||||
content: content === "whitelist list" ? "edited content" : content,
|
||||
editedAt: new Date().toISOString(),
|
||||
author: { id: authorId, username: "zzib", bot: false }
|
||||
};
|
||||
|
||||
const deleteEvent = {
|
||||
type: "MESSAGE_DELETE",
|
||||
id: process.env.TEST_TRIGGER_MESSAGE_ID ?? "400000000000000004",
|
||||
channelId: process.env.TEST_TRIGGER_CHANNEL ?? "200000000000000001",
|
||||
guildId: guildId ?? "100000000000000001"
|
||||
};
|
||||
|
||||
const reactionEvent = {
|
||||
type: process.env.TEST_TRIGGER_REMOVE === "1" ? "MESSAGE_REACTION_REMOVE" : "MESSAGE_REACTION_ADD",
|
||||
messageId: process.env.TEST_REACTION_MESSAGE_ID ?? "msg-1",
|
||||
@@ -48,7 +73,31 @@ const speakingEvent = {
|
||||
channelId: process.env.TEST_TRIGGER_CHANNEL ?? "200000000000000002"
|
||||
};
|
||||
|
||||
const event = isReaction ? reactionEvent : speakingUser ? speakingEvent : messageEvent;
|
||||
const voiceUser = process.env.TEST_TRIGGER_VOICE_USER;
|
||||
const voiceChannelRaw = process.env.TEST_TRIGGER_VOICE_CHANNEL;
|
||||
const voiceStateEvent = {
|
||||
type: "VOICE_STATE_UPDATE",
|
||||
userId: voiceUser ?? "999",
|
||||
channelId: voiceChannelRaw === "null" || voiceChannelRaw === "" ? null : voiceChannelRaw ?? "200000000000000002",
|
||||
guildId: guildId ?? "100000000000000001",
|
||||
mute: false,
|
||||
deaf: false,
|
||||
selfMute: false,
|
||||
selfDeaf: false
|
||||
};
|
||||
|
||||
const event =
|
||||
process.env.TEST_TRIGGER_UPDATE === "1"
|
||||
? updateEvent
|
||||
: process.env.TEST_TRIGGER_DELETE === "1"
|
||||
? deleteEvent
|
||||
: isReaction
|
||||
? reactionEvent
|
||||
: voiceUser
|
||||
? voiceStateEvent
|
||||
: speakingUser
|
||||
? speakingEvent
|
||||
: messageEvent;
|
||||
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
const socket = net.connect(coreSocketPath);
|
||||
|
||||
Reference in New Issue
Block a user