Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

alemonjs-mhy

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alemonjs-mhy

mhy-mod

latest
Source
npmnpm
Version
1.0.0-rc.3
Version published
Weekly downloads
14
180%
Maintainers
1
Weekly downloads
 
Created
Source

阿柠檬-米哈游

必要环境 nodejssql(mysql/sqlite)redischrome

该扩展推荐使用alemongoalemondesk作为生产环境

alemongo https://github.com/lemonade-lab/alemongo

alemondesk https://github.com/lemonade-lab/alemondesk

指令一览

README_COMMAND

安装方式1: Git

alemongo/alemondesk

  • 地址
https://github.com/xiuxianjs/alemonjs-mhy.git

若访问受限,可使用如下加速地址

https://ghfast.top/https://github.com/xiuxianjs/alemonjs-mhy.git
  • branch
release

本地

git clone -b release --depth=1 https://github.com/xiuxianjs/alemonjs-mhy.git ./packages/alemonjs-mhy
yarn install #开始模块化
  • alemon.config.yaml
apps:
  alemonjs-mhy: true # 启动扩展

安装方式2: npm

yarn add alemonjs-mhy -W
  • alemon.config.yaml
apps:
  alemonjs-mhy: true # 启动扩展

开发指南

导出 API

import {
  // 类型
  type MihoyoGame,
  type StoredCookieData,
  type StokenData,
  type QueryResult,

  // 游戏检测
  resolveGame,

  // 账号操作
  getUserCookie,
  getUserMainUid,
  bindUserCookie,

  // Stoken
  getUserStoken,
  bindStoken,

  // 签到
  performGameSign,
  performBbsSign,

  // 统一查询(推荐)
  queryMihoyoApi,

  // 底层 API
  mysApiFetch,
  fetchGameRoles
} from 'alemonjs-mhy';

queryMihoyoApi — 统一查询

大多数查询场景推荐使用此方法,自动处理 Cookie 读取、UID 获取、区服识别:

const result = await queryMihoyoApi({
  userId: '用户ID',
  game: 'gs',
  api: 'dailyNote'
});

if (result.success) {
  console.log(result.data); // API 返回数据
  console.log(result.uid); // 使用的 UID
}

mysApiFetch — 底层调用

需要自行传入 Cookie 和 UID,适合定制化场景:

const res = await mysApiFetch({
  uid: '100000001',
  cookie: 'ltoken=xxx;ltuid=xxx;',
  api: 'dailyNote',
  game: 'gs'
});

免责声明

  • 勿用于以盈利为目的的场景

  • 代码开放,无需征得特殊同意,可任意使用。能备注来源最好,但不强求

  • 图片与其他素材均来自于网络,仅供交流学习使用,如有侵权请联系,会立即删除

引用

NicknameContribution
Yunzai米游社API来源
miao米游社API部分来源
cvs米游社SToken来源
Hamster模拟抽卡背景素材来源
西风驿站角色攻略图来源
米游社友人A角色突破素材图来源

Keywords

alemonjs

FAQs

Package last updated on 28 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts