Remove placeholders and make title truncated instead of the embed field
This commit is contained in:
@ -45,7 +45,6 @@ def create_pages(ctx) -> list[Page]:
|
||||
trigger_text = trigger_value
|
||||
|
||||
message = job.kwargs.get("message")
|
||||
message = (message[:95] + '..') if len(message) > 95 else message
|
||||
|
||||
edit_button = interactions.Button(
|
||||
label="Edit",
|
||||
@ -108,10 +107,11 @@ def create_pages(ctx) -> list[Page]:
|
||||
components.insert(1, pause_or_unpause_button)
|
||||
|
||||
# Add a page to pages list
|
||||
title = (message[:95] + '..') if len(message) > 95 else message
|
||||
pages.append(
|
||||
Page(
|
||||
embeds=embed,
|
||||
title=message,
|
||||
title=title,
|
||||
components=ActionRow(components=components), # type: ignore
|
||||
callback=callback,
|
||||
position=RowPosition.BOTTOM,
|
||||
@ -135,7 +135,6 @@ async def callback(self: Paginator, ctx: ComponentContext):
|
||||
components = [
|
||||
interactions.TextInput( # type: ignore
|
||||
style=interactions.TextStyleType.PARAGRAPH,
|
||||
placeholder=old_message,
|
||||
label="New message",
|
||||
custom_id="new_message",
|
||||
value=old_message,
|
||||
@ -150,7 +149,6 @@ async def callback(self: Paginator, ctx: ComponentContext):
|
||||
components.append(
|
||||
interactions.TextInput( # type: ignore
|
||||
style=interactions.TextStyleType.SHORT,
|
||||
placeholder=str(trigger_time),
|
||||
label="New date, Can be human readable or ISO8601",
|
||||
custom_id="new_date",
|
||||
value=str(trigger_time),
|
||||
|
@ -6,7 +6,7 @@ import interactions
|
||||
from apscheduler.jobstores.base import JobLookupError
|
||||
from apscheduler.triggers.date import DateTrigger
|
||||
from dateparser.conf import SettingValidationError
|
||||
from interactions import CommandContext, Embed, Option, OptionType
|
||||
from interactions import CommandContext, Embed, Option, OptionType, autodefer
|
||||
from interactions.ext.paginator import Paginator
|
||||
|
||||
from discord_reminder_bot.countdown import calculate
|
||||
@ -31,6 +31,7 @@ async def base_command(ctx: interactions.CommandContext):
|
||||
|
||||
|
||||
@bot.modal("edit_modal")
|
||||
@autodefer()
|
||||
async def modal_response_edit(ctx: CommandContext, *response: str):
|
||||
"""Edit a reminder.
|
||||
|
||||
@ -189,6 +190,7 @@ async def list_command(ctx: interactions.CommandContext):
|
||||
),
|
||||
],
|
||||
)
|
||||
@autodefer()
|
||||
async def command_add(
|
||||
ctx: interactions.CommandContext,
|
||||
message_reason: str,
|
||||
@ -342,6 +344,7 @@ async def command_add(
|
||||
),
|
||||
],
|
||||
)
|
||||
@autodefer()
|
||||
async def remind_cron(
|
||||
ctx: interactions.CommandContext,
|
||||
message_reason: str,
|
||||
@ -494,6 +497,7 @@ async def remind_cron(
|
||||
),
|
||||
],
|
||||
)
|
||||
@autodefer()
|
||||
async def remind_interval(
|
||||
ctx: interactions.CommandContext,
|
||||
message_reason: str,
|
||||
|
Reference in New Issue
Block a user