Skip to content
This repository has been archived by the owner on Mar 4, 2023. It is now read-only.

chuangzhu/matrix-qq-bridge

Repository files navigation

matrix-qq-bridge

Work in progress. A Matrix-QQ puppeting bridge based on Trixnity and Mirai.

Building

$ gradle installDist

JARs and a wrapper can be found in app/build/install/app/.

Deployment

A example config for the bridge is at config-example.yaml.

Generate registration config file for your homeserver:

$ ./app/build/install/app/bin/app config.yaml > qq-registration.yaml

Add the registration config file to your homeserver's config:

# Synapse
app_service_config_files:
- /path/to/your/qq-registration.yaml

# Dendrite
app_service_api:
  config_files:
  - /path/to/your/qq-registration.yaml

Restart the homeserver, then start the bridge:

$ ./app/build/install/app/bin/app config.yaml qq-registration.yaml

Using Nix flakes

This repository is a flake, and it includes a NixOS module.

{
  inputs.matrix-qq-bridge.url = "github:chuangzhu/matrix-qq-bridge";
  outputs = { self, nixpkgs, matrix-qq-bridge }: {
    nixosConfigurations.your-host-name = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        matrix-qq-bridge.nixosModules.matrix-qq-bridge
        {
          services.matrix-qq-bridge = {
            enable = true;
            settings = { /* Configuration as Nix attribute set */ };
            serviceDependencies = [ "matrix-synapse.service" ];
          };
          services.matrix-synapse = {
            enable = true;
            settings.app_service_config_files = [ "/run/credentials/matrix-synapse.service/matrix-qq-bridge" ];
          };
          systemd.services.matrix-synapse.serviceConfig.LoadCredential = [
            "matrix-qq-bridge:/var/lib/matrix-qq-bridge/qq-registration.yaml"
          ];
        }
      ];
    };
  };
}

Usage

Create a direct chat with @<appservice.bot_username>:<homeserver.domain>. Available commands:

  • !login - Get instruction to login to QQ.
  • !listclient - List other clients of current QQ account.
  • !cancel - Cancel an ongoing action

Features and roadmap

  • QQ → Matrix
    • Message content
      • Text
      • Files (partial implementation in Mirai, group only)
      • Picture
      • Sticker
      • Emoji
      • Message reply
      • Mention
      • Nudge
      • Recall message
      • Miniapp message
      • Forwarded message
      • Audio
      • Location (not yet supported by Mirai)
      • Video (not yet supported by Mirai)
    • Group message
    • Friend message
    • Stranger message
    • OtherClient message
    • Presence
    • Group permissions
    • Membership actions (invite/kick/join/leave/mute)
    • Initial chat metadata
      • Group name
      • Group avatar
      • User name
      • User avatar
    • Chat metadata changes
      • Group name
      • Group avatar
      • Group member name
      • Group member avatar
      • Friend nick
      • Friend avatar
      • Stranger nick
      • Stranger avatar
    • Double puppeting
  • Matrix → QQ
    • Message content
      • Text
      • Files
      • Picture
      • Sticker
      • Emoji
      • Message reply
      • Mention
      • Redact message (within 2 mins)
      • Edit message (recall and resend, within 2 mins)
      • Location
      • Audio
      • Video (to a file)
    • Room message
    • Direct message
    • Relay userbot and plumbed room

About

A Matrix-QQ puppeting bridge

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published