Skip to content

Commit

Permalink
send again
Browse files Browse the repository at this point in the history
  • Loading branch information
Craftingmod committed Mar 2, 2018
1 parent 9e288ec commit 305edf6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Expand Up @@ -96,6 +96,15 @@ protected boolean editQueue(long discordUID,String newCafename,String newCafeID)
}
}

protected int getToken(long discordUID){
for(DiscordUser u : queue){
if(u.userID == discordUID){
return u.token;
}
}
return -1;
}

protected abstract void onAuthResult(ArrayList<DiscordUser> users);

@Override
Expand Down
Expand Up @@ -328,11 +328,17 @@ public void execCommand(MessageReceivedEvent event){
try {
PrivateChannel pChannel = sender.openPrivateChannel().complete(true);
int auth = this.requestAuth(user);
System.out.println("Auth key: " + auth);
if(auth >= 0){
pChannel.sendMessage("<@!#discordid>님이 회원임을 인증할려면 **#minute분안에** #url 에 __#num__ 숫자를 댓글에 남겨주세요.\n"
.replace("#discordid",Long.toString(sender.getIdLong()))
.replace("#url",cfg.cafeCommentURL)
.replace("#num",Integer.toString(auth)).replace("#minute",Long.toString(limit_minute))).queue();
}else{
pChannel.sendMessage("<@!#discordid>님이 회원임을 인증할려면 **#second초안에** #url 에 __#num__ 숫자를 댓글에 남겨주세요.\n"
.replace("#discordid",Long.toString(sender.getIdLong()))
.replace("#url",cfg.cafeCommentURL)
.replace("#num",Integer.toString(getToken(sender.getIdLong()))).replace("#second",Long.toString(Math.abs(auth)))).queue();
}
// update
StringBuilder sb = new StringBuilder();
Expand Down
2 changes: 1 addition & 1 deletion target/maven-archiver/pom.properties
@@ -1,5 +1,5 @@
#Generated by Maven
#Sat Mar 03 02:24:49 KST 2018
#Sat Mar 03 02:36:46 KST 2018
version=1.0.0
groupId=net.tarks.craftingmod
artifactId=ncc_auth

0 comments on commit 305edf6

Please sign in to comment.