Enhance Telegram bot functionality with message management and new API methods
Updated the ITelegramApi interface to include a method for deleting messages and modified SendMessageAsync to return the message ID. Enhanced the TelegramBotService to manage message visibility by replacing previous messages with new ones, ensuring a cleaner user experience. Introduced properties in TelegramSubscriber to track the latest menu and notice message IDs. Updated related tests to verify the new message management behavior and adjusted documentation to reflect these changes.
This commit is contained in:
Generated
+1599
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,36 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TeleWave.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class TelegramBotMessages : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "MenuMessageId",
|
||||
table: "TelegramSubscribers",
|
||||
type: "bigint",
|
||||
nullable: true
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "NoticeMessageId",
|
||||
table: "TelegramSubscribers",
|
||||
type: "bigint",
|
||||
nullable: true
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(name: "MenuMessageId", table: "TelegramSubscribers");
|
||||
|
||||
migrationBuilder.DropColumn(name: "NoticeMessageId", table: "TelegramSubscribers");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -850,6 +850,12 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
b.Property<DateTimeOffset?>("LastSeenAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<long?>("MenuMessageId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("NoticeMessageId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user