p0ryae / discord.js-meme Goto Github PK
View Code? Open in Web Editor NEWGenerate Popular memes! As good as Dank Memer bot itself ๐ธ
Home Page: http://youtube.com/DashCruft
Generate Popular memes! As good as Dank Memer bot itself ๐ธ
Home Page: http://youtube.com/DashCruft
Hey,The Bot isnt working when i open it on replit and input a secret (the token of my bot) and click on run i get it this issue
๎บง npm start
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2022-06-11T14_52_55_432Z-debug.log
exit status 1
Please help me
steps to produce:
whenever i try to run the code it says SyntaxError: Unexpected token '='
I'm using TypeScript for my bot and everything was working fine in the meme command. I used to code given in the meme command. I wanted to make a cat command with similar code so instead of adding the URL https://www.reddit.com/r/memes/random/.json
i added https://www.reddit.com/r/cats/random/.json
but I'm getting the error, TypeError: undefined is not a function
on the function got('https://www.reddit.com/r/cats/random/.json')
.
Here is the code-
module.exports = {
name: 'cat',
description: 'Sends a cat',
execute(message: any, args: any, embedFooter: string) {
const got = require('got');
const { MessageEmbed } = require('discord.js');
const embed = new MessageEmbed();
got('https://www.reddit.com/r/cats/random/.json')
.then((response: { body: string }) => {
const [list] = JSON.parse(response.body);
const [post] = list.data.children;
const permalink = post.data.permalink;
const memeUrl = `https://reddit.com${permalink}`;
const memeImage = post.data.url;
const memeTitle = post.data.title;
const memeUpvotes = post.data.ups;
const memeNumComments = post.data.num_comments;
embed.setTitle(`${memeTitle}`);
embed.setURL(`${memeUrl}`);
embed.setColor('RANDOM');
embed.setImage(memeImage);
embed.setFooter(`๐ ${memeUpvotes} ๐ฌ ${memeNumComments}`);
message.channel.send(embed);
})
.catch(console.error);
},
};
The fs module is a Security holding package, and does nothing.
This package name is not currently in use, but was formerly occupied by another package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we'll probably give it to you if you want it.
The module can be safety removed from the dependencies.
The package.json of the module is also empty, consisting of: https://github.com/npm/security-holder/blob/76509043e0f9a021e14b71c067c177fb950b1b5c/package.json#L1-L6
When I try to run my code it gives me an error that it cant read property 'name' of undefined.
I dunno how to add the intents
new bug try to fix it please! thank you!
The packages are out of date, and those versions have vulnerabilities which make npm audit
complain. The best idea is to upgrade the versions using Dependabot. I'll add a PR for enabling dependabot.
i dont know but it says Identifier 'Discord' has already been declared
The provided link to the support server no longer exists.
The bot keeps offlining every time
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.