Code Monkey home page Code Monkey logo

fnbr.js's Introduction

CI Status NPM Version NPM Downloads MIT License Discord Server

An object-oriented, stable, fast and actively maintained library to interact with Epic Games' Fortnite HTTP and XMPP services. Inspired by discord.js, fortnitepy and epicgames-fortnite-client.



Installation

npm install fnbr

Usage example

const { Client } = require('fnbr');

const client = new Client();

client.on('friend:message', (message) => {
  console.log(`Message from ${message.author.displayName}: ${message.content}`);
  if (message.content.toLowerCase().startsWith('ping')) {
    message.reply('Pong!');
  }
});

client.on('ready', () => {
  console.log(`Logged in as ${client.user.self.displayName}`);
});

client.login();

Links

License

MIT License

Copyright (c) 2020-2024 Nils S.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

fnbr.js's People

Contributors

alextusinean avatar artlfmj avatar assassxn avatar backiscute avatar burakys avatar buttonsz avatar cgrinker avatar dependabot[bot] avatar krowe-moh avatar kyeondiscord avatar leledergrasshalmi avatar lkxoayh avatar quentinbellus avatar revadike avatar taradinoc avatar thisnils avatar tnfangel avatar vanxh avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

fnbr.js's Issues

STW Feature Suggestion

STW Shop
• Rotational Event Store
• Special Event Store

STW Daily Rewards List
• Info about rewards on each specific day

How to create client object?

I see all the methods, but there is no listing for requirements for creating a client object, or information needed to do so...

Party Playlists

Im trying to set a party playlist but nothing was set. I dont know how to fix but if you have questions please ask.

Publish to NPM

Hey, can you publish the set Outfit command fix to the npmjs.com website?

Online-Type Feature Suggestion

Add a function to modify user presence

Client.user.setPresence(presencetypedef);

Presence typedefs:

  • Online
  • Away / Iddle / Inactive
  • Offline

This can be useful in cases that multiple bots are added to someone friends list so they aren't always at the top because it can be kinda annoying.

TypeError in User.js: Cannot Read 'displayName' Property - BotClient Login Failure

***/project23/node_modules/fnbr/dist/src/structures/user/User.js:16 this._displayName = data.displayName;
^

TypeError: Cannot read properties of undefined (reading 'displayName')
at new User (//project23/node_modules/fnbr/dist/src/structures/user/User.js:16:34)
at BotClient.getProfile (/
/project23/node_modules/fnbr/dist/src/client/Client.js:436:20)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ClientUser.fetch (//project23/node_modules/fnbr/dist/src/structures/user/User.js:62:22)
at async BotClient.login (/
/project23/node_modules/fnbr/dist/src/client/Client.js:157:9)
at async BotClient.login (/***/project23/src/core/Client.js:59:23)

Outfits

Hi, I created some code with this library, everything seems to work but I'm encountering a problem, when I try to equip a skin the bot recognizes the command but the skin are invisible

I know it has something to do with paths but I'm not very expert
so is there anything I can do?
something that i have to add to the code?

setStatus not working

\fnbr\src\Client\index.js:490
      this.config.status = status;
                         ^

TypeError: Cannot assign to read only property 'status' of object '#<Object>'
    at Client.setStatus (C:\Users\Theo\Documents\Bots Discord\Bot CMaker\node_modules\fnbr\src\Client\index.js:490:26)
    at EventEmitter.<anonymous> (C:\Users\Theo\Documents\Bots Discord\Bot CMaker\events\my\cmaker0fnbr.js:136:16)
    at EventEmitter.emit (events.js:314:20)
    at Timeout.eachSecond [as _onTimeout] (C:\Users\Theo\Documents\Bots Discord\Bot CMaker\node_modules\date-events\index.js:112:17)
    at listOnTimeout (internal/timers.js:551:17)
    at processTimers (internal/timers.js:494:7)```

It's just so you can remember. 👍 

Change the Module name to fnbr.ts

The module name does not fully compliment the language that the module is written in. In fact, only 1% of the module is JavaScript, while the rest 99% is TypeScript.

Setoutfit issue

Hi, I was trying to change outfit to the bot but it dont work
image

`User.fetch()` and `Friend.fetch()` not working

Code:

module.exports = async (client, discord, message) => {
    await message.author.fetch();

    if (message.author.displayName === client.user.displayName) return;

    const args = message.content.slice(client.config.fortnite.prefix.length).split(/ +/);
    const commandName = args.shift();
    const command = client.commands.get(commandName) || client.commands.find(x => x.aliases?.includes(commandName));

    if (!command) return;

    command.run(message, args);
};

Error:

E:\NoriaFN New\node_modules\fnbr\dist\src\client\Client.js:404
        query.forEach((q) => {
              ^

TypeError: Cannot read property 'forEach' of undefined
    at FortniteClient.getProfile (E:\NoriaFN New\node_modules\fnbr\dist\src\client\Client.js:404:15)
    at Friend.fetch (E:\NoriaFN New\node_modules\fnbr\dist\src\structures\User.js:56:40)
    at module.exports (E:\NoriaFN New\src\noria\global\fortnite\events\friends\friend-message.js:2:26)
    at FortniteClient.emit (node:events:394:28)
    at FortniteClient.emit (E:\NoriaFN New\node_modules\fnbr\dist\src\client\Client.js:121:22)
    at Client.<anonymous> (E:\NoriaFN New\node_modules\fnbr\dist\src\client\XMPP.js:193:29)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Warning under DMCA

Hello, I was passing by and noticed that there is a file which is a copy-paste of async-queue with slightly different names and identical logic. The offending code can be seen below:

/**
* Represents an asynchronous task queue used for meta patches
* @private
*/
class AsyncQueue {
/**
* The queued tasks
*/
private tasks: Task[];
constructor() {
this.tasks = [];
}
/**
* The amount of queued tasks
*/
public get length() {
return this.tasks.length;
}
/**
* Adds a task to the queue
*/
public wait() {
const first = this.tasks.length ? this.tasks[this.tasks.length - 1].promise : Promise.resolve();
let preResolve;
const promise = new Promise<void>((res) => {
preResolve = res;
});
const resolve = (preResolve as any) as () => void;
this.tasks.push({ resolve, promise });
return first;
}
/**
* Resolves the first task from the queue
*/
public shift() {
const first = this.tasks.shift();
if (typeof first !== 'undefined') first.resolve();
}
}

Which is identical to the file of the aforementioned original source code.

Furthermore, this repository does not comply with the LICENSE requirements from sapphiredev/utilities, which async-queue inherits due to being part of it. This license in question is The MIT License, and can be seen here.

Under the MIT license, you have some conditions for the re-distribution of the work, which is to keep the license and copyright notice. However, none can be seen in this repository as of 7b83474, which is the last commit made to the moment of writing this issue.

You may resolve this issue by pasting a full copy of our aforementioned license and a copyright notice within the next 7 days. You can find a valid copyright notice below:

// MIT License | Copyright © `2020` `The Sapphire Community and its contributors`

As a side note, the original code is published under @sapphire/async-queue in npm, so you do not need to keep a copy of the software here.

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.