Giter Club home page Giter Club logo

cross-server-bot's Introduction

Cross-Server-Bot

A Cross-Server bot script that works with Eris library. Link channels between them easily with an easy and beautiful visual thanks to webhooks. Supports message delete, update, lock command...

Features

  • Link as many channels as you want between them.
  • Instant redirection of messages.
  • Support message deletion and message updating
  • Usage of webhooks to simulate users (good looking and easy to understand chat).
  • Support images.
  • Warn if a server supposed to be in the linked channels is not here anymore or if a webhook is falsy.
  • EnhancedMention - mention a user/role/channel in another guild easily by simply using @name or #name.
  • ignore - Whether or not to ignore all messages coming from that channel.
  • ignoreBots - Whether to accept bots message to gothrough the network. False by default
  • Commands
    • lock - Lock the current channel (remove sendMessage for everyone role): c!lock
    • lock all - Lock all channels in the network: c!lock all
    • unlock - Unlock the current channel: c!unlock
    • unlock all - Unlock all channels: c!unlock all
    • commands are usable by poeple that have one of the roles in the managerRoles field in the config.

Setup

Clone this repository.
Run npm install or yarn.

Copy and paste config.template.json as config.json.
Enter your bot token and all correct information:

{
    "token": "botToken",
    "prefix": "c!",
    "enhancedMention": {
        "user": false,
        "role": false,
        "channel": false
    },
    "messageDelete": true,
    "deleteOnUpdate": true,
    "guilds": [
        {
            "name": "name",
            "identifier": "",
            "guildID": "111111",
            "channelID": "121212",
            "whID": "232323",
            "whToken": "webhookToken2323",
            "ignore": false,
            "ignoreBots": true,
            "managerRoles": []
        },
        {
            "name": "name",
            "identifier": "",
            "guildID": "444444",
            "channelID": "454545",
            "whID": "56565656",
            "whToken": "webhookToken5656",
            "ignore": false,
            "ignoreBots": true,
            "managerRoles": []
        }
    ]
}

You can enter here as many guilds as you want. Make sure webhooks and channels are valid.

The enhancedMention system makes the bot automatically resolve users, roles, channels in every guild if tried to be mentioned in another guild.
For instance if you type a message with @user in your guild but this user is not in your current guild but only in an other guild connected through the cross server system, it will mention the user in this other guild.

To enjoy all bots features you need to make sure the bot has the correct permissions:

  • read messages, send messages
  • @everyone role need to have the use external emoji permission in the channel in order to allow the bot to use all custom emotes
  • manage messages in order to support deleteOnUpdate and messageDelete options
  • manage permissions in the channel in order to support using lock commands

To start the bot once everything is ready, you can do:

  • npm start or yarn start to run the bot normally.
  • npm pm2start or yarn pm2start to run the bot with pm2.

cross-server-bot's People

Contributors

aervyon avatar bsian03 avatar dependabot[bot] avatar khaaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cross-server-bot's Issues

Multiple linked sets of channels

Hello, just want to say your bot is working great so far with syncing multiple channels together!

However, I was wondering, is there a way to link multiple sets of channels? For example:

Server1: #fortnite
Server2: #fortnite
Server3: #fortnite

Server1: #minecraft
Server2: #minecraft
Server3: #minecraft

I'm not sure the .json file accepts multiple "guilds":{ } fields, and was wondering if there was a built in way I missed or if I'd need to run multiple instances of the bot to do that.

Bot not starting - npm and Node.js both up to date on ubuntu 16.04.6 LTS [Debug log attached]

root@localhost:/cross# npm start index.js

[email protected] start /cross
node index.js "index.js"

sh: 1: node: not found

npm ERR! Linux 4.4.0
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start" "index.js"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] start: node index.js "index.js"
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] start script 'node index.js "index.js"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the cross-server-bot package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node index.js "index.js"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs cross-server-bot
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls cross-server-bot
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /cross/npm-debug.log
root@localhost:/cross#
npm-debug.log

Webhooks

I've come across an issue with the bot not forwarding messages sent to a channel via a separate Webhook. Is there a way this could be resolved?

bot crash with error when start it

[email protected] start
node index.js

Ready!
node:internal/process/promises:279
triggerUncaughtException(err, true /* fromPromise */);
^

DiscordHTTPError: 404 Not Found on POST /api/v7/webhooks/
at RequestHandler.request (/home/debian/Cross-Server-Bot/node_modules/eris/lib/rest/RequestHandler.js:71:15)
at Client.executeWebhook (/home/debian/Cross-Server-Bot/node_modules/eris/lib/Client.js:664:36)
at Client. (/home/debian/Cross-Server-Bot/src/index.js:24:21)
at Object.onceWrapper (node:events:641:28)
at Client.emit (node:events:527:28)
at Shard. (/home/debian/Cross-Server-Bot/node_modules/eris/lib/gateway/ShardManager.js:71:30)
at Shard.emit (node:events:527:28)
at Shard.checkReady (/home/debian/Cross-Server-Bot/node_modules/eris/lib/gateway/Shard.js:1690:23)
at Shard.restartGuildCreateTimeout (/home/debian/Cross-Server-Bot/node_modules/eris/lib/gateway/Shard.js:1608:29)
at Shard.wsEvent (/home/debian/Cross-Server-Bot/node_modules/eris/lib/gateway/Shard.js:736:30)

TypeError: config.guilds is not iterable

Try for the life of me I cannot figure out where this is error is. Could you possible write more detailed docs for the bot or open a support server for it? Also, I'd appreciate if you'd help me resolve this.

Love the bot and can't wait for a v2!
image

Adding a set webhook to send the message when the bot is online

So every time i turn on this bot, it posts the message: Bot Ready - Cross Server system operational! But i want to make it so that message won't get posted in every channel that the webhook is in, and i want to set it to a specific channel, but i tried to find a way but not sure, can this be added?

What is with this "webhook unavailable" message when an embed is sent

Hi! this is a very nice bot it took me a while to get how it works though but I got it working and I used this to link a discord channel of my mc server so it sends embeds if someone joins the server and if the server starts or stops but it says webhook unavailable in (server name)
image

TODO

v3.1.0

  • fix enhanced mention (use discord allowedMentions)
  • support true edit, and use webhook delete
  • support for discord reply
  • option so all message deletion gets waterfalled to all servers and not only the main message deletion (current behaviour)
  • support transfering embeds through webhooks

Any PR that helps toward this goal will be accepted.

v4.0.0 and later

For the future of this bot we could expect:

  • auto creation and management of webhook creation deletion (optional)
  • multiple channel network on the same bot

Can't run the bot

Hi,

I want to link two channels (say Channel A and Channel B) within the same discord server. But I can't seem to run the bot properly:

  1. Do I need to create a webhook for each of Channel A and Channel B?
  2. How do I get the "whID": "232323" and "whToken": "webhookToken2323"?

Thanks.

Bot keeps crashing

I’m able to run it a few minutes but once it relays one or two messages, it crashes. Any advice?

Assistance Needed

I was wondering what does the "identifier": "", in config.json means

and also can you guide me how i can set custom status of the bot if possible?

message deleted by bot (suggestion)

hello, this is a suggestion

is there a way to make the bot check if the message was deleted by another bot before of being sent?, because in my server exist a channel that no one can send link, and when this person send the link, the bot (Mee6 example) deleted this message but the bot (Cross-Server) send the message anyway

i hope this can be made! :D

Need help with WebHooks not working

Hey,

I don't know if anyone still uses this but its the only thing I found so I tried to set it up. I managed to get everything to work and got it running, but whenever I send a message i just get the "WebHook unavailable in [server name]" message. I quadruple checked the webhook IDs and Tokens, and even tried swapping stuff around, but couldn't get it to work. After some research I found that they made some changes to WebHooks this year and figured out maybe thats the reason. So if anyone reads this and still uses the bot, let me know if theres a fix for it. Or maybe I am just stupid and overlooked something, but im 99% sure I entered everything correctly.

image

image

EDIT: I also gave the bot admin perms to see if its a permission issue, still not working

When linking more than 2 channels together message appears on all of them

Hey,
I was using this to connect 4 channels between servers. The plan was to connect one channel to one channel and the other to the other channel. The problem I am running into though is, I am finding that one message is repeating on all 4 channels when sent on one of them. Any idea how to fix that?

Deleting a message will sometimes not properly delete it on linked servers

Hi,

I found that the bot has an issue with deleting messages. When a "duplicated" message is deleted, from someone with roles (moderation), this message won't get deleted on linked servers.
It does work when the original message is deleted (by the sender or a moderator), but not when a linked message is.

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.