#development
1 messages · Page 1652 of 1

that doesn't look fun to code on at all
why are you coding on mobile?
that's literally hell
welp, better if you regen those tokens now
save up
Go reset your youtube and discord token, right now
@vital void the image, remove the image and regen the tokens
stop deleting your messages
so, send the image again but this time redact/blur/censor the code
hello
or send in a codeblock
is there any way to actually filter by text? I might be stupid, but can i like do: array.filter(item == text)
which is better
The error was about port 3000 already being in use, so, the problem is that there's 2 web servers on the same port.
item => item === text
yes
oh so i was rigth! Thanks.
well not fully see the message avoce
it's a 2d array so you have to do it a little differently
above
let rand = Math.random();
if(rand<=(1/3)){
await message.redis.incr("cake",user.id,1);
message.replyMsg(cupcakeEmoji,", you gave one slice of cake to **"+user.username+"**! "+words[Math.floor(Math.random()*words.length)]);
}else if(rand<=(2/3)){
await message.redis.incr("cake",user.id,2);
message.replyMsg(sliceEmoji,", you gave two slices of cake to **"+user.username+"**! "+words[Math.floor(Math.random()*words.length)]);
}else{
await message.redis.incr("cake",user.id,3);
message.replyMsg(cakeEmoji,", you gave three slices of cake to **"+user.username+"**! "+words[Math.floor(Math.random()*words.length)]);
}
}``` error ```js
(node:34472) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined```
i used the word once, it kinda spammed me full
allItems = fs
.readFileSync("./keywords1.json", "utf8")
.split("\n")
.map((x) => x.split(/ +/));
for (var i = 0; i < allItems.length; i++) {
if (message.content.includes(allItems[i])) {
const data1 = fs.readFileSync("./role1.json");
const role1res = data1.slice(1,-1)
const role1 = message.guild.roles.find(r => r. name === `${role1res}`);
message.channel.send(`${role1} Come here now! Someone needs you!`)
}
}
oh holy shit ofc.
so what would be the best solution? I can put the send message outside the loop?
well... yes, of course.
You could just join the allIItems array and send it in a single message
Clearly words is undefined.
how would i go about making reaction roles work even after the bot restarts
gcp
google?
const Discord = require("discord.js")
const client = new Discord.Client()
const emotes = ["https://imgur.com/3SsZUVT.gif",
"https://imgur.com/g005tMV.gif",
"https://imgur.com/wzn0ghV.gif",
"https://imgur.com/D8SIe4Z.gif",
"https://imgur.com/xmj8XRD.gif",
"https://imgur.com/N10WUeF.gif",
"https://imgur.com/pO2smzw.gif",
"https://imgur.com/UYKs7Q1.gif",
"https://imgur.com/aBQJPvZ.gif",
"https://imgur.com/meZ0TDz.gif",
"https://imgur.com/jI8zhH6.gif",
"https://imgur.com/eP7NKy7.gif",
"https://imgur.com/a3upumA.gif",
"https://imgur.com/Lbzh24f.gif"
];
const comments = ["Ha! Deserves it.",
"c:<",
">:3",
"hahaha!"
];
module.exports = {
name:"bully",
async run(p, args) {
if(p.args.length!=1||!p.global.isUser(p.args[0])){
p.errorMsg(", Please @tag someone to use this command!",3000);
return;
}
let target = p.getMention(p.args[0]);
if(target == undefined){
p.send("**🚫 |** I couldn't find that user :c",3000);
return;
}
if(p.msg.author.id==target.id){
let text = "**"+p.msg.author.username+"**! Don't bully yourself!";
p.send(text);
return;
}
let emote = emotes[Math.trunc(Math.random()*emotes.length)];
let comment = comments[Math.trunc(Math.random()*comments.length)];
let embed = {
"color": 6315775,
"image": {
"url": emote
},
"author": {
"name" : p.msg.author.username+" bullies "+target.username+"! "+comment,
"url":emote,
"icon_url": p.msg.author.avatarURL
}
};
p.send({embed});
p.quest("emoteTo");
p.quest("emoteBy",1,target);
}
}
``` the error is `(node:25208) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined` How can i make it defined
the reject prepaid credit card.......
Niw code worked and bot online but still doesn't responds on commands?
allItems1 = fs
.readFileSync("./keywords1.json", "utf8")
.split("\n")
.map((x) => x.split(/ +/));
for (var i = 0; i < allItems1.length; i++) {
if (message.content.includes(allItems1[i])) {
const data1 = fs.readFileSync("./role1.json");
const role1res = data1.slice(1,-1)
const role1 = message.guild.roles.find(r => r. name === `${role1res}`);
message.channel.send(`${role1} Come here now! Someone needs you!`)
}
}```okay so i have a question. I tried stopping the loop after the message.channel.send by using break;. However, it still spammed the message like a ton of times.
without stopping the loop
There's no break in your code
why not just .find()?
const Discord = require("discord.js")
const client = new Discord.Client()
const emotes = ["https://imgur.com/3SsZUVT.gif",
"https://imgur.com/g005tMV.gif",
"https://imgur.com/wzn0ghV.gif",
"https://imgur.com/D8SIe4Z.gif",
"https://imgur.com/xmj8XRD.gif",
"https://imgur.com/N10WUeF.gif",
"https://imgur.com/pO2smzw.gif",
"https://imgur.com/UYKs7Q1.gif",
"https://imgur.com/aBQJPvZ.gif",
"https://imgur.com/meZ0TDz.gif",
"https://imgur.com/jI8zhH6.gif",
"https://imgur.com/eP7NKy7.gif",
"https://imgur.com/a3upumA.gif",
"https://imgur.com/Lbzh24f.gif"
];
const comments = ["Ha! Deserves it.",
"c:<",
">:3",
"hahaha!"
];
module.exports = {
name:"bully",
async run(p, args) {
if(p.args.length!=1||!p.global.isUser(p.args[0])){
p.errorMsg(", Please @tag someone to use this command!",3000);
return;
}
let target = p.getMention(p.args[0]);
if(target == undefined){
p.send("**🚫 |** I couldn't find that user :c",3000);
return;
}
if(p.msg.author.id==target.id){
let text = "**"+p.msg.author.username+"**! Don't bully yourself!";
p.send(text);
return;
}
let emote = emotes[Math.trunc(Math.random()*emotes.length)];
let comment = comments[Math.trunc(Math.random()*comments.length)];
let embed = {
"color": 6315775,
"image": {
"url": emote
},
"author": {
"name" : p.msg.author.username+" bullies "+target.username+"! "+comment,
"url":emote,
"icon_url": p.msg.author.avatarURL
}
};
p.send({embed});
p.quest("emoteTo");
p.quest("emoteBy",1,target);
}
}
``` the error is `(node:25208) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined` How can i make it
you have length multiple time there. which one is breaking?
never mind i already found out how to break it
i found the problem its this pert in the code that gives a error js if(p.args.length!=1||!p.global.isUser(p.args[0])){ p.errorMsg(", Please @tag someone to use this command!",3000); return; }
Well, do you know the difference between p.args and args?
because I feel you need the latter...
lol
ctx is also a readonly property so there's no way I'm changing it's value somewhere...
This is so stupid... I had a file named Context, but then I moved it in a folder, but the .js file of Context stayed and so it's getting the class from the old js file
how come i cant download brain.js-
guys, my bot can play music but if someone tries to play another song when the 1st one has finished, the bot has got to leave the channel and re-enter
hi so how can i start my react.js when i run node .? like i dont want to open another instance and run npm start
ping me if you know how
i mean, why do you want that exactly?
react has several commands needed for development and deployment
so you really should be using their explicit identifiers
so like
i need x2 terminals to run node . (for express) and npm start (for react). i just want x1 terminal and run node . which also runs the react app
running both backend and frontend on same terminal kekw
yes
that's crazy yk
But why, the dev server already does everything needed to develop the app
if you're deploying it in production you shouldnt even be using npm start
or using the dev server at all for that matter
or is there a way to run my express app and react app by running npm start
i really dont get what you're trying to achieve by doing this though
why cant you just.... have two terminals open
anyone know how to download brain.js without getting an error?
Well, I was told you're going to use this method and it's okay, apply it here.
let arreglo = [{
item: "Hot do",
lot: 1881
},
{
item: "Hot d",
lot: 28
},
{
item: "Hot ",
lot: 28282
},
{
item: "Ho",
lot: 882
},]
Math.max.apply(Math, arreglo.map(function(o) { return o.lot; }))
But now I want to get the "item" property through that number, but I don't like
What are you trying to do
does anyone know how to turn off certain rules with ts-standard? i tried .eslintrc, adding it to package.json, adding it to tsconfig.json, nothing seems to work
it being
"rules": {
"@typescript-eslint/strict-boolean-expressions": "off"
}```
That should be in the rules object inside your .eslintrc file
In the README it says that it looks for a tsconfig.eslint.json file
maybe put it in there
Though it says that it should also work with tsconfig.json
when i do that it scraps the tsconfig.json it seems
when i put it in the tsconfig.json it doesn't work
Hmmmm
hi berry
Try
"ts-standard": {
rules: {
"@typescript-eslint/strict-boolean-expressions": "off"
}
}
Inside the tsconfig file
np
const Discord = require("discord.js")
module.exports = {
name: "test",
run(message) {
var embed1 = new Discord.MessageEmbed()
.setColor('RED')
.setDescription('Test1')
var embed2 = new Discord.MessageEmbed()
.setColor('BLUE')
.setDescription('Test2')
var embed3 = new Discord.MessageEmbed()
.setColor('GREEN')
.setDescription('Test3')
var pages = [
embed1,
embed2,
embed3
];
var author = message.author;
message.channel.send(pages[0]).then( async message => {
await message.react('◀️');
await message.react('▶️');
var collector = message.createReactionCollector(
// only collect left and right arrow reactions from the message author
(reaction, user) => ['◀️', '▶️'].includes(reaction.emoji.name) && user.id === author.id,
// time out after a minute
{ time: 60000 }
)
let currentIndex = 0
collector.on('collect', reaction => {
reaction.emoji.name === '◀️' ? currentIndex -= 1 : currentIndex += 1;
if (currentIndex < 0) {
currentIndex += 1;
}
if (currentIndex + 1 > pages.length) {
currentIndex -= 1;
}
// edit message with new embed
message.edit(pages[currentIndex]);
})
})
}
};``` im working on this embed pages but i want the reactions to reset again because when i click at one reaction it doest remove it at the same time if you know what i mean
looks like you can't change the rules
im pretty sure that's saying the rules that're in the project already
Isn't the one you want to turn off included in the package?
ye
help
eror what?
Hi, I'm using discord.js, and I was wondering if there is a way to get an array of all the user ids of every user in a certain guild.
you'd need to cache or fetch all members of the guild
and then you can map them by their id
?
Would it be message.guild.members.cache.fetch?
helpp
without cache, fetch is not a cache operation
it's a promise so await the method and make sure you have the guild members intent
ok
that should return a collection of guild members for that guild
yes help me
Could I do something like this?
const difarr = [];
await message.guild.members.fetch.forEach(member => {
difarr.push(member.user.id);
});
console.log(difarr);
I have that same problem
and you don't need to loop through it, you can use <collection>.map()
bende türküm
nasıl çözcez :(
glitchtenmi yapıyon kanka
evet
english only channel
ok
hi nice mega weeb 02
hi
Error: Could not locate the bindings file. Tried:
help
did you tried google
we will rebuild the boat qw
Error: Could not locate the bindings file. Tried:
help meee
rebuild the boat 🤔
@flat pelican @unkempt ocean can you check log for this channel
Are you so clever
I saw you wrote "kafanizi sikim"
where is your code?
oh no, i am supposed to do something else
will help you next time
const Discord = require("discord.js")
module.exports = {
name: "test",
run(message) {
var embed1 = new Discord.MessageEmbed()
.setColor('RED')
.setDescription('Test1')
var embed2 = new Discord.MessageEmbed()
.setColor('BLUE')
.setDescription('Test2')
var embed3 = new Discord.MessageEmbed()
.setColor('GREEN')
.setDescription('Test3')
var pages = [
embed1,
embed2,
embed3
];
var author = message.author;
message.channel.send(pages[0]).then( async message => {
await message.react('◀️');
await message.react('▶️');
var collector = message.createReactionCollector(
// only collect left and right arrow reactions from the message author
(reaction, user) => ['◀️', '▶️'].includes(reaction.emoji.name) && user.id === author.id,
// time out after a minute
{ time: 60000 }
)
let currentIndex = 0
collector.on('collect', reaction => {
reaction.emoji.name === '◀️' ? currentIndex -= 1 : currentIndex += 1;
if (currentIndex < 0) {
currentIndex += 1;
}
if (currentIndex + 1 > pages.length) {
currentIndex -= 1;
}
// edit message with new embed
message.edit(pages[currentIndex]);
})
})
}
};``` im working on this embed pages but i want the reactions to be removed after i enter a new page how do i do that
Because I know turkish 🤡 you can't insult someone because they didn't help you
boyfriend i didn't insult
yeah i see
why did you call him boyfriend
Lets wait for turkish mods
sure
@exotic galleon please use English in this channel, also stop using slurs
okey ❤️
cough
Saying male colleague sounds me wrong?
[DEBUG/SHARD] Shard 0 connected to Discord's Gateway
[DEBUG/SHARD] Shard 1 connected to Discord's Gateway
(node:45) UnhandledPromiseRejectionWarning: Error [SHARDING_IN_PROCESS]: Shards are still being spawned.
at ShardingManager._performOnShards (/home/container/node_modules/discord.js/src/sharding/ShardingManager.js:258:75)
at ShardingManager.fetchClientValues (/home/container/node_modules/discord.js/src/sharding/ShardingManager.js:245:17)
at Shard._handleMessage (/home/container/node_modules/discord.js/src/sharding/Shard.js:338:22)
at ChildProcess.emit (events.js:315:20)
at emit (internal/child_process.js:903:12)
at processTicksAndRejections (internal/process/task_queues.js:81:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:45) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:45) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[DEBUG/SHARD] Shard 2 connected to Discord's Gateway
How can I fix this error on d.js
you're trying to use fetchClientValues() while your shards are still spawning
I am not doing that any where
But is there a Fix I can do
aAhh I think its this
How to fix it?
try setting up autoposter after all shards are ready (although I'm sure autoposter already checks for that before trying to post stats)
hmm then I dont see where the error is ...
require("dotenv").config(), should I put this in every file or is the index.js file just enough.
index.js file
Aight.
you're lucky erwin isn't here
lol
env = require("dotenv");
npm i -y dotenv
npm i dotenv
?
Thanks.
How long will take to my bot be added into top. Gg
Np bro
İs PC
@feral aspen Bro
You bots token generate
server.js
client.login(process.env.token);
clone folder
.env
new app
token=bot-token
and
npm i dotenv
bruh

I know that, but I just asked if I require it once and not in every single file! 👀
what you bot secret id
//Shard Logs
ShardingManager.on("shardCreate", shard => {
shard.on("ready", () => {
console.log(`[DEBUG/SHARD] Shard ${shard.id} connected to Discord's Gateway`)
embed.setColor(`#2ecc71`)
embed.setDescription(`Shard \`${shard.id}\` connected`)
botshards.send(embed)
});
shard.on("reconnecting", () => {
console.log(`[DEBUG/SHARD] Shard ${shard.id} reconnecting to Discord's Gateway`)
embed.setColor(`#e5c55e`)
embed.setDescription(`Shard \`${shard.id}\` reconnecting`)
botshards.send(embed)
shard.on("disconnect", () => {
console.log(`[DEBUG/SHARD] Shard ${shard.id} disconnect form Discord's Gateway`)
embed.setColor(`#ff7e57`)
embed.setDescription(`Shard \`${shard.id}\` disconnect`)
botshards.send(embed)
});
});
});
Will these events be Heard?
events in events, why?
hm
ShardingManager doest have them ..

My bot is not completely on and is not completed just some small features should I remove it?
no, no, shard has it
Shard = Speed Bot
never mind, it's your indentation
Will it though?
Or have different events per each?
if it's not always on then it's not a good idea to have it public
probably will, but it'll re-create those events everytime a shard is created
so different events?
so you'll have N * 3 listeners
advanced bot = shard 15
??
Tysm I will launch it later its currently in Dev.
shard ms
so different events?
idk how d.js handles it, but there's probably a way to do it globally instead of per-shard
give the docs a read to see if there's a better way
const Discord = require("discord.js")
module.exports = {
name: "test",
run(message) {
var embed1 = new Discord.MessageEmbed()
.setColor('RED')
.setDescription('Test1')
var embed2 = new Discord.MessageEmbed()
.setColor('BLUE')
.setDescription('Test2')
var embed3 = new Discord.MessageEmbed()
.setColor('GREEN')
.setDescription('Test3')
var pages = [
embed1,
embed2,
embed3
];
var author = message.author;
message.channel.send(pages[0]).then( async message => {
await message.react('◀️');
await message.react('▶️');
var collector = message.createReactionCollector(
// only collect left and right arrow reactions from the message author
(reaction, user) => ['◀️', '▶️'].includes(reaction.emoji.name) && user.id === author.id,
// time out after a minute
{ time: 60000 }
)
let currentIndex = 0
collector.on('collect', reaction => {
reaction.emoji.name === '◀️' ? currentIndex -= 1 : currentIndex += 1;
if (currentIndex < 0) {
currentIndex += 1;
}
if (currentIndex + 1 > pages.length) {
currentIndex -= 1;
}
// edit message with new embed
message.edit(pages[currentIndex]);
})
})
}
};``` im working on these embed pages but i want the reactions to be removed after i enter a new page can someome maybe tell me how do i do that
first of all: forget that var exists
it's bad, don't use it
do you want all reactions to be removed or just the clicked one?
@dusky lagoon
well both tbh hahaha
well first of all when i react the reaction stays so yeah i want that part to be removed
so that i dont have to click twice
I'm trying to like yk make a text coloured, but from what Ik, you cannot include html code in an embed, ik you could use js css etc but are those the only way to do it?
+ like this?
any lang u want, but there's not that many colors, try with other langs such as rust and go, but the colors are prolly gonna be the same
I hate it when people ask questions then disappear from the chat
mhm
ikr lol
well. multiple colours
im sorry, I don't have pings on here. Apologies
ty
how do u include html code in a message embed
i didnt know this
you cannot
ZetaBot is on and ready to serv the server !
index.js:19
Uncaught TypeError: Cannot read property 'get' of undefined
Process exited with code 1```

show your code
whatever is before the .get is undefined
but yeah, show code
ok so i have add this 2 code
bot.on("message", message => {
if (message.author.bot) return;
if (!message.content.startsWith(prefix)) return
const args = message.content.slice(prefix.length).trim().split(/ + /g)
const command = args.shift().toLowerCase();
if (command === "users") {
message.channel.send(`${message.member}, ZetaBot has a total of ${client.users.cache.size} users !`)
}
});```
```Js
bot.on("message", message => {
if (message.author.bot) return;
if (!message.content.startsWith(prefix)) return
const args = message.content.slice(prefix.length).trim().split(/ + /g)
const command = args.shift().toLowerCase();
if (command === "serveurs") {
message.channel.send(`${message.member}, ZetaBot is in ${client.guilds.cache.size} server(s) !`)
}
});```
when i remove this code
the bot is on
just send the code which shows the error
send me the full code which gave u an error in 1 embed
in my code, the bot not send any embed
index.js:19
Uncaught TypeError: Cannot read property 'get' of undefined
where is the error
send the code in like
like this
there's no get there btw
get isn't present here means you removed it, send the code which gave you an error
its those kind code
there isnt a .get in the code u sent
yeah but it won't give you an error if there isn't get
ur not showing the full thing
bot.on("guildMemberAdd", member => {
member.guild.channels.cache.get(config.greeting.channel).send(`__**[+] Bienvenue ${member} dans Zetaria | V1 Skyblock !**__ Je t'invite fortement de lire le règlement du serveur afin de ne pas être sanctionné. Nous somme désormais ${member.guild.memberCount} ! 🎉`)
member.roles.add(config.greeting.role)
});
bot.on('guildMemberRemove', (member) => {
member.guild.channels.cache.get(config.greeting.channel).send(`__**[-] ${member.user.tag} à quitté le serveur ! à cause de lui nous somme ${member.guild.memberCount} !**__ 😢`)
});```
that looks correct to me idk
same
you are using discord.js v11
depends on ur version yeah
change member.guild.channels.cache.get to member.guild.channels.get
nono don't tell them to change to old code
i use the discord.js 12.5.1
upgrade your discord.js
HOW
try running npm ls discord.js
12.5.1 is the latest im pretty sure
in the terminal he said: discord.js@12.5.1

ok are u sure thats line 19 then
that is not the line 19
then whats in line 19
bruh
the line 19 is
console.log('ZetaBot est allumé et pret à servir le serveur');```
weird
bruh
send the full index.js file
ok
if u want to
there are French texts so you can translate them
also why do u have separate message events for each command
i didn't understand
your coding is honestly a huge mess
why ?
u do
partials: ['MESSAGE', 'REACTION']
})
const client = new Discord.Client()```
this
for some reason
and u only login with the bot const
and then u use client to do this
message.channel.send(`${message.member} a un total de ${guild.memberCount} utilisateur(s)`)
})```
that doesnt matter
Yo don't threaten to shoot people because you don't speak developer 😛
and u have like 10 seperate message events too
i dont shoot them
one for each command
ok
yikes
u only need 1
So i'm curious
ReferenceError: message is not defined
at Object.execute (/home/container/commands/compare.js:69:161)
ik you can send the ReferenceError: message is not defined in a message, could you also send the 2nd line?
line 69 nice
didn't realise until you said it
what does the 161 mean?
error.stack
Would that be all of it or?
the row
yup
can i not limit it?
Line 69, column 161
ob column
flaze
hi
could you make a few commands for me?
for rose?
kinda
like what
those commands don't live up to the bot's name
idk, add some luca tags
@round cove #development message
?
Alright pal.
Oh really?
You can go to #memes-and-media or get muted so your pick.
Oh he left.
@round cove #memes-and-media message
oh lol
@round cove you have been summoned again
Yo
all good

(async () => {
let user = await client.shard.broadcastEval(`this.guilds.cache.get("675030984722350092").users.cache.get("326692518118948865").id`)
return user[0];
})()```help pls dont working
user may not be cached
you can just use fetch instead of broadcast evaling, too.
You don't need the guild in order to get a user by their ID
<Client>.guilds.fetch("guildID");
You cannot fetch a specific guild by number from what i know
you could fetch it by name maybe or ID
if you don't know the guild's ID then you cannot fetch it
^ maybe name tho(?)
no
I mean, by default all guilds are cached in memory
so you cannot fetch a guild by it's name
but you can get it from the cache
okay thanks
guild.users doesn't exist
client.commands.get(command).run(client, message, args);
TypeError: Cannot read property 'run' of undefined - Where the error
get() returns a value or undefined
check if it has() before or add a conditional chain
ex. client.commands.get(command)?.run()
are role positions ascending or decending?
I added ? and the error is resolved. Thanks
Does someone knows how to convert a string to object
like when I have:
"{title: hello, desc: descrtiption}"
as a string
do I just do .toObject() ?
[TRY AND SEE](try and see link)
does not work 
JSON.parse
assuming the string is valid json
if it's not then you'll have to parse it yourself or make it valid json
ah 💡 , hmm sometimes I wonder, why I ask, when I already new. But a lot of thx 
try to parse it then
oh hmm
looks like someone already told
yes lul
wym
like is the top role 0, 1, or the number of roles in the server?
pog indeed
lol
gotta love when berry makes a mistake with his lib
u cant im pretty sure
Is there a way i could get the guild name only with the guild id? Guild id's that i am not in
with your bot?
no i mean like is there a open tool for everyone?
hi
I made a command. My Bot Writes a "Message" every 10 seconds. but I can't stop it. How can I do "Prefix + Stop" Command?
Hey I'm using my friends discord account whilst he's on downstairs and I'm wondering how I fix this lmao (he is aware)
require('dotenv').config();
const cod_api = require('call-of-duty-api')();
module.exports = {
name: 'mpcheck'
description: 'this command shows stats for call of duty',
async execute(client, message, args, Discord){
if(!args[0]) return message.channel.send('Please enter a username');
if(!args[1]) return message.channel.send('PLease enter a platform');
let username = process.env.COD_USERNAME;
let password = process.env.COD_PASSWORD;
try{
await cod_api.login(username, password);
let data = await cod_api.MWwz('Ksavv#2278', 'battle');
console.log(data);
}catch(error){
message.channel.send('There was an error fetching this player');
throw error;
}
}
}
and then...they vanish
There's a missing comma after the name property
I'm programming on repl.it and it doesnt support discord.py rewrite it only uses the outdated one. What code editor should I use instead
repl.it isn't a code editor it's a hosting service with an IDE.
try VSCode on your own computer
please do it in breckets like this
UGH
here: \, you might need it
im having a stroke
is it possible to make a embed edit loop?? so you can make a stop motion with emoji's
so you could make something like this https://www.youtube.com/watch?v=TfS1GIr4kW4&ab_channel=Lamp
Bad Apple, 51x38 @ 10 fps, rasterized into unicode squares in Discord messages.
No video editing was done besides trimming and adding the audio.
Share this video so it gets more views than the inferior ones!
This IS api abuse, as 15 bots were used to circumvent the rate limit, so I do not recommend doing this! However, only 2,191 messages were...
using System;
namespace Hello_World
{
class Program
{
static void operate(int num1, int num2, string operation) {
if (operation == "+") {
Console.WriteLine(num1 + num2);
}
else if (operation == "-") {
Console.WriteLine(num1 - num2);
}
else if (operation == "/") {
Console.WriteLine(num1 / num2);
}
else if (operation == "*") {
Console.WriteLine(num1 * num2);
}
}
static void Main() {
Console.Write("Please input number 1: ");
string num1 = Console.ReadLine();
Console.Write("Please input operation: ");
string operation = Console.ReadLine();
Console.Write("Please input number 2: ");
string num2 = Console.ReadLine();
operate(Int32.Parse(num1), Int32.Parse(num1), operation);
}
}
}
operate(Int32.Parse(num1), Int32.Parse(num1), operation);
this line
ur 2nd arg
is bad
it's the same with the 1st arg
num1
ohw yeah ok that explains alot hahaha
Do you even read?
where did u see this?
In the embed
well isnt every nuke bot api abuse??
Read the last line, the issue is there
Yes
most nuke bots delete the channels?
That's why the owners get banned 99% the time
u talking about legit nuke bots or raid bots?
both prob
i know
@drifting wedge im able to delete whole servers with just one command
like clear/purge commands
ohhhh
but i have a server-reset command is that allowed??
Remove it then?
@dusky lagoon how?
Its a mod command
uhhh
called server-reset
its a dumb command
Like, you need to put a gargantuan delay so it's not api abuse
Something like 1 hour to finish resetting server
no it gives you a giant warning with ARE YOU SURE
Read my last msg
i have a give role to each user
i do 5 min per user
i take my time lol
name: Checks for commits and PR's
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14]
steps:
- uses: actions/checkout@master
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
registry-url: https://registry.npmjs.org/
- name: Cache NPM
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install packages
run: npm i --also=dev
- name: Compile typescript
run: npm run build
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14]
steps:
- uses: actions/checkout@master
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
registry-url: https://registry.npmjs.org/
- name: Cache NPM
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install packages
run: npm i --also=dev
- name: Lint
run: npm run lint
does anyone know why this gh action isnt working? it just doesnt run
i have fast pruge command doe?
Yeah, like, stuff like that really need to have a huge delay
purge has a bulk delete right?
Because it only takes 2 runs of that command to get your bot in shallow waters
No error?
is this a package??
what do you mean??
hahaha

var command = message.content.split(' ')[0].replace(guildConf[message.guild.id].prefix, '');
TypeError: Cannot read property 'prefix' of undefined
this line made my head go dead
guildConf[message.guild.id] returned undefined
if you're using a json db i'm about to slap you into another galaxy
It wasn't able to find a property with the guild's ID in that object
They are using json

man just testing shit before going to Mogoose
i didnt even change the file from the last build check and it just suddenly stopped doing anything on either pr or push
why not just use it right away
nice new logo
"bro why are you using a gate instead of a door for your house entrance"
"i'm just testing it i'm gonna add a door like later"
thank
but json doesn't translate to mongo
a deferent angle of view
they're similar but it isn't 1:1
cry avatar go full light theme mode?
man he changed the angle but its a huge jump for him
not like me stuck with this logo
i believe in troye sivan superiority
from 2016
Hmm
still
the thing is not the notice but the time it takes to finish the task
I'm trying to make a vote to release commands but I don't know how to start or how to do it
u mean like reactions?
{ name: 'X's test', value: ' ', inline: false },
How can I write X's test?
I can't use 'after x.

omgggg ty
" X's " will also work
pm pls
wait
so if i were to enter in a dir and run a script using my main dir would i do
start: "cd ./dashboard/dashboard-design & npm start"
right?
https://cdn.discordapp.com/attachments/815381714934300682/821186514545279006/gameleaderboard.png anyone know wut package is used for this?
nope..
any lib that can add text and insert image into another image will do tbh
most people do it custom with canvas
bitwise on bigint is so slow... sad
tell me about it
the majority of my shit is in bitint

not only for one thing
i think i got 4 or 5 different settings/data using bigint with bitwise
well
im working on a data converter/compressor/packer thing
and converting bigint to binary is sad
writing it in chunks using right shift
its like 50x slower than numbers
its still faster than using strings as intermediary tho thank god
but only up to a certain number of right shifts
if you get a really big bigint, like hundreds of characters long, its quite possible parsing it as strings will be faster lmao
its "slow" tho, right?
only if you abuse it
canvas sucks at high-res graphics
but it can still handle upwards of 4k fine
i used to generate 8000x8000 images
but it crashed sometimes
xD
idk
possibly
nope
just a github and npm
imagine not finding someone to code you a rust image API for the best performance

rust should be a lot better for image generation
by quite a margin
me neither

i can possibly wiggle my way through python if im gonna be honest
umm
but my forte is definitively typescript
node-canvas is very similar to the canvas in browsers right?
gang gang
Yes
Muted by erwin gang
bunch of people i've talked to has seen a great increase in performance with rust
i use JS without TS
ts is really cool imo
Tim is the odd ball of the bunch
tim is like the stubborn kid in class that refuses to use a calculator and takes pride into doing math with his head
yup
here we go again
erwin with detritus
how'd you know
:^)

LOL
Detritus is basically the best discord bot lib
@gritty tartan read past this #development message
i pointed some good things frmo detritus
including, basically, everything you need in terms of a lib
let me get you links
1sec
@gritty tartan http://detritusjs.com/ docs(i already spoke to cake, he'll improve them soon)
https://discord.gg/WzVumxNZjF (support server, they are always helping there, dont be afraid to ask)
https://github.com/cakedan/notsobot.ts/tree/master/src bot example with all good practices, notsobot code
erwin should be getting paid
ikr!
he isn't paid for this?
missionary for the church of detritus
Erwin sponsored by detritus
High Priest of the Detritus Church
Wouldn't be surprised
Imagine all the cash he has made with his ads
pays no taxes
idk who sent me this
Aye... let’s call the IRS
What if erwin is the one who created detritus and he's secretly doing them ads

screaming detritus

on a sunday
6am
gotta make sure to get people when they least expect, 6am seems a fitting time
you too? @earnest phoenix
did you really block them all?
Yea
how do i fix this issue? message.send().edit(...) is not a function?
and then you slap them with detritus
bruh
true instagram
LOL
i just talk about it cuz its an amazing lib and undervalued because of the clusterfuck d.js is
redis, detritus, postgres and typescript
The bottom part of the detritus's main file scared me
all of it scared me @earnest phoenix

DRPT stack
by nature
detritus redis postres typescript
there are docs
DRPT
discord-rose has a wiki
link
yea
@quartz kindle help erwin
LOL
Erwin doesn't like it
Detritus is nice, bottom part of the main file isn't tho
@gritty tartan everything is raw from the discord docs
That shit is scary man
lmao
OH MY GOD EVERYTIME I COME HERE ALL I SEE IS THAT MOTHERFUCKING SCREENSHOT
im gonna make my own lib
with blackjack and hookers
YOU WELCOME
@quartz kindle ill try it if you do 😉
thats the only real comparison i have
if i were to screenshot it now, it wouldnt be fair
since i added a shitton more stuff to it
those 2 comparisons are the same bot, everything is exactly the same
you are exactly the same
no u
no u
blackhook.js 👀
no no u
no u u
more confusing
customizable caching, good command client, why is it "not that good"?
compared to discord-rose?
where you do everything as you want
no restrictions by classes or anything
yeah but discord-rose is more into "raw" API
detritus offers you everything out of the gate and makes it a good wrapper for new users in terms of command handling by a whole MILE
don't have to deal with libs shits
rose is a skeleton, detritus is a hulk
discord-rose is not bad too, it's just that you'd have to rely on advaith for discord API docs xdxdxd
advaith?
detritus is a stable and complete library
so is discord-rose
advaith is addicted to discord
exactly, like i don't get why
oh
he should work there already when he can
i forgot to mention
but like he's young
detritus is official lib too #745874297926451210
pretty sure hes waiting for an opportunity for it
Detritus is really nice, discord-rose is also fine, detritus just has anything you need literally
ok im there now

I mean
Oh not that guy, the discord documentation addict
gonna be honest, another reason why theres not much talk in the detritus chat is that usually the users know what they're doing, so its very rare to get questions, but they answer it quickly
typescript users tend to be a bit more knowledgeable
the difference is:
d.js you can google something and find an example of 20-30 lines on how to do something
on detritus you have the same thing done more performant and by the lib with 3, but not many people ask about it cuz they check either the source or the docs
I mean a ping pong command in d-rose is like 10 lines total
what is it in detritus?
1 line
that message i sent shows you the difference in the commands loader
show
i mean in js everything can be minified to one line so that doesn't really count
just thought of something
1 statement per line
you dont lol
this is how you load all commands in detritus
No needs for FS, reading dirs, attaching stuff to commands, mapping them, making your own handler, none of that
py bad haha
its already hard enough to read
debatable
im telling you, detritus is possibly the best lib out there for js
everyone
thats what a missionary does
We all basically know erwin
xD
never
nah
I mean he won't ever respond to me so I can shit talk the lib all I want
win-win situation
Perhaps 
@earnest phoenix did you/could you make a bunch of commands for my dbl-reviewal-simulator bot?
yes
you did or will?
What commands tho
y tho
to annoy bot reviewers
Oh
Just loop through and set commands to the command handler with it sending a single response in every command @crimson vapor
not really, no

d.ts is just a type file
no @earnest phoenix real commands lol
depending on what you doing, yeah
a .d.ts just imports the types from that file
thats what the .d is for
declarations
theres no functional code in it
But that would take a long time

start with this to get a hang of it https://detritusjs.com/#command-client-sample
a lot of people like to having their interfaces inside their index.ts file
after a while it gets quite big, so i like to refactor it
aka put everything unecessary into another file
//index.ts
interface APIResponse {
name: string,
date: Date
}
let response:APIresponse = fetch('ulr')
// instead you can do
//index.ts
let response:APIResponse = fetch('url');
//index.d.ts
export interface APIResponse {
name: string,
date: Date
}
``` @gritty tartan
now your index.ts is relatively smaller
this is just 1 example, but you can see this stacking up
are all packages on npmjs legal to use?
Or like some are questionable.. like unofficial stuff you get me?
Why wouldn't they be legal, the npm registry is a place where you publicly publish something for other developers to use, so i don't see why it would be illegal

k
well there are some packages I see that webscraps website and that is usually a no no
Web scraping is fine
Hi, i am new
Well the package has no control over that so
wait what?

there are so many packages named imdb or imdb-api (not official)
they are clearly web scrapping
you can use an alternative instead, like TMDb API
Yeah thanks for that i found that and one other
im just trying to understand how it works
why is ctx not registered as a command
is it because of the python version i have or the d.py

Hello
What lang?
js
show code
php
lua
am0gus lang
Not the code, the bot does not log in. There is a problem originating from Discord.
Yeah, but what are you typing to login to discord?
Because 80% of the time it's probably a you error.
What exactly tells you that it doesn't work
Any error messages
Hope
Simply it "not logging in" doesn't tell me much, i would suspect it being a wrong token then
Then your discord bot token is wrong
Go to your developer portal and see if your bot was flagged for suspicious behaviour
Where exactly is it?
Hi
@rustic nova hii
Regenerate your token
Otherwise make dummy code and use your token on that
Like a simple login, then get your bots name
Could there be a situation like being blacklisted?
Because I tried different bots it worked.
Try some dummy code
i would be very thankfull if someone will fill out this fields
{
"load": "",
"verified": "",
"error": "",
"info": "",
"music": "",
"queue": "",
"success": "",
"music1": "",
"fun": "",
"chatbot": "",
"image": "",
"anime": "",
"nsfw": "",
"other": ""
}
dm me with filled fields
with?
5 bucks per emoji
yes this ^^
\emoji You can do it yourself \❌ You just have to get creative
tysm
wait
thats isnt what i wanted
what did you want then
because im very tired
i don't want to do that
nobody's gonna do it for you
then don't do that
ok im gonna do that by my self
i have a question about regex
can't help
im currently made it if it matches the regex, delete the world. Is there a way to whitelist the word in the regex/ignore certain words?
My regex: n(l|i|b|1|e)(gg|g|b|bb|q|qq|4)(er|3r|a|ro)
thanks
delete the world? 😳
😳
how to get webhook url
hope gave you the answer for this in #topgg-api
Press the Insert key
does anyone know this error? Discord.py
this is the code where the error appeared
but it works fine
I am just worried because of the error
there is a mistake in the code
where?








