根据你用 Discord.js 反应的表情符号做一些事情

时间:2021-04-21 16:31:27

标签: javascript node.js discord discord.js

我正在尝试创建一个日历,根据表情符号,我们会对哪个表情做出反应,但我没有找到好的功能。我试图在另一篇文章中找到,但没有任何帮助。

感谢您的帮助。

这是代码:

    if (message.content.startsWith('!agenda')){

        var embed = new Discord.MessageEmbed()
            .setColor('YELLOW')
            .setTitle('Matter')
            .addFields(
                {name : 'Math :', value: '?'},
            )

        var Msg = await message.channel.send(embed);
        Msg.react("?");
        var emoji = await Msg.awaitReactions;

        if (emoji === '?'){
            message.channel.send('test')
        }
    }   

}) 

1 个答案:

答案 0 :(得分:1)

这是你要找的:

library(shiny)
library(ggplot2)
library(dplyr)
library(tidyr)


ui <- pageWithSidebar(
  headerPanel('Example of Filtering a Plot'),
    sidebarPanel(
      h3("Filters"),
      selectInput("s_color", label="Color:", choices = c("All", as.character(unique(diamonds$color)))),
      selectInput("s_cut", label="Cut:", choices=c("All", as.character(unique(diamonds$cut)))),
      selectInput("s_clarity", label="Clarity:", choices=c("All", as.character(unique(diamonds$clarity)))),
      br(),
      selectInput("s_axis", label="X Axis:", choices=c("carat","price", "depth", "table"))
    ),
    mainPanel(plotOutput('dazzle'))
)

server <- function(input, output) {
  
  glittering_diamonds <- reactive({
    d <- diamonds
    if(input$s_color != "All")
      d <- d %>% dplyr::filter(color==input$s_color)
    if(input$s_cut != "All")
      d <- d %>% dplyr::filter(cut==input$s_cut)
    if(input$s_clarity != "All")
      d <- d %>% dplyr::filter(clarity==input$s_clarity)
    return(d)
  })
    
  output$dazzle <- renderPlot({
    p <- ggplot(glittering_diamonds(), aes_string(x=input$s_axis)) +
      geom_density(fill='blue', alpha=0.2) +
      theme_classic()
    print(p)
  })
}

shinyApp(ui = ui, server = server)

如果您对任何部分感到困惑,请提出问题。