lol-headless-client
TypeScript icon, indicating that this package has built-in type declarations

1.0.18 • Public • Published

LoL Headless Client

npm version npm downloads

LoL Headless Client (LHC)

LHC is a library that connects to League Of Legends API.

(BETA)

  • This project DOES NOT use the LCU api, so you don't need your league open to use it.

Features

  • Login
  • Create Lobby
  • Chat Integration
  • Select Role
  • Select Gamemode
  • Select Summoner Spells
  • Select Champion
  • Ban Champion
  • And much more!

Installation

npm

To install LHC, simply run the following command:

For npm:

npm install lol-headless-client

Yarn:

yarn add lol-headless-client

pnpm:

pnpm add lol-headless-client

Usage

This is a simple overview of how to set up this library.

// index.js
import { Champion, Gamemode, Region, Role, HeadlessClient } from "lol-headless-client";

const hc = new HeadlessClient({ region: Region.BR });

const callback = ({ eventName, data }: CallbackEvent) => console.log({ eventName, data }); // you will be notified for each event: see EventCallbackName

const main = async () => {
  hc.listen(callback); // Add callback function to lister HC events 

  await hc.login({ username: "YOUR-USERNAME", password: "YOUR-PASSWORD" }); // Login

  await hc.addFriend({ username: "FRIEND-USERNAME", tagline: "FRIEND-TAGLINE" }); // Add New Friend

  await hc.setInfo({ status: "chat" }); // Set status to online "chat"

  await hc.getChatHistory({ jid: "FRIEND-JID" }); // get chat history

  await hc.sendMessage({ message: "Hi", jid: "FRIEND-JID" }); // Send a message to a friend

  await hc.createLobby(); // Create a new Lobby

  // await hc.changePartyType("open"); // Set lobby to open (WORK IN PROGESS - DONT USE IT)

  await hc.selectGamemode({ gamemode: Gamemode.RANKED_SOLO_DUO }); // Select RANKED_SOLO_DUO gamemode

  await hc.selectRoles({ roles: [Role.MID, Role.TOP] }); // Select you roles

  await hc.findMatch({ summonerSpells: [SummonerSpell.FLASH, SummonerSpell.IGNITE] }); // Start to find a match

  hc.banChampion({ champion: Champion.YUUMI }); // Ban a champion

  hc.selectChampion({ champions: hc.getPlayerChampions() }); // Select a random champion
};
main();

Support and Suggestions

You can hit me up on Discord.

Readme

Keywords

Package Sidebar

Install

npm i lol-headless-client

Weekly Downloads

46

Version

1.0.18

License

MIT

Unpacked Size

450 kB

Total Files

65

Last publish

Collaborators

  • matheus.filho