小编Nin*_*dus的帖子

通过ID获取消息:Discord.js

我正在为不和谐的机器人制作报告系统,我希望玩家通过ID报告特定消息,以便主持人可以确定该消息是否令人反感。我正在努力寻找一种从给定ID获取消息文本的方法。有没有办法做到这一点?

bots messageid discord discord.js

5
推荐指数
2
解决办法
2万
查看次数

libtins 嗅探器未定义

#include <iostream>
#include <tins/tins.h>

using namespace Tins;
using namespace std;

bool callback(const PDU& pdu) {
    // Find the IP layer
    const IP& ip = pdu.rfind_pdu<IP>();
    // Find the TCP layer
    const TCP& tcp = pdu.rfind_pdu<TCP>();
    cout << ip.src_addr() << ":" << tcp.sport() << " -> "
         << ip.dst_addr() << ":" << tcp.dport() << endl;
    return true;
}

int main() {
    Sniffer("eth0").sniff_loop(callback);
}
Run Code Online (Sandbox Code Playgroud)

我给了你默认的代码libtins,但由于某种原因Sniffer是未定义的。我已将所有库包含在链接器中。

当我构建时它也给了我以下错误:

-- Build started: Project: Packet Sniffing, Configuration: Debug x64 ------
1>Packet Sniffing.cpp …
Run Code Online (Sandbox Code Playgroud)

c++ network-programming visual-studio-2019 libtins

2
推荐指数
1
解决办法
1468
查看次数