Rewrite old template variable names once
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
166cedd972
commit
8832e29552
2 files changed
+13
-1
No files matched your search
@@ -29,6 +29,15 @@ export const DEFAULT_TEMPLATE = [
|
||||
'Rejoin?: {rejoinText}',
|
||||
].join('\n');
|
||||
|
||||
/**
|
||||
* The first version's variables were text; they are booleans now, with the wording under
|
||||
* `…Text`. A stored template written against the old names is rewritten once on activation, so
|
||||
* an edited format keeps rendering words rather than `true`.
|
||||
*/
|
||||
export function migrateTemplate(template: string): string {
|
||||
return template.replace(/\{(ageVerified|pcRank|questRank|inGroup|rejoin)\}/g, '{$1Text}');
|
||||
}
|
||||
|
||||
export const settings = {
|
||||
enabled: {
|
||||
kind: 'boolean',
|
||||
|
||||
Reference in new issue
Block a user