Showing
1 changed file
with
35 additions
and
26 deletions
... | @@ -22,7 +22,7 @@ const { getVideoID } = require('ytdl-core'); | ... | @@ -22,7 +22,7 @@ const { getVideoID } = require('ytdl-core'); |
22 | //로그인 콘솔 출력 | 22 | //로그인 콘솔 출력 |
23 | client.on("ready", () => { | 23 | client.on("ready", () => { |
24 | console.log(`Logged in as ${client.user.tag}!`) | 24 | console.log(`Logged in as ${client.user.tag}!`) |
25 | - client.user.setActivity('도움말은 ~help', { | 25 | + client.user.setActivity('쿠옹이사용법! ➤ '+prefix+'도움말', { |
26 | type : 'PLAYING' | 26 | type : 'PLAYING' |
27 | }) | 27 | }) |
28 | }); | 28 | }); |
... | @@ -55,20 +55,20 @@ client.on("message", msg => { | ... | @@ -55,20 +55,20 @@ client.on("message", msg => { |
55 | 55 | ||
56 | 56 | ||
57 | //도움말 출력 | 57 | //도움말 출력 |
58 | - if (command === "help") { | 58 | + if (command === "help" || command === "도움말") { |
59 | const helpEmbed = new MessageEmbed() | 59 | const helpEmbed = new MessageEmbed() |
60 | .setColor('#A40F16') | 60 | .setColor('#A40F16') |
61 | .setTitle(':lion_face: 쿠옹이 사용법 :lion_face: ') | 61 | .setTitle(':lion_face: 쿠옹이 사용법 :lion_face: ') |
62 | - .addField('ping', '쿠옹이와 탁구를 칩니다.') | 62 | + .addField(prefix+'ping', '쿠옹이와 탁구를 칩니다.') |
63 | - .addField('현재시간', '현재시간을 알려줍니다.') | 63 | + .addField(prefix+'현재시간', '현재시간을 알려줍니다.') |
64 | - .addField('공부시작', '공부 시작!\n스톱워치가 켜집니다.') | 64 | + .addField(prefix+'공부시작', '공부 시작!\n스톱워치가 켜집니다.') |
65 | - .addField('공부끝', '공부 끝!\n스톱워치가 멈춥니다.') | 65 | + .addField(prefix+'공부끝', '공부 끝!\n스톱워치가 멈춥니다.') |
66 | - .addField('순위', '공부한 시간 순위를 알려줍니다.') | 66 | + .addField(prefix+'순위', '공부한 시간 순위를 알려줍니다.') |
67 | - .addField('디데이설정 (1) (2)', '디데이를 설정합니다.\n(1) : 이벤트이름\n(2) : 이벤트날짜 (mm/dd)\nex) ~디데이설정 기말고사 12/15') | 67 | + .addField(prefix+'디데이설정 ① ②', '디데이를 설정합니다.\n① : 이벤트이름\n② : 이벤트날짜 (mm/dd)\nex) '+prefix+'디데이설정 기말고사 12/15') |
68 | - .addField('디데이보기', '설정된 디데이를 보여줍니다.') | 68 | + .addField(prefix+'디데이보기', '설정된 디데이를 보여줍니다.') |
69 | - .addField('디데이삭제 (1)', '입력한 이벤트를 삭제합니다.\n(1) : 이벤트이름\nex)~디데이삭제 기말고사') | 69 | + .addField(prefix+'디데이삭제 ①', '입력한 이벤트를 삭제합니다.\n① : 이벤트이름\nex)'+prefix+'디데이삭제 기말고사') |
70 | - .addField('백색소음', '백색소음을 재생합니다.\n(먼저 음성채널에 입장해야합니다)') | 70 | + //.addField('백색소음', '백색소음을 재생합니다.\n(먼저 음성채널에 입장해야합니다)') |
71 | - .addField('재생 (1)','(1)을 재생합니다.\n(1) : 노래제목\n(먼저 음성채널에 입장해야합니다') | 71 | + .addField(prefix+'재생 ①','①을 재생합니다.\n① : 노래제목\n(먼저 음성채널에 입장해야합니다') |
72 | .setTimestamp() | 72 | .setTimestamp() |
73 | .setFooter('쿠옹이 사용법'); | 73 | .setFooter('쿠옹이 사용법'); |
74 | 74 | ||
... | @@ -94,7 +94,7 @@ client.on("message", msg => { | ... | @@ -94,7 +94,7 @@ client.on("message", msg => { |
94 | console.log('studyStart write end'); | 94 | console.log('studyStart write end'); |
95 | }); | 95 | }); |
96 | 96 | ||
97 | - msg.reply("공부시작! 열공~ ⁽⁽◝( ˙ ꒳ ˙ )◜⁾⁾"); | 97 | + msg.reply("공부시작! 열공~ :lion_face::lion_face:"); |
98 | } //공부시작 시간 체크 end | 98 | } //공부시작 시간 체크 end |
99 | 99 | ||
100 | 100 | ||
... | @@ -121,7 +121,7 @@ client.on("message", msg => { | ... | @@ -121,7 +121,7 @@ client.on("message", msg => { |
121 | } | 121 | } |
122 | 122 | ||
123 | //공부시간 출력 | 123 | //공부시간 출력 |
124 | - msg.reply(studyHours + "시간 " + studyMinutes + "분 공부하였습니다."); | 124 | + msg.reply(studyHours + "시간 " + studyMinutes + "분 공부했어요."); |
125 | console.log(studyHours + "h " + studyMinutes + "m"); | 125 | console.log(studyHours + "h " + studyMinutes + "m"); |
126 | 126 | ||
127 | //studyTime 기록 | 127 | //studyTime 기록 |
... | @@ -149,7 +149,7 @@ client.on("message", msg => { | ... | @@ -149,7 +149,7 @@ client.on("message", msg => { |
149 | //(공부시작을 하지 않은 경우) | 149 | //(공부시작을 하지 않은 경우) |
150 | if (error.code === "ENOENT") { | 150 | if (error.code === "ENOENT") { |
151 | console.log("user no start"); | 151 | console.log("user no start"); |
152 | - msg.reply("아직 공부를 시작하지 않았습니다."); | 152 | + msg.reply("아직 공부를 시작하지 않았어요."); |
153 | } | 153 | } |
154 | } | 154 | } |
155 | 155 | ||
... | @@ -184,7 +184,7 @@ client.on("message", msg => { | ... | @@ -184,7 +184,7 @@ client.on("message", msg => { |
184 | //순위 출력 | 184 | //순위 출력 |
185 | studyTimeArr.sort((a, b) => (b[0]+b[1]) - (a[0]+a[1])); | 185 | studyTimeArr.sort((a, b) => (b[0]+b[1]) - (a[0]+a[1])); |
186 | for (var i = 0; i < studyTimeArr.length; i++) { | 186 | for (var i = 0; i < studyTimeArr.length; i++) { |
187 | - msg.channel.send((i+1)+"등 <@"+studyTimeArr[i][1]+"> 님 "+parseInt(studyTimeArr[i][0]/60)+"시간 "+studyTimeArr[i][0]%60+"분 공부함."); | 187 | + msg.channel.send((i+1)+"등 <@"+studyTimeArr[i][1]+"> 님 "+parseInt(studyTimeArr[i][0]/60)+"시간 "+studyTimeArr[i][0]%60+"분 공부했어요"); |
188 | } | 188 | } |
189 | }); | 189 | }); |
190 | }//공부시간 순위 end | 190 | }//공부시간 순위 end |
... | @@ -215,7 +215,7 @@ client.on("message", msg => { | ... | @@ -215,7 +215,7 @@ client.on("message", msg => { |
215 | 215 | ||
216 | //디데이부분 수정 필요 | 216 | //디데이부분 수정 필요 |
217 | //디데이 설정 | 217 | //디데이 설정 |
218 | - if (msg.content.startsWith("~디데이설정")) { | 218 | + if (msg.content.startsWith(prefix+"디데이설정")) { |
219 | console.log("dDaySetStart"); | 219 | console.log("dDaySetStart"); |
220 | try { | 220 | try { |
221 | var dDayData = msg.toString().split(" "); | 221 | var dDayData = msg.toString().split(" "); |
... | @@ -230,7 +230,7 @@ client.on("message", msg => { | ... | @@ -230,7 +230,7 @@ client.on("message", msg => { |
230 | msg.reply(dDayWhen[0] + "월 " + dDayWhen[1] + "일에 " + dDayTitle + "이(가) 설정되었습니다."); | 230 | msg.reply(dDayWhen[0] + "월 " + dDayWhen[1] + "일에 " + dDayTitle + "이(가) 설정되었습니다."); |
231 | 231 | ||
232 | } catch { | 232 | } catch { |
233 | - msg.reply("양식이 올바르지 않습니다. 예) ~디데이설정 기말고사 12/15"); | 233 | + msg.reply("양식이 올바르지 않아요. 예) "+prefix+"디데이설정 기말고사 12/15"); |
234 | } | 234 | } |
235 | 235 | ||
236 | 236 | ||
... | @@ -250,8 +250,17 @@ client.on("message", msg => { | ... | @@ -250,8 +250,17 @@ client.on("message", msg => { |
250 | var dDayWhen = data.toString().split('/'); | 250 | var dDayWhen = data.toString().split('/'); |
251 | var t1 = moment(); //현재 날짜 | 251 | var t1 = moment(); //현재 날짜 |
252 | var t2 = moment(String(now.getFullYear()) + "-" + dDayWhen[0] + "-" + dDayWhen[1] , 'YYYY-MM-DD'); // 저장된 날짜 | 252 | var t2 = moment(String(now.getFullYear()) + "-" + dDayWhen[0] + "-" + dDayWhen[1] , 'YYYY-MM-DD'); // 저장된 날짜 |
253 | + var dDayPrint = (Number(t2.diff(t1,'days')) + 2); | ||
254 | + if (dDayPrint > 0) { | ||
255 | + msg.reply(el.replace('.txt','') + "까지 D - "+ dDayPrint); //dDay 답장 (날짜안지난경우) | ||
256 | + } | ||
257 | + else if (dDayPrint < 0) { | ||
258 | + msg.reply(el.replace('.txt','') + "까지 D + "+ (-dDayPrint)); //dDay 답장 (날짜지난경우) | ||
259 | + } | ||
260 | + else { | ||
261 | + msg.reply(el.replace('.txt','') + "까지 D - day"); //dDay 답장 (오늘인경우) | ||
262 | + } | ||
253 | 263 | ||
254 | - msg.reply(el.replace('.txt','') + "까지 D - "+ (Number(t2.diff(t1,'days')) + 2)); //dDay 답장 | ||
255 | }); | 264 | }); |
256 | }); | 265 | }); |
257 | }); | 266 | }); |
... | @@ -259,7 +268,7 @@ client.on("message", msg => { | ... | @@ -259,7 +268,7 @@ client.on("message", msg => { |
259 | 268 | ||
260 | 269 | ||
261 | //디데이 삭제 | 270 | //디데이 삭제 |
262 | - if (msg.content.startsWith("~디데이삭제")) { | 271 | + if (msg.content.startsWith(prefix+"디데이삭제")) { |
263 | var dDayData = msg.toString().split(" "); | 272 | var dDayData = msg.toString().split(" "); |
264 | var fileName = "data/dDay/" + dDayData[1] + ".txt"; | 273 | var fileName = "data/dDay/" + dDayData[1] + ".txt"; |
265 | try { | 274 | try { |
... | @@ -267,7 +276,7 @@ client.on("message", msg => { | ... | @@ -267,7 +276,7 @@ client.on("message", msg => { |
267 | fs.statSync(fileName); //파일 존재 확인 | 276 | fs.statSync(fileName); //파일 존재 확인 |
268 | try { | 277 | try { |
269 | fs.unlinkSync(fileName) // 파일 존재시 삭제 | 278 | fs.unlinkSync(fileName) // 파일 존재시 삭제 |
270 | - msg.reply("해당 이벤트가 삭제되었습니다."); | 279 | + msg.reply("해당 이벤트가 삭제되었어요"); |
271 | } catch (error) { | 280 | } catch (error) { |
272 | if(err.code == 'ENOENT'){ | 281 | if(err.code == 'ENOENT'){ |
273 | console.log("file delete error"); | 282 | console.log("file delete error"); |
... | @@ -279,7 +288,7 @@ client.on("message", msg => { | ... | @@ -279,7 +288,7 @@ client.on("message", msg => { |
279 | //파일이 없다면 에러 발생 | 288 | //파일이 없다면 에러 발생 |
280 | msg.reply("설정되지 않은 이벤트입니다."); | 289 | msg.reply("설정되지 않은 이벤트입니다."); |
281 | if (error.code === "ENOENT") { | 290 | if (error.code === "ENOENT") { |
282 | - console.log("파일이 존재하지 않습니다."); | 291 | + console.log("파일이 존재하지 않아요"); |
283 | } | 292 | } |
284 | } | 293 | } |
285 | 294 | ||
... | @@ -303,7 +312,7 @@ client.on("message", msg => { | ... | @@ -303,7 +312,7 @@ client.on("message", msg => { |
303 | }) | 312 | }) |
304 | .catch(console.log); | 313 | .catch(console.log); |
305 | } else { | 314 | } else { |
306 | - msg.reply("먼저 보이스채널에 입장해주세요."); | 315 | + msg.reply("먼저 보이스채널에 입장해주세요!"); |
307 | } | 316 | } |
308 | } // 음악재생 end | 317 | } // 음악재생 end |
309 | 318 | ||
... | @@ -315,7 +324,7 @@ client.on("message", msg => { | ... | @@ -315,7 +324,7 @@ client.on("message", msg => { |
315 | msg.member.voice.channel.leave(); | 324 | msg.member.voice.channel.leave(); |
316 | msg.reply('bye!'); | 325 | msg.reply('bye!'); |
317 | } else { | 326 | } else { |
318 | - msg.reply('이미 나왔어요.'); | 327 | + msg.reply('이미 나왔어요 :lion_face:...'); |
319 | } | 328 | } |
320 | } // 보이스채널 나가기 end | 329 | } // 보이스채널 나가기 end |
321 | 330 | ||
... | @@ -335,14 +344,14 @@ client.on("message", msg => { | ... | @@ -335,14 +344,14 @@ client.on("message", msg => { |
335 | //내용 추가 필요 | 344 | //내용 추가 필요 |
336 | }); | 345 | }); |
337 | console.log(results[0].title); | 346 | console.log(results[0].title); |
338 | - msg.reply(results[0].title + " 을 재생한다!"); | 347 | + msg.reply(results[0].title + " 을 재생할게요!"); |
339 | }); | 348 | }); |
340 | }).catch(err => { | 349 | }).catch(err => { |
341 | console.error(err); | 350 | console.error(err); |
342 | return msg.member.voice.channel.leave(); | 351 | return msg.member.voice.channel.leave(); |
343 | }); | 352 | }); |
344 | } else { | 353 | } else { |
345 | - msg.reply("먼저 보이스채널에 입장해주세요."); | 354 | + msg.reply("먼저 보이스채널에 입장해주세요!"); |
346 | } | 355 | } |
347 | } // 유튜브 음악 재생 end | 356 | } // 유튜브 음악 재생 end |
348 | 357 | ... | ... |
-
Please register or login to post a comment