rickvanloo / discord-cli Goto Github PK
View Code? Open in Web Editor NEWMinimalistic Command-Line Interface for Discord
License: GNU General Public License v2.0
Minimalistic Command-Line Interface for Discord
License: GNU General Public License v2.0
See Title
Go can work with C libraries. Currently it is using an unofficial version of this Library. Why not use the official bindings: it has been proven over time that it works. Also provides a finished Vi mode for all the Vi Folks out there.
I wanted to use this but with 2 Factor Authentication enabled I was returned with:
discord-cli - version: v0.3.0-DEVELOP
*Starting Session...2016/10/27 09:54:46 Session Failed
2016/10/27 09:54:46 Unable to fetch discord authentication token. <nil>
When a message is pinned, an Unknown event is raised:
> Unknown event.
Unknown event.
Event. Type: CHANNEL_PINS_UPDATE, State: 554 Operation: 0 Direction: 0
Event. Type: CHANNEL_PINS_ACK, State: 552 Operation: 0 Direction: 0
{
"last_pin_timestamp": "2016-07-08T05:53:11.073283+00:00",
"channel_id": "CHANNELID"
}
{
"timestamp": "2016-07-08T05:53:11.073283+00:00",
"channel_id": "CHANNELID"
}
Splitted Issue from #7
notify-send
works pretty well.
Has a dependency on libnotify though, so it needs to check if it is available.
After setting up what I thought was a sane configuration, I get this message.
discord-cli - version: v0.3.0-DEVELOP
*Starting Session...2017/03/07 08:54:50 Session Failed
2017/03/07 08:54:50 Unable to fetch discord authentication token. HTTP 400 Bad Request, {"email": ["Not a well formed email address."]}
Everything is green now, please fix.
As a preface, this error comes up while trying to install on an RPi running Debian Jessie, and as such it may be a specific issue to that architecture as I have had success installing on my x86_64 laptop. Version of Go is go1.6.2 linux/arm
from the Jessie backports.
Trying to install outputs this error message:
package encoding/binary: unrecognized import path "encoding/binary" (import path does not begin with hostname)
package encoding/json: unrecognized import path "encoding/json" (import path does not begin with hostname)
package fmt: unrecognized import path "fmt" (import path does not begin with hostname)
package bytes: unrecognized import path "bytes" (import path does not begin with hostname)
package compress/zlib: unrecognized import path "compress/zlib" (import path does not begin with hostname)
package errors: unrecognized import path "errors" (import path does not begin with hostname)
package bufio: unrecognized import path "bufio" (import path does not begin with hostname)
package compress/flate: unrecognized import path "compress/flate" (import path does not begin with hostname)
package crypto/rand: unrecognized import path "crypto/rand" (import path does not begin with hostname)
package crypto/sha1: unrecognized import path "crypto/sha1" (import path does not begin with hostname)
package crypto/tls: unrecognized import path "crypto/tls" (import path does not begin with hostname)
package encoding/base64: unrecognized import path "encoding/base64" (import path does not begin with hostname)
package io: unrecognized import path "io" (import path does not begin with hostname)
package io/ioutil: unrecognized import path "io/ioutil" (import path does not begin with hostname)
package math/rand: unrecognized import path "math/rand" (import path does not begin with hostname)
package net: unrecognized import path "net" (import path does not begin with hostname)
package net/http: unrecognized import path "net/http" (import path does not begin with hostname)
package net/url: unrecognized import path "net/url" (import path does not begin with hostname)
package strconv: unrecognized import path "strconv" (import path does not begin with hostname)
package strings: unrecognized import path "strings" (import path does not begin with hostname)
package time: unrecognized import path "time" (import path does not begin with hostname)
package unicode/utf8: unrecognized import path "unicode/utf8" (import path does not begin with hostname)
package image: unrecognized import path "image" (import path does not begin with hostname)
package image/jpeg: unrecognized import path "image/jpeg" (import path does not begin with hostname)
package image/png: unrecognized import path "image/png" (import path does not begin with hostname)
package mime/multipart: unrecognized import path "mime/multipart" (import path does not begin with hostname)
package reflect: unrecognized import path "reflect" (import path does not begin with hostname)
package runtime: unrecognized import path "runtime" (import path does not begin with hostname)
package sync: unrecognized import path "sync" (import path does not begin with hostname)
package container/list: unrecognized import path "container/list" (import path does not begin with hostname)
package os: unrecognized import path "os" (import path does not begin with hostname)
package os/signal: unrecognized import path "os/signal" (import path does not begin with hostname)
package sync/atomic: unrecognized import path "sync/atomic" (import path does not begin with hostname)
package syscall: unrecognized import path "syscall" (import path does not begin with hostname)
package unicode: unrecognized import path "unicode" (import path does not begin with hostname)
package unsafe: unrecognized import path "unsafe" (import path does not begin with hostname)
package log: unrecognized import path "log" (import path does not begin with hostname)
package math: unrecognized import path "math" (import path does not begin with hostname)
package os/exec: unrecognized import path "os/exec" (import path does not begin with hostname)
package os/user: unrecognized import path "os/user" (import path does not begin with hostname)
package regexp: unrecognized import path "regexp" (import path does not begin with hostname)
Currently Messages are being stored inside a map[string]*discordgo.Message
The order is random, sorting takes too long. Make it a queue.
That's a pretty big problem.
Discord supports bold text with **bold text**
tags. Many terminal emulators also support bold text, for example \033[1mbold text\033[0m
. Could you add bold text formatting to this client?
More functions:
List of users that are:
-Online inside Guild
-Offline inside Guild
-All inside Guild
This is pretty useless inside a big Guild, so there should be more functions. I'm at the moment not sure which.
This is quite hard actually, more information: #5
Need to use the log function probably.
#19 Needs to remove the necessity of readline.
I'm a rather happy discord-cli user on Arch Linux, but : On a Xubuntu box, when trying to install as per the README I get:
$ go get -u github.com/Rivalo/discord-cli
package github.com/Rivalo/discord-cli: mkdir /usr/share/go/src/github.com: permission denied
golang-go
is installed, $GOPATH is set for that user. Obviously I'm missing some something, maybe you can please gimme a light?
(GU) Conversion Error: strconv.ParseInt: parsing "": invalid syntax
Select a Guild:
[0] UnderDogs
[b] Extra Options
0
Select a Channel:
[b] Go Back
(CH) Conversion Error: strconv.ParseInt: parsing "": invalid syntax
Select a Channel:
[b] Go Back
I can select the Guild, no problem. I cannot select the channels. I have tried copying and pasting parts of the URL into the terminal, with no change. Running on Debian.
I've got to the last step in your installation instructzioons, (after much cursing! I haven't encountered Go before and don't understand it!), but I don't uunderstand what you nmean by saying "./discord-cli". What do I do with it? I have ended up with a directory by that name, located in /home/ab/.go/src/github.com/Rivalo, but there isn't anything obviously runnable in it.
Would appreciate help as the program itself looks just waht I want!
Thanks very much.
If I type @user name
or @"user name"
the user is not mentioned. How can I correctly mention a user?
Splitted Issue from #7
Embeds return nothing. The url should be returned.
I tried to connect through wget , curl but it doesn't work can this did the work?
I keep getting messages with something like:
Unknown event.
Event. Type: Event, State: number Operation: 0 Direction: 0
{
"user_id": "",
"message_id": "",
"emoji": {
"name": ",
"id": ""
},
"channel_id": ""
}
It happens constantly
I got this error when the current server was deleted:
> Unknown event.
Event. Type: RELATIONSHIP_ADD, State: 5230 Operation: 0 Direction: 0
{
"user": {
"username": "REDACTED_USER",
"id": "REDACTED_ID",
"discriminator": "2815",
"avatar": "REDACTED_ID"
},
"type": 3,
"id": "REDACTED_ID"
}
Unknown event.
Event. Type: RELATIONSHIP_ADD, State: 386 Operation: 0 Direction: 0
{
"user": {
"username": "REDACTED_USER",
"id": "REDACTED_ID",
"discriminator": "2815",
"avatar": "REDACTED_ID"
},
"type": 1,
"id": "REDACTED_ID"
}
>
Is there any support for direct messages/PMs? Can't seem to find it.
Needed for #11 functionality,
Editing or deleting already printed messages is quite a problem. This needs a complete overhaul for the way the client is shown. This should either be a a library like termbox-go, or the creation of a very minimal textual interface library.
Hi,
First off thanks for the resource, I believe this package may be outdated but it would be nice to keep on developing it, although I also believe discord may be reluctant on letting people use a CLI API so to circumvent their clickbait and content select traps on their own applications.
Anyways if any of you still using it , Im trying to first connect with it and After I get an error .
Unable to fetch discord authentication token. HTTP 400 Bad Request, {"email": ["Not a well formed email address."]}
I've setted the config.json accordingly such as
{"username":"Myuser","password":"Mypass","messagedefault":true,"messages":10,"email":"[email protected]"}
Anyone has any clue?
Thanks
A great feature of Discord is that it saves old messages. Starting discord-cli will only show all new messages after starting.
:
-function that receives the last n messages.After installation I stored my correct login files in the config.json
. If I run ./discord-cli
it says:
Unable to fetch discord authentication token. HTTP 400 Bad Request, {"captcha_key": ["captcha-required"]}
After I connect to a channel, I type :m 2
and press return. This is the output:
Welcome, shrx!
Guild: myguild, Channel: mychannel
Printing last 2 messages!
>
So, no old messages are displayed. I have the latest 0.3.0-develop version.
Fix.
There is currently only support for Guild/Channel communication.
See title
Currently the CLI prints your own message two times:
hi
2016/02/15 00:12:54 > Rivalo > hi
This is bad.
Especially when it are lots of them, and containing lots of text.
I can't find a way to handle this using the https://github.com/chzyer/readline library so this is a painpoint. Currently it not very easy to keep your input line at the bottom in Go without incoming logs tearing your scanf() apart. The readline library completely fixes this without adding any necessary ncurses bindings or necessary layout boxes that keep needing coordinates.
I want the CLI to be lightweight and minimal, just printing lines is the way to go I think.
Channels and Guilds don't need fast switching and the random order is quite irritating.
map[string]*discordgo.Channel
=> []*discordgo.Channel
Default = on.
First problem: It would be fine if it just printed this, but then it prints a whole bunch of json, making the program impossible to use.
I fixed it by commenting out line 241 in ~/go/src/github.com/Rivalo/discordgo_cli/discord.go
.
I then found that, on trying to join a channel:
*Starting Session... PASSED!
Select a Guild:
[0] Distance
[1] Ozzyinspace
[2] Toast Airways
[3] TheReadPanda
[4] /r/incremental_games
[5] My Colony
[6] Blacksilver & Co
[7] Solving Stratzenblitz
[8] Kerbal Capitalism Program
[b] Extra Options
Unable to unmarshal event data.
8
Select a Channel:
[b] Go Back
1
(CH) Error: ID is out of bound
There are no options.
Periodically, it will print again Unable to unmarshal event data.
Is it possible that I'm missing a library? If so, which one, and how do I get it?
It's not a problem with the computer it's running on; there's a bot running on it. I tried killing the bot to check if they were conflicting, no dice.
Some more things:
Marshall
, not marshal
.stderr
so we can suppress it with a bash redirect.I have no complete idea about how it should be done. I will first look into libraries that print full images and their terminal support, AAlib that just prints ASCII art could also be an option.
Stuff that is completely horrible and should be fixed:
Currently the *Member struct only returns a string of the Role ID.
Which needs a ridiculous amount of API calls and iteration before finally getting the correct *Role struct.
Let's do that in DiscordState beforehand.
Splitted issue from #7
Multi-line messages should be displayed as single-line messages
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.