I know you dont support this package but im just wondering why it is spaming when i do a api call? #8922
-
Beta Was this translation helpful? Give feedback.
Answered by
Syjalo
Dec 12, 2022
Replies: 3 comments
-
Any ideas why it would be spamming when my other commands don't? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Heres the Code I was doing const { Client, MessageEmbed } = require('discord.js');
const Canvas = require('canvas');
const config = require("./config.json");
// Create an instance of a Discord client
const client = new Client();
const sbt = "**test "
const dnd = "dnd"
const moment = require('moment');
const status = require('mc-server-stats')
const superagent = require('superagent');
const sf = require("snekfetch");
/**
* The ready event is vital, it means that only _after_ this will your bot start reacting to information
* received from Discord
*/
client.on("ready", () => {
console.log(client.user.username + sbt+ " Online!");
console.log(`Online and ready to serve ${client.guilds.cache.size} servers.`);
client.user.setActivity("New Season Dec 14th", { type: 'STREAMING',url: "https://twitch.tv/Twitch"});
});
client.on("message", async message => {
if (message.content === "!meow") return;
const { body } = await superagent
.get("http://aws.random.cat/meow");
message.channel.send(body.file);
})
client.login("token"); |
Beta Was this translation helpful? Give feedback.
0 replies
-
Your code does exactly what you said to do. And use the Discord server for discord.js related questions. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
almostSouji
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your code does exactly what you said to do.
if (message.content === "!meow") return;
So you stop the code if the content equals to
!meow
, else send a message.And use the Discord server for discord.js related questions.