e-enes / invitron Goto Github PK
View Code? Open in Web Editor NEWThe Best Way to Track Your Discord Server's Invites!
License: MIT License
The Best Way to Track Your Discord Server's Invites!
License: MIT License
Hi,
I just followed the install instruction but they don't seem to work, atleast not with nodejs 20.5
npm install doesn't do much, only install packages but not build the bot.
what npm install logs:
discord-invite-tracker# npm install --loglevel verbose
npm verb cli /usr/bin/node /usr/bin/npm
npm info using [email protected]
npm info using [email protected]
npm verb title npm install
npm verb argv "install" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/root/.npm/_logs/2024-01-12T21_12_30_847Z-
npm verb logfile /root/.npm/_logs/2024-01-12T21_12_30_847Z-debug-0.log
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 371ms
npm http fetch GET 200 https://registry.npmjs.org/undici 13ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@discordjs%2frest 10ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/discord.js 30ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@discordjs%2fws 34ms (cache hit)
up to date, audited 213 packages in 829ms
60 packages are looking for funding
run `npm fund` for details
3 low severity vulnerabilities
To address all issues, run:
npm audit fix
Run `npm audit` for details.
npm verb exit 0
npm info ok
and ofcourse node run start errors out
discord-invite-tracker# npm run start
> [email protected] start
> node dist/src/index.js
node:internal/modules/cjs/loader:1051
throw err;
^
Error: Cannot find module '/srv/bots/invite/dist/src/index.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
at Module._load (node:internal/modules/cjs/loader:901:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v20.5.1
I hope the install instructions get updated soon :)
Hi,
I have just installed and connected the bot to discord and the database successful. but while performing the /setup command, the bot logs the following:
/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1268
return errors.length === 0 ? Result.ok(finalObject) : Result.err(new CombinedPropertyError(errors));
^
CombinedPropertyError: Received one or more errors
at ObjectValidator.handleIgnoreStrategy (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1268:70)
at ObjectValidator.handleStrategy (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1121:47)
at ObjectValidator.handle (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1221:17)
at ObjectValidator.parse (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:212:88)
at EmbedBuilder.setFooter (/srv/bots/invite/node_modules/@discordjs/builders/dist/index.js:333:26)
at Object.run (/srv/bots/invite/dist/src/commands/setup.js:68:18)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errors: [
[
'text',
CombinedError: Received one or more errors
at UnionValidator.handle (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1104:23)
at UnionValidator.run (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:198:23)
at runPredicate (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1231:32)
at ObjectValidator.handleIgnoreStrategy (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1241:9)
at ObjectValidator.handleStrategy (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1121:47)
at ObjectValidator.handle (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1221:17)
at ObjectValidator.parse (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:212:88)
at EmbedBuilder.setFooter (/srv/bots/invite/node_modules/@discordjs/builders/dist/index.js:333:26)
at Object.run (/srv/bots/invite/dist/src/commands/setup.js:68:18)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errors: [
ExpectedValidationError: Expected values to be equals
at LiteralValidator.handle (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:745:76)
at LiteralValidator.run (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:198:23)
at UnionValidator.handle (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1099:32)
at UnionValidator.run (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:198:23)
at runPredicate (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1231:32)
at ObjectValidator.handleIgnoreStrategy (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1241:9)
at ObjectValidator.handleStrategy (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1121:47)
at ObjectValidator.handle (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1221:17)
at ObjectValidator.parse (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:212:88)
at EmbedBuilder.setFooter (/srv/bots/invite/node_modules/@discordjs/builders/dist/index.js:333:26) {
validator: 's.literal(V)',
given: '',
expected: null
},
ExpectedConstraintError: Invalid string length
at Object.run (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1546:79)
at StringValidator.run (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:202:27)
at UnionValidator.handle (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1099:32)
at UnionValidator.run (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:198:23)
at runPredicate (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1231:32)
at ObjectValidator.handleIgnoreStrategy (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1241:9)
at ObjectValidator.handleStrategy (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1121:47)
at ObjectValidator.handle (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:1221:17)
at ObjectValidator.parse (/srv/bots/invite/node_modules/@sapphire/shapeshift/dist/index.js:212:88)
at EmbedBuilder.setFooter (/srv/bots/invite/node_modules/@discordjs/builders/dist/index.js:333:26) {
constraint: 's.string.lengthGreaterThanOrEqual',
given: '',
expected: 'expected.length >= 1'
}
]
}
]
]
}
Give roles when reaching a invited target.
Example:
The bot is perfect, but after a few hours it starts giving the following error:
Uncaught Exception
Message: Cannot read properties of undefined (reading 'uses')
Name: TypeError
Cause: undefined
Source: undefined
Stack:
TypeError: Cannot read properties of undefined (reading 'uses')
at file:///root/invite-tracker/dist/events/guild/member/GuildMemberAdd.js:1:832
at _Collection.find (/root/invite-tracker/node_modules/.pnpm/@[email protected]/node_modules/@discordjs/collection/dist/index.js:172:11)
at w.execute (file:///root/invite-tracker/dist/events/guild/member/GuildMemberAdd.js:1:807)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
How can I solve?
Hi again,
While starting the bot it gives a TokenInvalid error, While I entered the right token inside .env, which is inside dist.
/srv/bots/invite# npm start
> [email protected] start
> node dist/src/index.js
/srv/bots/invite/node_modules/discord.js/src/client/websocket/WebSocketManager.js:136
const invalidToken = new DiscordjsError(ErrorCodes.TokenInvalid);
^
Error [TokenInvalid]: An invalid token was provided.
at WebSocketManager.connect (/srv/bots/invite/node_modules/discord.js/src/client/websocket/WebSocketManager.js:136:26)
at Client.login (/srv/bots/invite/node_modules/discord.js/src/client/Client.js:226:21)
at Object.<anonymous> (/srv/bots/invite/dist/src/index.js:59:8)
at Module._compile (node:internal/modules/cjs/loader:1233:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47 {
code: 'TokenInvalid'
}
Node.js v20.5.1
Generated a fresh pair two times, without any luck.
was testing, however when a member joins the guild, the error occurs.
Error:
yield guildInvites.each((inv) => invites.set(inv.code, inv.uses));
^
TypeError: Cannot read properties of undefined (reading 'set')
How remove that?
Why don't you put the bot in public and host it on a VPS? It would allow everyone to be able to use it.
You have put features on the bot that some bots have but you have to pay to have access to them
I encountered an error in which the bot stops logging invites and stops posting the logs.
I'm not entirely sure why, because the bug just starts eventually when the bot is running for a while.
The bot is hosted on PebbleHost, that also explains why there are minecraft dirs in the error log below.
But it's odd because the bot still keeps running and still responds to commands.
Just the logging and tracking stops and im not sure why it would suddenly stop being able to read uses.
The bot version is 2.0
The NodeJS Version is 16.17
Now I can see that a lot of packages actually ask for NodeJS 18 and above.
Especially discord [email protected]
So I would assume that maybe this error is due to the NodeJS being on 16.
So is this caused by the host running NodeJS 16 by default and I need to change to 18 or is the files provided setting it specifcally to 16.17?
Error Log
Uncaught Exception
Message: Cannot read properties of undefined (reading 'uses')
Name: TypeError
Cause: undefined
Source: undefined
Stack:
TypeError: Cannot read properties of undefined (reading 'uses')
at file:///home/minecraft/multicraft/servers/server703773/dist/events/guild/member/GuildMemberAdd.js:1:822
at Map.find (/home/minecraft/multicraft/servers/server703773/node_modules/@discordjs/collection/dist/index.js:172:11)
at w.execute (file:///home/minecraft/multicraft/servers/server703773/dist/events/guild/member/GuildMemberAdd.js:1:797)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Thanks for working on this project!
I just wanted to request a new command called /myinvitelink that generates (or recalls) a user's unique invite link.
I think this would be great from a UX standpoint instead of using having to manually generate an invite link.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.