Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chat.onMessage(async (channel, user, message, msgData) => {
- if (msgData.userInfo.userId === '82008718' && /^\u0001ACTION pajaS 🚨 ALERT\u0001$/.test(message)) {
- chat.say(channel, `/me PAGLADA 👉 🚨`);
- }
- const args = message.split(" ").filter(e => e.trim());
- const prefix = /^;/.test(args[0]);
- const channelName = channel.slice(1);
- const commandName = args[0].slice(1).toLowerCase();
- const validCommand = commands[commandName];
- if (prefix && validCommand) {
- if (args[0].includes('msg')) {
- args.push(msgIdTable);
- }
- if (!commandCooldowns.has(commandName)) {
- const { response, cooldown } = await validCommand?.(channelName, user, msgData.userInfo, chat, args);
- commandCooldowns.add(commandName);
- if (response) {
- chat.say(channel, response);
- }
- await Command.increment('count', {
- where: {
- name: commandName
- }
- });
- setTimeout(() => {
- commandCooldowns.delete(commandName);
- }, cooldown * 1000);
- }
- }
- });
Advertisement
RAW Paste Data
Copied
Advertisement