1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-09-29 08:20:59 -04:00

Add modifyUser function to modify the user's messages

This commit is contained in:
toast-ts 2024-01-08 11:37:20 +11:00
parent 13be00acd3
commit 0b9d3b89a7

View File

@ -56,6 +56,10 @@ export class UserLevelsSvc {
async deleteUser(userId:string) {
return await this.model.destroy({where: {id: userId}});
}
async modifyUser(userId:string, updatedMessages:number) {
await this.model.update({messages: updatedMessages}, {where: {id: userId}});
return (await this.model.findByPk(userId)).dataValues;
}
async messageIncremental(userId:string) {
const data = await this.model.findByPk(userId);
if (data) {