revoltchat / revolt.js

Modern Typescript library for interacting with Revolt.
https://revolt.js.org
MIT License
216 stars 54 forks source link

bug: A simple CommonJS Bot, but: revolt-api/node_modules/axios: 404 error when someone joins server: http Request of members/00000000000000000000000000 #74

Open BoQsc opened 1 year ago

BoQsc commented 1 year ago

What happened?

Plain simple bot gives an error of 404 when another bot joins the server.

OS: Linux/Debian

Setup: I'm using CommonJS, not TypeScript

Bot example:

const { Client } = require("revolt.js");

let client = new Client();

client.loginBot("YOUR_BOT_TOKEN");

Steps:

  1. Invite your bot example
  2. invite another bot for testing
  3. In the bot console you will see: 404 error with a Request of /members/00000000000000000000000000

Full error message: new 19.txt image

Rexogamer commented 1 year ago

Are you using v6 or v7?

BoQsc commented 1 year ago

@Rexogamer

Are you using v6 or v7?

root@vps:~/GuildBot2# node ./bot.js
NodeJS version: v18.16.0
revolt.js version: 7.0.0-beta.4
revolt.js documentation: https://revolt.js.org/
_______________________________
Welcome to a Basic Revolt Bot.
Client API URL: https://api.revolt.chat
Client API version: 0.5.19

I also encountered this issue a year or even a few years ago and was unable to resolve it, so I handled it by ignoring it in production bot. Now it's again a clean environment, but this 404 when someone joins the server still appears.

Xynnix commented 9 months ago

I would say if you're using serverMemberJoin event the way i fixed this is just simply checking if there's a user.id / member.id, or if its a message causing this issue, you could try message.system check (i think) as well as message.author.id; this could be a temp fix.

if you aren't using an serverMemberJoin event, i would say try adding it with this method i stated?

this worked for me on 7.0.0-beta.9, but i am unsure if that's a me problem though then again.

scratch that, this doesn't help.