summaryrefslogblamecommitdiffstats
path: root/README.md
blob: 8812cb17c1d1cdefff31f4dec3396ae6bda42f1f (plain) (tree)
1
2
3
4
5
6
7
8
9



                                                                                                
                                                                                                                                                                                                                                                                                                                                                          
 

              
                                                                                   
 

               


                           



                          

                                                              
                                                                                                           

   
                                 



                         

    
           
   
 










                                                                                                 










                                                                                                                       
























                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
 

                   












                                                                                                                                                                                 
# discord.c

an alternative client for the discord messaging platform, written in the C programming language.

code rewrite in 0.0.4 brings a lot of new features and marks the 0.0.3 release obsolete, though it still kind of works for terminal users, although it is very bad. rewritten version is better because it does not reach ratelimits due to using a socket connection and not polling for messages via HTTP. it also has voice support and a GUI frontend.

## screenshots

![screenshot in fullscreen](https://cdn.sijanec.eu/img/2021/03/discord.c_prtsc.png)

## instructions

### debian (ubuntu as well)

```
sudo apt update
sudo apt install discord.c
```

you need to add [my apt repository](https://prog.sijanec.eu/).

built packages only exist for `amd64`, `arm64` and `i386`. for other architectures grab the source package:

```
apt-get --install build discord.c
```

### caveman style install

```
make
./discord.c
```

#### building requirements

* a POSIX system - app is cross platform and should also be able to be compiled to all major OSes
* `gcc`
* GNU `make`
* `libwebsockets-dev` for faster bidirectional connections to the server
* `libgtk-3-dev` for the GUI
* `libcjson-dev` for parsing server responses
* `libsoundio-dev` for crossplatform sound output
* `xxd` for embedding XML GtkBuilder UI definitions directly in the binary

## automatic building

automatic building is done on two servers, one for `arm64` and the other for `amd64`.

check the build badge before downloading:

[![Build Status](https://jenkins.sijanec.eu/buildStatus/icon?job=discord.c)](https://jenkins.sijanec.eu/job/discord.c/)

* `amd64`: [https://cargova.sijanec.eu/prog/discord.c/](https://cargova.sijanec.eu/prog/discord.c/)
* `arm64`: [https://of.sijanec.eu/prog/discord.c/](https://of.sijanec.eu/prog/discord.c/)

there are deb packages and binaries.

## using discord.c as a library (libdiscord.c/discord.c-dev)

discord.c is programmed in two separate sections, the ui section, that was previously made in ncurses, and the API section, that can, as of the code rewrite, be used independently in other applications. It is useful to write alternative frontends for accessing content available using discord.c by using the discord.c library, since that allows breaking API changes to be fixed in one place instead of fixing it for each individual program. There is no documentation provided for the library, but reading discord.c source code you will get the idea. Expect a Doxygen soon.

to your surprise, you can use the ui section, as of the code rewrite, as a library as well and integrate other platforms into it. No docs yet here either.

The package for Debian comes with include header files and compiled shared objects so it can be used as a dependency, but beware, this dependency will depend on GTK+3.0, which would be, in case you are doing a GUI with a different widget toolkit, useless.

the program is, as of the code rewrite, single threaded, for increased stability and performance. it used to have separated network and ui threads, but now the threading model is abstracted with an event-based programming.

## android port?

it would be useful to have an android port, and luckily this is possible with little effort due to the GTK broadway backend that interfaces with a HTML renderer, WebView for example.

<!--

## working features

* listing guilds and their channels, including private message channels
* joining and listing past messages from those existing channels
* sending messages into channels, ability to be joined into multiple channels at once
* viewing attachments as links
* joining voice channels, talking

## missing features

* check for permissions before join (needs roles parsing)
* tagging people, parsing tags of people/channels/emotes
* ability to join video calls and stream video
* altering profile
* parsing per-channel nicks
* creating channels and creating PMs
* invites
* refreshing channel and guild lists whilst begin turned on
* responding to SIGWINCH and reloading ncurses windows whenever terminal window is resized
* refreshing sound devices whilst being turned on
* checking for rare system failures (for example [a malloc/realloc that fails and returns NULL will probably lead to corruption and SIGSEGV](http://etalabs.net/overcommit.html))

-->