Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
MCUmbrella committed Jan 16, 2023
1 parent 356bc11 commit 8e58f5d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>vip.floatationdevice</groupId>
<artifactId>guilded4j</artifactId>
<version>0.9.14</version>
<version>0.9.15</version>
<dependencies>
<dependency>
<groupId>cn.hutool</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
public class G4JWebSocketClient extends WebSocketClient
{
public static final String USER_AGENT = "Guilded4J/0.9.15 Java-WebSocket/1.5.3";
/**
* Guilded API's WebSocket URI (<a>wss://api.guilded.gg/v1/websocket</a>)
*/
Expand All @@ -45,7 +46,7 @@ public G4JWebSocketClient(String token)
{
super(WEBSOCKET_URI);
clearHeaders();
addHeader("User-Agent", "Guilded4J/0.9.14 Java-WebSocket/1.5.3");
addHeader("User-Agent", USER_AGENT);
addHeader("Authorization", "Bearer " + token);
setHeartbeatInterval(heartbeatIntervalMs);
}
Expand All @@ -59,7 +60,7 @@ public G4JWebSocketClient(String token, String lastMessageId)
{
super(WEBSOCKET_URI);
clearHeaders();
addHeader("User-Agent", "Guilded4J/0.9.14 Java-WebSocket/1.5.3");
addHeader("User-Agent", USER_AGENT);
addHeader("Authorization", "Bearer " + token);
if(lastMessageId != null) addHeader("guilded-last-message-id", lastMessageId);
setHeartbeatInterval(heartbeatIntervalMs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
public abstract class RestManager
{
public static final String
USER_AGENT = "Guilded4J/0.9.15 Hutool/5.8.11",
CHANNELS_URL = "https://www.guilded.gg/api/v1/channels",
CALENDAR_CHANNEL_URL = "https://www.guilded.gg/api/v1/channels/{channelId}/events",
CALENDAR_RSVP_URL = "https://www.guilded.gg/api/v1/channels/{channelId}/events/{calendarEventId}/rsvps",
Expand Down Expand Up @@ -103,7 +104,7 @@ public JSONObject execute(Method method, String url, JSONObject body)
{
HttpRequest req = new HttpRequest(UrlBuilder.of(url))
.method(method)
.header("User-Agent", "Guilded4J/0.9.14 Hutool/5.8.11")
.header("User-Agent", USER_AGENT)
.header("Authorization", "[REDACTED]")
.header("Accept", "application/json")
.header("Content-type", "application/json")
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/vip/floatationdevice/guilded4j/G4JTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public static void main(String[] args) throws Exception
//c.setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 9910)));
c.registerEventListener(new G4JTest()).connectWebSocket(true, null);
//==============================================================
ChatMessage m = c.getChatMessageManager().createChannelMessage(s.savedChannelId, "hello world!");
c.getChatMessageManager().createChannelMessage(m.setContent(m.getContent().toUpperCase()));
}

@Subscribe
Expand Down

0 comments on commit 8e58f5d

Please sign in to comment.