1.0.29 • Published 1 year ago

lol-headless-client v1.0.29

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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.

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.29

1 year ago

1.0.27

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago