Hi there,
Same issue for me except I was using keystroke on an application.
I simply fixed this issue by restarting my mac then adding
tell application "System Events" to activate.
That seems to do the trick.
Also I dont think the dank meemer bot team would be too happy about you running automation, it is also against Discord's inc terms of service for "self botting".
Kief