Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
mcchampions committed Aug 5, 2023
1 parent 5e254fd commit 7427a63
Show file tree
Hide file tree
Showing 15 changed files with 177 additions and 196 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,43 +48,43 @@ permissions: 763KB
<dependency>
<groupId>top.qscraft.dodoopenjava</groupId>
<artifactId>core</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>top.qscraft.dodoopenjava</groupId>
<artifactId>command</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>top.qscraft.dodoopenjava</groupId>
<artifactId>configuration</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>top.qscraft.dodoopenjava</groupId>
<artifactId>event-core</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>top.qscraft.dodoopenjava</groupId>
<artifactId>event-websocket</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>top.qscraft.dodoopenjava</groupId>
<artifactId>event-webhook</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>top.qscraft.dodoopenjava</groupId>
<artifactId>permissions</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
</dependency>
<!--又或者直接合成一个依赖项-->
<dependency>
<groupId>top.qscraft</groupId>
<artifactId>dodoopenjava</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
</dependency>
</dependencies>
```
Expand All @@ -97,15 +97,15 @@ permissions: 763KB
}
dependencies {
implementation 'top.qscraft.dodoopenjava:core:2.5.1'
implementation 'top.qscraft.dodoopenjava:command:2.5.1'
implementation 'top.qscraft.dodoopenjava:configuration:2.5.1'
implementation 'top.qscraft.dodoopenjava:event-core:2.5.1'
implementation 'top.qscraft.dodoopenjava:event-websocket:2.5.1'
implementation 'top.qscraft.dodoopenjava:event-webhook:2.5.1'
implementation 'top.qscraft.dodoopenjava:permissions:2.5.1'
implementation 'top.qscraft.dodoopenjava:core:2.5.2'
implementation 'top.qscraft.dodoopenjava:command:2.5.2'
implementation 'top.qscraft.dodoopenjava:configuration:2.5.2'
implementation 'top.qscraft.dodoopenjava:event-core:2.5.2'
implementation 'top.qscraft.dodoopenjava:event-websocket:2.5.2'
implementation 'top.qscraft.dodoopenjava:event-webhook:2.5.2'
implementation 'top.qscraft.dodoopenjava:permissions:2.5.2'
//又或者直接合成一个依赖项
implementation 'top.qscraft:dodoopenjava:2.5.1'
implementation 'top.qscraft:dodoopenjava:2.5.2'
}
```
### 教程(编写中,只差实战部分)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* 机器人API
*/
public class BotApi {
public static String url, param;

/**
* 获取机器人信息
Expand All @@ -32,8 +31,8 @@ public static JSONObject getBotInfo(String clientId, String token) throws IOExce
* @throws IOException 发送请求失败后抛出
*/
public static JSONObject getBotInfo(String authorization) throws IOException {
url = "https://botopen.imdodo.com/api/v2/bot/info";
param = "{}";
String url = "https://botopen.imdodo.com/api/v2/bot/info";
String param = "{}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
}

Expand All @@ -59,8 +58,8 @@ public static JSONObject setBotIslandLeave(String clientId, String token, String
* @throws IOException 发送请求失败后抛出
*/
public static JSONObject setBotIslandLeave(String authorization, String islandSourceId) throws IOException {
url = "https://botopen.imdodo.com/api/v2/bot/island/leave";
param = "{" +
String url = "https://botopen.imdodo.com/api/v2/bot/island/leave";
String param = "{" +
" \"islandSourceId\": \"" + islandSourceId + "\"" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
Expand All @@ -76,8 +75,8 @@ public static JSONObject setBotIslandLeave(String authorization, String islandSo
* @throws IOException 发送请求失败后抛出
*/
public static JSONObject getBotInviteList(String authorization, int pageSize, long maxId) throws IOException {
url = "https://botopen.imdodo.com/api/v2/bot/invite/list";
param = "{" +
String url = "https://botopen.imdodo.com/api/v2/bot/invite/list";
String param = "{" +
" \"pageSize\":" + pageSize + "," +
" \"maxId\":" + maxId + "" +
"}";
Expand All @@ -93,8 +92,8 @@ public static JSONObject getBotInviteList(String authorization, int pageSize, lo
* @throws IOException 发送请求失败后抛出
*/
public static JSONObject addBotInvite(String authorization, String dodoSourceId) throws IOException {
url = "https://botopen.imdodo.com/api/v2/bot/invite/add";
param = "{" +
String url = "https://botopen.imdodo.com/api/v2/bot/invite/add";
String param = "{" +
" \"dodoSourceId\": \"" + dodoSourceId + "\"" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
Expand All @@ -109,8 +108,8 @@ public static JSONObject addBotInvite(String authorization, String dodoSourceId)
* @throws IOException 发送请求失败后抛出
*/
public static JSONObject removeBotInvite(String authorization, String dodoSourceId) throws IOException {
url = "https://botopen.imdodo.com/api/v2/bot/invite/remove";
param = "{" +
String url = "https://botopen.imdodo.com/api/v2/bot/invite/remove";
String param = "{" +
" \"dodoSourceId\": \"" + dodoSourceId + "\"" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* 频道API
*/
public class ChannelApi {
public static String url, param;

/**
* 获取频道列表
Expand All @@ -34,8 +33,8 @@ public static JSONObject getChannelList(String clientId, String token, String is
* @throws IOException 失败后抛出
*/
public static JSONObject getChannelList(String authorization, String islandSourceId) throws IOException {
url = "https://botopen.imdodo.com/api/v2/channel/list";
param = "{" +
String url = "https://botopen.imdodo.com/api/v2/channel/list";
String param = "{" +
" \"islandSourceId\": \"" + islandSourceId + "\"" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
Expand Down Expand Up @@ -63,8 +62,8 @@ public static JSONObject getChannelInfo(String clientId, String token, String ch
* @throws IOException 失败后抛出
*/
public static JSONObject getChannelInfo(String authorization, String channelId) throws IOException {
url = "https://botopen.imdodo.com/api/v2/channel/info";
param = "{" +
String url = "https://botopen.imdodo.com/api/v2/channel/info";
String param = "{" +
" \"channelId\": \"" + channelId + "\"" +
"}";
return new JSONObject(NetUtil.sendRequest(param, url, authorization));
Expand Down Expand Up @@ -96,8 +95,8 @@ public static JSONObject addChannel(String clientId, String token, String island
* @throws IOException 失败后抛出
*/
public static JSONObject addChannel(String authorization, String islandSourceId, String channelName, int channelType) throws IOException {
url = "https://botopen.imdodo.com/api/v2/channel/add";
param = "{" +
String url = "https://botopen.imdodo.com/api/v2/channel/add";
String param = "{" +
" \"islandSourceId\": \"" + islandSourceId + "\"," +
" \"channelName\": \"" + channelName + "\"," +
" \"channelType\": " + channelType + "" +
Expand Down Expand Up @@ -131,8 +130,8 @@ public static JSONObject editChannel(String clientId, String token, String islan
* @throws IOException 失败后抛出
*/
public static JSONObject editChannel(String authorization, String islandSourceId, String channelName, String channelId) throws IOException {
url = "https://botopen.imdodo.com/api/v2/channel/edit";
param = "{" +
String url = "https://botopen.imdodo.com/api/v2/channel/edit";
String param = "{" +
" \"islandSourceId\": \"" + islandSourceId + "\"," +
" \"channelId\": \"" + channelId + "\"," +
" \"channelName\": \"" + channelName + "\"" +
Expand Down Expand Up @@ -164,8 +163,8 @@ public static JSONObject deleteChannel(String clientId, String token, String isl
* @throws IOException 失败后抛出
*/
public static JSONObject deleteChannel(String authorization, String islandSourceId, String channelId) throws IOException {
url = "https://botopen.imdodo.com/api/v2/channel/remove";
param = "{" +
String url = "https://botopen.imdodo.com/api/v2/channel/remove";
String param = "{" +
" \"islandSourceId\": \"" + islandSourceId + "\"," +
" \"channelId\": \"" + channelId + "\"" +
"}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
* 帖子频道API
*/
public class ChannelArticleApi {
public static String url, param;

/**
* 发布帖子
*
Expand Down Expand Up @@ -40,8 +38,8 @@ public static JSONObject addChannelArticle(String channelId, String title, Strin
* @throws IOException 失败后抛出
*/
public static JSONObject addChannelArticle(String channelId, String title, String content, String imageUrl, String authorization) throws IOException {
url = "https://botopen.imdodo.com/api/v2/channel/article/add";
param = "{" +
String url = "https://botopen.imdodo.com/api/v2/channel/article/add";
String param = "{" +
" \"channelId\": \"" + channelId + "\"," +
" \"title\": \"" + title + "\"," +
" \"content\": \"" + content + "\"," +
Expand Down Expand Up @@ -77,8 +75,8 @@ public static JSONObject removeChannelArticle(int type, String id, String channe
* @throws IOException 失败后抛出
*/
public static JSONObject removeChannelArticle(int type, String id, String channelId, String authorization) throws IOException {
url = "https://botopen.imdodo.com/api/v2/channel/article/remove";
param = "{" +
String url = "https://botopen.imdodo.com/api/v2/channel/article/remove";
String param = "{" +
" \"id\": \"" + id + "\"," +
" \"type\": " + type + "," +
" \"channelId\": \"" + channelId + "\"" +
Expand Down
Loading

0 comments on commit 7427a63

Please sign in to comment.