Giter Site home page Giter Site logo

atilion / botneck-bot Goto Github PK

View Code? Open in Web Editor NEW
59.0 10.0 7.0 244 KB

A simple discord selfbot for BetterDiscord. Installs as a plugin

License: GNU General Public License v3.0

JavaScript 100.00%
discord discord-selfbot discord-self-bot betterdiscord betterdiscord-plugin discordapp discord-bot

botneck-bot's Introduction

Hi there

I'm AtiLion and this is my "online life" GitHub account, I use it to post things that I don't want linked back to my personal life.

 

Discord Twitter Visitors

About me

I enjoy programming in tons of different languages, and love to learn new ones. I'm also highly active online and love meeting and talking to new people. If you want to you can contact me with the information above. I'm usually open to new ideas and new challenges to get over.


AtiLion's github stats Top Langs

botneck-bot's People

Contributors

atilion avatar x3i avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

botneck-bot's Issues

When taking too long, to give a message back, clyde returns an error.

So i am working on a plugin, called cowsay, which sends the first argument, just as cowsay would return it, by using sub processes, to invoke the real cowsay installed on the system. The problem is, the callbacks, on stdout, trigger too slowly, and clyde responds with an error, as seen in the image. Image

I wanted to know, if you could implement something on the api's side, to circumvent this kind of behaviour, and give the plugin a bit more time to respond.

I had one idea, though, the message gets sent normally, and then once cowsay returns something on stdout, the message gets edited and replaced with the output.

Thanks for a response!

How do I execute commands

I have just downloaded this and am starting to play with it I am unable to run commands. When I type in -> then one of the preinstalled commands it returns an error saying the command was not specified
Screenshot 2021-01-01 210928

BotNeck fails adding/loading my module

So I just made a purge module which purges my messages. It's class name and file name (purge.botneck.js) are both the same and I can't see anything wrong in my code. I reloaded Discord and it looks like it fails to add my module and gives me an error that it couldn't load it. I'm not sure why, but anyway, here's my code in case anything is wrong:

class purge {
	constructor() {
		this.permissions = [];
		this.command = "purge";
		this.description = "This will purge the selected amount of messages";
		this.usage = "purge [number]";
	}

	execute(message, args) {
		// Init
		delete message["content"];

		// Validate number of args
		if(BotNeckAPI.getArgumentNumber(args) < 1)
			return message["embed"] = BotNeckAPI.generateError("You need at least 1 argument for this command!");
		if(isNaN(args[0]))
			return message["embed"] = BotNeckAPI.generateError("Specified argument is not a number!");
		if(Number(args[0]) < 0 || Number(args[0]) > 100)
			return message["embed"] = BotNeckAPI.generateError("Message number can't be lower than 0 and higher than 100!");
		
		// Grab the last number(args) of messages in the channel
		const fetchedMsgs = message.channel.fetchMessages({limit: args[0])});
		
		// Filter messages to the user's messages
		const userMsgs = fetchedMsgs.filter(msg => msg.author);
		
		// Get the number of deleted messages
		const deletedMsgsCount = userMsgs.array().length;
		
		// Execute
		message.channel.bulkDelete(userMsgs)
			.catch(error => BotNeckAPI.generateError(`${error}`));

		// Send embed
		message["embed"] = {
			title: "Purge",
			type: "rich",
			description: "",
			color: 0x0061ff,
			fields: [
				{
					name: "Number of purged messages",
					value: deletedMsgsCount,
				}
			]
		}
	}
}

And here's a screenshot of the errors:
image

EDIT: It was cuz of some syntax errors, oops, I'll close this issue.

Possibility of timed messages?

I have been working on a module for your bot that would send a random message at a set interval, I've got the randomized message bit working, but as to implementing a sleep function within a module, every method I attempt leads to nothing. I have a feeling I won't be able to accomplish that within your bot, but if there is a way you recommend, let me know.

Error

saying file does not exist
screenshot from 2018-03-07 03 10 29

Feature Request

I'd love to see a quote and prune/purge feature in this

Quoting will grab the contents of a message with an id?

Prune/purge with options for self and all, so you can delete the last X amount of your messages, or all user messages (would have to check if user has the permission)

Revive Maybe?

I feel like you should come back to this project, it seems VERY useful and fun to mess with from my experience the past few hours with it. I like what you've made. Maybe there could be a support discord or something so we can ask open questions about the plugin?

My purge command doesn't seem to work?

So I've made my own purging module, but when I use the command, my command message doesn't even get sent in the chat and it says this:
image
and then doesn't do absolutely anything else. If I copy one of BotNeck's module code into my purge module (and change the class and command to purge) then the command works fine (say I copied code from calc.botneck.js into my module and changed the class and command names to purge, the command would work fine and it would basically do the same thing as the calc module does, obviously), so at least it's confirmed that there's an issue in my code, but I can't see the issue:

class purge {
	constructor() {
		this.permissions = [];
		this.command = "purge";
		this.description = "Purge your own messages";
		this.usage = "purge [number]";
	}

	execute(message, args) {
		// Init
		delete message["content"];
	
		// Validate number of args
		if(BotNeckAPI.getArgumentNumber(args) < 1)
			return message["embed"] = BotNeckAPI.generateError("You need at least 1 argument for this command!");
		if(isNaN(args[0]))
			return message["embed"] = BotNeckAPI.generateError("Specified argument is not a number!");
		if(Number(args[0]) < 0 || Number(args[0]) > 100)
			return message["embed"] = BotNeckAPI.generateError("Message number can't be lower than 0 and higher than 100!");

		
		// Grab the last number(args) of messages in the channel
		const fetchedMsgs = message.channel.fetchMessages({limit: args[0]});
		
		// Filter messages to the user's messages
		const userMsgs = fetchedMsgs.filter(msg => msg.author);
		
		// Get the number of deleted messages
		const deletedMsgsCount = userMsgs.array().length;
		
		// Execute
		message.channel.bulkDelete(userMsgs)
			.catch(error => BotNeckAPI.generateError(`${error}`));
	
		// Send embed
		message["embed"] = {
			title: "Purge",
			type: "rich",
			description: "",
			color: 0x0061ff,
			fields: [
				{
					name: "Number of purged messages",
					value: deletedMsgsCount,
				}
			]
		}
	}
}

Converting command modules

While I am by no means good at coding, I still try to mess with stuff, and im trying to take a existing command module from another bot and put it into this one, I have converted a bit of the code to try to make it compatible but I cant seem to get it to work, and im wondering if anyone else has tried this or has any idea on how to get it to work, thanks.

Commad suggestions(taken from other bots that dont work)

Im just going to put the code of each command here

Coinflip:
exports.run = async (bot, message, args) => {
let random = (Math.floor(Math.random() * Math.floor(2)));
if(random === 0) {
message.channel.send('Heads!');
}
else {
message.channel.send('Tails!');
}
},

exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 0
};

exports.help = {
name: 'coinflip',
description: 'Flip a Coin',
usage: 'coinflip'
};


Wallpaper:
const Discord = require('discord.js');
const superagent = require('superagent');
const customisation = require('../customisation.json');

exports.run = async (client, message, args, tools) => {
const { body } = await superagent
.get("https://nekos.life/api/v2/img/wallpaper");

const embed = new Discord.MessageEmbed()
.setColor("#ff9900")
.setImage(body.url) 
.setFooter(`© Cryptonix X Mod Bot by ${customisation.ownername}`);
message.channel.send({embed})

};

exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 0
};

exports.help = {
name: 'wallpaper',
description: 'Anime wallpapers OwO',
usage: 'wallpaper'
};


Timer:
const Discord = module.require('discord.js');
const ms = require('ms');

module.exports.run = async (bot, message, args) => {

let Timer = args[0];
if(isNaN(Timer)) return message.reply("heh, text time huh? How about no?")
if (ms(Timer) > 2147483647) return message.reply("You dweeb how do you expect me to handle such a big number nerd!")
if(ms(Timer) < 1) return message.reply("What's the point of that?")

if(!args[0]){
return message.channel.send(":x: " + "| Please Enter a time period followed by "s or m or h"");
}

if(args[0] <= 0){
return message.channel.send(":x: " + "| Please Enter a time period followed by "s or m or h"");
}

message.channel.send(":white_check_mark: " + "| Timer Started for: " + ${ms(ms(Timer), {long: true})})

setTimeout(function(){
message.channel.send(message.author.toString() + The Timer Has FINISHED!, it lasted: ${ms(ms(Timer), {long: true})})
}, ms(Timer));
}

exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 0
};

exports.help = {
name: 'timer',
description: 'Create a timer.',
usage: 'timer'
};


Slap:
const Discord = require('discord.js');
const superagent = require('superagent');
const customisation = require('../customisation.json');

exports.run = async (client, message, args, tools) => {
if (!message.mentions.users.first()) return message.reply("You need to mention someone to slap them");
if(message.mentions.users.first().id === "242263403001937920") return message.reply('You can't hurt him you pleblord.');
if (message.mentions.users.first().id == client.user.id && message.author.id === "242263403001937920"){
const { body } = await superagent
.get("https://nekos.life/api/v2/img/slap");

  const embed = new Discord.MessageEmbed()
  .setColor("#ff9900")
  .setTitle(`No u! *slaps*${message.mentions.users.first().username}`)
  .setImage(body.url) 
  .setFooter(`© Cryptonix X Mod Bot by ${customisation.ownername}`);
  return message.channel.send({embed})
}else if (message.mentions.users.first().id == client.user.id && message.author.id !== "242263403001937920"){
  return message.channel.send("NUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU **owwie**")
}
const { body } = await superagent
.get("https://nekos.life/api/v2/img/slap");

const embed = new Discord.MessageEmbed()
.setColor("#ff9900")
.setTitle(`OwO, ${message.mentions.users.first().username} You got slapped by ${message.author.username}`)
.setImage(body.url) 
.setFooter(`© Cryptonix X Mod Bot by ${customisation.ownername}`);
message.channel.send({embed})

};

exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 0
};

exports.help = {
name: 'slap',
description: 'Slaps someone OwO',
usage: 'slap'
};


Neko:
const Discord = require('discord.js');
const superagent = require('superagent');
const customisation = require('../customisation.json');

exports.run = async (client, message, args, tools) => {
const { body } = await superagent
.get("https://nekos.life/api/neko");
link = body.neko;

const embed = new Discord.MessageEmbed()
.setColor("#ff9900")
.setTitle("Here's Your Neko OwO")
.setImage(body.neko) 
.setFooter(`© Cryptonix X Mod Bot by ${customisation.ownername}`);
message.channel.send({embed})

};

exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 0
};

exports.help = {
name: 'neko',
description: 'Sends a random Neko OwO',
usage: 'neko'
};


Say:
exports.run = (client, message) => {
let args = message.content.split(" ").slice(1);
message.delete();
if (message.content.includes("@everyone") || message.content.includes("@here")) return message.channel.send("You ain't making me Ping anyone BOI!");
message.channel.send(args.join(" ")).cleanContent;
};

exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 0
};

exports.help = {
name: "say",
description: "Makes the bot repeat your message.",
usage: "say [message]"
};


Userinfo:
const moment = require('moment');
const Discord = require('discord.js');
const customisation = require('../customisation.json');
function checkDays(date) {
let now = new Date();
let diff = now.getTime() - date.getTime();
let days = Math.floor(diff / 86400000);
return days + (days == 1 ? " day" : " days") + " ago";
};
exports.run = async (client, message, args) => {
let user = message.mentions.users.first();
let muser = message.guild.member(message.mentions.users.first());
if(!message.mentions.users.first() && args.lenth > 0){
user = message.guild.member(args[0]).user
muser = message.guild.member(args[0]);
}
if (!muser) muser = message.member;
if(!user) user = message.author;

let status = ""
if(status === null) status = "No Game"
if(muser.presence.activities[0].type == 'CUSTOM_STATUS'){
let cstatus = muser.presence.activities[0].state
if(muser.presence.activities[0].emoji) {
if(muser.presence.activities[0].emoji.animated == true){
cstatus = <a:${muser.presence.activities[0].emoji.name}:${muser.presence.activities[0].emoji.id}> ${cstatus}
}
if(muser.presence.activities[0].emoji.animated !== true){
cstatus = <:${muser.presence.activities[0].emoji.name}:${muser.presence.activities[0].emoji.id}>${cstatus}
}
}
status = Custom Status:\n${cstatus}\nApp:\n${muser.presence.activities[1].name}
}else{
status = ${muser.presence.activities[0].type.toLowerCase()}: ${muser.presence.activities[0].name}
}

const embed = new Discord.MessageEmbed();
embed.addField("Username", ${user.username}#${user.discriminator}, true)
.addField("ID", ${user.id}, true)
.setColor(3447003)
.setThumbnail(${user.avatarURL()})
.setTimestamp()
.setURL(${user.avatarURL()})
.addField('Currently', ${muser.presence.status.toUpperCase()}, true)
.addField('Game', status, true)
.addField('Joined Discord', ${moment(user.createdAt).toString().substr(0, 15)}\n(${moment(user.createdAt).fromNow()}), true)
.addField('Joined Server', ${moment(muser.joinedAt).toString().substr(0, 15)}\n(${moment(muser.joinedAt).fromNow()}), true)
.addField('Roles', ${muser.roles.cache.array()}, true)
.addField('Is Bot', ${user.bot.toString().toUpperCase()}, true)
.setFooter(© Cryptonix X Mod Bot by ${customisation.ownername});
message.channel.send({embed});
}

exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 0
};

exports.help = {
name: 'user',
description: 'Displays information about a user.',
usage: 'user <@user>'
};

Thats it for now, I dont want to get greedy with this, and I feel like I already have

Option to change prefix?

Can you please add an option to change the prefix, ive tried editing the js and its not willing to change.

Its broken lol

The plugin's broken, seeing as Discord updated the text box to a new thing that supports live formatting (cant remember the name, starts with a w lmao) but yeah basically needs a rewrite again, or correcting to check the right text box and all.

Hope it does, this was seriously one of my favourite things to play with.

Best regards,
Obey.

suggestion

maybe you could add a system where other people can use the bot if their authorized or know the prefix?

Feature request :)

So I saw that you added MAL searching, but I was wondering if you could add Anilist searching aswell. They have a open source discord bot on github that has the api and everything. Im not too good at coding so this is why im asking heh :)

Help pls

Where do i find the better discord directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.