WIP: Make Lavalink optional
At the moment, there's a broken instance of the Lavalink system running. When executing `.play`, our home-hosted `musicbot` will start playing, but the production TravBot instance will error. I haven't implemented this as a choice in the setup yet, that's for another time. Right now, all I need is for it to be optional.
This commit is contained in:
parent
1e673a3969
commit
ac81b6a103
|
@ -2,6 +2,7 @@ import attachClientToLavalink from "discord.js-lavalink-lib";
|
|||
import {Config} from "../structures";
|
||||
import {client} from "../index";
|
||||
|
||||
if (Config.lavalink) {
|
||||
// Although the example showed to do "client.music = LavaLink(...)" and "(client as any).music = Lavalink(...)" was done to match that, nowhere in the library is client.music ever actually used nor does the function return anything. In other words, client.music is undefined and is never used.
|
||||
attachClientToLavalink(client, {
|
||||
lavalink: {
|
||||
|
@ -47,3 +48,4 @@ for (const listener of process.listeners("uncaughtException")) {
|
|||
process.off("uncaughtException", listener);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ class ConfigStructure extends GenericStructure {
|
|||
public owner: string;
|
||||
public admins: string[];
|
||||
public support: string[];
|
||||
public lavalink: boolean | null;
|
||||
public systemLogsChannel: string | null;
|
||||
public webhooks: {[id: string]: string}; // id-token pairs
|
||||
|
||||
|
@ -23,6 +24,7 @@ class ConfigStructure extends GenericStructure {
|
|||
this.owner = select(data.owner, "", String);
|
||||
this.admins = select(data.admins, [], String, true);
|
||||
this.support = select(data.support, [], String, true);
|
||||
this.lavalink = select(data.lavalink, null, Boolean);
|
||||
this.systemLogsChannel = select(data.systemLogsChannel, null, String);
|
||||
this.webhooks = {};
|
||||
|
||||
|
|
Loading…
Reference in New Issue