Advertisement
Profesar

Untitled

Dec 18th, 2021
89
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. chat.onMessage(async (channel, user, message, msgData) => {
  2.  
  3. if (msgData.userInfo.userId === '82008718' && /^\u0001ACTION pajaS 🚨 ALERT\u0001$/.test(message)) {
  4. chat.say(channel, `/me PAGLADA 👉 🚨`);
  5. }
  6.  
  7. const args = message.split(" ").filter(e => e.trim());
  8. const prefix = /^;/.test(args[0]);
  9. const channelName = channel.slice(1);
  10. const commandName = args[0].slice(1).toLowerCase();
  11. const validCommand = commands[commandName];
  12.  
  13. if (prefix && validCommand) {
  14. if (args[0].includes('msg')) {
  15. args.push(msgIdTable);
  16. }
  17. if (!commandCooldowns.has(commandName)) {
  18. const { response, cooldown } = await validCommand?.(channelName, user, msgData.userInfo, chat, args);
  19. commandCooldowns.add(commandName);
  20. if (response) {
  21. chat.say(channel, response);
  22. }
  23. await Command.increment('count', {
  24. where: {
  25. name: commandName
  26. }
  27. });
  28. setTimeout(() => {
  29. commandCooldowns.delete(commandName);
  30. }, cooldown * 1000);
  31. }
  32. }
  33. });
Advertisement
RAW Paste Data Copied
Advertisement