Coder Social home page Coder Social logo

e-enes / invitron Goto Github PK

View Code? Open in Web Editor NEW
38.0 2.0 42.0 600 KB

The Best Way to Track Your Discord Server's Invites!

License: MIT License

TypeScript 99.79% Shell 0.02% JavaScript 0.19%
discord discord-api discord-bot discord-invite-manager nodejs open-source discord-invite-tracker invite-tracker discord-invites discord-invitemanager invite-manager invitron

invitron's Introduction

Invitron: Invite Management!

The Best Way to Track Your Discord Server's Invites!

Requirements

  • Node.js version 18.18 or higher
  • A Discord bot token

Features

  • Precise tracking of each member's server invitations
  • Access to an invitation leaderboard to see who's on top
  • Ability to manually adjust member invites, adding or removing as needed
  • Option to reset a member's invite count to zero
  • Advanced detection of fraudulent invitations
  • Plus, many more exciting features...

Quick Start Guide

Step 1: Clone the repository to get started:

git clone https://github.com/e-enes/invitron.git
cd invitron

Step 2: Install all necessary dependencies:

pnpm install

Note: If pnpm is not already installed, you can install it globally using npm i -g pnpm.

Step 3: Set up your .env and src/config.ts files:

mv .env.example .env

Then, fill in the required information accordingly.

Step 4: Start the bot:

pnpm build && pnpm start

Finally, execute the /setup command on discord.

Join Our Contributors!

We warmly welcome contributions! Whether you're suggesting new features, reporting bugs, or directly contributing to the code, your input is invaluable. Feel free to open an issue or submit a pull request to join our growing community.

License

Invitron is proudly licensed under the MIT License. For more details, please see the LICENSE file.

Warning

Please note that the translation files for this project were generated by AI. While we strive for accuracy, there may be errors or inconsistencies. We appreciate your understanding and welcome any corrections.

invitron's People

Contributors

e-enes avatar louiszn avatar

Stargazers

 avatar  avatar  avatar  avatar TajuanaDapa avatar NakishaSchnippe avatar LucileTollerson avatar ShaniTesauro avatar RoyOliva avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar TristanCooperstein avatar  avatar  avatar Cristiano avatar Chien-Ting Lu avatar  avatar  avatar Louan Fontenele avatar Majka Zmajeva avatar Taimoor Shafique avatar Matt Childers avatar  avatar Le Dien Phuc avatar  avatar  avatar Akio avatar  avatar Karim avatar MOZGIII avatar Glander avatar  avatar

Watchers

David  Rowan avatar  avatar

invitron's Issues

Support for a /myinvitelink command?

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.

TokenInvalid error

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.

Give roles as rewards

Give roles when reaching a invited target.

Example:

  • If the user invited 50 people, the user receives a X role.
  • If the user invited 100 people, the user receives a Y role.

Cannot read properties of undefnined (reading 'uses')

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)

Host this bot and put it in public

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

install instructions don't work

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 :)

error while performing /setup

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'
          }
        ]
      }
    ]
  ]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.