mirror of https://github.com/openclaw/hermit.git
feat: add new thread say command
This commit is contained in:
parent
ec02c73aa7
commit
a43d019d48
|
|
@ -40,6 +40,13 @@ class SayModelCommand extends SayCommand {
|
|||
protected message = "Any discussion about various AI models should be taken to <#1478196963563409520>."
|
||||
}
|
||||
|
||||
class SayNewThreadCommand extends SayCommand {
|
||||
name = "new-thread"
|
||||
description = "Ask for a new thread when topics change"
|
||||
protected message = "This thread is getting very long and answers may not be accurate due to the large context. Please start a new thread for any different problems/topics. <@1457407575476801641> please sum up the answer to the initial message and the conversation briefly."
|
||||
protected useRawContent = true
|
||||
}
|
||||
|
||||
class SayStuckCommand extends SayCommand {
|
||||
name = "stuck"
|
||||
description = "Share the fastest way to get unstuck"
|
||||
|
|
@ -104,6 +111,7 @@ export default class SayRootCommand extends CommandWithSubcommands {
|
|||
contexts = [InteractionContextType.Guild, InteractionContextType.BotDM]
|
||||
subcommands = [
|
||||
new SayModelCommand(),
|
||||
new SayNewThreadCommand(),
|
||||
new SayHelpCommand(),
|
||||
new SayUserHelpCommand(),
|
||||
new SayServerFaqCommand(),
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export default abstract class SayCommand extends BaseCommand {
|
|||
ApplicationIntegrationType.UserInstall
|
||||
]
|
||||
contexts = [InteractionContextType.Guild, InteractionContextType.BotDM]
|
||||
protected useRawContent = false
|
||||
options = [
|
||||
{
|
||||
name: "user",
|
||||
|
|
@ -30,6 +31,13 @@ export default abstract class SayCommand extends BaseCommand {
|
|||
? `${this.formatMention(user.id)}${this.lowercaseFirstLetter(this.message)}`
|
||||
: this.message
|
||||
|
||||
if (this.useRawContent) {
|
||||
await interaction.reply({
|
||||
content: message
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const container = new Container([new TextDisplay(message)])
|
||||
|
||||
await interaction.reply({
|
||||
|
|
|
|||
Loading…
Reference in New Issue