GithubHelp home page GithubHelp logo

sm00th / bitlbee-discord Goto Github PK

View Code? Open in Web Editor NEW
289.0 21.0 27.0 325 KB

Bitlbee plugin for Discord (http://discordapp.com)

License: GNU General Public License v2.0

C 94.71% Shell 0.69% Makefile 1.72% M4 2.28% Dockerfile 0.59%
bitlbee discord irc im

bitlbee-discord's Introduction

Discord protocol plugin for bitlbee.

License

bitlbee-discord plugin is distributed under GPLv2 license.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Build dependencies

bitlbee and headers >= 3.5

If using distribution version of bitlbee you will need to install the dev package, usually bitlbee-dev or bitlbee-devel. If bitlbee was built from source don't forget to do make install-dev.

glib2 and headers => 2.32

The library itself is usually installed as a dependency of bitlbee, headers need to be installed separately. In Debian, the package containing them is libglib2.0-dev.

autotools (if building from git)

A bit of an overkill, but autotools is the build system of choice now, sorry.

Building and Installing

If building from git you will first need to generate autotools configuration script and related files by executing the following command:

$ ./autogen.sh

After that (or when building from a tarball) you can build as usual:

$ ./configure
$ make
$ sudo make install

If your bitlbee's plugindir is in non-standard location you can specify it by calling ./configure with --with-plugindir=/path/to/plugindir option.

You can also use the dockerfile from contrib/docker to build a docker container containing bitlbee + bitlbee-discord. Use this command to run the container:

$ docker run -d -v /bitlbee/config:/var/lib/bitlbee -p 6667:6667 --name bitlbee <image>

Usage

Plugin adds 'discord' protocol to bitlbee, add your account as usual:

> account add discord <email> <password>
> account discord on

On your first login you might need to authorize bitlbee's ip address (discord will send you an email with a link) or get a captcha-request. In latter case you will have to manually set discord login-token to log in:

> account discord off
> acc discord set token_cache xxxxxxxx

To get your token you'll have to login with your browser and locate it in "local storage"

Chrome: Developer Tools -> Application -> Local Storage -> https://discordapp.com -> token Firefox: Web Developer -> Storage Inspector -> Local Storage -> http://discordapp.com -> token

For more info on captcha issue and any progress on making it less painful see #118

You also need to configure discord channels you would like to join/autojoin. To do that use bitlbee's 'chat list' functionality (help chat list and help chat add):

> chat list discord

This will show you the list of available channel with indexes that can be used for adding channels.

> chat add discord !1 #mydiscordchannel
> chan #mydiscordchannel set auto_join true
> /join #mydiscordchannel

If you set auto_join to true, next time you reconnect there will be no need to join the channel manually.

Options

This section describes options available through "account set" bitlbee command (for help on usage of this command see "help account set").

host (type: string; default: "discordapp.com")

Discord server hostname. Just in case discord changes the hostname or there are some alternatives with compatible API.

voice_status_notify (type: boolean; default: no)

This enables text notifications in your control channel about users changing/leaving voice channels. Can be noisy on big servers.

edit_prefix (type: string; default: "EDIT: ")

A string that will be prefixed to an edited message to distinguish those from normal ones.

urlinfo_handle (type: string; default: "urlinfo")

User handle that will be used to post url expansion info such as title and description in groupchats.

max_backlog (type: integer; default: 50)

Maximum number of backlog messages per channel to fetch on connection. Unlike twitter implementation in bitlbee this won't dump seen messages. Setting this to 0 or negative values disables backlog fetching.

send_acks (type: boolean; default: yes)

By default bitlbee-discord will send an "ack" for every message received, thus marking everything as "read" on mobile/webapp. Setting this to false will disable all acks from bitlbee-discord.

mention_suffix (type: string; default: ":")

Suffix used in a regex to look for username mentions to automatically convert your usual irc-style "nick:" mentions to discord's "<@id>" format. So if you type "nick: hello" in bitlbee, it will be displayed as "@nick hello" in discord. This can be multicharacter and you can even do OR logic here because it is actually used as a part of glib regex. That is setting this to "[:,]" will match both "nick:" and "nick,". But beware overcomplicating this may lead to bitlbee-discord spending a lot of time parsing your outgoing messages. Setting this to "" will disable this function.

mention_ignorecase (type: boolean; default: off)

Ignore case when looking for outgoing mentions. This also affects channel mentions.

incoming_me_translation (type: boolean; default: on)

This option controls whether bitlbee-discord will translate incoming messages that are fully italicized (that is enclosed in '*' characters) to '/me' messages.

never_offline (type: boolean; default: off)

Contacts from this account will never appear as offline and will be marked away instead.

server_prefix_len (type: int; default: 3)

Prefix channel names with this many characters of server name. If set to 0 nothing will be prefixed. If set to anything lower than 0 - full server name will be prefixed. Assuming we have a channel "general" on "beecord" server here is what channel name you are going to get with different settings:

-1 - #beecord.general
 0 - #general
 3 - #bee.general

fetch_pinned (type: boolean; default: off)

Fetch pinned messages on channel join.

friendship_mode (type: boolean; default: on)

With this option enabled, online/offline status is determined by the friendship relationship with a user in addition to their actual away status, and other users are added to channels.

always_afk (type: boolean; default: off)

When enabled bitlbee-discord would always report client's status as afk. This feature is not properly documented in official docs, but it presumably can force push notifications to other clients when bitlbee is connected.

emoji_urls (type: boolean; default: on)

Controls whether bitlbee-discord would display an url to emoji image next to it's text alias.

auto_join (type: boolean; default: off)

Automatically join all of the server's channels so you don't have to add them manually (no "chat add" needed).

auto_join_exclude (type: string; default: "")

Comma-separated list of channel patterns to exclude when auto-joining channels. * matches any text, ? matches a single character. For instance, "Foo.*,Bar.A" will exclude all channels from server "Foo" and channel "A" from server "Bar".

verbose (type: boolean; default: off)

Show more protocol-related messages in control channel.

Debugging

You can enable extra debug output for bitlbee-discord, by setting BITLBEE_DEBUG environment variable. This will enable bitlbee-discord to print all traffic it exchanges with discord servers to stdout and there is a lot of it. To get it on your screen run bitlbee by hand in foreground mode:

$ BITLBEE_DEBUG=1 bitlbee -nvD

then connect with an irc client as you usually do.

WARNING: there IS sensitive information in this debug output, such as auth tokens, your plaintext password and, obviously, your incoming and outgoing messages. Be sure to remove any information you are not willing to share before posting it anywhere.

If you are experiencing crashes please refer to this page for information on how to get a meaningful backtrace: https://wiki.bitlbee.org/DebuggingCrashes

Bugs

Please report bugs at github: https://github.com/sm00th/bitlbee-discord/issues For questions, bitlbee-discord breakage demonstrations and chitchat you can join the following discord server: https://discord.gg/0lUXEAZXmvW3ovUC or ping trac3r on irc.oftc.net/#bitlbee (irc is preferable).

bitlbee-discord's People

Contributors

alcaro avatar arcnmx avatar ddasilva avatar dequis avatar dgw avatar digitalcircuit avatar eclipseo avatar ecx86 avatar jwheare avatar kensanata avatar mickael9 avatar mumixam avatar nickseagull avatar ranndom avatar seschwar avatar sm00th 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitlbee-discord's Issues

Nicklist inaccurate when common user exists on mutiple servers

When you share multiple servers with the same user they only appear in the nicklist of 1 server which seems to be the 1st server sorted by alphabet

UserA is a member of ServerA
UserA is a member of ServerB

UserA appears in the nicklist of #ChanA on ServerA
UserA Does not appear in the nicklist of #ChanB on ServerB

This issue also seems to effect the voice status
UserA is connected to ServerA's voice channel ChanA and decides to join ServerB's voice channel ChanB the following appears in &bitlbee
discord - User UserA is no longer in any voice channel.

Allow toggling of autojoining channels.

There are a couple channels I part every time I enter trhough bitlbee, especially since its a mirror from an IRC channel I'm in, so I get tons of pings when I speak. So, it'd be nice if I wasnt forced into that every single time discord Bitlbee disconects and rejoins.

/me

typing /me something in bitlbee-discord results in a literal "/me something" in discord
typing /me something in discord results in something in bitlbee-discord

Some messages getting lost

Sometimes messages typed on the IRC end won't get through to the discord side.
I suspect this is the same thing that happens in the actual client too, which then marks your messages with red color to indicate the sending failed.
There isn't any indication of failing to send messages in the plugin.

It would be really appreciated if there would be some kind of check-up if the message was succesfully delivered, and if not, a notification or automatic re-send.

[listchan] Channels still marked as read without adding chat

In short

  • In listchan branch, channels that haven't been chat add'd still mark messages as read
  • Prevents catching up on the Discord website with no way to check what you've actually seen
  • Possibly make send_acks into tri-state, with always, joined (default), never

Thoughts

In the listchan branch, by default no channels are joined, yet all messages are marked as read. Originally, I expected only joined channels (chat add discord [index]) to be marked as read.

I join two Discord groups mostly for keeping up with the individuals on them, not the actual server channels. However, every now and then I'd still like to catch up on the channels right now, without wanting all of it in my IRC client.

Others may have different use cases, so keeping some form of disabling message acknowledgement makes sense. Some might prefer marking all channels as read.. though that use case might be better handled by muting channels.

Fix Multiline support through Pastebuffer

Discord will reject messages sent with new lines, which if you have pastebuffer enabled on bitlbee, when you split it will add in new lines.

Pastebuffer merges multiple messages into one single message when sent within a certain period of time.

Therefore, either new lines should trigger a split into a separate message, or they should just be stripped out altogether.

Update:
Really the above fix that we did, is more of a jury rig, especially since discord does now support multi-line messages. So, the question becomes, why is discord rejecting multiline messages? Its generating a 400 error, which is a bad request.

Big user lists cause time-out on login

I don't know if the service is down or what is going on, but I cannot connect to discord at all lately (at least with mfa). I even tried removing the token from the config xml file and retry, but every time I enter in my 2FA token in discord_mfa, the lag starts and just goes up until the point it just lags itself out and bitlbee restarts. Like it will start at 1 and just keeps counting upward. I verified with my twitter account that if I don't enter in 2FA token, no lag at all. But the second I enter it, bitlbee won't work and requires a restart. This also means my other connections on bitlbee won't work during this constant lag fest.

Permissions not supported.

whenever discord logs in, i'm added to channels on servers on discord that my role doesn't have access too. i don't receive messages from these channels, but buffers still open for each of them.

Manual @mentions Broken

Per the latest update, the following are fine:

kays: hello
kays_test: hello

Manual @mentions like:

hello @kays

does not work. It shows up as plain text. Would be nice to have it work even via

hello kays

where kays is auto-complete-able.

Maybe a better option would be to check if any word matches a nick? Or would that be too slow of a process? I don't think it has to send the message to the server the millisecond after I hit enter. If it's a second slower, I don't think it's a big deal. But if it is not practical, then manual @mentions support would be great.

And if you can also add case-insensitive matching such that:

kays: hello
Kays: hello

both work, I'd appreciate it. Often times, typing on mobile devices auto-capitalize first letter and this also breaks.

Translate Discord Markdown formatting to/from IRC formatting

Most IRC clients support mIRC color codes and formatting for italics, bold, etc. For example, here's how Quassel IRC handles converting from mIRC to Qt internal.

Discord also supports formatting (minus colors) via their flavor of Markdown. Mapping mIRC to Markdown and vice-versa would help keep visual intent the same.

This should be optional, akin to the incoming_me_translation, say, incoming_format_translation, and apply to both channels and private messages (also see issue #27). Sending out mIRC codes probably should always be translated as the special characters are nonsensical to the Discord client.

Some more information on color and formatting (feel free to ignore the color aspect):
http://en.wikichip.org/wiki/irc/colors
https://wiki.mibbit.com/index.php/Formatting
http://www.mirc.com/colors.html

Aside: the Bitlbee OTR plugin uses mIRC color and formatting codes, then strips certain color combinations and the prefix of <<OTR>> in order to ensure OTR messages cannot be spoofed. However, it's unlikely to need handled here, for even if the OTR plugin doesn't account for other plugins, Discord itself doesn't support colors.

undefined symbol: lws_set_log_level

Starting the plugin crashes bitlbee with the following error:

/usr/lib/bitlbee/discord.so: undefined symbol: lws_set_log_level

Compiled with latest source for libwebsockets, version 1421.8d5351a-1

Outgoing mentions

I don't know the best issue topic name for this feature request.

Basically, in IRC, highlights work like:
user: <message> or user, <message> etc

And typing @user: message is slow because I can't tab complete. So I'm wondering if bitlbee-discord can translate Kays: message to @Kays message

P.S.: not sure if Discord keeps a list of IRC nicks to Discord nicks because it has to account for spaces in Discord nicks in the translation.

Control channel with show_users "online,away,offline" still generate joins/quits

For control channels, with channel set show_users "online,away,offline" to always keep offline users visible (I distinguish using away message thanks to away-notify support), anyone who goes offline will quit then immediately rejoin, filling up the log, like so:

[1:53:52 am] <BitlbeeNick> channel set show_users "online,away,offline"
[1:53:52 am] --> DiscordUser (DiscordUser@discord) has joined &discord
[1:53:52 am] <root> show_users = `online,away,offline'
[...trimmed many entries...]
[2:48:36 pm] <-- DiscordUser (DiscordUser@discord) has quit (Leaving...)
[2:48:36 pm] --> DiscordUser (DiscordUser@discord) has joined &discord
[2:49:46 pm] <-- DiscordUser (DiscordUser@discord) has quit (Leaving...)
[2:49:46 pm] --> DiscordUser (DiscordUser@discord) has joined &discord
[2:55:10 pm] <-- DiscordUser (DiscordUser@discord) has quit (Leaving...)
[2:55:10 pm] --> DiscordUser (DiscordUser@discord) has joined &discord
[2:58:17 pm] <-- DiscordUser (DiscordUser@discord) has quit (Leaving...)
[2:58:17 pm] --> DiscordUser (DiscordUser@discord) has joined &discord
[3:01:22 pm] <-- DiscordUser (DiscordUser@discord) has quit (Leaving...)
[3:01:22 pm] --> DiscordUser (DiscordUser@discord) has joined &discord

With the default of online+,special%,away, or a non-default of online,away, the join/quit spam stops, replaced by nicks disconnecting and reconnecting. That.. works, but isn't desirable as it forces using the blist all command to see when new users join.

Chat channels (as opposed to control channels) have no option to show offline users, so the issue doesn't apply there.

Admittedly, I don't know if Bitlbee's plugin interface is responsible, or if the Discord plugin isn't handling the situation properly.

Connection timeout on account on

After adding the account, trying to set it on:

16:14:34 <@bleader> acc discord on
16:16:34 <@root> discord - Login error: Connection timeout
16:16:34 <@root> discord - Logging in: Signing off..
16:16:34 <@root> discord - Logging in: Reconnecting in 135 seconds..

Not sure if this is related to bitlbee-discord for real, but I actually have no clue how to debug this, so I'm filing this issue.

It never worked for me yet, I tried to change password in case something was wrong with auth, but in this case the message is different and instant.

This is on a FreeBSD 9.1 with libwebsockets 1.6.3 manually compiled, and bitlbee 3.4.1 and glib 2.34.

Any hint on how to try to debug this? I'm guessing this isn't really a code issue, but likely some kind of odd combination of app/libs/os.

Implement away status for account (if protocol allows)

In testing, /away Reason for away, set away "Reason for away", and account discord set away "Reason for away" do not propagate to the Discord plugin.

I'm not sure how to set status as the web interface doesn't seem to allow changing it and the Linux client doesn't yet exist. Discord's help indicates that it's supposed to happen after some time of being away-from-keyboard, but doesn't indicate if the client controls this. Requesting more status options for the official client is voted as the number 1 suggestion on Discord's feedback page, so.. this -might- have to wait for a protocol change.

In my particular case, I have Bitlbee behind Quassel IRC, which stays connected all the time via the Quassel "core". When I close the client, the core sends to Bitlbee /away [detach_message]. Next time the client reconnects, it's cleared by sending Bitlbee a blank /away.

Unable to login with my account

Hello,

I can't login on Discord with the plugin since yesterday. I tried to upgrade bitlbee-discord with the latest changes but even after this I can't login. I get the following error:

discord - Login error: Failed to get server info.
discord - Logging in: Signing off..
discord - Logging in: Reconnecting in 5 seconds..

I am however able to login using the command line and mimicking what the discord_http_login is doing:

$ curl -X POST -d '{"email": "[REDACTED]", "password": "[REDACTED]"}' \
  -H "Content-Type: application/json" \
  -H "User-Agent: Bitlbee-Discord" \
  http://discordapp.com/api/auth/login

{"token": "[REDACTED]"}

Channelname collisions

When channel names on multiple servers coincide bitlbee will add "_" suffixes to the name until it is unique, which doesn't help to see which one is which.

A possible solution to this is to add an option that will change channel naming convention to #servername.channelname for all channels.

Reported by: @Kays in #5

Autogen Build Error

Hello,
With the latest changes (thank you very much), I'm getting this error while running autogen.sh:

aclocal: couldn't open directory 'm4': No such file or directory

Thanks!

Different nickname per discord server

Enhancement request.

As a user I'd like the ability to set a different nickname based on the Discord server I am on. When connecting using the bitlbee-discord plugin, the nickname is set by your Discord login name.

The Discord web-based and application clients let you change your nick name on a per server basis. I've set this preference for each server I wish to override the default.

However when I login to Discord with Bitlbee + bitlbee-discord, my Discord login name is used as the nickname.

Since Bitlbee is the gateway into different chat systems such as discord, a configuration plugin option should be used.

Unread Indicators

bitlbee-discord messes up all the unread indicators (and notification alerts) on my Discord apps, on both my computer and mobile devices.

I don't know if it's possible to not auto-mark all messages as read.

2FA

Is there any way to use Two-Factor Authentication with this?

Display nicknames rather than server names

Not sure if this is closely related enough to #40 to warrant it being part of the same issue, but, channels seem to display the account name/username (not sure of the terminology) rather than the per-server nickname. Would be handy to have the per-server nick showing up instead :)

Channel removal causes undefined behaviour

I think this is a followup to #14

  1. Create a new channel. I'll call it #test for reference.
  2. Go to a different channel (let's say #general) and type something, referencing #test in a message in either/both Discord client and bitlbee-discord.
  3. Delete the channel.
  4. Type #test again in #general to verify that the links no longer work.
  5. After that, messages that other people type in #general won't show up in bitlbee-discord. However, your messages sent from bitlbee-discord will still work.

P.S.: I'm still trying to figure another bug out that causes bitlbee to completely crash. When I was going through a few scenarios above while trying to find the culprit, I've triggered bitlbee to crash on many occasions but the steps to reproduce it is still unclear.

Messages stopped working

I think messages have stopped working.
A friend messaged me from discord the other day, I received it just fine.
But today, I was trying to connect through to bitlbee-discord and bitlbee kept crashing with SIGSERV.

I opened my discord.app @me and saw that I had a message from someone hours ago that I never received while logged in though the irc client. After reading the message, bitlbee-discord successfully connected.

May not have anything to do with it, but I pulled the latest git before I had the last message sent to me.

Bitlbee Crash on Discord-Channel /part

Discord-Plugin Version: git-master from 2016-08-05 ( d7fb6b1 ?)
BitlBee Version: apt-get package "bitlbee-libpurple" (3.4.1-1 0 http://ports.ubuntu.com/ wily/universe armhf )
Setup: Raspberry Pi 2 with Ubuntu Mate 15.10

Issue:
Wanting to remove Discord channels from the Channel-List by using /part (and clear Chatlog in client) crashes Bitlbee resulting in a DC…

Reason I want to part them is the problem mentioned in Issue #34

It does not seem related to the IRC Client … I tested it with Quassel and HexChat …
Parting Channels from other Bitlbee Plugins is fine …

Crashlog:
http://pastebin.com/mcLvAUSj

Connection lost to bitlbee on account on

on acc discord on or acc on, irc immediately loses connection to bitlbee. Upon reconnect, bitlbee has forgotten about the account.

0319 @johnny acc add discord (EMAIL) (PASS)
0319 @root Account successfully added with tag discord

0319 @johnny acc discord on
0319 -- irc: disconnected from server

0321 @root Password accepted, settings and accounts loaded
0321 @root No accounts known. Use `account add' to add one.

HTTP 400 errors with OTR policy of 'opportunistic'

With set otr_policy opportunistic, I consistently received HTTP 400 errors, e.g.

<root> discord - Error: Failed to send message (400).

After using set otr_policy manual, messages appear to send correctly and show up in the Discord web interface. I'm guessing the whitespace and tab pattern interferes with what Discord expects, but I do not know for sure.

Any way to fix this other than manual? It'd be useful to preserve opportunistic for protocols where others may or may not be using OTR.

Cannot build on Debian 8

Hello, I am running Debian jessie and I am running into an error upon executing make.
Sysinfo:

$ uname -a
Linux gan 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u6 (2015-11-09) i686 GNU/Linux
$ cat /etc/issue.net
Debian GNU/Linux 8

I got bitlbee and bitlbee-dev from the official Debian jessie repositories:

$ sudo bitlbee -V
BitlBee 3.2.2-2
API version 030202

Compiled libwebsockets yesterday from the git version:

jidori@gan:~/bitlbee-discord$ libwebsockets-test-echo
[1451753072:2612] NOTICE: Built to support client operations
[1451753072:2618] NOTICE: Built to support server operations
lwsts[23599]: libwebsockets echo test - (C) Copyright 2010-2015 Andy Green <[email protected]> - licensed under LGPL2.1
lwsts[23599]: Running in server mode
lwsts[23599]: Initial logging level 7
lwsts[23599]: Libwebsockets version: 1.6.0 0c7e5a9

However, whenever I try to build bitlbee-discord itself I cannot even get past the first file:

$ LC_ALL="en_US.UTF-8" make
gcc `pkg-config --cflags bitlbee` -fPIC -Wall -g3 -ggdb -O0 -std=gnu99 -c -o discord.o src/discord.c
src/discord.c: In function 'init_plugin':
src/discord.c:100:5: error: unknown field 'handle_is_self' specified in initializer
     .handle_is_self = discord_is_self
     ^
src/discord.c:101:3: warning: initialization from incompatible pointer type
   };
   ^
src/discord.c:101:3: warning: (near initialization for 'pp.auth_allow')
Makefile:13: recipe for target 'discord.o' failed
make: *** [discord.o] Error 1

Might this be because the bitlbee version in jessie repos is too old?

Incompatible with latest Git commit of libwebsockets.

After installing libwebsockets-git from the Arch Linux AUR using the latest Git commit, trying to make bitlbee-discord gives the following error:

gcc `pkg-config --cflags bitlbee` -fPIC -Wall -g3 -ggdb -O0 -std=gnu99 -c -o discord.o src/discord.c
gcc `pkg-config --cflags bitlbee` -fPIC -Wall -g3 -ggdb -O0 -std=gnu99 -c -o discord-http.o src/discord-http.c
gcc `pkg-config --cflags bitlbee` -fPIC -Wall -g3 -ggdb -O0 -std=gnu99 -c -o discord-websockets.o src/discord-websockets.c
src/discord-websockets.c: In functiondiscord_ws_callback’:
src/discord-websockets.c:107:45: error: dereferencing pointer to incomplete typestruct libwebsocket_pollargsdd->main_loop_id = b_input_add(pargs->fd, B_EV_IO_READ,
                                             ^
src/discord-websockets.c:119:18: error: dereferencing pointer to incomplete typestruct libwebsocket_pollargsif (pargs->events & POLLIN) {
                  ^
Makefile:13: recipe for target 'discord-websockets.o' failed
make: *** [discord-websockets.o] Error 1

Compiling using libwebsockets v1.5-chrome47-firefox41 worked.

Discord /me uses _underscores_ to italicize, not *asterisks*

Discord now uses underscores to indicate /me messages, e.g. /me does a thing_does a thing_. It might still be useful to translate *does a thing* as both produce italic text.

For example, typing the following:

/me sends a message from web-client, with Firefox Developer tools open...

Results in:
Using a me command

Whenever incoming_me_translation is on, these messages should be translated back, e.g.:

-*- discord_nick does a thing

Aside, handling Discord formatting to/from mIRC codes would be a neat future addition

Running commands on/pre-processing messages

19:42 <nick> https://cdn.discordapp.com/attachments/xxxxxxxxxxxxxxxxxx/233267567148531722/xnAuW6nD1NUcoqhUKE8hcfKIAnzkqJlsGLucOPEvmplWYcGthYM8p90K_b8RhZ1ccs7wL6u7nCfUTh08Fkjip9QYmkD7eAhKq9zeB6YrwQaOY0JdAt6So0xGV7UuLRKIJEA8-i_i7QEDFcZmql-a30P9m2yVBhTIXpehg0HSs5GyohTGQtw8mrd8GlNOtgJ- 19:42 <nick> ZtCUk6p9uQ9hreYUO04upddELDKVIaR8tVeciZ3P34rDVR6xR1tDudcg_cDaxlYYATcJXqI8SYf1jDIzHr_V4m_kCDY8ntGdrbirg_u1RUxHzb5Li9FL4Wt2j7zqPpizBBt1Avjehjd8byeBvIGtDDTT2sMqRaAEUqFe_iiYgbsOG3vAj-ddPodbMtsNu1Y1CFkZmsTf5c89Ij1p0TSBku2gEVK55HGmhIcEQM_3cP0UemaN4i6kRfWKI9kEgQt7z-zk_dQJnVtXyo-WO37eXpgsxRPhb4Z38J6sEtBUOlDsVz63RqLY5QKy41afM1PrE6-kQ1biN1FS-XlzJlKR6zbV97nC_zK4g4Vt8gPcBMudPZpBU_dzIpXUExh7Az07xfQqR5uWr_- 19:42 <nick> NbXwLPfgAlM9jXF5IhFoh5ZJUyfX1V8wJxc-fw359-h638-no.png

Would it be possible to add an option to shorten urls with some service before displaying them, in case of really long links(multi-line)? Opening these is a hassle.

Possibly scripting support to pre-process messages before giving them to bitlbee (which supposedly splits them). Having an option to run a shell command on each message would be very nice.

symbol lookup error

I installed this from the AUR. The error I'm getting is:
bitlbee[19007]: /usr/bin/bitlbee: symbol lookup error: /usr/lib/bitlbee/discord.so: undefined symbol: lws_set_log_level
This is making Bitlbee crash, let me know if you need more info.

Login error: (null) when password includes special characters

Noticed that I couldn't log in to my account when my password included characters like ~`/{ and so forth.

Was welcomed with this:
@root discord - Login error: (null)
@root discord - Logging in: Signing off..
@root discord - Logging in: Reconnecting in 5 seconds..

Changed my password and it works like a charm.

Using bitlbee-discord-git-121.c4f3426-1 from AUR.

EDIT: Seems it has nothing to do with the plugin, just need to input the password in quotes; https://bugs.bitlbee.org/ticket/758

Build Error

Hello,
First, I want to thank you for your work.

I am trying to build it but I am running into an error. (BitlBee version 3.4.1.) I started with libwebsockets and that went well via these commands:

mkdir build && cd build
cmake ..
make
sudo make install

Then proceeding to build bitlbee-discord:

$> make
gcc `pkg-config --cflags bitlbee` -fPIC -Wall -g3 -ggdb -O0 -std=gnu99 -c -o discord.o src/discord.c
gcc `pkg-config --cflags bitlbee` -fPIC -Wall -g3 -ggdb -O0 -std=gnu99 -c -o discord-http.o src/discord-http.c
gcc `pkg-config --cflags bitlbee` -fPIC -Wall -g3 -ggdb -O0 -std=gnu99 -c -o discord-websockets.o src/discord-websockets.c
In file included from src/discord-websockets.c:20:0:
src/discord-handlers.h:25:55: error: unknown type name ‘json_value’
src/discord-websockets.c: In function ‘discord_ws_send_payload’:
src/discord-websockets.c:29:3: warning: implicit declaration of function ‘libwebsocket_write’ [-Wimplicit-function-declaration]
src/discord-websockets.c: In function ‘discord_ws_keepalive_loop’:
src/discord-websockets.c:42:5: warning: implicit declaration of function ‘libwebsocket_callback_on_writable’ [-Wimplicit-function-declaration]
src/discord-websockets.c: In function ‘discord_ws_service_loop’:
src/discord-websockets.c:54:3: warning: implicit declaration of function ‘libwebsocket_service’ [-Wimplicit-function-declaration]
src/discord-websockets.c: At top level:
src/discord-websockets.c:67:21: warning: ‘enum libwebsocket_callback_reasons’ declared inside parameter list [enabled by default]
src/discord-websockets.c:66:56: error: parameter 3 (‘reason’) has incomplete type
src/discord-websockets.c: In function ‘discord_ws_callback’:
src/discord-websockets.c:69:10: warning: implicit declaration of function ‘libwebsocket_context_user’ [-Wimplicit-function-declaration]
src/discord-websockets.c:69:30: warning: initialization makes pointer from integer without a cast [enabled by default]
src/discord-websockets.c:103:9: warning: implicit declaration of function ‘libwebsockets_remaining_packet_payload’ [-Wimplicit-function-declaration]
src/discord-websockets.c:118:7: warning: implicit declaration of function ‘libwebsocket_cancel_service’ [-Wimplicit-function-declaration]
src/discord-websockets.c: At top level:
src/discord-websockets.c:166:38: error: array type has incomplete element type
src/discord-websockets.c: In function ‘discord_ws_init’:
src/discord-websockets.c:181:3: warning: implicit declaration of function ‘libwebsocket_get_internal_extensions’ [-Wimplicit-function-declaration]
src/discord-websockets.c:181:19: warning: assignment makes pointer from integer without a cast [enabled by default]
src/discord-websockets.c:191:3: warning: implicit declaration of function ‘libwebsocket_create_context’ [-Wimplicit-function-declaration]
src/discord-websockets.c:191:14: warning: assignment makes pointer from integer without a cast [enabled by default]
src/discord-websockets.c:196:3: warning: implicit declaration of function ‘libwebsocket_client_connect’ [-Wimplicit-function-declaration]
src/discord-websockets.c: In function ‘discord_ws_cleanup’:
src/discord-websockets.c:206:5: warning: implicit declaration of function ‘libwebsocket_context_destroy’ [-Wimplicit-function-declaration]
src/discord-websockets.c: At top level:
src/discord-websockets.c:166:38: warning: ‘protocols’ defined but not used [-Wunused-variable]
make: *** [discord-websockets.o] Error 1

Not sure how to move forward from this. Any help is appreciated. Thank you!

Support for unicode nick

The plugin does not seem to have support of users with Unicode nicks, like "メカラッピーダイラト"
They do not show up in the NickList and all chat messages show with the nick _ (and again _ is not listed in the nicklist)

Only after reconnecting, _ show up in the nicklist, but this is still not the correct

Do not know if this a limit of the plugin or bitlbee

Uploaded media shows up as blank lines

In the web client, there is a button next to the input bar that allows for media uploads.
Receiving this message in bitlbee-discord results in a blank line, but when clicking on the media link in the web client (provided you have previews off), it points to an actual url of the attachment.

Mentions are shown as numerical identifiers

Hi

First and foremost, thank you very much for this project, it helped me regroup all my chats in my IRC client :-)

I have an issue though with mentions. When someone mentions somebody, it shows up as <@105630595446521857> instead of @RealName.

non-ascii characters breaking mentions

Example, someone with name (ᵔᴥᵔ) as his username breaks mentions. It doesn't show up in bitlbee-discord and name_: does not convert into a mention properly

Broken Smiley/Emoticon

Using any emotes:

:O :( :) :D

does not get converted properly in Discord. Likewise, emotes used in Discord do not show up in bitlbee-discord.

Group PMs dont show

PMs work fine, and servers chats work fine, but if you start a group PM then that does not show up in bitlbee, and one is forced to use discord for that.

Empty contact list (&discord) until I connect from web browser.

Don't know if this is already a known issue. But I noticed this after setting up my discord account in BitlBee. First of all: I create a contact list channel for every account (&channel) - the one for discord is named &discord.

This contact list is empty (except root and myself) until I connect to a server from a random webbrowser or from Android. As soon as I join a server from web/android the contact list pops up in my IRC client. Very strange.

The configuration is as follows

[00:38] <GhettoGirl> acc discord set
[00:38] <root> auto_connect = `true'
[00:38] <root> auto_reconnect = `true'
[00:38] <root> away is empty
[00:38] <root> edit_prefix = `EDIT: '
[00:38] <root> host = `discordapp.com'
[00:38] <root> incoming_me_translation = `on'
[00:38] <root> max_backlog = `50'
[00:38] <root> mention_ignorecase = `off'
[00:38] <root> mention_suffix = `:'
[00:38] <root> never_offline = `off'
[00:38] <root> nick_format is empty
[00:38] <root> nick_source = `handle'
[00:38] <root> password = `********' (hidden)
[00:38] <root> send_acks = `on'
[00:38] <root> server_prefix_len = `0'
[00:38] <root> status is empty
[00:38] <root> tag = `discord'
[00:38] <root> urlinfo_handle = `urlinfo'
[00:38] <root> username = `*******' (hidden)
[00:38] <root> voice_status_notify = `off'

Once joined, the chat is working fine.

Additional questions:
Is it also possible to join a server by some command or not? Channels pops up for the server, which I connected from web.
Is there multiple server support yet?

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.