mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 04:10:59 -05:00
Add modifyUser function to modify the user's messages
This commit is contained in:
parent
13be00acd3
commit
0b9d3b89a7
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user