Toggle navigation
Toggle navigation
This project
Loading...
Sign in
유병우
/
lostark-discord-bot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
남우성
2022-05-16 14:43:20 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
46c0fbc933a27bc252176dbdaf741825c1f35ebb
46c0fbc9
1 parent
e3ad88e1
Create adventure island information supply method
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
2 deletions
commands/compass.js
commands/help.js
commands/compass.js
View file @
46c0fbc
const
{
SlashCommandBuilder
}
=
require
(
'@discordjs/builders'
);
const
{
MessageEmbed
}
=
require
(
'discord.js'
);
const
axois
=
require
(
'axios'
);
const
cheerio
=
require
(
'cheerio'
);
\ No newline at end of file
const
axios
=
require
(
"axios"
);
const
cheerio
=
require
(
"cheerio"
);
module
.
exports
=
{
data
:
new
SlashCommandBuilder
()
.
setName
(
'나침반'
)
.
setDescription
(
'오늘 이용가능한 프로키온의 나침반 스케줄 정보를 조회합니다.'
),
async
execute
(
interaction
)
{
const
getHtml
=
async
()
=>
{
try
{
return
await
axios
.
get
(
"https://www.loawa.com/"
)
}
catch
(
error
){
console
.
error
(
error
);
}
}
await
getHtml
()
.
then
(
html
=>
{
const
$
=
cheerio
.
load
(
html
.
data
);
let
info_island
=
[]
let
info_contents
=
[]
const
$IslandList
=
$
(
"ul.today-quest-list"
).
children
(
"li.list"
);
$IslandList
.
each
(
function
(
i
,
elem
){
info_island
[
i
]
=
{
name
:
$
(
this
).
find
(
'h4.island-name span'
).
text
(),
reword
:
$
(
this
).
find
(
'h5.lang-text'
).
text
()
}
})
let
island_print
=
""
for
(
var
i
=
0
;
i
<
info_island
.
length
;
i
++
){
island_print
+=
`
${
info_island
[
i
].
name
}
:
${
info_island
[
i
].
reword
}
\n`
;
}
const
termembed
=
new
MessageEmbed
()
.
setColor
(
'#008B8B'
)
.
setTitle
(
'프로키온의 나침반'
)
.
setDescription
(
`오늘 이용가능한 컨텐츠 정보`
)
.
addField
(
"모험섬"
,
island_print
)
interaction
.
reply
({
embeds
:
[
termembed
],
allowedMentions
:
{
repliedUser
:
false
}
});
})
},
};
...
...
commands/help.js
deleted
100644 → 0
View file @
e3ad88e
File mode changed
Please
register
or
login
to post a comment