Removing discord bot code

This commit is contained in:
2022-08-18 18:29:11 -04:00
parent 8f10a98862
commit 76ad18234a
11 changed files with 0 additions and 6027 deletions
-2
View File
@@ -1,2 +0,0 @@
node_modules
.env
-1
View File
@@ -1 +0,0 @@
worker: node index.js
-11
View File
@@ -1,11 +0,0 @@
# Discord bot example
Read this [article](https://medium.freecodecamp.org/how-to-create-a-discord-bot-under-15-minutes-fb2fd0083844) to fully understand what this is about 😃
## Getting started
1. Clone this repository
2. Run `npm install`
3. Grab a token on [Discord's developer portal](https://discordapp.com/developers/applications)
4. Create a `.env` file and add a `BOT_TOKEN` environmental variable whose value is the token above.
5. Run `npm run dev`
-18
View File
@@ -1,18 +0,0 @@
module.exports = message => {
const member = message.mentions.members.first();
if (!member) {
return message.reply(
`Who are you trying to kick? You must mention a user.`
);
}
if (!member.kickable) {
return message.reply(`I can't kick this user. Sorry!`);
}
return member
.kick()
.then(() => message.reply(`${member.user.tag} was kicked.`))
.catch(error => message.reply(`Sorry, an error occured.`));
};
-5
View File
@@ -1,5 +0,0 @@
module.exports = (client, member) => {
member.send(
`Welcome on the server! Please be aware that we won't tolerate troll, spam or harassment. Have fun 😀`
);
};
-7
View File
@@ -1,7 +0,0 @@
const kick = require("../commands/kick");
module.exports = (client, message) => {
if (message.content.startsWith("!kick")) {
return kick(message);
}
};
-3
View File
@@ -1,3 +0,0 @@
module.exports = client => {
console.log(`Logged in as ${client.user.tag}!`);
};
-17
View File
@@ -1,17 +0,0 @@
require("dotenv").config();
const Discord = require("discord.js");
const fs = require("fs");
const client = new Discord.Client();
fs.readdir("./events/", (err, files) => {
files.forEach(file => {
const eventHandler = require(`./events/${file}`);
const eventName = file.split(".")[0];
client.on(eventName, (...args) => eventHandler(client, ...args));
});
});
client.login(process.env.BOT_TOKEN);
client.channels.find(x=> x.id === "969297543538311248");
-5938
View File
File diff suppressed because it is too large Load Diff
-20
View File
@@ -1,20 +0,0 @@
{
"name": "discord-bot",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js",
"dev": "nodemon index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"discord.js": "^11.4.2",
"dotenv": "^7.0.0"
},
"devDependencies": {
"nodemon": "^1.18.11"
}
}
-5
View File
@@ -26,11 +26,6 @@
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.8" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="6.0.8" />
<!--
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0-preview.2.22153.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="7.0.0-preview.2.22153.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0-preview.2.22153.1" />
<NativeFileReference Include="e_sqlite3.o" /> -->
</ItemGroup>
<ItemGroup>