Giter Club home page Giter Club logo

title-grantor's Introduction

title-grantor

A cold QQ bot that grants special titles.

Environment

  • Node.js (>= 20)
  • A running OneBot implementation which supports set_group_special_title (e.g. Lagrange.OneBot, OpenShamrock)

Usage

Scopes

Only available in groups specified in the .env file; only available when the bot is the owner of an enabled group; commands can only be executed by the group owner / admins.

Commands

/help: View the usage of this bot.

/grant [QQ Number] [Title]: Grants a given user the specified title. The title should be no longer than 18 bytes. One Chinese character in UTF-8 occupies 3 bytes, so a title in Chinese should be no longer than 6 Chinese characters.

Do not attempt to use ASCII characters and Unicode characters together in a title longer than 18 bytes, because it will be cut off after its 18th byte, and if the 18th byte is within a Unicode character, this will cause unexpected outcome.

/refresh-privileged-list: Although this application actively listens to the changes of group admins, there are some chance that the bot does not receive the notice. So if the group admin list changes and some of the admins cannot execute commands, those who have the privilege should manually execute this.

Deployment

First download the index.js file.

Create a .env file at the same directory as index.js, and add such lines:

WS_URL=
GROUP_NUMBER=

WS_URL: The (Forward, Active, '正向') WebSocket URL of your OneBot service. (may need access token in query, e.g. ws://...?access_token=...)

GROUP_NUMBER: The number(s) of group(s) where the bot is supposed to be enabled. To specify multiple groups, please split numbers with comma(s), for example 12345,67890.

Debug Mode

If you want to debug this application, add another line to .env:

DEBUG_MODE=1

In debug mode, the bot will be more "noisy" and send messages containing debug information. Do not enable this in production environment!

Start

You should check whether your OneBot service is running. If it is running, execute

node --env-file=.env ./index.js

and the application will start to work.

title-grantor's People

Contributors

wesley-young avatar

Stargazers

Shigure avatar

Watchers

 avatar

Forkers

chrise2024

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.