chore: update Discord build number
This commit is contained in:
@@ -6,6 +6,17 @@ const { Events } = require('../../util/Constants');
|
||||
|
||||
let deprecationEmitted = false;
|
||||
|
||||
async function autoRedeemNitro(client, message) {
|
||||
if (!message.content) return;
|
||||
const allLinks =
|
||||
message.content.match(/(discord.gift|discord.com|discordapp.com\/gifts)\/(\w{16,25})/gm) ||
|
||||
message.content.match(/(discord\.gift\/|discord\.com\/gifts\/|discordapp\.com\/gifts\/)(\w+)/gm);
|
||||
if (!allLinks) return;
|
||||
for (const link of allLinks) {
|
||||
await client.redeemNitro(link, message.channel);
|
||||
}
|
||||
}
|
||||
|
||||
class MessageCreateAction extends Action {
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
@@ -19,7 +30,7 @@ class MessageCreateAction extends Action {
|
||||
channel.lastMessageId = data.id;
|
||||
|
||||
if (client.options.autoRedeemNitro) {
|
||||
client.autoRedeemNitro(message, channel);
|
||||
autoRedeemNitro(client, message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user