fix build
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { chatClient } from "./core/client.ts";
|
||||
import { registerAllEvents } from "./events/registry.ts";
|
||||
import { chatClient } from "./core/client.js";
|
||||
import { registerAllEvents } from "./events/registry.js";
|
||||
|
||||
registerAllEvents();
|
||||
chatClient.connect();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ChatUser } from "@twurple/chat";
|
||||
import { Config } from "../config/config.ts";
|
||||
import { chatClient } from "../core/client.ts";
|
||||
import type { ICommand, ICommandRequirements } from "./interface.ts";
|
||||
import { Config } from "../config/config.js";
|
||||
import { chatClient } from "../core/client.js";
|
||||
import type { ICommand, ICommandRequirements } from "./interface.js";
|
||||
|
||||
export abstract class BaseCommand implements ICommand {
|
||||
protected get chatClient() {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Collection } from "@discordjs/collection";
|
||||
import { PingCommand } from "./impl/ping.ts";
|
||||
import { PositionCommand } from "./impl/position.ts";
|
||||
import { SongCommand } from "./impl/song.ts";
|
||||
import { TempCommand } from "./impl/temp.ts";
|
||||
import { VanishCommand } from "./impl/vanish.ts";
|
||||
import { VolumeCommand } from "./impl/volume.ts";
|
||||
import { WhereCommand } from "./impl/where.ts";
|
||||
import type { ICommand } from "./interface.ts";
|
||||
import { PingCommand } from "./impl/ping.js";
|
||||
import { PositionCommand } from "./impl/position.js";
|
||||
import { SongCommand } from "./impl/song.js";
|
||||
import { TempCommand } from "./impl/temp.js";
|
||||
import { VanishCommand } from "./impl/vanish.js";
|
||||
import { VolumeCommand } from "./impl/volume.js";
|
||||
import { WhereCommand } from "./impl/where.js";
|
||||
import type { ICommand } from "./interface.js";
|
||||
|
||||
export const commands = new Collection<string, ICommand>();
|
||||
const cmds: Array<ICommand> = [];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { ChatMessage } from "@twurple/chat";
|
||||
import { calculateSecondsBetween } from "../../util/general.ts";
|
||||
import { logSuccess } from "../../util/logger.ts";
|
||||
import { BaseCommand } from "../base-command.ts";
|
||||
import type { ICommandRequirements } from "../interface.ts";
|
||||
import { calculateSecondsBetween } from "../../util/general.js";
|
||||
import { logSuccess } from "../../util/logger.js";
|
||||
import { BaseCommand } from "../base-command.js";
|
||||
import type { ICommandRequirements } from "../interface.js";
|
||||
|
||||
export class PingCommand extends BaseCommand {
|
||||
started: number;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { ChatMessage } from "@twurple/chat";
|
||||
import { getDeskPositionText } from "../../util/api-homeassistant.ts";
|
||||
import { calculateSecondsBetween } from "../../util/general.ts";
|
||||
import { logSuccess } from "../../util/logger.ts";
|
||||
import { BaseCommand } from "../base-command.ts";
|
||||
import { getDeskPositionText } from "../../util/api-homeassistant.js";
|
||||
import { calculateSecondsBetween } from "../../util/general.js";
|
||||
import { logSuccess } from "../../util/logger.js";
|
||||
import { BaseCommand } from "../base-command.js";
|
||||
import type { ICommandRequirements } from "../interface.ts";
|
||||
|
||||
export class PositionCommand extends BaseCommand {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import type { ChatMessage } from "@twurple/chat";
|
||||
import { getSongFromTidalFormatted } from "../../util/api-tidal.ts";
|
||||
import { logSuccess } from "../../util/logger.ts";
|
||||
import { BaseCommand } from "../base-command.ts";
|
||||
import type { ICommandRequirements } from "../interface.ts";
|
||||
import { getSongFromTidalFormatted } from "../../util/api-tidal.js";
|
||||
import { logSuccess } from "../../util/logger.js";
|
||||
import { BaseCommand } from "../base-command.js";
|
||||
|
||||
import type { ICommandRequirements } from "../interface.js";
|
||||
|
||||
export class SongCommand extends BaseCommand {
|
||||
name = "song";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { ChatMessage } from "@twurple/chat";
|
||||
import { getTemperatures } from "../../util/api-homeassistant.ts";
|
||||
import { logSuccess } from "../../util/logger.ts";
|
||||
import { BaseCommand } from "../base-command.ts";
|
||||
import type { ICommandRequirements } from "../interface.ts";
|
||||
import { getTemperatures } from "../../util/api-homeassistant.js";
|
||||
import { logSuccess } from "../../util/logger.js";
|
||||
import { BaseCommand } from "../base-command.js";
|
||||
import type { ICommandRequirements } from "../interface.js";
|
||||
|
||||
export class TempCommand extends BaseCommand {
|
||||
name = "temp";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { ChatMessage } from "@twurple/chat";
|
||||
import { purgeByIds } from "../../util/api-functions.ts";
|
||||
import { logSuccess } from "../../util/logger.ts";
|
||||
import { BaseCommand } from "../base-command.ts";
|
||||
import type { ICommandRequirements } from "../interface.ts";
|
||||
import { purgeByIds } from "../../util/api-functions.js";
|
||||
import { logSuccess } from "../../util/logger.js";
|
||||
import { BaseCommand } from "../base-command.js";
|
||||
import type { ICommandRequirements } from "../interface.js";
|
||||
|
||||
export class VanishCommand extends BaseCommand {
|
||||
name = "v";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { ChatMessage, ChatUser } from "@twurple/chat";
|
||||
import { Config } from "../../config/config.ts";
|
||||
import { getVolumeFromTidal, setVolumeToTidal } from "../../util/api-tidal.ts";
|
||||
import { logSuccess } from "../../util/logger.ts";
|
||||
import { BaseCommand } from "../base-command.ts";
|
||||
import type { ICommand, ICommandRequirements } from "../interface.ts";
|
||||
import { Config } from "../../config/config.js";
|
||||
import { getVolumeFromTidal, setVolumeToTidal } from "../../util/api-tidal.js";
|
||||
import { logSuccess } from "../../util/logger.js";
|
||||
import { BaseCommand } from "../base-command.js";
|
||||
import type { ICommand, ICommandRequirements } from "../interface.js";
|
||||
|
||||
export class VolumeCommand extends BaseCommand {
|
||||
name = "vol";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ChatMessage } from "@twurple/chat";
|
||||
import { logSuccess } from "../../util/logger.ts";
|
||||
import { BaseCommand } from "../base-command.ts";
|
||||
import type { ICommandRequirements } from "../interface.ts";
|
||||
import { logSuccess } from "../../util/logger.js";
|
||||
import { BaseCommand } from "../base-command.js";
|
||||
import type { ICommandRequirements } from "../interface.js";
|
||||
|
||||
export class WhereCommand extends BaseCommand {
|
||||
name = "where";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { ApiClient } from "@twurple/api";
|
||||
import { type AccessToken, RefreshingAuthProvider } from "@twurple/auth";
|
||||
import { ChatClient } from "@twurple/chat";
|
||||
import { Config } from "../config/config.ts";
|
||||
import { logError } from "../util/logger.ts";
|
||||
import { TokenManager } from "./token-manager.ts";
|
||||
import { Config } from "../config/config.js";
|
||||
import { logError } from "../util/logger.js";
|
||||
import { TokenManager } from "./token-manager.js";
|
||||
|
||||
const tokenManager = new TokenManager(Config.bot_user_id);
|
||||
const tokenData = await tokenManager.getToken();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { promises as fs } from "node:fs";
|
||||
import type { AccessToken } from "@twurple/auth";
|
||||
import { logError, logInfo } from "../util/logger.ts";
|
||||
import { logError, logInfo } from "../util/logger.js";
|
||||
|
||||
export class TokenManager {
|
||||
private readonly tokenFilePath: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { chatClient } from "../core/client.ts";
|
||||
import type { IEvent } from "./interface.ts";
|
||||
import type { EventName } from "./registry.ts";
|
||||
import { chatClient } from "../core/client.js";
|
||||
import type { IEvent } from "./interface.js";
|
||||
import type { EventName } from "./registry.js";
|
||||
|
||||
export abstract class BaseEvent implements IEvent {
|
||||
protected get chatClient() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { logSuccess } from "../../util/logger.ts";
|
||||
import { BaseEvent } from "../base-event.ts";
|
||||
import type { EventName } from "../registry.ts";
|
||||
import { logSuccess } from "../../util/logger.js";
|
||||
import { BaseEvent } from "../base-event.js";
|
||||
import type { EventName } from "../registry.js";
|
||||
|
||||
export default class ConnectedEvent extends BaseEvent {
|
||||
name: EventName = "connected";
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Collection } from "@discordjs/collection";
|
||||
import type { ChatMessage } from "@twurple/chat";
|
||||
import { commands } from "../../commands/collection.ts";
|
||||
import type { ICommand } from "../../commands/interface.ts";
|
||||
import { Config } from "../../config/config.ts";
|
||||
import { BaseEvent } from "../base-event.ts";
|
||||
import type { EventName } from "../registry.ts";
|
||||
import { commands } from "../../commands/collection.js";
|
||||
import type { ICommand } from "../../commands/interface.js";
|
||||
import { Config } from "../../config/config.js";
|
||||
import { BaseEvent } from "../base-event.js";
|
||||
import type { EventName } from "../registry.js";
|
||||
|
||||
const Cooldowns = new Collection<string, number>();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { EventName } from "./registry.ts";
|
||||
import type { EventName } from "./registry.js";
|
||||
|
||||
export interface IEvent {
|
||||
name: EventName;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { chatClient } from "../core/client.ts";
|
||||
import { logInfo } from "../util/logger.ts";
|
||||
import ConnectedEvent from "./impl/connected.ts";
|
||||
import MessageEvent from "./impl/message.ts";
|
||||
import type { IEvent } from "./interface.ts";
|
||||
import { chatClient } from "../core/client.js";
|
||||
import { logInfo } from "../util/logger.js";
|
||||
import ConnectedEvent from "./impl/connected.js";
|
||||
import MessageEvent from "./impl/message.js";
|
||||
import type { IEvent } from "./interface.js";
|
||||
|
||||
export const eventRegistry = {
|
||||
message: (handler: IEvent) => chatClient.onMessage(handler.triggered),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { exchangeCode } from "@twurple/auth";
|
||||
import { Config } from "../config/config.ts";
|
||||
import { TokenManager } from "../core/token-manager.ts";
|
||||
import { TwitchAuth } from "../util/auth.ts";
|
||||
import { logInfo } from "../util/logger.ts";
|
||||
import { Config } from "../config/config.js";
|
||||
import { TokenManager } from "../core/token-manager.js";
|
||||
import { TwitchAuth } from "../util/auth.js";
|
||||
import { logInfo } from "../util/logger.js";
|
||||
|
||||
const port = 3000;
|
||||
const redirectUri = `http://localhost:${port}`;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiClient } from "@twurple/api";
|
||||
import { AppTokenAuthProvider } from "@twurple/auth";
|
||||
import { Config } from "../config/config.ts";
|
||||
import { Config } from "../config/config.js";
|
||||
|
||||
const authProvider = new AppTokenAuthProvider(
|
||||
Config.client_id,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { promptForInput } from "../util/general.ts";
|
||||
import { logError, logSuccess, logWarning } from "../util/logger.ts";
|
||||
import { setupClient } from "./setup-client.ts";
|
||||
import { promptForInput } from "../util/general.js";
|
||||
import { logError, logSuccess, logWarning } from "../util/logger.js";
|
||||
import { setupClient } from "./setup-client.js";
|
||||
|
||||
const botname = await promptForInput("enter bot username: ");
|
||||
const developers = (
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { UserIdResolvable } from "@twurple/api";
|
||||
import { Config } from "../config/config.ts";
|
||||
import { apiClient } from "../core/client.ts";
|
||||
import { getUserId } from "./general.ts";
|
||||
import { logError } from "./logger.ts";
|
||||
import { Config } from "../config/config.js";
|
||||
import { apiClient } from "../core/client.js";
|
||||
import { getUserId } from "./general.js";
|
||||
import { logError } from "./logger.js";
|
||||
|
||||
export async function banByIds(
|
||||
channelId: UserIdResolvable,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import axios from "axios";
|
||||
import { Config } from "../config/config.ts";
|
||||
import { logWarning } from "./logger.ts";
|
||||
import { Config } from "../config/config.js";
|
||||
import { logWarning } from "./logger.js";
|
||||
|
||||
type HomeAssistantEntity = {
|
||||
entity_id: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import axios from "axios";
|
||||
import { Config } from "../config/config.ts";
|
||||
import { logWarning } from "./logger.ts";
|
||||
import { Config } from "../config/config.js";
|
||||
import { logWarning } from "./logger.js";
|
||||
|
||||
type Song = {
|
||||
title: string;
|
||||
|
||||
@@ -5,8 +5,8 @@ import {
|
||||
type ServerResponse,
|
||||
} from "node:http";
|
||||
import { URL } from "node:url";
|
||||
import { Config } from "../config/config.ts";
|
||||
import { logError, logInfo } from "./logger.ts";
|
||||
import { Config } from "../config/config.js";
|
||||
import { logError, logInfo } from "./logger.js";
|
||||
|
||||
export class TwitchAuth {
|
||||
private readonly redirectUri: string;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as readline from "node:readline";
|
||||
import type { UserIdResolvable } from "@twurple/api";
|
||||
import { apiClient } from "../core/client.ts";
|
||||
import { logSuccess, logWarning } from "./logger.ts";
|
||||
import { apiClient } from "../core/client.js";
|
||||
import { logSuccess, logWarning } from "./logger.js";
|
||||
|
||||
export async function getUserId(username: string): Promise<UserIdResolvable> {
|
||||
const user = await apiClient.users.getUserByName(username);
|
||||
|
||||
Reference in New Issue
Block a user