Greasy Fork

VIPCore.js

Core Library for VIP BOT

目前为 2024-12-31 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.cloud/scripts/522438/1512721/VIPCorejs.js

// ==UserScript==
// @name              VIPCore.js
// @namespace         https://i.imgur.com/tdC3R86.png
// @version           1.0.0
// @description       Core Library for VIP BOT
// @author            CryptHowl
// @license           MIT
// @run-at            document-start
// ==/UserScript==

class VIPCore {
  constructor(options = {}) {
    this.options = options;
    this.debugMode = options.debugMode || false;
  }

  log(message) {
    if (this.debugMode) {
      console.log(`[VIP BOT]: ${message}`);
    }
  }

  warn(message) {
    console.warn(`[VIP BOT WARNING]: ${message}`);
  }

  error(message) {
    console.error(`[VIP BOT ERROR]: ${message}`);
  }

  async delay(ms) {
    return new Promise((resolve) => setTimeout(resolve, ms));
  }
}

// VIPCore'u global bir değişken olarak kaydediyoruz.
window.VIPCore = VIPCore;