Chrome Extension - custom emote picker

I’m developing a chrome extension that sends a message every a specific period of time
and I’m using nearly the same code and I’ve got the same problem I hope you found out how to solve it if you did please share it with me