removed deprecated bot directory
This commit is contained in:
parent
7a7d7ac02f
commit
3da48c4afe
5
bot/.gitignore
vendored
5
bot/.gitignore
vendored
@ -1,5 +0,0 @@
|
|||||||
node_modules
|
|
||||||
# Keep environment variables out of version control
|
|
||||||
.env
|
|
||||||
build
|
|
||||||
src/json/token.json
|
|
@ -1,25 +0,0 @@
|
|||||||
const Discord = require('discord.js');
|
|
||||||
const ms = require('ms');
|
|
||||||
|
|
||||||
module.exports.run = async function(bot, message, args){
|
|
||||||
message.delete();
|
|
||||||
//if (!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You do not have the needed permission");
|
|
||||||
let toRemove = parseInt(args[0]);
|
|
||||||
|
|
||||||
if(args[0] > 200) return message.channel.send("Invalid arguments");
|
|
||||||
|
|
||||||
setTimeout(function () {
|
|
||||||
message.channel.bulkDelete(args[0])
|
|
||||||
.then(message.channel.send(`Ich habe ${toRemove} Nachrichten gelöscht!`)
|
|
||||||
.then(msg => {
|
|
||||||
setTimeout(() => {
|
|
||||||
msg.delete();
|
|
||||||
},5000)
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}, ms("500ms"));
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports.help = {
|
|
||||||
name: "clear"
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
const { MessageEmbed } = require('discord.js');
|
|
||||||
|
|
||||||
module.exports.run = async function(bot, message, args){
|
|
||||||
message.delete();
|
|
||||||
// TODO: Figure out how to setup the helppage properly
|
|
||||||
const userEmbed = new MessageEmbed()
|
|
||||||
.setColor('#0099ff')
|
|
||||||
.setTitle('Frankenbot Help')
|
|
||||||
.setURL('https://frankenbot.io/help')
|
|
||||||
.setAuthor({ name: 'Frankenbot', iconURL: "https://cdn.slpnetwork.de/img/sys/users/frankenbot.png", url: 'https://frankenbot.io' })
|
|
||||||
.setDescription('A List of Commands for Frankenbot')
|
|
||||||
.setThumbnail("https://cdn.slpnetwork.de/img/sys/users/frankenbot.png")
|
|
||||||
.addFields(
|
|
||||||
{ name: '**Help**', value: '`!help`' },
|
|
||||||
)
|
|
||||||
.setFooter({ text: 'commands are used as !<command in lowercase>', iconURL: "https://cdn.slpnetwork.de/img/sys/users/frankenbot.png" });
|
|
||||||
|
|
||||||
message.channel.send({ embeds: [userEmbed] }).then(msg => {
|
|
||||||
setTimeout(() => {
|
|
||||||
msg.delete();
|
|
||||||
},5000);
|
|
||||||
}).catch(err => console.error(err));
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports.help = {
|
|
||||||
name: "help"
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
const { MessageEmbed } = require('discord.js');
|
|
||||||
|
|
||||||
module.exports.run = async function(bot, message, args){
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
// select settings object from existing storage
|
|
||||||
}
|
|
||||||
module.exports.help = {
|
|
||||||
name: "settings"
|
|
||||||
}
|
|
@ -1,97 +0,0 @@
|
|||||||
const { MessageAttachment } = require('discord.js');
|
|
||||||
const Canvas = require('canvas');
|
|
||||||
|
|
||||||
module.exports.run = async function(bot, message, args){
|
|
||||||
// Create a 700x250 pixel canvas and get its context
|
|
||||||
// The context will be used to modify the canvas
|
|
||||||
const canvas = Canvas.createCanvas(700, 250);
|
|
||||||
const context = canvas.getContext('2d');
|
|
||||||
const background = await Canvas.loadImage('./background.png');
|
|
||||||
const avatar = await Canvas.loadImage(message.author.displayAvatarURL({ format: 'jpg' }));
|
|
||||||
const progressWidth = 400;
|
|
||||||
let type = "image";
|
|
||||||
let xp = 300;
|
|
||||||
let max = 1500;
|
|
||||||
let perc = ((xp/max)*100)/100;
|
|
||||||
let prog = Math.floor(progressWidth*(perc-4));
|
|
||||||
let position;
|
|
||||||
let text;
|
|
||||||
let correction = 0;
|
|
||||||
|
|
||||||
if(type == "image") {
|
|
||||||
context.drawImage(background, 0, 0, canvas.width, canvas.height);
|
|
||||||
} else if(type === "solid") {
|
|
||||||
context.fillStyle = "#2d3436";
|
|
||||||
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the color of the stroke
|
|
||||||
context.strokeStyle = '#0099ff';
|
|
||||||
|
|
||||||
// Select the font size and type from one of the natively available fonts
|
|
||||||
context.font = '40px sans-serif';
|
|
||||||
|
|
||||||
// Select the style that will be used to fill the text in
|
|
||||||
context.fillStyle = '#ffffff';
|
|
||||||
|
|
||||||
// Actually fill the text with a solid color
|
|
||||||
context.fillText(message.member.displayName, canvas.width / 2.5, canvas.height / 2);
|
|
||||||
// Select the font size and type from one of the natively available fonts
|
|
||||||
text = xp + "/" + max + "xp";
|
|
||||||
context.font = '25px sans-serif';
|
|
||||||
position = (canvas.width / 1.225);
|
|
||||||
|
|
||||||
// correcting level text overflow
|
|
||||||
if(canvas.width - ((canvas.width / 1.225) + context.measureText(text).width) <= 23){
|
|
||||||
correction = (canvas.width - ((canvas.width / 1.225) + context.measureText(text).width)) - 24;
|
|
||||||
}
|
|
||||||
|
|
||||||
context.fillText(text, position + correction, canvas.height / 2);
|
|
||||||
|
|
||||||
// rank banner
|
|
||||||
// Select the font size and type from one of the natively available fonts
|
|
||||||
context.font = '30px sans-serif';
|
|
||||||
position = (canvas.width / 1.225);
|
|
||||||
text = "Level 300";
|
|
||||||
correction = 0;
|
|
||||||
// correcting level text overflow
|
|
||||||
if(canvas.width - ((canvas.width / 1.225) + context.measureText(text).width) <= 23){
|
|
||||||
correction = (canvas.width - ((canvas.width / 1.225) + context.measureText(text).width)) - 24;
|
|
||||||
}
|
|
||||||
|
|
||||||
context.fillText(text, position + correction, canvas.height / 4);
|
|
||||||
|
|
||||||
// progressbar
|
|
||||||
context.fillStyle = '#636e72';
|
|
||||||
context.fillRect(canvas.width / 2.5, canvas.height / 1.8, progressWidth, 50);
|
|
||||||
context.moveTo(220, 200);
|
|
||||||
context.fillStyle = '#2d3436';
|
|
||||||
if(prog < 0) {prog = Math.floor(progressWidth*perc);}
|
|
||||||
context.fillRect(canvas.width / 2.5 + 2, (canvas.height / 1.8) + 3, prog, 44);
|
|
||||||
|
|
||||||
// Pick up the pen
|
|
||||||
context.beginPath();
|
|
||||||
|
|
||||||
// Start the arc to form a circle
|
|
||||||
context.arc(125, 125, 100, 0, Math.PI * 2, true);
|
|
||||||
|
|
||||||
// Put the pen down
|
|
||||||
context.closePath();
|
|
||||||
|
|
||||||
// Clip off the region you drew on
|
|
||||||
context.clip();
|
|
||||||
|
|
||||||
// Move the image downwards vertically and constrain its height to 200, so that it's square
|
|
||||||
context.drawImage(avatar, 25, 25, 200, 200);
|
|
||||||
|
|
||||||
// Use the helpful Attachment class structure to process the file for you
|
|
||||||
const attachment = new MessageAttachment(canvas.toBuffer(), 'profile-image.png');
|
|
||||||
|
|
||||||
message.channel.send({
|
|
||||||
files: [attachment],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports.help = {
|
|
||||||
name: "stats"
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
# Frankenbot
|
|
Binary file not shown.
Before Width: | Height: | Size: 111 KiB |
48
bot/index.js
48
bot/index.js
@ -1,48 +0,0 @@
|
|||||||
const { Client, Intents, Collection } = require('discord.js');
|
|
||||||
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
let bot = new Client({
|
|
||||||
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
|
|
||||||
disableEveryone: true
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.commands = new Collection();
|
|
||||||
|
|
||||||
/* ===============
|
|
||||||
* File Import *
|
|
||||||
=============== */
|
|
||||||
fs.readdir('./Plugins/Commands/', (err, files) => {
|
|
||||||
if (err) console.log(err);
|
|
||||||
let jsfile = files.filter(f => f.split(".").pop() == "js")
|
|
||||||
if (jsfile.length <= 0) {
|
|
||||||
console.log("[sys-cmd]: Befehle konnten nicht gefunden werden");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
jsfile.forEach((f, i) => {
|
|
||||||
let props = require(`./Plugins/Commands/${f}`);
|
|
||||||
console.log(`[sys-cmd]: ${f} [loaded]`);
|
|
||||||
bot.commands.set(props.help.name, props);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
bot.on('messageCreate', message => {
|
|
||||||
if (message.author.bot || message.channel.type === "DM") return;
|
|
||||||
|
|
||||||
//Command Handler & Message Handler
|
|
||||||
let prefix = "!";
|
|
||||||
|
|
||||||
if (!message.content.startsWith(prefix)) return;
|
|
||||||
|
|
||||||
let messageArray = message.content.split(" ");
|
|
||||||
let cmd = messageArray[0];
|
|
||||||
let args = messageArray.slice(1);
|
|
||||||
let commandfile = bot.commands.get(cmd.slice(prefix.length));
|
|
||||||
let settings = null;
|
|
||||||
|
|
||||||
if (commandfile) commandfile.run(bot, message, args);
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.login(require("./json/token.json").token)
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"list": ["https://discord.gg","http://discord.gg","http:/discord.gg","https:/discord.gg", "https:discord.gg","http:discord.gg", "discord.gg","hgw", "@random"]
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"prefix":"!",
|
|
||||||
"yellow": "#f5ff7b",
|
|
||||||
"orange": "#ffb87b",
|
|
||||||
"red": "#ff7b7b",
|
|
||||||
"green": "#7bff9f",
|
|
||||||
"blue": "#38c2ff"
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"315176194050097152": {
|
|
||||||
"spam": "botspam",
|
|
||||||
"prefix": "?",
|
|
||||||
"greet": "welcome-leave"
|
|
||||||
},
|
|
||||||
"422056965041291264": {
|
|
||||||
"spam": "mainhall",
|
|
||||||
"prefix": "?"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"token":"NDE5NTI4OTU1MjMwNjgzMTM2.GZ9Nnx.yCZHtiAIiLULzx3Q1QB5cRGjNj6fM_EUSsYOKo"
|
|
||||||
}
|
|
1531
bot/package-lock.json
generated
1531
bot/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,29 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "Frankenbot Discord Instance",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"description": "",
|
|
||||||
"main": "sharding.js",
|
|
||||||
"scripts": {
|
|
||||||
"build": "tsc",
|
|
||||||
"start": "node build/sharding.js",
|
|
||||||
"dev": "concurrently \"tsc -w\" \"nodemon build/sharding.js\""
|
|
||||||
},
|
|
||||||
"author": "Steev",
|
|
||||||
"repository": {
|
|
||||||
"type":"git",
|
|
||||||
"url": ""
|
|
||||||
},
|
|
||||||
"license": {
|
|
||||||
"type": "frankenbot-license",
|
|
||||||
"url": "https://path-to.license"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"-": "^0.0.1",
|
|
||||||
"@prisma/client": "^3.12.0",
|
|
||||||
"canvas": "^2.9.3",
|
|
||||||
"discord.js": "^13.6.0",
|
|
||||||
"g": "^2.0.1",
|
|
||||||
"moment": "^2.29.1",
|
|
||||||
"ms": "^2.1.3"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
// Include discord.js ShardingMana
|
|
||||||
const { ShardingManager } = require('discord.js');
|
|
||||||
|
|
||||||
|
|
||||||
// Create your ShardingManager instance
|
|
||||||
const manager = new ShardingManager("./index.js", {
|
|
||||||
// for ShardingManager options see:
|
|
||||||
// https://discord.js.org/#/docs/main/stable/class/ShardingManager
|
|
||||||
totalShards: "auto",
|
|
||||||
token: require("./json/token.json").token
|
|
||||||
});
|
|
||||||
|
|
||||||
// Emitted when a shard is created
|
|
||||||
manager.on("shardCreate", shard => console.log(`Shard ${shard.id} launched`));
|
|
||||||
|
|
||||||
// Spawn your shards
|
|
||||||
manager.spawn();
|
|
@ -2,14 +2,6 @@ import { createApp } from 'vue'
|
|||||||
import './style.css'
|
import './style.css'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import Login from './components/Login.vue';
|
import Login from './components/Login.vue';
|
||||||
import User from './components/user.vue';
|
|
||||||
import Dashboard from './components/Dashboard.vue';
|
|
||||||
import Logs from './components/dashboard/Logs.vue';
|
|
||||||
import Actions from './components/dashboard/actions.vue';
|
|
||||||
import Users from './components/dashboard/users.vue';
|
|
||||||
import Support from './components/dashboard/support.vue';
|
|
||||||
import Settings from './components/dashboard/settings.vue';
|
|
||||||
|
|
||||||
import Home from './components/Home.vue';
|
import Home from './components/Home.vue';
|
||||||
|
|
||||||
import { createRouter, createWebHistory } from 'vue-router'
|
import { createRouter, createWebHistory } from 'vue-router'
|
||||||
@ -19,13 +11,6 @@ const router = createRouter({
|
|||||||
history: createWebHistory(),
|
history: createWebHistory(),
|
||||||
routes: [
|
routes: [
|
||||||
{ path: '/', component: Home },
|
{ path: '/', component: Home },
|
||||||
{ path: '/dash', component: Dashboard },
|
|
||||||
{ path: '/settings', component: User },
|
|
||||||
{ path: '/dash/logs', component: Logs },
|
|
||||||
{ path: '/dash/actions', component: Actions },
|
|
||||||
{ path: '/dash/users', component: Users },
|
|
||||||
{ path: '/dash/support', component: Support },
|
|
||||||
{ path: '/dash/serversettings', component: Settings },
|
|
||||||
{ path: '/login', component: Login },
|
{ path: '/login', component: Login },
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user