Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mcchampions committed Oct 21, 2023
1 parent 62eaaf7 commit 248eaa7
Show file tree
Hide file tree
Showing 14 changed files with 413 additions and 474 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public void muteSender(int Time) throws IOException {
* @throws IOException 失败后抛出
*/
public void muteSender(int Time, String reason) throws IOException {
MemberApi.addMemberReasonrMute(Command.Authorization, IslandSourceId, SenderDodoSourceId, Time, reason);
MemberApi.addMemberReasonMute(Command.Authorization, IslandSourceId, SenderDodoSourceId, Time, reason);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public static JSONObject getBotInfo(String clientId, String token) throws IOExce
*/
public static JSONObject getBotInfo(String authorization) throws IOException {
String url = "https://botopen.imdodo.com/api/v2/bot/info";
String param = "{}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
JSONObject jsonObject = new JSONObject();
return new JSONObject(NetUtil.sendRequest(jsonObject.toString(), url, authorization));
}

/**
Expand All @@ -59,10 +59,9 @@ public static JSONObject setBotIslandLeave(String clientId, String token, String
*/
public static JSONObject setBotIslandLeave(String authorization, String islandSourceId) throws IOException {
String url = "https://botopen.imdodo.com/api/v2/bot/island/leave";
String param = "{" +
" \"islandSourceId\": \"" + islandSourceId + "\"" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
JSONObject jsonObject = new JSONObject();
jsonObject.put("islandSourceId", islandSourceId);
return new JSONObject(NetUtil.sendRequest(jsonObject.toString(), url, authorization));
}

/**
Expand All @@ -76,11 +75,10 @@ public static JSONObject setBotIslandLeave(String authorization, String islandSo
*/
public static JSONObject getBotInviteList(String authorization, int pageSize, long maxId) throws IOException {
String url = "https://botopen.imdodo.com/api/v2/bot/invite/list";
String param = "{" +
" \"pageSize\":" + pageSize + "," +
" \"maxId\":" + maxId + "" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
JSONObject jsonObject = new JSONObject();
jsonObject.put("pageSize", pageSize)
.put("maxId", maxId);
return new JSONObject(NetUtil.sendRequest(jsonObject.toString(), url, authorization));
}

/**
Expand All @@ -93,10 +91,9 @@ public static JSONObject getBotInviteList(String authorization, int pageSize, lo
*/
public static JSONObject addBotInvite(String authorization, String dodoSourceId) throws IOException {
String url = "https://botopen.imdodo.com/api/v2/bot/invite/add";
String param = "{" +
" \"dodoSourceId\": \"" + dodoSourceId + "\"" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
JSONObject jsonObject = new JSONObject();
jsonObject.put("dodoSourceId", dodoSourceId);
return new JSONObject(NetUtil.sendRequest(jsonObject.toString(), url, authorization));
}

/**
Expand All @@ -109,9 +106,8 @@ public static JSONObject addBotInvite(String authorization, String dodoSourceId)
*/
public static JSONObject removeBotInvite(String authorization, String dodoSourceId) throws IOException {
String url = "https://botopen.imdodo.com/api/v2/bot/invite/remove";
String param = "{" +
" \"dodoSourceId\": \"" + dodoSourceId + "\"" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
JSONObject jsonObject = new JSONObject();
jsonObject.put("dodoSourceId", dodoSourceId);
return new JSONObject(NetUtil.sendRequest(jsonObject.toString(), url, authorization));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ public static JSONObject getChannelList(String clientId, String token, String is
*/
public static JSONObject getChannelList(String authorization, String islandSourceId) throws IOException {
String url = "https://botopen.imdodo.com/api/v2/channel/list";
String param = "{" +
" \"islandSourceId\": \"" + islandSourceId + "\"" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
JSONObject jsonObject = new JSONObject();
jsonObject.put("islandSourceId", islandSourceId);
return new JSONObject(NetUtil.sendRequest(jsonObject.toString(), url, authorization));
}

/**
Expand All @@ -63,10 +62,9 @@ public static JSONObject getChannelInfo(String clientId, String token, String ch
*/
public static JSONObject getChannelInfo(String authorization, String channelId) throws IOException {
String url = "https://botopen.imdodo.com/api/v2/channel/info";
String param = "{" +
" \"channelId\": \"" + channelId + "\"" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
JSONObject jsonObject = new JSONObject();
jsonObject.put("channelId", channelId);
return new JSONObject(NetUtil.sendRequest(jsonObject.toString(), url, authorization));
}

/**
Expand Down Expand Up @@ -96,12 +94,11 @@ public static JSONObject addChannel(String clientId, String token, String island
*/
public static JSONObject addChannel(String authorization, String islandSourceId, String channelName, int channelType) throws IOException {
String url = "https://botopen.imdodo.com/api/v2/channel/add";
String param = "{" +
" \"islandSourceId\": \"" + islandSourceId + "\"," +
" \"channelName\": \"" + channelName + "\"," +
" \"channelType\": " + channelType + "" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
JSONObject jsonObject = new JSONObject();
jsonObject.put("islandSourceId", islandSourceId)
.put("channelName", channelName)
.put("channelType", channelType);
return new JSONObject(NetUtil.sendRequest(jsonObject.toString(), url, authorization));
}

/**
Expand Down Expand Up @@ -131,12 +128,11 @@ public static JSONObject editChannel(String clientId, String token, String islan
*/
public static JSONObject editChannel(String authorization, String islandSourceId, String channelName, String channelId) throws IOException {
String url = "https://botopen.imdodo.com/api/v2/channel/edit";
String param = "{" +
" \"islandSourceId\": \"" + islandSourceId + "\"," +
" \"channelId\": \"" + channelId + "\"," +
" \"channelName\": \"" + channelName + "\"" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
JSONObject jsonObject = new JSONObject();
jsonObject.put("islandSourceId", islandSourceId)
.put("channelName", channelName)
.put("channelId", channelId);
return new JSONObject(NetUtil.sendRequest(jsonObject.toString(), url, authorization));
}

/**
Expand Down Expand Up @@ -164,10 +160,9 @@ public static JSONObject deleteChannel(String clientId, String token, String isl
*/
public static JSONObject deleteChannel(String authorization, String islandSourceId, String channelId) throws IOException {
String url = "https://botopen.imdodo.com/api/v2/channel/remove";
String param = "{" +
" \"islandSourceId\": \"" + islandSourceId + "\"," +
" \"channelId\": \"" + channelId + "\"" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
JSONObject jsonObject = new JSONObject();
jsonObject.put("islandSourceId", islandSourceId)
.put("channelId", channelId);
return new JSONObject(NetUtil.sendRequest(jsonObject.toString(), url, authorization));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ public static JSONObject addChannelArticle(String channelId, String title, Strin
*/
public static JSONObject addChannelArticle(String channelId, String title, String content, String imageUrl, String authorization) throws IOException {
String url = "https://botopen.imdodo.com/api/v2/channel/article/add";
String param = "{" +
" \"channelId\": \"" + channelId + "\"," +
" \"title\": \"" + title + "\"," +
" \"content\": \"" + content + "\"," +
" \"imageUrl\": \"" + imageUrl + "\"" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
JSONObject jsonObject = new JSONObject();
jsonObject.put("title", title)
.put("channelId", channelId)
.put("content", content)
.put("imageUrl", imageUrl);
return new JSONObject(NetUtil.sendRequest(jsonObject.toString(), url, authorization));
}


Expand Down Expand Up @@ -76,12 +75,11 @@ public static JSONObject removeChannelArticle(int type, String id, String channe
*/
public static JSONObject removeChannelArticle(int type, String id, String channelId, String authorization) throws IOException {
String url = "https://botopen.imdodo.com/api/v2/channel/article/remove";
String param = "{" +
" \"id\": \"" + id + "\"," +
" \"type\": " + type + "," +
" \"channelId\": \"" + channelId + "\"" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", id)
.put("channelId", channelId)
.put("type", type);
return new JSONObject(NetUtil.sendRequest(jsonObject.toString(), url, authorization));
}

}
Loading

0 comments on commit 248eaa7

Please sign in to comment.