Compare commits

..

No commits in common. "0cd23ff738349335b25ca0d0831023a43c6a51e8" and "fdbf05b8464aa3ce93e83a79f7555b88d1275815" have entirely different histories.

View File

@ -6,11 +6,10 @@ var DataStore = require("./datastore");
var ds = new DataStore("activity");
app.get("/detect/:code", (req, res) => {
app.get("/detect/:userid", (req, res) => {
res.sendFile(process.cwd() + "/track-image.png");
if (req.headers["user-agent"].includes("Discordbot")) return;
onActivity(ds.get(req.params.code));
ds.del(req.params.code);
onActivity(req.params.userid);
});
@ -83,14 +82,11 @@ async function deactivateMember(member) {
}
var magic_channel_message_id = ds.get(member.id + "magicchannelmessage");
var unique_code = Math.random().toString();
ds.put(unique_code, member.id);
var content = `${config.base_uri}/detect/${unique_code}`;
if (!magic_channel_message_id) {
var magic_channel_message = await magic_channel.send({content});
var magic_channel_message = await magic_channel.send(`${config.base_uri}/detect/${member.id}?${Math.random()}`);
ds.put(member.id + "magicchannelmessage", magic_channel_message.id)
} else {
await magic_channel.messages.edit(magic_channel_message_id, {content});
await magic_channel.messages.edit(magic_channel_message_id, {content: `${config.base_uri}/detect/${member.id}?${Math.random()}`});
}
}