Giter Site home page Giter Site logo

mugamelife / discord-telegram-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from a2569875/discord-telegram-bot

0.0 0.0 0.0 1.02 MB

在多個群組間傳話的機器人,包括但不限於Discord、Telegram等通訊軟體。

License: GNU Affero General Public License v3.0

Shell 0.02% JavaScript 99.98%

discord-telegram-bot's Introduction

node.js License

Discord-Telegram-Bot

The functionality of this bot is to relay messages between multiple groups, including but not limited to Discord, Telegram, and other messaging software. Inspired by the Chinese Wikipedia Interconnection Group and zhmrtbot.

This project is a modification of LilyWhiteBot, originally named "qq-tg-irc."

Original Readme

The development of this project is based on a fork and, according to the definition of the upstream project, it supports message synchronization between various communication software, including Discord, Telegram, WeChat (WeChat), IRC, QQ, and more. However, this project is developed and maintained exclusively for message synchronization between Discord and Telegram.

Language

How to Install

Mandatory Steps

  • Prepare a bot account as needed. (Specific methods are provided later.)
  • Install Node.js, version requirement: >=7.x.
  • Download the bot's core.
  • Execute:
npm install
node main.js
  • If you're concerned about crashes, you can run it in a loop, for example: while true; do node main.js; done, or:
:a
node main.js
goto a
  • Modify config.example.js according to your actual needs and rename it to config.js.
  • Format for QQ groups: qq/QQ group number; Format for Telegram groups: telegram/a string of numbers (this number can be obtained using /thisgroupid, as explained later, and please note that this number is negative); Format for IRC channels: irc/#channel name, don't forget the #; Format for Discord channels: discord/channel ID.

Setting up the Telegram Bot

To set up a Telegram bot, follow these steps:

  1. Find the user @BotFather on Telegram and interact with it. Follow the on-screen prompts to create a bot account.

  2. After setting up the bot, BotFather will provide you with a Token. You need to fill this Token into the config.js file.

  3. Remember to execute the /setprivacy command to set the bot's Privacy to DISABLED. This allows the bot to see messages within groups.

  4. Initially, you can keep the "groupid-tg" within the config.js under the "plugins" section. Then, run the program and enter /thisgroupid in the group. This action will allow the bot to automatically provide the group ID for interconnection. If you don't understand the previous sentence, you can also add @combot to the group and enter /stat to see the number provided by the bot. Note that the number is negative.

Setting up the Discord Bot

To set up a Discord bot, follow these steps:

  1. Go to the Discord Developer Portal and create an Application.

  2. In the Bot section, click "Add Bot." Fill the Token into the config.js file. You can refer to the first half of this tutorial for guidance.

  3. You can find the Channel ID in the URL of the web version; it's the string of numbers at the end.

  4. You can also obtain the Channel ID on the desktop version by right-clicking the channel and selecting "Copy Channel ID." On mobile, you can get it by long-pressing the channel and selecting the corresponding option.

    Desktop Mobile

Setting up Bots for Other Platforms

Please refer to the old ReadMe for instructions on setting up bots for other platforms, including:

Tips

  1. If you set paeeye in config.js to //, you can prevent messages from being seen by other groups by adding // before your message (e.g., "//hidden").

  2. If you allow IRC to accept commands (with "irccommand" in the "plugins" section), you can use /command command in Telegram and QQ. This command is not for IRC but for interaction with the bot in IRC channels.

  3. If you enable IRC queries (with "ircquery" in the "plugins" section), you can use commands like /names (get a list of online users), /whois nickname (whois), and /topic (get the topic).

Other Features

To configure the following features, make changes in config.js:

  • filter: Filters messages that match specified rules.
  • qqxiaoice: Summons QQ group's XiaoBing. (Requires QQ group owner to enable XiaoBing/BabyQ functionality)
  • wikilinky

Acknowledgments

a2569875/Discord-Telegram-Bot

discord-telegram-bot's People

Contributors

mrhso avatar vjudge0 avatar a2569875 avatar sirnochan avatar artoria2e5 avatar wangqiliang avatar

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.