Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js'); //połączenie bota z discordem
- const client = new Discord.Client(); //to też chyba
- const Booru = require('booru'); //dostęp do wyszukiwania w booru
- const YouTube = require('youtube-node'); //dostęp do wyszukiwania w yt
- var yt = new YouTube(); //to też coś do tego
- yt.setKey('AIzaSyDH6Sqbrk7JYOEGdr0IrqkvHdDLWZL4-Co'); //to też
- const ffmpeg = require('ffmpeg'); //to do vc
- var vchannel;
- client.on("ready", ()=>{
- console.log("It's on uwu");
- });
- client.on(`guildMemberAdd`, member => {
- const channel = member.guild.channels.find(ch=>ch.id==='546306970345275397');
- if(!channel) return;
- var wiadpow = [`Hey! Welcome to our server ${member}!!!`, `Hello! Welcome ${member}!!`, `Look who's here, it's ${member}!`, `Hello there ${member}!`, `Heeeeeello ${member}!`, `Nice to see you there ${member}!!!`]
- channel.send(wiadpow[Math.floor(Math.random()*6)]);
- });
- client.on("message", (msg)=>{
- if(msg.content.toLowerCase().startsWith("hello") || msg.content.toLowerCase().startsWith("hey") || msg.content.toLowerCase().startsWith("howdy") || msg.content.toLowerCase().startsWith("hi") || msg.content.toLowerCase().startsWith("sup") || msg.content.toLowerCase().startsWith("heey") || msg.content.toLowerCase().startsWith("what's up") || msg.content.toLowerCase().startsWith("good seeing you")){
- if(msg.content.toLowerCase().includes("ruby") || msg.content.includes('<@552148708272111632>')){
- var powitania = [`Hello ${msg.author}`, `Hey ${msg.author}`, `Howdy ${msg.author}`, `Hello, how are you ${msg.author}?`, `Hi ${msg.author}`, `Sup ${msg.author}`, `What's up ${msg.author}?`, `Good seeing you ${msg.author}`];
- msg.channel.send(powitania[Math.floor(Math.random()*5)]);
- }
- }
- else if(msg.content.toLowerCase().startsWith("bye") || msg.content.toLowerCase().startsWith("bye bye") || msg.content.toLowerCase().startsWith("goodbye")){
- if(msg.content.toLowerCase().includes("ruby") || msg.content.includes('<@552148708272111632>')){
- var pozegnania = [`Goodbye ${msg.author}`, `Bye bye ${msg.author}`, `Bye ${msg.author}`, `Bye then ${msg.author}`, `Nice talking with you ${msg.author}`, `It was nice talking with you ${msg.author}`, `It was nice seeing you ${msg.author}`]
- msg.channel.send(pozegnania[Math.floor(Math.random()*7)]);
- }
- }
- else if(msg.content.toLowerCase().startsWith("goodnight")){
- if(msg.content.toLowerCase().includes("ruby") || msg.content.includes('<@552148708272111632>')){
- var noc = [`Goodnight ${msg.author}`, `Bye ${msg.author}, see you tomorrow!`, `Ahh, goodnight then! Bye~ ${msg.author}`, `Sleep well ${msg.author}!`]
- msg.channel.send(noc[Math.floor(Math.random()*4)]);
- }
- }
- else if(msg.content.includes("413")){
- msg.channel.send("https://i.imgur.com/zppP0Jo.png");
- }
- else if(msg.content.includes('<@552148708272111632>')){
- var ping = ["Always here for you", "Yes?", "What now?", "Yes? Need anything?", "Yeeees?", "Go make 'Ping mods 19 times in a row challenge', not 'Ping bot because why not' >:|", "If you need any help, mods are here to help!","If you need any help, admins are here to help!", "What is it?", "..."]
- msg.channel.send(ping[Math.floor(Math.random()*10)]);
- }
- else if(msg.content.startsWith("rj!")){
- if(msg.content.startsWith("rj!ytsearch")){
- var video = msg.content.split(" ");
- video.shift();
- var search = " ";
- for(var i =0; i < video.length; i++){
- search += video[i];
- search += " ";
- }
- yt.search(search, 1, (error, result) => {
- if (error) {
- msg.channel.send("Sorry, something went wrong..");
- console.log(error);
- }
- else {
- msg.channel.send(`The video you searched for!: http://youtu.be/${result.items[0].id.videoId}`);
- }
- });
- }
- else if(msg.content.startsWith("rj!safeboorusearch")){
- var tagi = msg.content.split(" ");
- tagi.shift();
- Booru.search("safebooru", tagi, {limit: 5, random: true})
- .then(images => {
- var finished_string = "";
- for(var i = 0; i < images.length; i++) {
- finished_string += images[i].fileUrl;
- finished_string += " ";
- }
- msg.channel.send(`The images you searched for ;3 : ${ finished_string }`);
- })
- .catch(err => {
- console.log(err);
- })
- }
- else if(msg.content.startsWith("rj!furryboorusearch")){
- var tagi = msg.content.split(" ");
- tagi.shift();
- Booru.search("furrybooru", tagi, {limit: 5, random: true})
- .then(images => {
- var finished_string = "";
- for(var i = 0; i < images.length; i++) {
- finished_string += images[i].fileUrl;
- finished_string += " ";
- }
- msg.channel.send(`OwO wat diz? : ${ finished_string }`);
- })
- .catch(err => {
- console.log(err);
- })
- }
- else if(msg.content.startsWith("rj!konansearch")){
- var tagi = msg.content.split(" ");
- tagi.shift();
- Booru.search("konan", tagi, {limit: 5, random: true})
- .then(images => {
- var finished_string = "";
- for(var i = 0; i < images.length; i++) {
- finished_string += images[i].fileUrl;
- finished_string += " ";
- }
- msg.channel.send(`The images you searched for uwu: ${ finished_string }`);
- })
- .catch(err => {
- console.log(err);
- })
- }
- else if(msg.content.startsWith("rj!list")){
- msg.channel.send("Servers I'm on:")
- client.guilds.forEach((guild) => {
- msg.channel.send(" - " + guild.name)
- })
- }
- else if(msg.content.startsWith("rj!join")){
- var kanal = msg.content.split(" ");
- kanal.shift();
- var nic = "";
- for(var i =0; i < kanal.length; i++){
- nic += kanal[i];
- }
- vchannel = msg.guild.channels.find(ch => ch.name == nic);
- if(!vchannel) return msg.channel.send("There's no channel like that :(");
- vchannel.join().then(connection =>{
- console.log("Succesfully connected")
- msg.channel.send("Connected! :D")
- })
- .catch(err => {
- console.error(err);
- })
- }
- else if(msg.content.startsWith("rj!leave")){
- if(!vchannel)msg.channel.send("I'm not connected to a channel! :(");
- vchannel.leave();
- vchannel = 0;
- console.log("Succesfully left")
- msg.channel.send("Left!")
- .catch(err =>{
- console.error(err);
- })
- }
- else if(msg.content.startsWith("rj!kick")){
- const user = msg.mentions.users.first();
- if (user){
- const member = msg.guild.member(user);
- if(member){
- member.kick(`Kicked.`).then(()=>{
- msg.reply(` ${user.tag} was succesfully kicked! >:D`);
- })
- .catch(err=>{
- msg.reply(`I can't kick that user :pensive:`);
- console.error(err);
- })
- }
- else{
- msg.reply(`That user is not here!`);
- }
- }
- else{
- msg.reply(`you haven't mentioned anyone! :|`);
- }
- }
- else if(msg.content.startsWith("rj!ban")){
- const user = msg.mentions.users.first();
- if(user){
- const member = msg.guild.member(user);
- if(member){
- member.ban({
- reason: 'J U S T I C E' })
- .then(()=>{
- msg.reply(` you just smashed ${user.tag} with banhammer! >:D`);
- })
- .catch(err=>{
- msg.reply(`I can't ban that user :pensive:`);
- console.error(err);
- })
- }
- else{
- msg.reply(`That user is not here!`);
- }
- }
- else{
- msg.reply(`you haven't mentioned anyone :|`);
- }
- }
- else if(msg.content.startsWith("rj!help")){
- msg.channel.send("Info!: \n \n I respond to every hi, goodnight, goodbye, and ping! uwu (but please don't ping me too many times >:|) \n \n You can search for really great pics! Here's the list of Booru's: \n \n :black_small_square: Safebooru - use command ```rj!safeboorusearch``` [enter tags after command, separate them with space] \n \n :black_small_square: Furrybooru (this is nsfw bot) - use command ```rj!furryboorusearch``` [enter tags after command, separate them with space] \n \n :black_small_square: Konachan (sometimes drops nsfw)- use command ```rj!konansearch``` [enter tags after command, separate them with space] \n \n You can also search for videos on YouTube using command ```rj!ytsearch``` [enter the name of video after command] \n \n I can ban and kick members, so beware of banhammer >:D \n \n If I don't know a command, don't worry, I'll tell you!");
- }
- else{
- msg.channel.send("I don't know that command. Sorry :pensive:");
- }
- };
- })
- client.login("NTUyMTQ4NzA4MjcyMTExNjMy.D17Utg.B1JOoh5ntyagRpDZz6za2nKsD3A");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement