fixed bug in production

This commit is contained in:
Ale 2024-03-15 23:40:10 +01:00
parent ba6bb87b3f
commit 0a59132329

View file

@ -7,14 +7,14 @@ export default async function sendAsMember(message: Message, database: Database)
const memberRepo: MemberRepo = new MemberRepo(database); const memberRepo: MemberRepo = new MemberRepo(database);
let members: MemberModel[]; let members: MemberModel[];
await memberRepo.getAltersByUserId(message.author.id).then(result => members = result); await memberRepo.getAltersByUserId(message.author.id).then(result => members = result);
members.forEach( async alter => { members.forEach( async alter => {
const pre_prefix = alter.prefix.split("text"); const pre_prefix = alter.prefix.split("text");
if ( if (
message.content.startsWith(pre_prefix[0]) message.content.startsWith(pre_prefix[0])
&& message.content.endsWith(pre_prefix[1] && message.content.endsWith(pre_prefix[1])
&& message.content.length > 1) && message.content.length > 1
) { ){
let actualContent: string = message.content; let actualContent: string = message.content;
actualContent = actualContent.slice(pre_prefix[0].length, actualContent.length - pre_prefix[1].length) actualContent = actualContent.slice(pre_prefix[0].length, actualContent.length - pre_prefix[1].length)