#development
1 messages · Page 606 of 1
What if you want the value 120000.5
Your solution won't be right
because its a decimal
if you get to millions e.g
1,000,000 and replace it with dots it will become 1.000.000 which is an invalid decimal
stop using invalid logic and read what we say
oof that too
oh yeah
its best to do offspring checking
divide by a million, if it returns 1 or above its a million, apply M to the returned number
otherwise divide by a thousand, if it returns 1 or above its a thousand, apply K to the returned number
there is probably a way to do this with regex too but writing regex is pain and suffer
I'd probably put the characters in an array like ["k", "m", "b", "..."]
And then loop through them or something
Could use Math.pow() in there to use thousand/million/..
I mean if you rly only want k and m, just hardcoding that would probs be faster 🤷
its c# but here's a vague way how it works
"pussy grabber"
Nerd
@jolly zephyr
@jolly zephyr
mee6 sucks
Nou
bots can have animated avatar right?
well tell me one thing mee6 does better than any other bot x)
should be allowed ye, bots have nitro by default
but why are bots with animated avatars so rare 
because they abuse a bug
@lilac geyser They can, but that is against Discord ToS etc
wait thats against discord tos 
wait can anyone actually show me the document/anything that states that that is not allowed?
It's common sense
bots dont have nitro afaik
they have
why is that common sense lol
Bots are not supposed to have gif avatars
so i can report bots with animated avatar?
I guess
Pretty much correct
repawted
Doubt Discord would care about it tbh
Wepowted
But they're not supposed to have gif avatars
oh
Bots only have external and animated emojis feature from Nitro, that's it
regular users can get animated avatars by abusing this bug
,
Quite a weird question, really. Would it be API abuse if I were to send a message in a channel every 5 minutes? I can't be bothered to set up a database because I literally just want to store one number, so I was thinking of using a channel as a database
Nope
Oh no
It'd be unreliable, yes but it'd honestly be a very easy way to store data
Indeed
persistent though
🤔
variables arent
how often can I fetch messages in one channel?
and how often can I edit a message?
5 minutes should be ok, right?
it should be, yeh
Duh
actually
3 years ago someone did just that
lol
whats the error its saying @abstract quarry
it doesn't want to run
there is a red line in your code
hover over it, and tell me what it says
Hello, who can help me?
i dont even know where to begin with that
xml
oh
porn.xml on the top
in an unknown file??
with everything being broken??
and a typo in the project name??
oml
and Main.java broken??,
i just noticed the porn.xml
what is the problem
this is a pom.xml
dissapointment.png
no
wait a minute
I have it from zekroTJA @mossy vine
And was the mistake
Guys i have a strange problem. I use discord js and pm2 on my digitalocean ubuntu vps. Sometimes, (i think after getting an error+ pm2 restart) the bot starts to send messages twice, thrice,.. / two, three,.. bots are running and have the same server on them. The bot is sharded but only running on 1 shard with 1k guilds. What can it be?
Guys, how can I get the votes count of my bot using discord.js? I have tried dlb.getVotest().size / .length but it doesn't really work 😅
its promise based
Ok, this show a number
let votes;
dbl.getVotes().then(v => {
votes = v.length;
});```
But it's bigger than my votes count =/
thats not how you write asynchronous code
votes will be undefined outside of the .then() callback
this could be what youre looking for: const votes = await dbl.getVotes().then(v => v.length)
how do i find out if something is in an array?
if (list.contain("id"))```
i have tried indexof
filter
includes returns true or false
indexof returns the position index, or -1 if not found
Hey, I got a little question for discord.py and python in general. I have a command and I would like to have 2 args but not mandatory : I could write +a, +a arg1 or even +a arg1 arg2 where arg2 would be a mention.
async def a(ctx, *args, *member):
How can I do that here ? with 2 mandatory args ?
none of the stuff worked
arr.includes('value') will return true or false
arr.indexOf('value') will return position or -1
exactly as tim said
these will both work
can you show us what you tried and what the error or unexpected behavior was?
@frigid juniper = None for arg to make it optional
You can't have two args like *arg btw
wish i knew python so i could help more people lol
I know this was a question xD
And what do you mean @slender thistle by None ?
I've tried something else now but i wonder else
arg = None, if arg was not specified, it will be None
how can i redact my bot token in git but keep the token in my project?
Git ignore, private repos, store it in a different file
make a config file (i recommend .env) and put it into your .gitignore file
then your bot can use the token from the hidden file but it will be ignored by git and will not be pushed up to your repo
generally, it's a bad practice to store configurable data in source code
how does self.client.send_file() work, i cant get it working, i have tried with just the file name, and doing picture = open("example_picture.png", "r")
Is example_picture in the main directory?
yes
and this is my error message
ClientRequestError: Can not write request body for https://discordapp.com/api/v6/channels/563442135135944715/messages
what does that mean?
It's for that url which is unauthorised
Idk tbh I just get the url and set it as image
Open it in rb mode
I would suggest using context manager or at least close()ing your picture variable later :p
Start what
I just installed the bot he do i begin
Excuse me what?
How do i start and sellect pokemon?
Ok, go to their support server then
And this is not development talk, so go to #general
Dammm..mthx for the help mcbitch!
Lmao wtf
idk how to respond
No need, they left
thanks @languid dragon
LMFAO
mcbitch in mcdonalds eating mcfood
Does anyone know what this is actually called (where you have : then another class)
Oh, wait nvm its inheritance
plus I just realized that's not even what I want to do
@slender thistle https://discordapp.com/channels/264445053596991498/272764566411149314/568897144518606848 😃 i already did, but thanks

@spring wharf do you mean the <>
Any way to put close to the very bottom?
hi jazz
have you even asked a question
its simple i should now the answer but
do u know the library to generate onetime login token
for passport
i have no idea what passport is
really...
like a passport to go out of country?
i was going to say that might be illegal
It's for easy OAuth2
no i want to do one time login strategy with that
not for discord
I know
u can use it where ever u want
I'm saying it has something for discord too
JWT?
JWT?
googling
Hi
message.member.removeRole("502550139693563906").catch(console.error);
message.member.removeRole("502549651560464395").catch(console.error);
message.member.removeRole("502550385874173982").catch(console.error);
message.member.removeRole("502550526538416138").catch(console.error);
message.member.removeRole("502550706163679233").catch(console.error);
message.member.removeRole("502550787566600222").catch(console.error);
message.member.removeRole("502550865639505950").catch(console.error);
message.member.removeRole("502550943112495105").catch(console.error);```
My console send : Role nor a snowflake
i used passport auth2 for my discord and passport google for my other proj now i need it to make a photo vault using it
so people can login to there vault using one time code
@earnest phoenix
🤷
yo
opts.issuer = 'accounts.examplesoft.com';
opts.audience = 'yoursite.net';```
what email do i need here?
ok so i want my bot to be always on, could i just do that with online website hosting?
do you have an error event
client.on('error', () => console.error)
God Im tired
That was the third edit lol
Np
@mystic shell look at the pins in this channel
It has a list of webhosts
i can't afford any of those, besides i think i found one that might work (heliohost.org), it has a git repository section, would that be what i need?
You just need something that host your bot which if it can take the code from a git repo and run it, then that'll do
holy shit that would be great, thank you so much
Both are equally bad
heroku > glitch but theyre both not very good
oh wait ive used glitch before
i use heroku to host small projects that dont require local storage
ok i think i got it, i used repl.it to write my code originally and then i just put the link to run the code into uptimerobot
@idle basalt heroku is ok, but u use free version or other?
I use free but I have monthly limit of hours and if bot is not used he has turn off
I think that hobby version
Limit of hours never mattered for me
My bot kept running even when my limit was reached
when i used heruko same tbh. the free miners is wried
or... woah heres a crazy idea, dont use free hosting 😲
i use the free version but i just linked a credit card to get 1000 hours
thats more than enough for my small crap
Nah Imma use my Glitch script that connects to Heroku
And all that with public token on GitHub
isn't local host ++?
Heya I want to make my dashboard. I know css / html little but I dont know how I can make it connected with Discord, oauth and other stuff
what?
Yeah, rendering templates might be usefil but you dont need them
i answer to toasty
you dont need any of that stuff 🤔
^
You need to set up a webserver that can communicate with your bot, and make the webserver handle the oauth, and requests from the user of the dashboard
to create something like mee6 has, simply html and css alone won't be enough
Html and css is just the frontend
Guys i have a strange problem. Anyone with discordjs sharding+pm2 knowledge please help!
I use discord js and pm2 on my vps. After getting a crash+ pm2 restart) the bot then sends messages twice/ two bots are running and have the same servers on them.
Even when i do pm2 restart bot the second bot stays alive. Only rebooting will kill it or killing it by process id.
I am using a ecosystem file for pm2, in which i have the option "treekill" activated.
What can it be??
not even that, you'll have to learn some js frameworks like react or vue due to the complex design of the bot
if you should use rendering templates you can make it easily but if you want use purejs and post/get methods good luck
Someone help me setup the API for server count? Discord.py
Client is not definded
i already tried a few things
Command: https://hastebin.com/iqukeyusib.js
No error in console.
Bot don't edit message, and don't send new message
Don't name your files dbl @trail dagger
what should i name it too?
message.member.removeRole("502550139693563906").catch(console.error);
message.member.removeRole("502549651560464395").catch(console.error);
message.member.removeRole("502550385874173982").catch(console.error);
message.member.removeRole("502550526538416138").catch(console.error);
message.member.removeRole("502550706163679233").catch(console.error);
message.member.removeRole("502550787566600222").catch(console.error);
message.member.removeRole("502550865639505950").catch(console.error);
message.member.removeRole("502550943112495105").catch(console.error);```
My console send : Role nor a snowflake
@trail dagger anything but dbl
i did change it
Still the same error?
Ah, good old errors
I would advice using my fork of dblpy but its docs are a no-go atm
Send an HTTP request yourself
var x = await Client.generateInvite()
console.log(x)
delete it
mustn't share your token
delete it
sorry
remove token and resend it
console.log(`Logged in ${Client.user.tag}\nLink invite: ${await Client.generateInvite()}`)
})```
my code
thinking its right
Client.login('token').then(async () => {
var x = await Client.generateInvite()
console.log(`Logged in ${Client.user.tag}\nLink invite: ${x}`)
})
alternative
Client.on("ready" () => {
var x = await Client.generateInvite()
console.log(`Logged in ${Client.user.tag}\nLink invite: ${x}`)
})
if bot login to Discord, ready function works
how do you install discord.js master now?
what why
Did you regen your token @pallid zinc
Because it's logged in #265156361791209475
and those cool kids with client mods that see deleted messages can also get it 
@steel heath npm i discordjs/discord.js
thanks
@coral trellis | @modern sable ^

@idle basalt your code is xd
(I have 8 votes)
bot.on('message', async message => {
if (message.author.bot) return;
if (message.content === `${prefix}dev`) {
const votes = await dbl.getVotes().then(v => v.length);
message.channel.send(`votes: ${votes}`);
};
});
or maybe to I'm an idiot
how this works?
better voting system xD;
btw
let Activity = [
`I'm so Dank`,
`Created by GOD`,
`${prefix}help • for help`,
`On ${bot.guilds.size} servers`,
`~${bot.users.size} user can use me`
]
let ActivityType = [
"LISTENING",
"WATCHING"
]
bot.user.setActivity(Activity[Math.floor(Math.random() * Activity.length)], {
type: ActivityType[Math.floor(Math.random() * ActivityType.length)]
})
setTimeout(() => {
BotUserActiviy()
}, 10 * 1000);
}
no err in console
but not working
Are you calling the function?
Also maybe use setInterval for intervals instead of a reoccuring timeout 👀
calling the function inside the function
also that's considered too quick on discord's api
changing the bot's activity every 10 seconds
I dont see why you want your bot to have its status change fast
not it makes it annoying to use, it also spams discord api
who u mean?
the god guy
ah
Niko, what is that
python for blocking other bots response
Are you sure that's what you want/need to post/use
It's return
Not pass
pass continues the function, return stops it
mhh thank you 🤔
i think always it was pass for ignore it
have change it now to return
oh do you use python, too?
Yes
can you help me than with one thing?
i want to show how many members are bots. how i do this?
List comprehension with an if checking if member.bot is True
while iterating through server.members
bots = list(member for member in server.members if str(member.bot == True))
this like?
Could just do [] instead of list()
Also, nope
No need for that str
(Use is for comparing to True, False and None)
i use async.
i have try it with is and become a syntax fail in this line
Show me what you got there
thats my list for role perms. it works lol
l = list(permi for permi, value in role.permissions if str(value)== 'True')```
l = list(permi for permi, value in role.permissions if str(value)== 'True')
i = '\n📍 '.join(l)```
the last to make the better format. without the (,)
Can you show me the error you get when using the bot members list thing
how to delete party of string in all elements of the array?
const array = [
"el1.a",
"el2.a"
]
//how to remove ".a"?
bad request
😮
@slender thistle can i invite you to my coding server? than i can show you that
In DMs
sure.
how to delete party of string in all elements of the array?
const array = [
"el1.a",
"el2.a"
]
//how to remove ".a"?```
use ``.forEach`` and modify each string in the foreach
HEllo. I'm shit at frontend and need help. I can't make 2 divs have the same height, and idk how to do it tbh, because I use a css framework.
https://i.imgur.com/pNl5FCD.png It looks like this on a 16:10 monitor, however on a 16:9 monitor it looks like this: https://i.imgur.com/oDzjC1f.png That's one big gap.
use max-height
I need it to be responsive, very responsive
which css framework do you use
materializecss
i suggest not
the divs do that on mobile: https://i.imgur.com/NH81wTj.png
materialize is very buggy
it's not exactly something to use in production
i abandoned it for material ui on react
although react is a SPA js framework it has amazing libraries for design, i use https://material-ui.com/ which is basically materialize but actually works
That's not the point, I just need 2 divs to have the same height.
view-source:https://antiowo.xyz
sorry, can't help with materialize, it's very buggy
although material ui looks very cool
How to use the code box in discord?
```language
code()
```
thanks
for example
function foo() {}
```js
function foo() {}
```
const directoryPath = path.join(__dirname, 'commands');
fs.readdir(directoryPath, function (err, files) {
if (err) return console.log('Unable to scan directory: ' + err);
files.forEach(file => {
const filenames = file.slice(0,file.length -3);
const filesarr = [];
filesarr.push(filenames);
console.log(filesarr);
bot.on('message', message => {
if (message.author.bot) return;
if (message.content === `${prefix}help2`) {
const embed = new Discord.RichEmbed()
.setDescription(filesarr)
message.channel.send(embed)
}
})
});
});
why this code return all array elements in other message?
I'm blind and don't see this
please help me -,-
:C
First of all
That code adds a message listener for every file in your commands folder
Which you shouldn't do 👀
That code doesn't even make sense at all
What are you trying to do
I trying write names of my files in directory in message
Do you have a message listener for each command 👀
^^
Your code should only have 1 bot.on('message', message => {
If that's not the case, please fix that first
In his case 1 would do
@real portal I'm pretty sure there's guides for discord.js command handler implementations
You should check those out probably
tbh you would be better off learning node.js basics first, it will save you a lot of hassle for future
node.js basics !== Javascript Basics
Sigh
How i use the vote api?
Webhooks or sending requests to the API?
Use an HTTP library for your programming language, read the docs (https://discordbots.org/api/docs)
in Java (JDA), when I do:
public void onGuildMessageReceived(GuildMessageReceivedEvent e){
String[] args = e.getMessage().getContentRaw().split(" ");
if (args[0].equalsIgnoreCase("hello")){
e.getChannel().sendMessage("Hello you =)").queue();
}
}```
The Bot spam Hello you =). Someone can help me to know why ?
you're splitting the entire message by a space, then detecting if the first word is hello, while you're sending a message Hello you which starts with hello, making the message received event loop
Oh okk, how can i solve this ?
if the bot replies to itself, what do you think you have to do?
create a codition who verifie if the author of the message isn't a bot ?
correct
simply check if the author is a bot
if it is you can return out of the method
ohh my GAAWWDD it works
Does this look okey for my personal website?
@trail dagger u make page in vanilla html/css/js?
html and css
Nice save
I don't know what about you speak

@trail dagger so.. u must have some time to do this ;>
Yea
message.member.removeRole("502550139693563906").catch(console.error);
message.member.removeRole("502549651560464395").catch(console.error);
message.member.removeRole("502550385874173982").catch(console.error);
message.member.removeRole("502550526538416138").catch(console.error);
message.member.removeRole("502550706163679233").catch(console.error);
message.member.removeRole("502550787566600222").catch(console.error);
message.member.removeRole("502550865639505950").catch(console.error);
message.member.removeRole("502550943112495105").catch(console.error);```
My console send : `Role nor a snowflake`
how did you get the role ids
can't you just remove every role at once? this seems like an api spam
const role = <guild>.roles.get("502550943112495105")
message.member.removeRole(role).catch(() => { // I'd say don't log that });```
what eggsy said
Just how i can remove the console log
interesting, because I tried it myself by looking at the user's roles, they were all simultaneously removed/added
discord.py doesn't even have a way for single roles
it's either add_roles or remove_roles
how many roles at once
many, I tried with 13
🤷
d.js also has <GuildMember>.removeRoles()
so it can
what he does is api spam, a lib wouldn't be encouraging it
Just how i can remove the console log plz 😢 
delete the line that logs it to the console 
you start by not removing each role individually, that's spamming
use removeRoles instead
you are spamming discord by removing 9 roles really fast, that's really unnecessary
For me it's nessecary how i can ?
mate
do you read
i sent you a link to the docs
that documentates the function
you need to use
Someone know how to heberg bot on Heroku when we use JDA API ?
heberg?
Has anyone found a way to be able to get a bot to DM the owner of the guilds its in when you make updates because atm i have it under a *updates command and when i make changes etc or have to put offline for a short period of time i have noway of informing the guilds owners? also on my *botinfo command i cnt seem to add how many guilds its in
Preferably use your support server for things like this
If you feel like it's very important, try to bind it to commonly used commands on your bot
People who really care will most likely join your support server
@lofty hamlet what
Did you mean to send a message to a random member to add your bot?
@spring ember hosts*
i want to host my bot
Don't forget to await
Note: This is a list of hosting, not a backing/support for them. You will need to make your own decision.
- OVH: https://www.ovh.com/us/vps/
Starting at $3.35/month (USD), 2GB RAM and 10GB storage, high reliability. - Digital Ocean: https://m.do.co/
Starting at $5/month (USD), 1GB RAM and 25GB storage, high reliability. - Linode: https://www.linode.com/
Starting at $5/month (USD), 1GB RAM and 20GB storage. - Vultr: https://www.vultr.com/
Starting at $2.5/month (USD), 512MB RAM and 20GB storage, plan only available on certain regions. - Amazon(AWS) Lightsail: https://amazonlightsail.com/
Starting at $5/month (USD) (first month free), 512MB RAM and 20GB storage, high reliability. - Time4VPS: https://www.time4vps.eu/
Starting at €2.99/month (billed every 4 months for €11.96/quarter), 512MB RAM and 20GB storage, free backups. - VIRMACH: http://virmach.com/
Starting at $1/month (USD), 192MB RAM and 10GB storage, free DDoS protection, 1 CPU core. - VPSDime.com https://vpsdime.com/
Starting at $7/month (USD), 4 CPU Cores, 6GB RAM, 30GB SSD Storage, 2TB Traffic and 10 Gbps Uplink - Servercheap https://servercheap.net/
Starting at $4.50/month (USD), 2 CPU Cores, 2GB RAM, 30GB SSD Storage, Unmetered Bandiwdth - Scaleway https://www.scaleway.com/
Starting at €2.99/month (Euro), 2 CPU Cores, 2GB RAM, 50GB SSD Storage
Enter the Cloud with your VPS: fast and cost-effective! Root access, 16 GB RAM, 100 Mbps, 200 GB HDD, 100% flexible. Starting at $8,99/month!...
Providing developers and businesses a reliable, easy-to-use cloud computing platform of virtual servers (Droplets), object storage (Spaces), and more.
Cloud hosting for you. Instantly deploy an SSD cloud server running with your choice of Linux distro, resources, and node location.
I use scale way epicly
This was taken from the pins
"free of charge"
Heroku is free
@earnest phoenix heroku is cool for small bot
@earnest phoenix free of charge are not reliable
my bot is small
And they are not designed for bots
dude
We don't recommend free vps
so it's great idea to use heroku
I saw a video where the man host his bot on Heroku
You should read on how dynos work before
@unique nimbus ik
Walox do you have another pc at home
yh but i won't LH
i won't localhost
i'll read that ty dondish
You literally just need to run the bot that's it
I know but
my bot is a micro service :p
he want to host small bot
My bot is small
I got scaleway
35 servers its in and barely uses storage its fine
why he must pay to host small bot if he can host on free heroku? xd
Have you read the tos of Heroku?
I use heroku
I'm no going to waste 1$ for a f-bot wich say "good morning" when user write "hi"
what do u mean boy?
I not use english everyday and idk all shortcuts
terms of service
I know but concret
..
I know what is tos
using "my bot doesnt crash" for people who justify heroku hosting is probably valid because their bot's guild count is lower than their age
tldr dont use free hosting
A terms of service is basically an agreement which you agree apon
yhhh, you don't underatand
Terms of service (also known as terms of use and terms and conditions, commonly abbreviated as TOS or ToS, ToU or T&C) are rules by which one must agree to abide in order to use a service. Terms of service can also be merely a disclaimer, especially regarding the use of webs...
...
Bet I can host 14 guilds bot on it 
Yes
@earnest phoenix your bots is 100% not a micro service
I don't have problems with Heroku because I know how it works...
wtf dondish ?
to my needs heroku is cool idea
I don't have problems with Heroku because I know how it works...```
you don't have problems with heroku because your guild count is equivalent of human's fingers per hand
Microservices are a software development technique—a variant of the service-oriented architecture (SOA) architectural style that structures an application as a collection of loosely coupled services. In a microservices architecture, services are fine-grained and the protoco...
it's fine for 10 or 15 guilds
XD
later on it's going to start giving up, dying, disconnecting, underperforming
oh we haven't the same def of micro service
The issue with Heroku is that the free version has specific monthly allowance
so
do not you understand that we are talking about small bots?
paid heroku is still a rip off
@real portal yes it was a reply
yes i do semadami
Small bits become big
And as I said the specific monthly allowance thing should make you worried
Because your bot will be offline in some part of the month
youu advise me what as host (free plz) ?
iirc heroku's monthly hours don't count using worker dyno
youu advise me what as host (free plz) ?```
there is no good free hosting. if you want a public bot, pay for hosting, otherwise don't run a public bot.
besides that, hosting is really cheap nowadays
it's like a buck or two
for 1 gb machine
just for begining i need a free host
Yes i can use LH, but i wounld rather not
Do you want me to tell you what I did for host when my bot was new
I paid nothing for this
ok cool
selfhosting is better than using free online hosting
Yes
if u use lh u must fast websocket
literally don't go out with friends or something for one day and you've already got yourself a machine covered
Luteinizing hormone
You know that you can run your not yourself for testing
M8 my localhost is shit
It's fine for my bot
@unique nimbus Localhost
Yes
Yes
Allows for quick tesing and easy acces to the logs
yeah, but on the long term, it's hard
Yes
you don't have to struggle with containers
i can agree
localhost 300ms ping 
ok so i use localhost rn
if you mean it's less power efficient, maybe. power bill can get racked up quickly but to start with pcs dont use that much power in the first place.
even if, you can set your pc to lower performance settings, turn off the monitor and close excess programs
if somebody spam the bot
lol
emoji fail x')
command cooldowns
eaz
if somebody can give me donate for hosting I will happily use it but I don't have money to do that yourself, I have my private needs and other expenses and I live in Poland where earnings are very low and I don't have 7$ per month to buy hosting, heroku is ok for me now
there isn't command cooldown since.... it's a small bot 
gg
u can get raided boi
you should always have command cooldowns
don't risk some idiot ratelimiting your bot
samedamciToday at 11:59 PM
if somebody can give me donate for hosting I will happily use it but I don't have money to do that yourself, I have my private needs and other expenses and I live in Poland where earnings are very low and I don't have 7$ per month to buy hosting, heroku is ok for me now
hosting is as low as $1 a month
or someone here can make a transfer to me like that i can buy a real host
literally don't buy gum for like one or two days and you cover hosting
192 mb of RAM?
i've seen $1 go for 512
I have 512 for free
if you're lucky you can catch some sales and get $1 for 1 gb
sale for one month
and no, a vps that has 512mb is not equivalent to heroku 512mb
yeah, on heroku I have 512b...
I got 2gb of ram and 20gb of storage with unlimited bandwidth for 3 euros a month
Scaleway son
Dad?
Yes
my point is; if you can't afford it, don't run a public bot. otherwise, it won't hurt you to literally spend a buck or two a month for a machine
it's almost a fact that bots hosted on heroku are mostly shitty and generic
@earnest phoenix well that's not what they asked
oi lads, many people use heroku on such, if the guy wants to do so, dont fucking talk shit about him or his bot
either help him, or just dont reply
thanks
And Heroku is not bad
im not asking for facts
It's just not meant for bots
not bots
heroku works for bots though, and that is what he wishes to use
it can be use for bot
You're not talking facts when you're saying it can only run few guilds
Slight exageration
@earnest phoenix you can use it but it might be asleep later this month
run a bot on heroku in 50 guilds with more presence changes and let me see how it handles it lol
heroku not without reason can run node.js files
you're basically telling someone to use a band aid over a proper bandage
Heroku is a good example of a good host
Don't exaggerate
ohh
Some people here don't even have a credit card
Heroku is a host for specific things
That shouldn't stop them from developing
so lets spend 100$ with OVH
OVH is hella cheap
OVH is cheap
Yes
did you ignore the whole part about telling us that hosting can get as low as $1
alright, if you wanna continue arguing over changing his hosts and whatnot rather than helping, im gonna be dishing out mutes
biased lol
ahah
what is the cmd for show up the list of host ?
they're in pinned messages
good point
lazy
1€ == 4,2 PLN, my parents earn 1500 PLN monthly, food, bills, pleasure.... several dozen PLN are left
I sent that an hour ago
Just press on the Pins button and you can check the hosts
polish currency
wut?
if you're 15 or older you can also get a temp job
not in france :)
offtopic but it's surprising how many people are ashamed to get a temp job; nothing to be a shamed of, it's a way to generate a source of income
job for discord bot which use 10 members
1500 pln monthly is below minimum wage @real portal
having a temp job doesnt mean you have to spend all of the money on the hosting lol
you get to treat yourself
on hand, gross
or maybe few higher
Jobs are good
let's end up being sorry
work isn't
Jobs are work

I got a job at McDonald's
I work at McDonald's
Anyway, good night igtg
Night
you can find mushrooms

i worked at retail for a few months, it drove me actually crazy
😂
Hey it's development here hello
touché
yeah i can see that
In England its 11:19pm
00:19
GMT+1
mhm
Wit
we're not in off topic, we'll get banned
You haven't seen my weeb background
;-)
oh no
@@late hill Thank you for your input
i mean i have a support server and i keep regular updates inside. but also the other guy said my bot will be kicked?
But is there a specific way to find out how many guilds my bot is in i mean i have bot info and i can get the uptime to show but it doesnt specify how many days etc just has 4 numbers like 5756 so the things im trying to find out is the how to add the info how many guilds my bots in when you do *botinfo and how long its been on on its uptime
i dont know what lib youre using but they all have a way to get your guild total
its up to you to interpret the numbers youve been given and turn them into something humans can understand
its likely that your uptime is in milliseconds and you can parse those into normal seconds/minutes/hours/days relatively easily (i recommend division)
@neat depot we are a coding discord not a hardware support server
😦
@neat depot regardless , that seems to be your mouses issue
check the up key
Faulty scroll wheel maybe
Ive had an issue with scrollwheels and it did stuff like that
^^
its not broken though
what’s WEB
How would I use HTTP to retrive my bot's votes from the DBL websitewith Java
How would i go about getting the code from some bots?
Or you know just code it yourself 🙄
yes
Because hypothetically if I modified it I should be able to set the stuff I need with it right?
Like those bots but modified
so i could just add or remove code when needed
So basically I'm asking if anybody here has links to those bots
Code
....
.....
I mean unless there is a way to make it so they can't be seen in the discord under the members list
@prime cliff
The status and game message is global on all servers the bot is in you can never change it for just 1 server
But is there a way for the bots to not be visible in the members list
Without modifying code
Just deny it read messages permission in the channel but the bot won't be able to respond in that channel that is all you can do
Ok
Hello
over here the rate limit states that request type can be any
but only blocked from posting?
before the .join do .slice()

function getGuilds(start_number) {
const mapped = bots.guilds.map(g => `${g.name}: ${g.memberCount} Members`)
const end = start_number + 10
mapped.splice(start_number, end)
return mapped
}
const mapped_guilds = getGuilds(5)
console.log(mapped_guilds.join('\n'))
here an example
edited
Am i allowed to use CSS on my DBL Bot Page ?
Yes
Wasn't that like Certified Devs only sometime
helllo 👀 i have a question for python.
what need i write to let the bot know that this user has no perms on the channel?
Depends on what perms
How do you decline Permission to show an error img on command in DBL? (py)
Error image?
Yes like b.cjfjejcjr
Comes up with
thats cancer why would you want that
Stfu if I want it I want it
What is your discord.py version
3.6.5
Not python
pls read
I installed the module
@pallid zinc ./ looks for the file in the current directory, if you want to require a module you dont need it
Also isnt discordeco deprecated?
WOuld need some small help would you know how to refer this ```js
else {
await channel.send(dmEmbed).catch(O_o => console.log({O_o}));
}
for DMChannel
const Command = require(`${process.cwd()}/Handler/Command.js`);
const Discord = require(`discord.js`);
class DM extends Command {
constructor(client) {
super(client, {
name:"dm"
})
}
async run(message) {
const args = message.content.slice().split(/ +/);
const commandName = args.shift().toLowerCase();
const client = new Discord.Client();
if (message.author.id !== "131766624872038400") return;
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if (!rUser) return message.channel.send("Provide a valid Ping or User ID");
let reason = args.join(" ").slice(22);
if (!reason) return message.channel.send("Provide a message!")
let dmEmbed = new Discord.MessageEmbed()
.setDescription("DM Message")
.setColor('RANDOM')
.setDescription(reason);
let channel = client.users.get(rUser.id)
if (!channel) {
message.channel.send("Can't find a user.")
return;
}
else {
await channel.send(dmEmbed).catch(O_o => console.log({O_o}));
}
}
}
module.exports = DM;
Well the only issue I have is that when I apply a mentioneduser and I provide a message it still returns Can't find a user even if that user is in the server
well since you are looking for a GuildMember, you would need message.mentions.members.first()
I used that here ```js
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
Are you having trouble sending the message to the user?
Yes
message.guild.member(message.mentions.users.first()) is not valid
Dam for real
either message.guild.members.get() or simply use the mention directly
i believe get() accepts both ids and objects, so you can just do .get(...users.first() || args[0])
or simply rUser = message.mentions.members.first() || message.guild.members.get(args[0])
alright I changed it will test run it
still not working as a matter of fact the only issue is with this part ```js
else {
await channel.send(dmEmbed).catch(O_o => console.log({O_o}));
}
```
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
Don't use channel.send simply use rUser.send
👍
dam it still get this
try rUser.user.send() since rUser is a guildmember not a user
still same issue 😢 bruh I've been trying with this for long time 😄 I think I'll just take a break
how does your full code look like now?
let user = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if(!user) return message.reply("Couldn't find user.");
if(!message.member.hasPermission("MANAGE_MEMBERS")) return;
if(user.hasPermission("MANAGE_MESSAGES")) return message.channel.send("Cannot ban that user.");
const banEmbed = new Discord.RichEmbed()
.setAuthor(`Ban | ${user.user.tag}`, user.user.displayAvatarURL)
.addField('User', '<@' + user.id + '>', true)
.addField('Moderator', '<@' + message.author.id + '>', true)
.addField('Reason', reason)
.setFooter(`ID: ${user.id}`)
.setTimestamp()
try{
await user.send(`**You were banned from ${message.guild.name} for**: \`${reason}\`.`)
}catch(e){
return;
}
await message.guild.member(user).ban(reason).then(modlogs.send(banEmbed));
This is my ban command
Work fine 🤔
This one also DM's
const Command = require(`${process.cwd()}/Handler/Command.js`);
const Discord = require(`discord.js`);
class DM extends Command {
constructor(client) {
super(client, {
name:"dm"
})
}
async run(message) {
const args = message.content.slice().split(/ +/);
const commandName = args.shift().toLowerCase();
const client = new Discord.Client();
if (message.author.id !== "131766624872038400") return;
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if (!rUser) return message.channel.send("Provide a valid Ping or User ID");
let reason = args.join(" ").slice(22);
if (!reason) return message.channel.send("Provide a message!")
let dmEmbed = new Discord.MessageEmbed()
.setDescription("DM Message")
.setColor('RANDOM')
.setDescription(reason);
let channel = client.users.get(rUser.id)
if (!channel) {
message.channel.send("Can't find a user.")
return;
}
else {
await rUser.user.send(dmEmbed).catch(O_o => console.log({O_o}));
}
}
}
module.exports = DM;
that's the code rn
well, of course you will get that error
you're still checking for channel even though you changed it not to use it anymore
if you want to use user.send() remove the channel part
and your rUser is still the same as it was before
Also have to take into account that some users have DM's disabled so make sure to run that in a try catch statement
hes using await catch
oh wait
thats also wrong lmao
if you use await, you should use try catch
.catch is only for .then
What command handler are you using 
Just toke a break im on later tonight
Why this don't return me id?
Code: const snekfetch = require('snekfetch'); snekfetch.get(`https://api.roblox.com/users/get-by-username?username=Mespeczek`).then(r => { message.channel.send(r.Id); })
console.log(r) and youll find out whats going on
also like mentioned above, snekfetch has been deprecated in favor of node-fetch so you should use a different fetch package
How does the token for DBL work?
wym
hey guys. have any a useable code for the servercount for the dbl in python 3.6?
Just don't use dblpy
How can I add a command that changes the bot's prefix?
You have to do that with a database
For that type of stuff I'd use enmap @fallow steppe
Or what you can do is change it in the json file if you have one
(node:9020) UnhandledPromiseRejectionWarning: Error: Something took too long to do.
at timeout.client.setTimeout (/home/filemon/node_modules/discord.js/src/clie nt/ClientManager.js:40:57)
at Timeout.setTimeout [as _onTimeout] (/home/filemon/node_modules/discord.js /src/client/Client.js:433:7)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
(node:9020) 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(). (rejection id: 22)
(node:9020) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre cated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
help
ClientManager.js:40:57
?
help me plz
root@cba131:/home/filemon# node bot.js
(node:9020) UnhandledPromiseRejectionWarning: Error: Something took too long to do.
at timeout.client.setTimeout (/home/filemon/node_modules/discord.js/src/clie nt/ClientManager.js:40:57)
at Timeout.setTimeout [as _onTimeout] (/home/filemon/node_modules/discord.js /src/client/Client.js:433:7)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
(node:9020) 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(). (rejection id: 22)
(node:9020) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre cated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
??
Did you find the issue
@sullen elm you forgot to await
oky
You want to start your bot?
Wait you might not need to
yes
client.login('TOKEN')
@sullen elm nvm might be an issue with the api
and all the time this error pops up as typing node bot.js.
Or something is blocking the thread
What's your main files name
settings.json
?
?
Where you put client.login()
Have you written any code


