Giter VIP home page Giter VIP logo

discordircd's People

Contributors

creesch avatar jimt avatar pokechu22 avatar rctgamer3 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  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  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  avatar  avatar  avatar  avatar  avatar

discordircd's Issues

VIM based replace/edit

As seen by many IRC bots and the discord webapp itself,
using an input such as s/foo/bar will, depending on the platform, will edit, or resend the last message with the replacement string.
Discord also have a replacement of no content to delete the message from the buffer
This could be useful for editing the last sent message from the deamon

Here's discord's implementation, a bit minified though

searchReplace: {
                    regex: /^s\/((?:.+?)[^\\]|.)\/(.*)/,
                    REMOVE_ESCAPE_CHARS: /\\([*?+\/])/g,
                    action: function(e, t) {
                        if (!t.isEdit) {
                            var n = e.content;
                            e.content = "";
                            var a = x["default"].getChannelId();
                            if (a) {
                                var i = V["default"].getLastEditableMessage(a);
                                if (i && i.id) {
                                    var r = Array.from(n.match(this.regex) || []),
                                        o = r[1],
                                        s = r[2];
                                    o = o.replace(this.REMOVE_ESCAPE_CHARS, function(e, t) {
                                        return t
                                    }), s = s.replace(this.REMOVE_ESCAPE_CHARS, function(e, t) {
                                        return t
                                    });
                                    var E = i.content.replace(o, s);
                                    E ? E !== i.content && z["default"].editMessage(a, i.id, {
                                        content: E
                                    }) : z["default"].deleteMessage(a, i.id)
                                }
                            }
                        }
                    }
                }

Handle embeds.

Some bots for example use embeds for part of their communication.

IRC Nicknames via user Notes (or something)

This might not be a catch-all solution, as I expect some users actually use notes for a purpose,
but it would be helpful to have an ability to alias a user to a name
https://discord.js.org/#/docs/main/stable/class/User?scrollTo=note

Some messages I get will look like

Their account name uses supported alphanumeric characters as an added detail, but it this didn't work out


irc;([a-zA-Z0-9_\\[\]\{\}\^`\|]+) could be a suggestion to use irc nicks alongside regular notes
but I'll let you figure it out

Give owner that luscious tilde

Guild owners are usually the creator, or have been transferred ownership,

Should be fetchable with discordClient.guilds.get(discordID).owner which returns the user as an object
or with ownerID if you want their unique ID

Makeshift Friends List

I had this idea ages ago as a idea to fix #10
If there was a channel on the irc instance for PMs, This could be used to watch users go online and offline (or away, could be a few different solutions).

There could also be another channel just to list your private messages list, since not everyone you talk to privately are in your friends list

TypeError: Cannot read property 'id' of undefined

Happens randomly, no idea what's causing it. If I'm able to reproduce it properly I'll update here later

/home/volkor/git/discordIRCd/server.js:599
    const discordServerId = oldChannel.guild.id;
                                             ^

TypeError: Cannot read property 'id' of undefined
    at Client.<anonymous> (/home/volkor/git/discordIRCd/server.js:599:46)
    at Client.emit (events.js:198:13)
    at ChannelUpdateAction.handle (/home/volkor/git/discordIRCd/node_modules/discord.js/src/client/actions/ChannelUpdate.js:13:14)
    at ChannelUpdateHandler.handle (/home/volkor/git/discordIRCd/node_modules/discord.js/src/client/websocket/packets/handlers/ChannelUpdate.js:7:34)
    at WebSocketPacketManager.handle (/home/volkor/git/discordIRCd/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (/home/volkor/git/discordIRCd/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (/home/volkor/git/discordIRCd/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
    at WebSocket.onMessage (/home/volkor/git/discordIRCd/node_modules/ws/lib/event-target.js:120:16)
    at WebSocket.emit (events.js:198:13)
    at Receiver._receiver.onmessage (/home/volkor/git/discordIRCd/node_modules/ws/lib/websocket.js:137:47)

Syntax error

When i tried to run it i get this
Syntax error
r

Organize the code in modules instead of one big file.

Currently everything lives in one big file with just a little abstraction. This makes maintenance a bit of a pain and contributions also less likely.

It would probably be beneficial to split out the code in several components. Something along the lines of:

  • start.js would be responsible for
  • discord.js would be responsible for the discord connection side of things.
  • irc-server.js would contain the connection functionality for the server.
  • utils.js would be the home of all the functions responsible for parsing data. Like these lines here and a lot of functionality that now happens directly in the event handlers themselves.

It would be no small task, but it has been on my mind for a while so I might as well make an issue for it.

Username mention in DM crashes discordIRCd server

When your discord nick is mentioned in a direct message, the discordIRCd server will crash. The issue seems to be 100% reproducable any time the other person in the DM mentions you.

/home/devtea/discordircd/server.js:132
            const memberObject = discordClient.guilds.get(discordID).members.get(userID);
                                                                    ^

TypeError: Cannot read property 'members' of undefined
    at /home/devtea/discordircd/server.js:132:69
    at Array.forEach (<anonymous>)
    at parseDiscordLine (/home/devtea/discordircd/server.js:130:26)
    at /home/devtea/discordircd/server.js:909:40
    at Array.forEach (<anonymous>)
    at /home/devtea/discordircd/server.js:906:24
    at Array.forEach (<anonymous>)
    at Client.<anonymous> (/home/devtea/discordircd/server.js:895:22)
    at Client.emit (events.js:159:13)
    at MessageCreateHandler.handle (/home/devtea/discordircd/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/devtea/.npm/_logs/2017-12-29T15_53_25_883Z-debug.log

Contents of /home/devtea/.npm/_logs/2017-12-29T15_53_25_883Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/devtea/discordircd/node_modules/.bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/devtea/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/devtea/bin
9 verbose lifecycle [email protected]~start: CWD: /home/devtea/discordircd
10 silly lifecycle [email protected]~start: Args: [ '-c', 'node server.js' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `node server.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack     at EventEmitter.emit (events.js:159:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:159:13)
13 verbose stack     at maybeClose (internal/child_process.js:943:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/devtea/discordircd
16 verbose Linux 4.14.8-1-ARCH
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v9.3.0
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `node server.js`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Userlist nicknames wasn't updated

Noticed this issue when autocomplete matched the nickname as it would be at some hours of the day, instead of the one that was currently in use in the chat buffer

Reported based off 9564b56
have since pulled, unsure if this would have any affect

Crash; Error: read ECONNRESET

Sometimes the server explodes itself requiring a manual restart

events.js:161
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at exports._errnoException (util.js:1028:11)
    at TCP.onread (net.js:572:26)

Unfortunately, that's all I have, I don't have a proper debugger for anything else

NPM install errors: dependency issues?

Hi all,

It seems running npm install on my machine for discordIRCd does not work properly.
I don't totally know what I'm doing, but judging from what I can gather from my terminal's output after trying npm install, it looks like discordIRCd might require all sorts of specific versions of .js material, which is why I titled this "[...] dependency issues?".

Running git clone to clone the git to my home directory works fine, no problems there.

Afterwards,

tamberoo@studio1:~/discordIRCd$ npm install
loadDep:erlpack → resolve ▐ ╢███████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
loadDep:erlpack → get ▐ ╢███████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated [email protected]: use node-fetch instead
loadDep:uuid → headers ▌ ╢████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
loadDep:punycode → 200 ▀ ╢█████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟

> [email protected] install /home/tamberoo/discordIRCd/node_modules/bufferutil
> prebuild-install || node-gyp rebuild

/usr/bin/env: ‘node’: No such file or directory
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:354:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-142-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/tamberoo/discordIRCd/node_modules/bufferutil
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
[email protected] /home/tamberoo/discordIRCd
├── UNMET PEER DEPENDENCY @discordjs/opus@^0.1.0
├── UNMET PEER DEPENDENCY @discordjs/uws@^10.149.0
├── UNMET DEPENDENCY bufferutil@^3.0.0
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│ └── [email protected]
├─┬ UNMET PEER DEPENDENCY [email protected] (git://github.com/hammerandchise/erlpack.git#c514d36ec81a7a61ef90b75df261025ab046574d)
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]
├── UNMET PEER DEPENDENCY libsodium-wrappers@^0.7.3
├── UNMET PEER DEPENDENCY node-opus@^0.2.7
├── UNMET PEER DEPENDENCY opusscript@^0.0.6
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ └── [email protected]
└── UNMET PEER DEPENDENCY sodium@^2.0.3

npm WARN [email protected] requires a peer of @discordjs/uws@^10.149.0 but none was installed.
npm WARN [email protected] requires a peer of bufferutil@^4.0.0 but none was installed.
npm WARN [email protected] requires a peer of erlpack@discordapp/erlpack but none was installed.
npm WARN [email protected] requires a peer of libsodium-wrappers@^0.7.3 but none was installed.
npm WARN [email protected] requires a peer of @discordjs/opus@^0.1.0 but none was installed.
npm WARN [email protected] requires a peer of node-opus@^0.2.7 but none was installed.
npm WARN [email protected] requires a peer of opusscript@^0.0.6 but none was installed.
npm WARN [email protected] requires a peer of sodium@^2.0.3 but none was installed.
npm ERR! Linux 4.4.0-142-generic``npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: prebuild-install || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'prebuild-install || node-gyp rebuild'.
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 bufferutil package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! prebuild-install || node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bufferutil
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bufferutil
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/tamberoo/discordIRCd/npm-debug.log
tamberoo@studio1:~/discordIRCd$

So, to me it looks like this project requires some certain things:

  1. a file or directory in /usr/bin/env called node
  2. some sort of different Linux kernel (probably older)??? since 4.4.0-142-generic seems to make it throw a hissyfit
  3. discord.js, erlpack, bufferutil, libsodium-wrappers, node-opus, opusscript, sodium
  4. Possibly a lot more that I can't find or know about
    My guess it that this project requires all these things. The thing I don't know how to do is install/set up all these dependencies (if that's the right word for them).

Running uname -a gives me this output: Linux studio1 4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:01:15 UTC 2019 i686 i686 i686 GNU/Linux so that way y'all know some info about my machine. And hey, just for the hell of it: here's a link to a screenshot of my current setup and my terminal running screenfetch.

How would one go about solving this?

mIRC 7.47 error

Any chance you'll work on getting this to work with mIRC? Or maybe you could give me a lead and I could try to fix it myself?

mIRC won't connect after verifying the username: http://i.imgur.com/tHTOWhk.png

(pardon the funny usernames)

it'd be rad to get my mirc bot into my discord server.

a few suggestions

Hello! I have some suggestions to help improve the IRCd. I'm just gonna compile them into this list so I don't end up making a ton of issues.

  1. Server owners should have the "Owner" IRC role (the ~)
  2. If a user has a role that matches a irc role (e.g. their discord role is voiced) they should also get the voiced role.
  3. Be able to WHOIS a user, and find their ID, Real Discord name (if nicked), their discriminator, and whatever else.

This is it for now, but I might keep adding to it.

Channel List is blank

I've followed your instructions, but I don't believe I'm doing it entirely correctly
My token is being accepted, and I used what I believe should be the correct guild id via /PASS
(in my example 157745176616501248)

My username matches authentication and I'm connected to the irc fine,
but using /list returns no channels

My debug looks a little like this

Can't login into the server

Followed the instructions and every-time I try to connect to the server I get
Connected. Now logging in. * Disconnected (Remote host closed socket)
Connected. Now logging in.* Disconnected (Connection reset by peer)
or some other variation of this.
Can you clarify that hostname in config.js is the same as the server address (in my case 127.0.0.1)
and username is whatever you want and put into the config under username (does it has to be the same as discord username I guess?)
Also the server id of discord server should be under login method /Pass password correct?
Also is githubToken necessary for this to work?
Thank you.

Crash on guild leave

When using the web client, if I leave a guild using the web interface, my IRC connection drops and the deamon crashes.

/mnt/mpathag/scratch/node/discordIRCd/server.js:555
        ircDetails[discordServerId].channels[newChannel.name] = {
                                   ^

TypeError: Cannot read property 'channels' of undefined
    at Client.<anonymous> (/mnt/mpathag/scratch/node/discordIRCd/server.js:555:36)
    at emitOne (events.js:96:13)
    at Client.emit (events.js:189:7)
    at ClientDataManager.newChannel (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/client/ClientDataManager.js:69:51)
    at Guild.setup (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/structures/Guild.js:179:68)
    at new Guild (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/structures/Guild.js:65:12)
    at ClientDataManager.newGuild (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/client/ClientDataManager.js:23:19)
    at GuildCreateHandler.handle (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/client/websocket/packets/handlers/GuildCreate.js:17:26)
    at WebSocketPacketManager.handle (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:120:65)
    at WebSocketManager.eventMessage (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/client/websocket/WebSocketManager.js:273:31)

What's interesting is that this guild wasn't connected via the deamon at all, was only part of it for approximately three minutes

Properly deal with IRC v3 capability negotiation

13:41:32 [192] -!- Welcome to the fake Internet Relay Chat Network user
13:41:32 [192] -!- This server was created specifically for you
13:41:44 [192] -!- AWAY :Do not disturb
13:41:44 [192] -!- AWAY :Do not disturb
13:41:44 [192] -!- AWAY :Do not disturb
13:41:44 [192] -!- AWAY :Do not disturb
13:41:44 [192] -!- AWAY :Do not disturb
13:41:44 [192] -!- AWAY :Do not disturb
13:41:44 [192] -!- AWAY :Do not disturb
13:41:44 [192] -!- AWAY :Do not disturb
13:41:44 [192] -!- AWAY :Do not disturb
13:41:44 [192] -!- AWAY :Do not disturb

http://take.ms/dwvsO

Duplicate messages received

After a while I always begin to receive duplicate messages. May be related to connecting to discordircd using a bouncer (znc)? I usually have to do a reconnect to get things back to normal.

image

Apologies for lack of info, let me know if there's anything else I can provide.

Give users IRC roles based on permissions.

For example, server owner should have the "Owner" (+q commonly, prefixed with ~).
People with Administrator should have "Admin" (+a commonly, prefixed with &).

It is possible to get user permissions, I'm not entirely sure how. I don't know Discord.js, but it is possible in JDA, so unless they do hacky things, and d.js has a method, shouldn't be terribly difficult.

For Ops and below, it's a bit harder to figure out. Ops and Half-ops are basically indistinguishable, however ops can demote and promote half-ops. Both Half/Ops can manage channel and roles (below them, obviously) so maybe anyone with these permissions could be opped?

People with manage messages only could be half-op, I guess?

Voiced is just a general "notice" role, maybe this could be applied to anyone with a role?

This all relies on d.js and the discord api allowing us to get user's permissions, which I'm almost certain is possible without any roles or special permissions.

Hangs forever

With the config

global.configuration = {
    DEBUG: false,
    showOfflineUsers: true, // When true all users will always be shown. Offline users will be shown as away on clients that support away-notify.
    discordToken: 'my token is here',
    tlsEnabled: false,
    tlsOptions: {
      keyPath: '/path/to/key.pem',
      certPath: '/path/to/cert.pem'
    },
    handleCode: true,
    githubToken: 'also here',
    ircServer: {
        listenPort: 6667,
        hostname: '127.0.0.1',
        username: 'witheld'
    }
};

Running "node server.js" silently hangs forever

Better handling of Claimed Account restricted guilds

When connecting to a guild in IRC that has a claimed account restriction with an unclaimed account, this error is thrown

(node:22110) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot set property 'discordDisplayName' of undefined
data: QUIT :Leaving

An interesting alternative is to have your name as your username+descriminator, and have all channels as voiced only/read only

Clean up port after SIGINT (Ctrl+C)

Common issue I have after stopping the server to restart it / git pull
After giving it a graceful shutdown via a SIGINT, the port still seems to be in use for another couple of minutes.
Due to this, an error is thrown

Error: listen EADDRINUSE :::34416
    at Object.exports._errnoException (util.js:1028:11)
    at exports._exceptionWithHostPort (util.js:1051:20)
    at Server._listen2 (net.js:1261:14)
    at listen (net.js:1297:10)
    at Server.listen (net.js:1375:9)
    at Client.<anonymous> (/mnt/mpathag/scratch/node/discordIRCd/server.js:320:19)
    at emitNone (events.js:91:20)
    at Client.emit (events.js:186:7)
    at WebSocketManager._emitReady (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/client/websocket/WebSocketManager.js:325:17)
    at Promise.all.then (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/client/websocket/WebSocketManager.js:344:49)

Seems to already have a stackoverflow thread since it's common appearance, ...six years ago
https://stackoverflow.com/questions/4075287/node-express-eaddrinuse-address-already-in-use-kill-server
I'm still unsure on the correct approach to a fix though

seems incompatible with eggdrop

Hello there...

I tried to use discordIRC with an eggdrop... The eggdrop connects well to the server, but don't see the channel when I add it (.+chan #test in party-line).
So, I use .tcl putserv "join #test" and I can send messages to the channel, but it's always in pending status for the eggdrop, so it can't see anything of the conversation.

It seems like some parts of the IRC protocol wasn't well implemented. My eggdrop is set to be compliant with unrealircd.

Handle code blocks better using github gist and possibly irccloud text snippets

Currently they aren't handled at all resulting in each line being send to irc separately, making the code unreadable.

The best solution to me seems to look for code blocks and pass those to a pastebin like service.

However, since some channels likely are considered private I don't want to do this to a open service. So the only services I will build in are those that allow private/unlisted text snippets.

gist.github.com is the most obvious choice for this. Secondly I want to explore if the irccloud text snippet functionality has an api endpoint.

WHOIS command: handle unknown nick

…Instead of crashing.

                        const userID = ircDetails[socket.discordid].members[whoisUser];
                                                                           ^
TypeError: Cannot read property '<NICK>' of undefined
    at /opt/discordIRCd/server.js:1392:76
    at Array.forEach (native)
    at Socket.<anonymous> (/opt/discordIRCd/server.js:1149:19)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:547:20)

Dictionary key is unchecked at: https://github.com/creesch/discordIRCd/blob/04e14d3/server.js#L1392

LIST on Direct Message crash

The deamon will crash if a user inputs a LIST command for any reason when connecting to the DMServer

data: LIST                                                                                        │··························
                                                                                                  │··························
/mnt/mpathag/scratch/node/discordIRCd/server.js:693                                               │··························
    const channels = discordClient.guilds.get(discordID).channels.array();                        │··························
                                                        ^                                         │··························
                                                                                                  │··························
TypeError: Cannot read property 'channels' of undefined                                           │··························
    at listCommand (/mnt/mpathag/scratch/node/discordIRCd/server.js:693:57)                       │··························
    at /mnt/mpathag/scratch/node/discordIRCd/server.js:933:25                                     │··························
    at Array.forEach (native)                                                                     │··························
    at Socket.<anonymous> (/mnt/mpathag/scratch/node/discordIRCd/server.js:779:19)                │··························
    at emitOne (events.js:96:13)                                                                  │··························
    at Socket.emit (events.js:189:7)                                                              │··························
    at readableAddChunk (_stream_readable.js:176:18)                                              │··························
    at Socket.Readable.push (_stream_readable.js:134:10)                                          │··························
    at TCP.onread (net.js:551:20)     

Message history over IRCv3

It would be helpful to handle message history, which is supported by a small handful of clients keeping up to date with IRCv3.
It's still under development (might be a bit stalled), but there's a current standard that could be followed. since a few clients already follow it, and inspircd have implemented it into their deamon as well.

http://ircv3.net/specs/extensions/batch/chathistory-3.3.html
Here's a simple format for messages.
I would assume that when a user connects to the irc server, and joins a channel, the previous X messages could be fetched and sent over to the client

Incoming DMs are ignored

Logged on to Discord through the website today to find out that a few people had sent me DMs that never showed up on IRC. If logs are helpful, I can get someone to send me a DM while I'm logging.

move config to user home directory

Something that has been on my mind for a while. In order to do this properly it is probably also needed to make discordIRCd check for the existence of a config and if not generate a default one.

Inline links for Attached files

Probably the biggest UX issue is that files that are uploaded from other users into a channel are missing.
Easiest solution would to append these as a URL to the end of the message, or as a new line to send

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.