Skip to content

Commit 80835fd

Browse files
authored
Merge pull request #74 from Rodis-Infrastructure/feat/auto-threads-nickname-arg
Replace Automatic Thread Creation's $SURFACE_NAME with $NICKNAME placeholder
2 parents aa49497 + 8ad119e commit 80835fd

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/events/MessageCreate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export default class MessageCreate extends EventListener {
249249
message.startThread({
250250
name: autoThreadChannel.name
251251
.replace("$USERNAME", `@${message.author.username}`)
252-
.replace("$SURFACE_NAME", getSurfaceName(message.member))
252+
.replace("$NICKNAME", `${message.member.nickname ?? `@${message.author.username}`}`)
253253
.replace("$USER_ID", message.author.id),
254254
reason: `Auto-thread created from @${message.author.username} (${message.author.id})'s message with ID ${message.id} in #${message.channel.name}`
255255
}).catch(() => null);

src/managers/config/schema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,10 @@ const autoThreadSchema = z.object({
308308
* ## Args
309309
*
310310
* - `$USERNAME`: The username of the message author
311-
* - `$SURFACE_NAME`: The username and, if available, visible name of the message author on the current surface (e.g., their nickname in that guild)
311+
* - `$NICKNAME`: The server nickname of the message author (falls back to username if no nickname is set)
312312
* - `$USER_ID`: The ID of the message author
313313
*/
314-
name: placeholderString(["USERNAME", "SURFACE_NAME", "USER_ID"], 1, 100).default("$SURFACE_NAME's thread"),
314+
name: placeholderString(["USERNAME", "NICKNAME", "USER_ID"], 1, 100).default("$USERNAME's thread"),
315315
role_scoping: roleScopingSchema.default({})
316316
});
317317

0 commit comments

Comments
 (0)