Cyanic76 / discord-modmail

THIS IS A MIRROR. ISSUES AND PR MUST BE SUBMITTED TO CODEBERG.
https://codeberg.org/Cyanic76/discord-modmail
MIT License
77 stars 48 forks source link

Logging #19

Closed AngelIsSad closed 3 years ago

AngelIsSad commented 3 years ago

The log feature doesn't seem to work

Cyanic76 commented 3 years ago

What do you mean?

AngelIsSad commented 3 years ago

After you close a ticket or block someone, it doesnt get logged in the log channel

Cyanic76 commented 3 years ago

Is there any error? Did you give enough perms?

AngelIsSad commented 3 years ago

There are no errors and the Bot has Admin perms

Cyanic76 commented 3 years ago

Did you correctly set channel IDs in config.json?

AngelIsSad commented 3 years ago

I did

AngelIsSad commented 3 years ago

Everything works perfectly except the log

Cyanic76 commented 3 years ago

Apparently the bot was not sending any embed because there was no declared embed or anything. Should be fixed in the next commit.

Cyanic76 commented 3 years ago

There. Can you retry without setting config.showParticipants to true?

AngelIsSad commented 3 years ago

You changed the code right?

Cyanic76 commented 3 years ago

I did

AngelIsSad commented 3 years ago

There is an error saying log is not defiend

Cyanic76 commented 3 years ago

Refresh your code and try again?

AngelIsSad commented 3 years ago

I did many times

AngelIsSad commented 3 years ago

Error: Cannot read property 'forEach' of undefined

AngelIsSad commented 3 years ago

TypeError: Cannot read property 'forEach' of undefined

AngelIsSad commented 3 years ago

bot.js/line 273

Cyanic76 commented 3 years ago

There is literally nothing - did you put anything on line 273?

AngelIsSad commented 3 years ago

I have this on there

participants.forEach(p => {

AngelIsSad commented 3 years ago

Its line 237.... My bad

AngelIsSad commented 3 years ago

Still the same error TypeError: Cannot read property 'forEach' of undefined

AngelIsSad commented 3 years ago

Still doesn't work... Can i just send you my code?

Cyanic76 commented 3 years ago

Sure, go ahead

Provide the error too

AngelIsSad commented 3 years ago

Code: https://starb.in/Vr1YVE.js

Error: TypeError: Cannot read property 'forEach' of undefined Line: 315

AngelIsSad commented 3 years ago

I have modified the code abit btw

Cyanic76 commented 3 years ago

Can you remove lines 313 to 322?

AngelIsSad commented 3 years ago

It works but it doesn't send the log to the log channel. It sends the closing message

https://cdn.discordapp.com/attachments/845989262317977610/847054800649977866/unknown.png

AngelIsSad commented 3 years ago

Isn't it supposed to send the conversation between the mod and the other person or a link where you can read their convo?

Cyanic76 commented 3 years ago

I'll soon add this feature. Check your logs channel ID in your config.json file?

AngelIsSad commented 3 years ago

The log is going to the correct channel but it is sending the closeing message

Cyanic76 commented 3 years ago

the closing message that's being sent to the thread channel is here and the log is here. both are sent to the correct channels.

AngelIsSad commented 3 years ago

It sends the line 220

return client.users.cache.get(support.targetID).send(Thanks for getting in touch with us. If you wish to open a new ticket, feel free to message me.\nYour ticket #${actualticket} has been closed.)

Cyanic76 commented 3 years ago

This is sent to the user, yeah

AngelIsSad commented 3 years ago

And also sent to the log channel

AngelIsSad commented 3 years ago

Could you help me with the logs?

AngelIsSad commented 3 years ago

?

Cyanic76 commented 3 years ago

Yep, was a little busy - can you show me your code?

AngelIsSad commented 3 years ago

The bot.js?

AngelIsSad commented 3 years ago

Bot.js: https://starb.in/2KDwHI.js

Cyanic76 commented 3 years ago

There you go, it's fixed

AngelIsSad commented 3 years ago

There is 1 error with the mod role

AngelIsSad commented 3 years ago

Error

AngelIsSad commented 3 years ago

The mod role id is correct

AngelIsSad commented 3 years ago

moderator is not defined

AngelIsSad commented 3 years ago

? It takes me to the top of the ticket

Cyanic76 commented 3 years ago

Click here instead

AngelIsSad commented 3 years ago

Hey. It seems like the unblock command isn't working

AngelIsSad commented 3 years ago

And when is this out? https://github.com/Cyanic76/discord-modmail/issues/19#issuecomment-848652268

Cyanic76 commented 3 years ago

Hey. It seems like the unblock command isn't working

What errors does it gives?

AngelIsSad commented 3 years ago

It doesn't give any error in the terminal, it just sends the message You can not use that in the ticket channel even tho i have the mod role