File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,24 @@ class Akun {
193
193
return this . _closeNode ( readerPostNodeId ) ;
194
194
}
195
195
196
+ ban ( storyId , postId ) {
197
+ return this . core . post ( `/api/anonkun/ban` , {
198
+ blockFor : postId ,
199
+ blockFrom : storyId
200
+ } , false ) ;
201
+ }
202
+
203
+ unban ( storyId , postId ) {
204
+ return this . core . delete ( `/api/anonkun/ban` , {
205
+ blockFor : postId ,
206
+ blockFrom : storyId
207
+ } , false ) ;
208
+ }
209
+
210
+ getBans ( storyId ) {
211
+ return this . core . get ( `/api/anonkun/story/bans/${ storyId } ` ) ;
212
+ }
213
+
196
214
_openNode ( nodeId ) {
197
215
return this . core . post ( `/api/anonkun/editChapter` , {
198
216
'_id' : nodeId ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " akun-api" ,
3
- "version" : " 4.0.3 " ,
3
+ "version" : " 4.1.0 " ,
4
4
"description" : " A module intended to enable easy interactions with Anonkun" ,
5
5
"main" : " index.js" ,
6
6
"type" : " module" ,
Original file line number Diff line number Diff line change @@ -190,14 +190,25 @@ async function testPost(akun, chatId) {
190
190
// console.log(await client.reply('rooply', 't2KXjRztofE5Z58uE'));
191
191
}
192
192
193
+ async function testBan ( akun ) {
194
+ let res ;
195
+ res = await akun . login ( credentials [ 'username' ] , credentials [ 'password' ] ) ;
196
+ console . log ( res ) ;
197
+ res = await akun . unban ( 'iRoYFFCDCZnB2QvEq' , '53zAELYaC8RkkMpcn' ) ;
198
+ console . log ( res ) ;
199
+ res = await akun . unban ( 'iRoYFFCDCZnB2QvEq' , 'B5cqvTk3kMgRNPesr' ) ;
200
+ console . log ( res ) ;
201
+ }
202
+
193
203
async function runTests ( akun ) {
194
204
// await testAnonToggle(akun, 'vhHhMfskRnNDbxwzo');
195
205
// await testPost(akun, 'vhHhMfskRnNDbxwzo');
196
- await testStory ( akun , 'vhHhMfskRnNDbxwzo' ) ;
206
+ // await testStory(akun, 'vhHhMfskRnNDbxwzo');
197
207
// await testChat(akun, 'oQ2fkvRS4nxjLfSmA');
198
208
// await testChat(akun, 'oWC3WhFDMXqZkAG69');
199
209
// await testPut(akun, 'vhHhMfskRnNDbxwzo');
200
210
// await testVote(akun, 'TziTddJsppEfr82nh');
211
+ // await testBan(akun);
201
212
}
202
213
203
214
async function setup ( withRealtime = true ) {
You can’t perform that action at this time.
0 commit comments