utils.CommunicationManager.on("addUser", async (data, reply) => {
/*
In this, data.userId is confirmed to be my user ID (267380687345025025)
data.accessToken is confirmed to be a legitimate access token with the guilds.join scope.
*/
try {
const guild = await client.guilds.fetch(config.discord.mcp_guild);
await guild.members.add(data.userId, {
accessToken: data.accessToken,
fetchWhenExisting: true,
});
reply({});
} catch(err) {
console.error(`Error while adding user to guild:`);
console.error(err);
}
});
utils.CommunicationManager.on("addUser", async (data, reply) => {
/*
In this, data.userId is confirmed to be my user ID (267380687345025025)
data.accessToken is confirmed to be a legitimate access token with the guilds.join scope.
*/
try {
const guild = await client.guilds.fetch(config.discord.mcp_guild);
await guild.members.add(data.userId, {
accessToken: data.accessToken,
fetchWhenExisting: true,
});
reply({});
} catch(err) {
console.error(`Error while adding user to guild:`);
console.error(err);
}
});