Giter Site home page Giter Site logo

sparker-99 / admin-bot Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 13.0 138 KB

A small discord bot to interact with IW4M Admin's api and execute commands from discord

License: MIT License

JavaScript 99.81% Batchfile 0.18% Shell 0.02%
iw4m-admin call-of-duty discord-bot nodejs

admin-bot's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

admin-bot's Issues

sanitize user input

const response = await fetch(config.Client.webfronturl + '/api/client/' + parseInt(cid) + '/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: `{"password":"` + pass + `"}` })

The user can modify the JSON sent to the server and make it invalid JSON or send other data to the server that was not intended because the user input is not sanitized

Example: User types in ", "my_custom_json_value": "poo as their password and then the json

{
  "password": "",
  "my_custom_json_value": "poo"
}

is sent to the server

Error: Cannot find module 'discord.js'

C:\Users\Administrator\Downloads\IW4MAdmin\_TOOLS\Discord Bot>StartAdminBot.cmd
node:internal/modules/cjs/loader:1152
  throw err;
  ^

Error: Cannot find module 'discord.js'
Require stack:
- C:\Users\Administrator\Downloads\IW4MAdmin\_TOOLS\Discord Bot\index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1149:15)
    at Module._load (node:internal/modules/cjs/loader:990:27)
    at Module.require (node:internal/modules/cjs/loader:1237:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (C:\Users\Administrator\Downloads\IW4MAdmin\_TOOLS\Discord Bot\index.js:1:61)
    at Module._compile (node:internal/modules/cjs/loader:1378:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
    at Module.load (node:internal/modules/cjs/loader:1212:32)
    at Module._load (node:internal/modules/cjs/loader:1028:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:142:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\Administrator\\Downloads\\IW4MAdmin\\_TOOLS\\Discord Bot\\index.js'
  ]
}

Node.js v21.6.1
Press any key to continue . . .

Admin-Bot dont work after Iw4mAdmin Update

ERROR
The Admin-bot ran really well but since the new update from iw4madmin it doesn't work properly anymore i keep getting this error

node:internal/modules/cjs/loader:1078
throw err;
^

Error: Cannot find module 'node-json-db'
Require stack:

  • C:\Users\Administrator\Desktop\Admin-Bot\include\dbutils.js
  • C:\Users\Administrator\Desktop\Admin-Bot\events\ready.js
  • C:\Users\Administrator\Desktop\Admin-Bot\index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object. (C:\Users\Administrator\Desktop\Admin-Bot\include\dbutils.js:1:20)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\Administrator\Desktop\Admin-Bot\include\dbutils.js',
    'C:\Users\Administrator\Desktop\Admin-Bot\events\ready.js',
    'C:\Users\Administrator\Desktop\Admin-Bot\index.js'
    ]
    }

Node.js v18.16.0

What i already tried.
i have already updated everything (node,npm,adminbot) i have npm install node-json-db
executed and still have the problem I do not know what the problem could be.

Priority
Would be urgent for us

Not working as intended

When running the bot I get the following message:

(node:10160) DeprecationWarning: Guild#me is deprecated. Use Guild#members#me instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:10160) DeprecationWarning: MessageEmbed#addField is deprecated and will be removed in the next major update. Use MessageEmbed#addFields instead.

Also, none of the commands are working.

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.