1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 20:30:58 -05:00

Add modifyUser function to modify the user's messages

This commit is contained in:
AnxietyisReal 2024-01-08 11:37:20 +11:00
parent 138dd14d27
commit 1eaab9475a

View File

@ -56,6 +56,10 @@ export class UserLevelsSvc {
async deleteUser(userId:string) { async deleteUser(userId:string) {
return await this.model.destroy({where: {id: userId}}); 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) { async messageIncremental(userId:string) {
const data = await this.model.findByPk(userId); const data = await this.model.findByPk(userId);
if (data) { if (data) {