Skip to content

How to use the Guilded4J debugger

MCUmbrella edited this page Mar 28, 2022 · 4 revisions

CAUTION!

This page is outdated. G4JDebugger still exists but has been moved out of the 'main' code directory. You need some other ways to launch it.

I'll update this page sooner or later.

Intro

Guilded4J now has a built-in debugger(aka G4JDebugger). It looks like an interactive console chat interface using Linux commands. You can launch the debugger by using a shell command like this:
java -cp guilded4j-1.0-SNAPSHOT-jar-with-dependencies.jar vip.floatationdevice.guilded4j.G4JDebugger

Logging in

If this is the first run it will ask you to enter your API token. Guilded4J login
After that the debugger will attempt to open socket connection to Guilded. If no problems it will print 'logged in' and now you can use the G4JDebugger command line. Guilded4J logged in

NOTE:

  • G4JDebugger will save your token and last used channel UUID to an unencrypted file called 'G4JSession.dat' under your shell's workdir. It is used to quickly restore login information at the next debugger launch. Please keep this file safe. If you no longer need it, please delete it at the first opportunity.

Interacting

Before doing most of operations you may need to specify a target channel UUID. Copy it from Guilded client and use cd <UUID> to change the target UUID. cd

Receive and send text messages

Incoming text messages will automatically printed to console in this format:
[TIME] [CHANNEL ID] (MESSAGE ID) <USER ID> CONTENT
To send a text message you need to specify a text channel and type send <CONTENT>. receive and send text msgs

Close socket connection

Guilded API uses Websocket to send you events and you send HTTP requests to do any operations so disconnecting from websocket will only prevent you from receiving any events(such as receiving messages) without preventing you from sending actions to the Guilded server.
Usage: disconnect
disconnected msg sent after disconnecting

Other functions

G4JDebugger can perform most of the operations that Guilded4J implements. Type help to see the G4JDebugger command list: help