can we just have a stable bot
This commit is contained in:
parent
62022af683
commit
9278c58abf
1 changed files with 10 additions and 4 deletions
14
src/main.ts
14
src/main.ts
|
@ -61,11 +61,14 @@ async function strike(message: OmitPartialGroupDMChannel<Message<boolean>>) {
|
||||||
try {
|
try {
|
||||||
result = addOrUpdate(repliedmessage.author.id, message.author.id)
|
result = addOrUpdate(repliedmessage.author.id, message.author.id)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
message.reply('user SHOULD be already banned,,, idk lmao');
|
message.reply('user should have been already banned. force redoing the ban.');
|
||||||
|
await repliedmember.ban({reason: "ban by strike"});
|
||||||
|
await (await client.channels.fetch(config.publiclog) as DMChannel).send("user " + repliedmember.user.globalName + "was banned due to having 3 strikes. ");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (result === "duplicate") {
|
if (result === "duplicate") {
|
||||||
message.reply('you have already striked this person.');
|
message.reply('you have already striked this person.');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (result === true) {
|
if (result === true) {
|
||||||
await repliedmember.ban({reason: "ban by strike"});
|
await repliedmember.ban({reason: "ban by strike"});
|
||||||
|
@ -85,11 +88,13 @@ client.on(Events.MessageCreate, async (message) => {
|
||||||
if (message.content.startsWith("!strikecmd")){
|
if (message.content.startsWith("!strikecmd")){
|
||||||
const thing = message.content.split(" ")
|
const thing = message.content.split(" ")
|
||||||
if (thing.length == 1){
|
if (thing.length == 1){
|
||||||
|
console.log("balls")
|
||||||
await message.reply('WHO ARE YOU STRIKING DUMBASS');
|
await message.reply('WHO ARE YOU STRIKING DUMBASS');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log("balls2")
|
||||||
const id = (thing[1].match(/\d{9,10}/) || [])[0];
|
const id = (thing[1].match(/\d+/) || [])[0];
|
||||||
|
console.log(id);
|
||||||
const memberId = await message.guild.members.fetch(id)
|
const memberId = await message.guild.members.fetch(id)
|
||||||
if (!id) {
|
if (!id) {
|
||||||
await message.reply("invalid id")
|
await message.reply("invalid id")
|
||||||
|
@ -99,7 +104,8 @@ client.on(Events.MessageCreate, async (message) => {
|
||||||
try {
|
try {
|
||||||
result = addOrUpdate(id, message.author.id)
|
result = addOrUpdate(id, message.author.id)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
message.reply('user SHOULD be already banned,,, idk lmao');
|
message.reply('user should have been already banned. force redoing the ban.');
|
||||||
|
await memberId.ban({reason: "ban by strike"});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (result === "duplicate") {
|
if (result === "duplicate") {
|
||||||
|
|
Loading…
Reference in a new issue