【问题标题】:Slack events: IndexError: list index out of rangeSlack 事件:IndexError:列表索引超出范围
【发布时间】:2019-04-21 16:38:46
【问题描述】:

我正在尝试从 slack 读取事件并返回匹配事件的响应。

问题是,当我匹配一个事件并将其返回给 slack 时,它给了我一个错误:

IndexError: list index out of range

代码片段:

【问题讨论】:

    标签: python regex list exception slack-api


    【解决方案1】:

    怎么样:

    res = regVal.findall(text)  ### output of res, res = ['CHG1234567']
    if res:
        change = res[0]
        incomingSlack(change, channel)
    

    【讨论】:

      猜你喜欢
      • 2011-10-31
      • 2015-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多