feat(funbox): add instant messaging (@fehmer) (#5850)

Thanks
This commit is contained in:
Christian Fehmer 2024-09-05 17:36:10 +02:00 committed by GitHub
parent b8ca187ab3
commit 77c1e8e298
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 0 deletions

View file

@ -354,6 +354,13 @@ const FunboxList: MonkeyTypes.FunboxMetadata[] = [
frontendFunctions: ["alterText"],
name: "ddoouubblleedd",
},
{
canGetPb: false,
difficultyLevel: 1,
properties: ["changesCapitalisation"],
frontendFunctions: ["alterText"],
name: "instant_messaging",
},
];
export default FunboxList;

View file

@ -273,6 +273,11 @@ const list: MonkeyTypes.FunboxMetadata[] = [
info: "TTyyppee eevveerryytthhiinngg ttwwiiccee..",
properties: ["noLigatures"],
},
{
name: "instant_messaging",
info: "Who needs shift anyway?",
properties: ["changesCapitalisation"],
},
];
export function getAll(): MonkeyTypes.FunboxMetadata[] {

View file

@ -523,6 +523,16 @@ FunboxList.setFunboxFunctions("ddoouubblleedd", {
},
});
FunboxList.setFunboxFunctions("instant_messaging", {
alterText(word: string): string {
return word
.toLowerCase()
.replace(/[.!?]$/g, "\n") //replace .?! with enter
.replace(/[().'"]/g, "") //remove special characters
.replace(/\n+/g, "\n"); //make sure there is only one enter
},
});
export function toggleScript(...params: string[]): void {
FunboxList.get(Config.funbox).forEach((funbox) => {
if (funbox.functions?.toggleScript) funbox.functions.toggleScript(params);

View file

@ -195,5 +195,10 @@
"name": "ddoouubblleedd",
"info": "TTyyppee eevveerryytthhiinngg ttwwiiccee..",
"canGetPb": true
},
{
"name": "instant_messaging",
"info": "Who needs shift anyway?",
"canGetPb": false
}
]