add direct message support

This commit is contained in:
Syping 2026-03-23 02:18:37 +01:00
parent 7588ca865b
commit 77621a8991
15 changed files with 115 additions and 40 deletions

View file

@ -1,6 +1,6 @@
/*****************************************************************************
* dtranslatebot Discord Translate Bot
* Copyright (C) 2024 Syping
* Copyright (C) 2024-2026 Syping
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@ -25,13 +25,20 @@
#include <queue>
namespace bot {
struct translated_message {
struct translated_direct_message {
dpp::message_context_menu_t event;
std::string message;
};
struct translated_guild_message {
std::string author;
std::string avatar;
std::string message;
dpp::webhook webhook;
};
typedef std::variant<translated_direct_message, translated_guild_message> translated_message;
class submit_queue {
public:
void add(const translated_message &message);