#development
1 messages ยท Page 1176 of 1
const api = require('novelcovid')
const Discord = require('discord.js')
module.exports = {
name: 'today19',
description: "corona today info",
execute: async (message, args) => {
api.settings({
baseUrl: 'https://disease.sh'
})
const data = await api.all()
const COVID = new Discord.MessageEmbed()
.setTitle("COVID-19 Today's Stats")
.setAuthor(`Requested by ${message.author.username}`, `${message.author.displayAvatarURL()}`)
.setThumbnail('https://cdn.pixabay.com/photo/2020/04/29/08/24/coronavirus-5107804_1280.png')
.setColor("#ffa343")
.addFields(
{name: '**`Today\'s Cases:`**', value: data.todayCases},
{name: '**`Today\'s Deaths:`**', value: data.todayDeaths},
{name: '**`Today\'s Recoveries:`**', value: data.recovered},
)
.setFooter("Info provided by: https://disease.sh")
.setTimestamp()
message.channel.send(COVID)
}
}
my code
here
what command are you executing
like
.help
@vale garden ?
try executing (your prefix)today19
@golden pewter
is there any way i can store messages temporarily and then send the transcript to person
this is how i currently use
Hey,
I want to make if someone vote my bot on Top.gg Then he will get reward!
How can i do this?
you can use webhooks
Yes but #topgg-api
DBL offer one that returns the userid
ok
client.on("messageReactionAdd", async (reaction, user, message) => {
if (user.partial) await user.fetch();
if (reaction.partial) await reaction.fetch();
if (reaction.message.partial) await reaction.message.fetch();
if (user.bot) return;
let ticketid = await settings.get(`${reaction.message.guild.id}-ticket`);
if (!ticketid) return;
if (reaction.message.id == ticketid && reaction.emoji.name == "๐ซ") {
reaction.users.remove(user);
reaction.message.guild.channels
.create(`ticket-${user.username}`, {
permissionOverwrites: [
{
id: user.id,
allow: ["SEND_MESSAGES", "VIEW_CHANNEL"]
},
{
id: reaction.message.guild.roles.everyone,
deny: ["VIEW_CHANNEL"]
},
{
id: reaction.message.guild.roles.cache.find(
role => role.name === "Patrol"
),
allow: ["SEND_MESSAGES", "VIEW_CHANNEL"]
}
],
type: "text"
})
.then(async channel => {
channel.send(
`<@${user.id}>`,
new Discord.MessageEmbed()
.setTitle("Welcome to your ticket!")
.setDescription("Support Team will be with you shortly")
.setColor("RANDOM")
.addField(
"**Links**",
"**[Invite Me](https://discord.com/oauth2/authorize?client_id=745926398212046878&scope=bot&permissions=8) | " +
"[Support Server](https://invite.gg/blacksheep)** | "
)
);
});
}
});```
**What I wanna do?**
=> I want my bot to send a transcript to a channel called transcripts
i can do channel thingy
but how can i store messages
maybe i need to fetch messags if yes then how can i send it
fetch messages, iterate through them, add the content to some variable, then send the content of the variable to the channel
fetch messages, iterate through them, add the content to some variable, then send the content of the variable to the channel
@restive furnace how to add content to some variable do u have a link to docs
where some info on this thing is there
i tried finding
but wasn't able to
x = fetched.content
do i need to get an object from fetch
ok'
V12 <channel>.messages.fetch(id)
100 is max
Trying to get banned?
my bot is a ticket bot
probablt he is working in ticket bot tbh
so
it isnt probhidden
i wanna send transcript
Then fetch messages in a channel
Save every single message when it is sent
Nah
Bad idea that could get big depending on the issue.
There's a method for fetching x messages from a channel
something like this
message.channel.fetchMessages({ limit: 80 }).then(messages, fetched => {
let x = fetched.content
smh
It returns one argument messages
actually
x += "\n" + content
@restive furnace by conyent u mean fetched.content?
ok
message.channel.fetchMessages({ limit: 80 }).then(messages, fetched => {
let x += "\n" + fetched.content})
something like this
No
no ?
It returns messages
?
Which is a collection of all the messages
that's what i want
oh i m in the wrong server
Iterate over them and append to the string.
Iterate over them and append to the string.
@warm marsh i am not getting mwaning of lterate
why did you star that
loop over
forEach
You could
no
@carmine summit it happened for a reason, if you were doing it for the badge, stop
Fking badge... So hard to get... now they are now unobtainable
yes
The "EARLY"
quit coding
if u care so much abt badges, dont make a bot
welp if you want your bot to be blocked by discord then don't give an f about verification
anyways @warm marsh can you explain a bit more to me?
iterate over those messages and append to the string then send.
hmmm maybe let content = ""; fetchMessages().then(x => x.map(x => content += x.content + "\n"));
yeah
Would work.
ok thanks :)
but one thing
what do i get in end as messages
and how can i send it as a text file
Store as text file then send file
.then(function(messages) {
let listOfMsgs = [];
for (const m of messages) m.content && listOfMsgs.push(m.content);
message.channel.send(listOfMsgs.join("\n"));
});```
store the string of messages
let content = ""; fetchMessages().then(x => x.map(x => content += x.content + "\n")).then(function(messages) {
let listOfMsgs = [];
for (const m of messages) m.content && listOfMsgs.push(m.content);
message.channel.send(listOfMsgs.join("\n"));
});```
nono
yikes.
sorry :(
Use one or the other.
<channel>.fetchMessages({
limit: 80
})
.then(function(messages) {
let listOfMsgs = [];
for (const m of messages) m.content && listOfMsgs.push(m.content);
message.channel.send(listOfMsgs.join("\n"));
});```
Thank you
Change the send to storing that into a txt file then send the file.
But please, learn what it does.
ok
could someone help me? my code isn't fetching from subreddits properly
AFAIU You took list of messages as null
Then for every M of messages you sent it to a channel
We require to see code.
this worked for me channel.send({ files: [{ name: "test.txt", attachment: Buffer.from("text") }] });
AFAIU = as far as i undestood
do you want the code in this channel or?
i mean[]
https://hastebin.com/larudilena.js help me understand why this code is only fetching the same 3 memes over and over again and how I could fix it?
message.guild.channels.fetch(id).fetchMessages() ...
my pseudocode:
let content = "";
const messages = await fetchMessages();
messages.map(x => content += x.content + "\n"));
channel.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });```
what does buffer.from does
oh ok thanks
flazepe
yeah
you could save appending to that variable by changing content = messages.map....
then Buffer.from(content.join("\n")
would make it more uniform also as it wouldn't be added to the end of the last entry
i just saw someone used += so why not
Yeah
is guild.name something
const content = (await fetchMessages()).map(x => x.content).join("\n");
channel.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });```
Yes, it's part of the Guild object.
ok
@fierce stag why are you using Object.keys(response).length for it?
const content = await fetchMessages().then(x => x.map(y => y.content).join("\n"));
channel.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });```
@pale vessel
How u define fetch messages
fetchMessages then
i've tried so many things on that line itself, nothing is working :/
x is messages
it says me fetchMessages is not a func
it's messages#fetch()
means that's not the actual code but something you can read from
channel.messages.fetch({ limit: 2 }) works
Oh it was changed?
yeah
fetchMessages doesn't exist
if (command == "close") {
if (!message.channel.name.includes("ticket-"))
return message.channel.send("You cannot use that here!");
let channel = message.channel
const content = channel.fetch({limit: 80}).then(x => x.map(y => y.content).join("\n"));
message.author.send(`Transcript for your ticket in ${message.guild.name} Server`)
message.author.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });
message.channel.delete();
}```
@fierce stag
let image = response.data.children[Math.floor(Math.random() * (response.data.children).length].data;
Try that.
you can use https://discord.js.org/#/docs/main/stable/typedef/ChannelLogsQueryOptions instead of id
i got an error saying (node:4964) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type object
You were trying to use Object.keys(response) which is apparently only 2 long
message.author.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });
at this line
๐ซ
how to fix the second line?
if(mentionedMember.roles.find(r => r.name === "Blaues_Auge")) return message.channel.send(`${mentionedMember}```
it is http://ip:port/dblwebhook @earnest phoenix
@delicate shore so what?
it helps in telling you who voted for your bot
TypeError: Cannot read property 'roles' of undefined
@warm marsh im getting an error on let image = response.data.children[Math.floor(Math.random() * (response.data.children).length].data;
SyntaxError: missing ) after argument list
That's probably something you're missing.
message.author.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });```
My code
My error - `(node:4964) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type object`
But I'll check in-case
response.data.children[Math.floor(Math.random() * response.data.children.length)].data;
that's not for me right ?
nope
any idea why i get error
fetch(`https://api.reddit.com/r/dankmemes/top.json?sort=top&t=day&limit=800`)
.then(response => response.json())
.then(response => {
let image = response.data.children[
Math.floor(Math.random() * (response.data.children).length)
].data;
console.log(image);
});```
it works for me so idk if you're doing something else wrong?
Ah I must have deleted it before on accident.
if (command == "close") {
if (!message.channel.name.includes("ticket-"))
return message.channel.send("You cannot use that here!");
let channel = message.channel
const content = channel.fetch({limit: 80}).then(x => x.map(y => y.content).join("\n"));
message.author.send(`Transcript for your ticket in ${message.guild.name} Server`)
message.author.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });
message.channel.delete();
}```
Sublime pretty shit
npp gang
hm its sending memes now, but how do I check if its truly random?
@delicate shore await the messages
no
When I logged it before it said 100 length so it should be fine
where tho
Ihr dummen arschgesichter mit Narben im Kopf.
in content?
๐
lmao
also, it's channel.messages.fetch()
if (command == "close") {
if (!message.channel.name.includes("ticket-"))
return message.channel.send("You cannot use that here!");
let channel = message.channel
const content = await channel.messages.fetch({limit: 80}).then(x => x.map(y => y.content)).join("\n"));
message.author.send(`Transcript for your ticket in ${message.guild.name} Server`)
message.author.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });
message.channel.delete();
}```
let content = message.channel.messages.fetch({limit:80})
.then(function(messages) {
return messages.map(message => message.content && message.content);
}).join("\n");```
Wait your code for that should be fine.
join it inside .then
oh wait
can someone help me with #topgg-api
await channel.messages.fetch({limit: 80}).then(x => x.map(y => y.content).join("\n"));
ok i quit gg
oh god
Could you stop sending the same block over and over?
message.channel.messages.fetch({limit:80})
.then(function(messages) {
let content = messages.map(message => message.content && message.content).join("\n");
message.author.send(`Transcript for your ticket in ${message.guild.name} Server`);
message.author.send({ files: [{ name: "test.txt", attachment: Buffer.from(content) }] });
message.channel.delete();
});```
waw
new code
spoonfeed alert
it's not
๐
๐๏ธ
It's just refactored
i think it was fine, you just have to change this https://discordapp.com/channels/264445053596991498/272764566411149314/746617356578586625
@delicate shore
ok
it's fine
ok thanks @warm marsh it worked
it also awaits the then
the .then doesn't return a promise
flazepe getting rekted
yes but i have not defined channel
Unknown Channel
anywhere
Dude
and i am sending it to author
Maybe
no, it sent it lul
That output does
that's because the function returns void
20000 ms = 20 seconds?
yes
Yes
ok nice
Just times it by 1000
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
and @golden condor i was doing message.channel.delete() 2 times
that is why it was saying it
channel.delete why
to delete the channel when the ticket is done
becaause wht not
20 seconds is far too long
20e+3
const Discord = require("discord.js");
module.exports = {
name: "afk",
run:(client, message, args, prefix) =>{
const bot = client
if (args[0] === 'null') {
return message.reply('I set your AFK to: \`AFK\`.')};
if (message.author.bot) return;
if (message.guild.id != "721292328475557928") return;
if (message.member.roles.cache.has('746608450179563638')) {
guildMember.roles.remove('746608450179563638');
message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`)
} else {
if (message.member.roles.cache.has('746608450179563638')) {
guildMember.roles.add('746608450179563638');
message.reply(`**I set your AFK to: \`${args[0]}\`\**`)
}}
}
};
ok
what's wrong ?
@warm marsh can't believe it was such a simple fix, thankyou ๐คฆโโ๏ธ
We aren't gonna debug your code for you
what's wrong ?
also no console errors
We aren't gonna debug your code for you
@golden condor idk what's wrong
They don't have either of those roles maybe?
np unbound
what's wrong ?
Typo in line 13: Did you meanWelcome?
How do I count reactions on collector 'end'?
@pale vessel lmao, it's too early my bad
Typo in line 13: Did you mean
Welcome?
@fluid basin then what next ? ๐
TypeError: Cannot read property 'roles' of undefined

change guildMember to message.member
const Discord = require("discord.js");
module.exports = {
name: "afk",
run:(client, message, args, prefix) =>{
const bot = client
if (args[0] === 'null') {
return message.reply('I set your AFK to: \`AFK\`.')};
if (message.author.bot) return;
if (message.guild.id != "721292328475557928") return;
if (message.member.roles.cache.has('746608450179563638')) {
guildMember.roles.remove('746608450179563638');
message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`)
} else {
if (!message.member.roles.cache.has('746608450179563638')) {
guildMember.roles.add('746608450179563638');
message.reply(`**I set your AFK to: \`${args[0]}\`\**`)
}}
}
};
change
guildMembertomessage.member
k
or define it unnecessary
i'll try
How do I count reactions on collector 'end'?
Hello
Uncaught ReferenceError: guildMember is not defined
at module.run (module.js:12:8)
at main (bot.js)
Uncaught ReferenceError: guildMember is not defined
at module.run (module.js:12:8)
at main (bot.js)
@fluid basin guildMember is not a thing unless you put it to define a guild member
Beep boop I'm a code compiler
Collection#size
on a specific emoji
this is redundant
flaze you're confusing him
line 9 ?
hol up i don't see anything wrong with the code other than that
flaze is confusing, so am I
@viral iris show your current code
John Cena
const Discord = require("discord.js");
module.exports = {
name: "afk",
run:(client, message, args, prefix) =>{
const bot = client
if (args[0] === 'null') {
return message.reply('I set your AFK to: \`AFK\`.')};
if (message.author.bot) return;
if (message.guild.id != "721292328475557928") return;
if (message.member.roles.cache.has('746608450179563638')) {
message.member.roles.remove('746608450179563638');
message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`)
} else {
if (message.member.roles.cache.has('746608450179563638')) {
message.member.roles.add('746608450179563638');
message.reply(`**I set your AFK to: \`${args[0]}\`\**`)
}}
}
};
@viral iris show your current code
@pale vesselif the member don't have rolenot working
@viral iris you are developer
What is your problem?
add !
add if
it was before
@viral iris
no
@viral iris please i need help
...
or remove the whole if statement and just use else
add !
@pale vessel u told me to remove that ๐
if (message.member.roles.cache.has('746608450179563638')) {
message.member.roles.remove('746608450179563638');
message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`);
} else {
message.member.roles.add('746608450179563638');
message.reply(`**I set your AFK to: \`${args[0]}\`\**`);
}```
@sleek apex what is your problem instead of mentioning people
@warm marsh I have a music code with a YouTube link that doesn't work I want someone to help me fix it
@viral iris I have a music code with a YouTube link that doesn't work I want someone to help me fix it
Did you copy and paste this code from somewhere?
@warm marsh dbd
@sleek apex just post it here and someone will help you
?
if (args[0] === 'null') {
return message.reply('I set your AFK to: \`AFK\`.')};
why it's undefined ?
what is dbd?
lol
stop mention me
@warm marsh djs sorry
why it's undefined ?
you can useif (!args[0])
as it doesn't give you string @viral iris
You require a few things to make it play a youtube link.
if (args[0] === 'null')
@viral iris null is not a string
I'm not a professional coder so I can add that to the code you can add if invite you to code
I'm also not a professional
@warm marsh ๐
@random
@sleek apex stop force pinging, and try youtube to find a solution
๐
accept add
I'm not going to do it for you.
@sterile thicket I'm just learning JS I don't know if you can help me send me your code fix it for me
try executing (your prefix)today19
@torn ravine im suuper late but wdym
like do you mean use the command in chat
or wat
@sleek apex have you read the #rules-and-info ?
whatโs your bots prefix
you can use
if (!args[0])
@sterile thicket i did still undefined
post your current code, and explain me what you want to do with it?
const Discord = require("discord.js");
module.exports = {
name: "afk",
run:(client, message, args, prefix) =>{
const bot = client
if (!args[0] === 'null') {
return message.reply('I set your AFK to: \`AFK\`.')};
if (message.author.bot) return;
if (message.guild.id != "721292328475557928") return;
if (message.member.roles.cache.has('746608450179563638')) {
message.member.roles.remove('746608450179563638');
message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`)
} else {
message.member.roles.add('746608450179563638');
message.reply(`**I set your AFK to: \`${args[0]}\`\**`)
}
}};
...
Remove the === "null"
args[0] will return a value or undefined
never null
unless it's "null" as a string
yes
@viral iris I told you to remove string null
@golden pewter
Yes
the bot can't change owner nickname ?
no
Nope.
needs highest permission in the server
Only <Member>s that are lower than current bot perm
have.
it will never be
No one here is helping anyone
if (!message.member.roles.cache.has('746608450179563638')) {
if (!args[0]) {
return message.reply('I set your AFK to: \`AFK\`.')
message.member.roles.add('746608450179563638')}
};
what's wrong?
async run(client, message, args) I have this. If client is the first thing, message is not defined but if message is first client is not defined... can someone help? (@ me if you know)
line 4 got dark color in vsc
how is it setup in your main file @fringe axle
What you mean?
lemme see your code
The giveaway?
what's wrong?
if (!message.member.roles.cache.has('746608450179563638')) {
if (!args[0]) {
return message.reply('I set your AFK to: \`AFK\`.')
message.member.roles.add('746608450179563638')}
};
check console @viral iris
I removed the client.login of course
and itโll probably say something like โillegal return statementโ because you have it in curly brackets ({})
because of the return
this code will never get triggered
@fringe axle how are u running the code
The giveaway code?
Wrong channel for that.
ok
it's just sad to see
when people make bot with discord bot maker
And their bot comes on top of you in top.gg
please level up @fossil oxide
please level up @fossil oxide
please level up @fossil oxide
please level up @fossil oxide
please level up @fossil oxide
please level up @fossil oxide
xD
Hi Oliy, hope you will have a good day!
oliy, i hope you level up
Poor Oliy
ooof
poor oliy
the mans just wanted a level up man 
const Discord = require("discord.js");
module.exports = {
name: "afk",
run:(client, message, args, prefix) =>{
const bot = client
if (!message.member.roles.cache.has('746608450179563638')) {
if (!args[0]) {
message.reply('I set your AFK to: \`AFK\`.')
message.member.roles.add('746608450179563638')}};
if (message.author.bot) return;
if (message.guild.id != "721292328475557928") return;
if (message.member.roles.cache.has('746608450179563638')) {
message.member.roles.remove('746608450179563638');
message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`)
} else {
message.member.roles.add('746608450179563638');
message.reply(`**I set your AFK to: \`${args[0]}\`\**.`)
}
}};
could probably merge those if's btw
now when it's
-afk
send line 8 and 17
so, whats the issue here...?
add if(args[0]) { ??
i mean merging the if's you currently got
so, whats the issue here...?
@opal plank i need it if args0 is nothing like-afksend line 7
and when it -afk anything send line 18
add
if(args[0]) {??
@viral iris ??
no need for
if(a) return
if(b) return
if(c) return
do if(a || b || c) return
use operator OR
it's 2
well yeah, just recommending you to merge it
@opal plank if (a or b or c)
Did i do it right?
i guess no need
@earnest phoenix 

if args 0 is undefined its going to send undefined
you can add an inline if , if you want
if (!args[0]) {
message.reply('I set your AFK to: \`AFK\`.')
the code looks fine, not sure whats the issue with it
that works or you could use inline if
@viral iris https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator
could also use this
that works or you could use inline if
@opal plank please read the code, i have that line already
thats precisely what i've been trying to tell you this whole time
@opal plank what is it ๐
i did it
const Discord = require("discord.js");
module.exports = {
name: "afk",
run:(client, message, args, prefix) =>{
const bot = client
if (!message.member.roles.cache.has('746608450179563638')) {
if (!args[0]) {
message.reply('I set your AFK to: \`AFK\`.')
that should work fine, but then again
i was working
ssh: connect to host vpsip port 22: Connection timed out```
im trying to connect to my vps, i connected a week ago so idk whats happening
If you're sure the VPS is running, your IP is right and you have internet I would try it a few more times
Also not sure if you want your IP to be leaked here
const Discord = require("discord.js");
module.exports = {
name: "afk",
run:(client, message, args, prefix) =>{
const bot = client
if (!args[0]) {
return message.reply('I set your AFK to: \`AFK\`.')};
if (message.author.bot) return;
if (message.guild.id != "721292328475557928") return;
if (message.member.roles.cache.has('746608450179563638')) {
message.member.roles.remove('746608450179563638');
message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`)
} else {
message.member.roles.add('746608450179563638');
message.reply(`**I set your AFK to: \`${args[0]}\`\**`)
}
}
};
now if member have the role args0 not working
itโs returning because thereโs no args
so I donโt think it gets that far
I think
ya'll should start using step debugging tbh

dont assume, follow the code as its executed
what about this ?
why are you requiring discord twice
nvm
kek
you shoud likely learn js too while at it
if you arent familiar with if, i got bad news for you brother
it's almost worked
that code needs formatting
Alright let's sum this up
- Please format your code correctly so it's easy to read:
const Discord = require("discord.js");
module.exports = {
name: "afk",
run: (client, message, args, prefix) => {
const bot = client
if (!args[0]) {
return message.reply('I set your AFK to: \`AFK\`.')
};
if (message.author.bot) return;
if (message.guild.id != "721292328475557928") return;
if (message.member.roles.cache.has('746608450179563638')) {
message.member.roles.remove('746608450179563638');
message.channel.send(`**Welcome Back <@${message.author.id}>!, I removed your AFK!.**`)
} else {
message.member.roles.add('746608450179563638');
message.reply(`**I set your AFK to: \`${args[0]}\`\**`)
}
}
};
- You're defining Discord but not using it
!=accept 1 as equals of true, null as equals of false and some others (because the values are automatically casted when being compared). For Exact comparisons I would recommend to use!==
I would recommend you to learn at least the basics of JS before you continue coding
@floral creek this channel is for chatting about or help with (bot) development, please stay on topic
hlw
this is the function:
module.exports = {
secureTrans: function (secureNum) {
switch(secureNum){
case 0:
return "NONE";
case 1:
return "LOW";
case 2:
return "MEDIUM";
case 4:
return "HIGH";
case 5:
return "VERRY HIGH"
}
}
};
This is the code
const {secureTrans} = require("../../lib/secureTrans");
return secureTrans(message.guild.verificationLevel) //it return UNDEFIENED
But it return underfiened
help meeee
Oh in v12 i dont have to transfer it
:000000
didnt know
hey guys i have a questrion
i jues uploaded all my bot files to my vps
but how do i actually host them there 24/7?
i juse start them like, node .
and python run.py etc.
and after that i just close putty?
yeah, that's one way to do it
you can also use a process manager like pm2
Using a process manager is better because if your program crashes / vpn restarts, it will be automatically started again
because no one knows you asked for it?
its js but typed
what exactly returns the array?
number
its not an array btw
you cant declare 0 = something
so '0' = something
constants['0']
min_cooldown is so fucking long
anyway
86,400 seconds
It should be
If the server is, yes
so i can close my putty now?
Yโall know how to make bots
or should i save something
you can close it
Yโall tryna make me one
okay lovely guys

@slender thistle needdev?
-needdev @manic ruin
@manic ruin
DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.
I wrote the discord bot list api in the pom.xml there are no errors but I can't find them if I want to implement them
They made a website for freelance
Why use PuTTy when you have Terminus
someone help me setup a V.P.S pls with Discord bot studio
did someone have experience with java spring security
I am trying to make like a banner for my bot by I dont know why but it makes the embed smaller
hih
That's Discord rendering it to the client.
That's something you probably don't have control over.
So wich one is better?
Pick the one you like.
with banner or with out
With banner
For preference I'd go with the second one (without banner) but keep in mind the look is not going to be the same on everyone's screens. Take mobile users for example.
Yep
hey so 2 of my hosted bot are working
but only 1 isn't
why?
i have done pm2 list
and they were all working
but only the commands aren't of bot 3
could anyone help me out?
So it's online but not responding
yeah
Possibly check your command handler
PM2 doesnโt log errors
show the code
try stopping it
But I could add theme to embeds that are usualy small
then running it using node <bot file>.js
but inside the project folder
But I could add theme to embeds that are usualy small
@floral creek go with what you prefer
Yeah the embed looks nice especially with the banner there but I'd only use it in a case where the user wants info about the bot (such as an about command) or some form of advertisement.
disable embeds for mobile users please
it is eezi to check if the user is on mobile
tipcc does that
and on $deposit it send the currency address in a normal messagr
tf
I added DiscordBotList's API in my pom.xml, but I can't use it in my class. What should i do now?
I added DiscordBotList's API in my pom.xml, but I can't use it in my class. What should i do now?
@unreal hemlock give more info
show code
show errors
show yourself peeing
this api added in my pom.xml https://github.com/top-gg/DBL-Java-Library
An API wrapper for https://discordbots.org/api/docs that works in Java - top-gg/DBL-Java-Library
show code
this is how my porjectory looks like
so 1 folder that contains all these folders
JUST SHOW WHAT YOU TYPED IN THE FREAKING FILE
me?
this is how my porjectory looks like
@eternal osprey porjectory wtf
projectory**
your project is fucking
why is his clarity better
??
bruh i cannot type
Maybe he is downloading the avatar at a higher resolution
Red is not found
@unreal hemlock over over the red part, what does it say?
Js?
@unreal hemlock please show both the code and errors
I only know how to in python unfortunately
ok
let avatar = (smth).avatarURL({options});
options is an object
resolution can be selected in options
@delicate shore how did u made that
the jail command
by coding
Look in the options @delicate shore https://discord.js.org/#/docs/main/stable/class/User?scrollTo=avatarURL
canvas ?
@unreal hemlock please show the code where you defined DiscordBotListAPI
the command
Opticha did you download the DBL Java library?
u have only one file ?
i do have 1 folder with these inside
@unreal hemlock please show the code where you defined DiscordBotListAPI
@earnest phoenix This is a error
wait java
@eternal osprey wait any error ?
I'm out bye
i use javascript so...
wait java
@earnest phoenix Maven
@earnest phoenix it is xml
the fuck is maven
@earnest phoenix it is xml
@earnest phoenix big brain
lol
xml is not a programming language
it is a file
running this using vsc would work
but not using vps
What should I do
then stfu
@earnest phoenix u dont help him either : /
bruh
idk java i only know js
and json
and batch
uhhm could anyobdy help me?
with wut
@unreal hemlock I haven't used Java in a while so I may not be of big help, but did you make sure to also include the jitpack repository? Have you built it so you're sure it's been downloaded? I mainly use Gradle.
Look in the options @delicate shore https://discord.js.org/#/docs/main/stable/class/User?scrollTo=avatarURL
@placid iron thank you
canvas ?
@earnest phoenix yes
@unreal hemlock I haven't used Java in a while so I may not be of big help, but did you make sure to also include the jitpack repository? Have you built it so you're sure it's been downloaded? I mainly use Gradle.
@sudden geyser https://eversit.de/uploadserver/ba89dc9e-e527-44dc-9cf1-d7685becc6b4.png
Lol
need more help marshmallow? @delicate shore
@earnest phoenix no thank
hmm
you can't define a custom resolution
you can only choose from the provided ones
TypeError: Cannot convert "null" to int
at Object.toWireType (/home/holasoyender/KiroBot/node_modules/opusscript/build/opusscript_native_wasm.js:8:47113)```
does someone know why that?
You care trying to convert a null variable to an int
is that even possible
@unreal hemlock like I said, have you built it so you're sure the library has been downloaded?
@jovial nexus the error is quite self-explanatory, but it's coming from a dependency for some reason. Is there any more to the stacktrace?
can you explain the issue you're having
learn js
You should be able to tell us the actual issue you're having. In this case, it's a syntax error because you don't close your braces/scopes near the bottom
You have forgotten a few }s and )s
@unreal hemlock like I said, have you built it so you're sure the library has been downloaded?
@jovial nexus the error is quite self-explanatory, but it's coming from a dependency for some reason. Is there any more to the stacktrace?
@sudden geyser yes i have build a pom
?ยฟ
after args[0] you completed the bracket
wait why do you even have the one at the end
its a switch statement
lmao sure
"Problem"
๐
You leak your token btw
damn he did
bruh
regen the token

next time
hi is it possible to make a bot run commands by voice?
i think bots can have voice_receive but i don't think it's documented and it might be against tos
so no
i think bots can have voice_receive but i don't think it's documented and it might be against tos
@pale vessel wait is it?
How to get number of users
i guess not?
totall with my bot
did u ?
bot.guilds.forEach((guild) => {
guild.fetchMembers().then(g => {
let count = 0;
g.members.forEach((member) => {
count++;
});
console.log(count);
});
});```
it gives an error
They can track voice

did
thats why you read the docs
aaeval bot.guilds.forEach((guild) => {
guild.memberCount().then(g => {
let count = 0;
g.memberCount.forEach((guild) => {
count++;
});
console.log(count);
});
});```
ID is undefined
yes ik
but what do i need to understand? is m undefined too?
isn't it the way to define m properly?
ok
The first parameter for the filter of a reaction collector is the reaction โ which doesnโt have an author property.
@earnest phoenix omg
i didn't know thx
big box thrown at users is it still illegal/shady to put cryptocurrency mining scripts on the website.
const filter = (reaction, user) => ..
@earnest phoenix yes but how do i do that?
i just want the author's reaction
Does anyone know how you'd return a error message if there wasn't a number between 5 - 90 in args[1] (d.js) or there just generally wasnt a number in args1
Does anyone know how you'd return a error message if there wasn't a number between 5 - 90 in args[1] (d.js) or there just generally wasnt a number in args1
@still merlin just use an if statement to check if 5 < n < 90
<reaction>.emoji.name
@earnest phoenix do u have an exemple ?
Donโt do that.
@earnest phoenix that's the ONLY way i can monetize my stuff
Thanks
@earnest phoenix i want multiple reactions so it won't help right?
no just one
this is my embed
i want the author to choose with reactions
ok
i understood but now i have problems with emojis
emojis used returned undefined
what
Yes
ok i'll try
heya so i've got some code:
@bot.command()
async def test(ctx):
def predicate(message):
if message.channel.id != ctx.channel.id:
return False
return message.author.id == ctx.message.author.id
try:
msg = await bot.wait_for('message', check=predicate, timeout=30)
except asyncio.TimeoutError:
print('Timeout')
return
It just waits for a message from the author but sometimes it doesn't register it. My bot is in ~700 servers so it's reading messages really quickly and sometimes misses it i've found, any suggestions to make it find the message every time?
smh
@cloud pebble do you think py return message.author.id == ctx.message.author.id and message.channel.id == ctx.channel.id will be more appropriate?
i've tried that but i've found it actually misses it more often like that
might just be placebo, worth giving it another shot i suppose
Yeah and only checks things after if the first one is false I think so it shouldn't make much of a difference
yeah i tried adding print statements and found it just prints everything the bot can read, but since messages are coming in so fast it just doesn't read the ones it needs to
That generally shouldn't be a problem
A blind guess from me: try moving the predicate function out of the command
Oooohhh this is why sharding exists
and instead create it in the file scope
Hmm alright, will try that out
can i just pass ctx as an argument for the predicate function in the file scope too?
Ahah alright
hmm my other idea was getting the channel history and then filtering to get the last message that matches the predicate since using wait_for is missing it too often
but i feel like that'd be much more inefficient
Can you also send the guilds from the bot to DiscordBotList with url?
What's the specific feature you are trying to implement, @cloud pebble?
Once the command is invoked, it reads the message sent after it and does something based on the message content
What youโre doing now is checking for reactions on the message that triggered your event. What you want to do, is checking for reactions on the embed message youโre sending โ by using
const ... = await message.channel.send({ embed: embed }).
@earnest phoenix embed: embed?
@cloud pebble which language do you code in?
d.js seems to be much better for this ๐
Does anyone know how you give a footer a icon in d.js, The docs let me down.
i might be switching to another lib soon
to what lib @opal plank
@earnest phoenix
thankyou so much
@cloud pebble I would say a easy way to fix this is to shard the bot. I belive that creates more instances and so they would share the load
like that?
But I'm not too sure
Hmm that's something I've been thinking about, do you perhaps have a link or something where I could find out more @placid iron ?
Not really just the documentation. I think there is a autoShardedBot class which does it for you but I'm not too sure how good that is because you may want to make more or less shards
Hmm I see, thanks for the help, will take a look at it
No problem, I hope you find a fix
Can you also send the guilds from the bot to DiscordBotList with url?
Hi, I'm trying to make a lyrics command but i ran into a problem. The lyrics is too long to fit in one embed so i substring it and now it sends 2 embeds but the problem is when the lyrics is substringed it splits the words in half so how can i solve this problem
like:
dan
ce
@earnest phoenix how is defined the emoji name in the collection?
so to return results
"emoji" isn't ok now so
can i host a website
on a vps
how?
i am new to vps things
i started hosting my bot
but can i host my website
i tried
code continue running before the collection ends
that's bad i guess
maybe "await" is good to use but i don't know how @earnest phoenix
can i host a website
on a vps
but how
@violet haven - You cannot await an event emitter.
I'm assuming you're using Message.createReactionCollector? Look into Message.awaitReactions - it is the Promise form.
whatever you want as your backend
install a web server
@pale vessel next?
configure your web server
how ๐ค
Use nginx to direct traffic from port 80/443 to whatever port your app is listening to. Or, direct it to a dir to serve a static site. @delicate shore
so?
How can I make a variable that has a value, but its value changes everytime a loop completes?
@carmine summit let/var something;
let should work if you declare it before the loop
otherwise use var
Am confused
Whats foo?
Nono
Ima change its value
To 212other value
Everytime a loop completes
So when 212loops complete, all values must be read



