Open DyteSprite opened 4 years ago
Hello,
Seems similar as #8. Discord might have changed api, i'll try to check it out when I will have some free time.
Cheers!
Also just a quick suggestion,
Maybe incorporating a logging of Discord ID & tag, not just name. So instead of it's current printout of (as an example), "DyteSprite" as the name, it would be "DyteSprite#9999, 987654321123456789". This would help a lot of keeping track of users if they changed their name.
Thanks!
that is indeed a great suggestion
Seems like discord blocked the ability to use method for fetching members of the guild for user token. And currently, I don't see a way of how that can be fixed.
The error message that is returned:
{"message": "Missing Access", "code": 50001}
Maybe it's possible to obtain via cache or something?
I tried all the possible ways that I'm aware of. I couldn't find anything that would work. Unfortunately, I think the project will remain in a "broken" state until someone hopefully will find a way to fix it.
Took your scripts and used Discord.js instead. Works like a charm so far. What's the format of your json exported files in /data ? @inlife (I want to use the same one, and couldn't see it as the json files are blank with the current script.)
oh, interesting @prrjn could you show how did you do that? I wanted to work on a new version until I got stuck on this issue
format for json files was simply following the api responses:
fetch user guilds as an array
for each guild fetch users (they were stored as buch of json files in data/members folder):
and then they were glued together by user id's forming a json object, where keys are user ids, and one of the object's members was a new "shared_servers" field, containing an array of shared servers
I'm currently re-working your export.js
script to fix the issue. compare.js
and print.js
should work afterwards.
Here's the Discord.js method I used to fetch members from different guilds
Here's the 'homemade' script I used :
const Discord = require('discord.js');
const client = new Discord.Client();
const fs = require("fs");
const gracefulFs = require('graceful-fs');
gracefulFs.gracefulify(fs);
client.exported_data = require ("./exported_data.json");
client.once('ready', async () => {
// Set the guild id
const guild = client.guilds.get('THE_GUILD_ID')
// Updating the members of the guild
await fetch(guild)
// Write in .json file every info for each member
var i = 0
guild.members.forEach( mem => {
client.exported_data[i] = {
["user"]: {
id: mem.user.id,
username: mem.user.username,
discriminator: mem.user.discriminator,
avatar: mem.user.avatar,
locale: mem.user.locale,
verified: mem.user.verified,
email: mem.user.email,
flags: mem.user.flags,
premium_type: mem.user.premium_type,
created_at: mem.user.createdAt
},
["nickname"]: mem.nickname,
["joined_at"]: mem.joinedAt,
["premium_since"]: mem.premium_since,
["roles"]: mem.roles
}
i++
})
fs.writeFile("./exported_data.json", JSON.stringify (client.exported_data, null, 4), err => {
if (err) throw err;
})
console.log('Done!')
});
async function fetch(oneGuild) {
await oneGuild.fetchMembers()
return console.log(oneGuild.members.size)
}
client.login("YOUR_DISCORD_TOKEN");
hm, but how are you fetching the guilds current user belongs to?
the script you showed me works as an exporter for a single guild
or am i missing something?
Yup, this was for testing! I need to loop on all user's guilds, create all the jsons, like your script.
if you find a way to do this, that would be amazing so far its the only problem im blocked by
So I'm not the only who is having the same problem.
yea, unfortunately, seems like discord decided to block the ability to do this at least as i understand the situation
That would make sense considering how many problems they had with bots using user accounts to join the servers and spam DMs. They might have limited that functionality only to bot users that require owner invitation to join
yea, I can't say I disagree with how essentially unsecure all of that stuff was :D
@prrjn any progress so far? :)
Was hoping to use this to check on spies from other guilds in a guild of an MMO I'm playing. Cause people are joining our discord to find us and harass us in game, but we don't know who they are. :(
@ayyneya maybe you will benefit from server management bot like Tatsumaki, Mee6 or Miki
Anyone have an updates on the status of this, or is it still completely broken?
no updates, most likely it is, i doubt discord made any changes in that regards
When running "node export.js [token]", console returns multiple similar errors.