Code Monkey home page Code Monkey logo

disco's Introduction

disco: Discord client for 9front

Fork of theboxmage's discord-cli.

Ndb config is in $home/lib/disco.ndb for setting password, should be made automatically after first run. Alternatively, you may use factotum.

Install

Dependencies

  • 9fans.net/go/plan9
  • github.com/Plan9-Archive/libauth
  • github.com/mischief/ndb
  • golang.org/x/crypto
  • github.com/gorilla/websocket
  • github.com/bwmarrin/discordgo

Installation

% go get github.com/henesy/disco

Usage

% disco -h
Usage of disco:
  -n	Enable notifications
  -t	Hide timestamps in channel log
  -w string
    	Dimensions to pass through to statusmsg (default "10,10,260,90")

Commands

Commands available in chat:

Command Function
:q Quits disco
:g Change listening Guild
:c [n ?] Change listening Channel inside Guild, or list channels
:m [n] Display last [n] messages: ex. :m 2 displays last two messages
:p Pulls up the private channel menu
:n name Change nickname to name
:! Print current server information
:? List the available commands

You can regex the last message sent using a format such as:

s/forsynth/forsyth/

Config

A basic $home/lib/disco.ndb looks something like:

auth=pass
loadbacklog=true
messages=10
promptchar=→
timestampchar=>

[email protected]	password=somepassword1

Note that the auth= tuple accepts

auth=factotum

for authentication using a factotum key and will ignore the password= tuple.

If used, the factotum key should resemble something to the effect of:

proto=pass server=discordapp.com service=discord [email protected] !password=hunter2

Notes

If you can connect to a channel and see messages, but yours aren't sending, check to make sure your e-mail address is verified.

FAQ

Q: What if go get doesn't work?

A: If you want to use go get on 9front to install disco and its dependencies (recommended) you should use driusan's dgit as git. Alternatively, on 9front specifically, you can wrap Ori's git9.

Q: What if I can't login because of a captcha error?

A: You'll need to sign in to Discord via the web app (thus solving a captcha) using a browser with html5/js. I recommend an http proxy such as this in conjunction with a system with such a browser..

Q: What if I get an error about signing in from a new location?

A: Discord has sent you an e-mail with a location confirmation link, click it, no js should be required.

Problems

  • Does not create accounts for you, this still needs to be done in a browser/app
  • Does not support 2FA (Discord API explicitly does not allow this)

disco's People

Contributors

henesy avatar neutralinsomniac avatar

Stargazers

rainonwires avatar Gio Rice avatar potassium5703 avatar Dwight Spencer (denzuko@mastodon.social) avatar Nikita Popov avatar Timo Sarkar avatar Avalon WIlliams avatar Edoardo La Greca avatar Cynthia Foxwell avatar  avatar Lilly Cham avatar blue avatar Loup Lobet avatar Tiago Carvalho avatar Sergey Zhilkin avatar Larkin avatar

Watchers

James Cloos avatar  avatar Sergey Zhilkin avatar

disco's Issues

Better regex for last message

s/word/words/ eats 'word', s/word/words/g works as expected.

It would be nice to have full structural regular expressions as a go package.

Refine :p

Refine :p and its menu.

Maybe when leaving a pm, drops back to channel dialogue from last guild (feature?)

Handle and better explain unmarshal error

Connecting...2019/07/17 23:39:53 [DG0] wsapi.go:552:onEvent() error unmarshalling READY event, json: cannot unmarshal number into Go struct field ReadState.last_message_id of type string
	 PASSED!

Operation cannot continue after this error has occurred and all guilds will appear to be empty to the user.

Use go-modules

With the release of 1.16: "...and use of go get to build and install packages is deprecated.", this project should use go modules. This would also allow for your dependencies be automatically installed with go get github.com/henesy/disco. Dependencies are also found in the go.mod file.

[request] sign in with only token

Would it be possible to use this and sign in with only a token instead of a username and password?

Since I cannot get that to work I think this might work better.

problems authenticating

Hi, i am unable to authenticate myself with this, some information: ...

% go version
go version go1.15.3 linux/amd64
% uname -a
Linux issss95.home 5.9.1-arch1-1 #1 SMP PREEMPT Sat, 17 Oct 2020 13:30:37 +0000 x86_64 GNU/Linux

I am using auth=pass, and have verified the information is correct.

Connecting...2020/10/24 18:16:39 Session Failed
2020/10/24 18:16:39 Unable to fetch discord authentication token.

Fix :m

Currently does not operate as expected and most likely makes stale API calls.

Issue with discord auth

when I run disco it starts to connect but I immediately get the error

Session Failed
Unable to fetch discord authentication token.

How do I fix this?
I'm not using factotum, I just put my mail address and pw in the config file.

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.