This commit introduces a comprehensive message translation system for the Discord bot, featuring: - Interactive language selection buttons for each translatable message. - Ephemeral translation responses visible only to the requesting user. - Robust filtering to prevent translation buttons for messages consisting solely of emojis, stickers, GIFs, or other non-translatable content. - Preservation of non-textual elements (images, video thumbnails, stickers) alongside translated text in embeds. - Full compatibility with DiscordPHP v7, addressing various API usage and error handling specifics (e.g., then , correct handling of null message properties, intent). Additionally, this commit resolves an incompatibility introduced in the shared class, ensuring that the Telegram bot's translation functionality remains fully operational by correctly parsing return values across both platforms. The following files were modified: - : Main Discord bot logic for message handling, button generation, and interaction processing. - : Adjusted to return full API response including confidence score. - : Updated environment variable loading and added new constants for service URLs and tokens. - : Updated constructor to include for absolute URL generation. - : Adjusted all calls to to correctly extract language codes from the new array return format, resolving Telegram bot's translation issues.
37 KiB
Executable File
37 KiB
Executable File