![我将参考这张图片)https://imgur.com/a/99XPfIa
我正在用JavaScript制作Discord机器人,并且卡在某个地方
我有一个say命令,您可以使用!say这里的文本,然后机器人会发送一条简单的消息,说这里的文本
现在,我希望该机器人发送使用相同消息的嵌入消息,并且希望该机器人具有默认设置的标题,图像,链接和作者。 [请查看我的图片]当某人这样做时!说嵌入@everyone loco(其中的文字)
[查看图像
有人可以帮我吗?谢谢yoi
答案 0 :(得分:0)
去那里:
library(rvest)
library(stringr)
library(purrr)
library(readbulk)
library(dplyr)
#Read URLs
urls <- read_bulk("C:/Users/XXXX", extension = ".csv") %>%
dplyr::distinct(link) #removing dublicates
#For Loop
titles <- c()
text <- c()
url <- c()
date <- c()
for(i in 1:nrow(urls)){
data <- read_html(paste0(urls$link[i]))
body <- data %>%
html_nodes("p") %>%
html_text() %>%
str_c(collapse = " ", sep = "")
text = append(text, body)
data <- read_html(paste0(urls$link[i]))
header <- data %>%
html_node("title") %>%
html_text()
titles = append(titles, rep(header,each=length(body)))
data <- read_html(paste0(urls$link[i]))
time <- data %>%
html_nodes("time") %>% #See HTML source code for data within this tag
html_text() %>%
str_c(collapse = " ", sep = "")
date = append(date, rep(time,each=length(time)))
url = append(url, rep(paste0(urls$link[i]),each=length(body)))
print(i)
}
data <- data.frame(Headline=titles, Body=text, Date=date, Url=url) # As Dataframe
我找不到任何网址和图片网址,所以请自行更改。