#development
1 messages ยท Page 520 of 1
Reset your token then
@tight heath nice
Lmao
who gives a shit
if you make your token public ur honestly asking people to use it
please Host my bot here is token
Step up your game with a modern voice & text chat app. Crystal clear voice, multiple server and channel support, mobile apps, and more. Get your free server now!
lmao
pls host my bot the token is 264811613708746752264811613708746752264811613708746752264811613708746752264811613708746752
no its luca's id 5 times
lmao
oh el mao
u bl i nd
my token is gay
here you go heres my real token MjY0ODExNjEzNzA4NzQ2NzUy.C0grJQ.dGhpc2lzYWZha2VfdDBrM251bnViLi4u
(luca's github repo)
yes
such resource usage much wow
heard of the new challenge.
No fuck off

apparently
no u
thing is
how do i make it so people can't see my token?
new file: .gitignore
/data/settings.json
you give it to me
the pain (luca)
Hoomans
the file wont show on github anymore
o
best advice you can get
any vps good thats under 5$ a month
palerino
@earnest phoenix yes
;p
Vultr is good
galaxygate is 3$
^
vultr is ipv6 at 2.50$/m
and there was that german one for 2.5 euros
im using galaxy gate atm
i forgot the name
yeah hetzner
is skysilk still free
hetzner has 2gb ram for 2.49 euro
Webdock is where you should go for CPU
is the vultr vps good for a bot with music?
They don't have much storage, but in return they give you a beast cpu
You can get a core i7 6700 for like $4.50 a month
its good for a bot with music then?
wait what
Should be
do you actually get full 4 cores / 8 threads for 4 euro?
ew
jesus
Yes
lmao
el mao
whats the catch
You get only 3 gigs of space
sounds perfect for my needs
its enough for node.js and maybe a simple database
Tbh, its not enough for me
uh
wait
the 3.50 vps for vultr is only 512 mb
does that include the OS installation?
how much space does ubuntu 18 use
so then you have 2.3gb free?
is the price in usd?
or they put it in a different volume?
cuz if it is
I cant say for sure tim
I dont have that plan
the 5$ one for me is 6.90
Im on their ssd 8 plan
@earnest phoenix How much storage do you need?
idk
Just starting?
my bot is on 480 servers
Do you have a large database?
i dont use database
Ah.
then to be honest, the webdock plan I mentioned is enough for you
i pay like 15 a month for mine kek
jesus
ikr
are you torrenting with it?
idk
11 terabytes?
wtf is your bot doing
no
its unlimited
Unlimited bandwidth? Hmm...
thats what it says
Usually hosting companies don't do that
galaxy gate i think does
where?
fishy's
lul
@earnest phoenix did you see this?
Powerful VPS hosting โ SSD storage, snapshots, virtual machines equipped with brand new hardware, 100 mbit/s unlimited traffic, starting at just 3,99โฌ/month.
4gb ram and 300gb hdd for 4 euros?
wat
10gb ram for 8 euro
Oversellllll
They're probably using openvz, which means they can oversell greatly
Try it, sign up for a server
i cant right now
but webdock does seem very nice. hit me up if anything better comes up
i still have webhosting paid for 2 more years, then i'll switch to a vps
Webdock is probably the best that you're going to get on a vps. only thing better would be a dedicated server
You pay yearly, Tim?
prepaid for 3 years
Ouch.
Signing your deal hunting rights for 3 years

The most I'll ever do at a time is yearly
And thats if I really love my service
well, when you dont have much funds, you try to bargain xd
What company are you with?
im on interserver right now
cheapest webhosting
For your bot?
but im thinking of getting a single vps for everything in the future
im on free tier
for what size bot tho
im building a unified api for both my website and my bot, so it makes no sense to have the website in a separate server, but i didnt think of doing that before so now im stuck with managing multiple projects until i get them working under the unified api lmao
size of bot under gce?
like 120-250mb ram, 300mb hdd, 400 guilds
o understandable
i still dont know what im gonna do regarding databases
the website is on mysql, and my api is on redis
is it fast enough for a rest api?
yes
hmm i might give it a try then
if indexed correctly
Unified api.
how about ram usage? i dont wanna waste too much ram with a db
That sounds interesting
my database is small, mostly text, on redis is using like 9mb ram
I'm using about 500mb with it
with 300-400k records
if anything redis would use more since it's memory db
how fast does it need to be 
I can use xmlHttp to do oauth2 right? :o
well, im probably overthinking about performance
i want it to be the same performance as google's apis
but i dont think it will matter what kind of db i use
You said you were using GCE?
my bot is on gce yes
Wow. they are expensive
Isnt that only for a year?
the bonus credit is for a year, but the lowest tier vps is free forever
but bandwidth is not
im using about 1$/mo in bandwidth charges
taken from the free credit
cost really gets out of hand when you have a large bot
i pay a bit for yt
my bot will never get that large because it targets a relatively small/specific audience
Multiple connections are fine
imagine only being able to use 1 connection total. lol
i use rethink
rethink is fine to an extent
its out of date ish
but I noticed it's like a gigantic memory hog
but it's realtime @tight heath
This code send all my discord of my bot but i want send just the the top 5 of the big discord where is my bot
fonction.channellogs(message)
if (message.author.id === '403159739178942464') {
var embed = new Discord.RichEmbed()
.setColor(embedcolor)
.setAuthor("Akimitsu", +bot.user.avatarURL + bot.guilds.size)
.setDescription(bot.guilds.map(r => `:arrow_forward: ***${r.name}***` + ` | **${r.memberCount}** membres`))
.setFooter("- by Nebulus")
message.channel.send(embed);
} else
message.channel.send(':Croix: **Cette commande est interdite pour manque de confiance** :Croix:');
break;```
Help me plz
Mongo is CRUD
my project right now includes 1 bot (maybe more than one if i port it to telegram/etc), 1 api and 1 website. all have to access the same database, which includes user information, api keys, and filenames pointing to storage
?
I mean I still use both
Can you help me ?
CRUD is quite useful
bot.guilds.sort(memberCount).map(...).first(5)
Hu ?
Wait
.setDescription(bot.guilds.map(r => `:arrow_forward: ***${r.name}***` + ` | **${r.memberCount}** membres`).sort(memberCount).first(5))
?
rave, your order is a bit off
shhhhhhha
nebulus, don't copy things without understanding them
You want to sort the guilds first.
yea
Yes
yes
I'm having brain lags at 11.40 already
This is ?
.setDescription(bot.guilds.map(r => `:arrow_forward: ***${r.name}***` + ` | **${r.memberCount}** membres`).sort(memberCount).first(5))
I go to try this
and...ya ignored what I said...
first sort
d
then map
^ which was said above
^ exactly
But i'm french i don't understan everythink
.sort((a, b) => b.memberCount - a.memberCount)
.setDescription(bot.guilds.map(r => `:arrow_forward: ***${r.name}***` + ` | **${r.memberCount}** membres`).sort(memberCount).first(5))
no
I have don't understand
.setDescription(bot.guilds
.sort((a, b) => b.memberCount - a.memberCount)
.first(5)
.map(r => `:arrow_forward: ***${r.name}*** | **${r.memberCount}** membres`)
.join('\n'))
Because .first() is not an array method..
forgot map returns an Array
don't copy paste things randomly
.sort((a, b) => b.memberCount - a.memberCount)
.map(r => `:arrow_forward: ***${r.name}*** | **${r.memberCount}** membres`)
.first(5))```
This code is false ?
like I sent it
.setDescription(bot.guilds
.sort((a, b) => b.memberCount - a.memberCount)
.first(5)
.map(r => `:arrow_forward: ***${r.name}*** | **${r.memberCount}** membres`)
.join('\n'))
I don't understand this code ๐ข
first, sort by memberCount, highest -> lowest
take the first 5
map them to name | members
join them into a string, line-seperated
Ok ok i test this code ?
.sort((a, b) => b.memberCount - a.memberCount)
.first(5)
.map(r => `:arrow_forward: ***${r.name}*** | **${r.memberCount}** membres`)
.join('\n'))```
Mmmmhhh
as long as you have permission to show that data
whats the best mongodb admin panel? something like phpmyadmin
@quartz kindle Admin panel? for what?
@quartz kindle I don't actually use any admin panel, I perform query on the cli
thank
MongoDB admin panel = lazy way
I go to my bed ๐
for example to preview the structure and set up indexes
Goodbye have a nice night
yeah but i mean
i insert data on it, and i want to like, preview it
like dump all
into a single object
I used to use robo: https://robomongo.org/
for local env
my production database doesn't bind to public ip, so I only do it via cli
i'll probably do something via the api like im doing with redis
i had to make a custom dump function because redis doesnt have one
just to make sure the data im inputing is being inputted correctly
with the correct keys and such
hey there's lots of js people in here right
how do i remove all entries from a map whose values match a certain predicate?
right now i'm thinking something like
const toRemove = [...map.entries()].filter(e => predicate(e[1]));
for (const [k, v] of toRemove) map.delete(k);
but that seems ugly
new Map([...map0].filter(([k, v]) => !predicate(v))
``` maybe
i'm not too familiar with js btw
@glossy sand lmfao
yeah in java u can just remove from the entry set
map = map.findAll { !predicate.test(it.value) }
HECK
why wont it recognize my groovy
๐
map.entrySet().removeIf(predicate);
memes
map = map.findAll { !predicate.test(it.value) }```
oof
map = map.findAll { !predicate.test(it.value) }```
aaaaaa```
is there an invisible char in urs
probably
or smth
map = map.findAll { !predicate.test(it.value) }```
there
wow it didnt even do anyhting
lmfao
lol
nobody's ever gonna see my question again
i'll just stick with my ugly soln
you can post it again
i don't think there's a better way
You can take a look at the djs Collection.sweep
sweep(fn, thisArg) {
if (thisArg) fn = fn.bind(thisArg);
const previousSize = this.size;
for (const [key, val] of this) {
if (fn(val, key, this)) this.delete(key);
}
return previousSize - this.size;
}
oh
i guess js doesn't care about concurrent modification
extends Map
yeah ok
i was just wary of doing something like that because it would throw a runtime exception in java
Iโm having trouble setting up my bot I have no experience and keep getting errors with install npm
what are you trying to run
I donโt know I have no idea what Iโm doing just following this guide on the internet
which framework
Ive tried using The Node.js thing

Idk Oof
lmao
.
tfw you copy and pasting something you don't know
yes
@tawdry mountain
Dm and I can help
Anyone need free bot hosting I have Microsoft azure free
@earnest phoenix what spec on azure tho
THE SPECS
7gb ram
iten xeon
1 gigabyte connection both ways
120gb ssd
@keen drift
1-2 months probaly more
24/7
i host daddy bot and daddy music
my bots on them
you want to se
o I was hoping for longer
how did you get it for free 
man lucky
let me show you the bots ping
14ms
me and this other guy host our bots on the vm
its a vm
@earnest phoenix what is it called that your school is paying for
Azure Imagine or something
yes
u literally said your school pays for it
im pretty sure Microsoft Imagine is only a student version
tell ur school to make me an account
how long does it last 
wdym
the rdt
runs 24/7
you just have to install node js or whatever u use
i get 12-16ms ping on my bots
i did a speed test
got 1000+mbps upload download
like how many months, 1-2 months right?
prob longer
if not you can always backup and i can ask my school for another
16ms
15
XD
here dm me
hm why not, dm me one, it got ssh access rite?
oh it's windows
lmao
it got linux?
ubuntu
i can't verify my phone
#rip
Someone pls help Discord Bot Offline No error message Uptime says its online but discord says otherwise
I hosted a bot on glitch.com(I know its not supposed to be a vps). I put injs const server = require('./server.js'); above everything else in index.js and put const https = require('https'); const express = require('express'); const app = express(); app.get("/", (request, response) => { console.log(Date.now() + " Ping Received"); response.sendStatus(200); }); setInterval(() => { https.get(`https://enshrined-broccoli.glitch.me/`); }, 6000) const listener = app.listen(process.env.PORT, function() { console.log('Your app is listening on port ' + listener.address().port); }); in server.js
It was supposed to ping the bot but discord says that the bot is offline and uptime and glitch says it is up and live. Can someone please help me?
Also, I have another bot that has this as its pinger
const express = require('express');
const app = express();
app.get("/", (request, response) => {
console.log(Date.now() + " Ping Received");
response.sendStatus(200);
});
app.listen(process.env.PORT);
setInterval(() => {
https.get(`https://nervous-gerbil.glitch.me`);
}, 6000);```
(PING ME WHEN U ARE RESPONDING TO ME)
wtf am I reading
that's a simple error with a simple fix. stop using glitch.
man at least make the first one readable
@earnest phoenix it's not bad, def one of the cheaper options
I'm currently on Hetzner
will it make a difference for the music
music I'll stick with US providers I suppose
meaning minimal lag
i have the 3$ atm if i choose the 5$ one will it make it less lag(3$ one has a bit of lag)
depends what resource deprivation
But what resource are you depriving on the $3
wdym?
ram is enough im guessing
eww
...
@earnest phoenix
come on mine
?
i have 3 guys on my vps
XD
tf
ASK @earnest phoenix
ummm
@earnest phoenix
@earnest phoenix gimme vm
yeah I'm in the process 
i just want a vm for running some data aggregators
my bot needs higher spec than 8gb tho 
kk
whats the specs?
and speed test
1gbps
XD
ummm
you want windows or ubuntu
nut
n u t ty
yo @keen drift do you trust him?
idk
ask iam
but I'm not running anything sensitive on it
i already have a host for my bot
I just need some data vms
@earnest phoenix oh yeah, does azure support key auth
I'll give you my public key if it does
yeah
how are you making the vps @earnest phoenix ?
ooo
XD
those are good specs
Btw my school limits me to 400$
aa month
damn
that's still a lot
and also you get 1 gigbit
your school is rich
upload and download speed
i would like a better vps tho
this is
what are you running your bot on rn
or are you even
would you like anything in return?
no
fuk that
i dont want shit
XD
its my birthday
o
happy bday
my bot gets 12-16ms ping
XD
damnnn
also wdym what is my bot running on
on the vm
os?
windows 10
on the vps
node js and python for my music bot
i use ubuntu
@keen drift ports and key?
in dms
ports?
open ports
o none
ye 22
XD
ssh http https
give me the key
in dms
so i can set it
yo @earnest phoenix do you recommend windows os?
for the vps
are you running your bot on node js
or python
node js
windows
Use glitch
Or repl
Or just self host it
we are
but windows is good as well
any is fine
self hosting it on microsft azure
vm
but i will make windows 10 for you @earnest phoenix
o ok, thank you
but you have to install all your programs
yea ik
like node js
and shit
yep
by the way
yea?
@keen drift @earnest phoenix @earnest phoenix Backup all your new shit every day and make a group chat and add me and all you guys so if something goes wrong with the vps i will tell you
make a group chat on discord, right?
o, I suppose
or do you want me?
yeah
kk
by the way
guys dont be doing huge transfers
because it bases the price of the how much i use
to that
but dw
ok ๐
@earnest phoenix accept my friend request
@keen drift
dem key is on it rite 
yes
wait @earnest phoenix you from canada?
yes
same
fuck
?
NOOOOOOOOOOOOOOOOOOOO
IT WONT LET ME RUN MORE THEN VCPUS EACH PERSON GAT
GAYYY
How could I restart a certain module of my js program? Like I have a js file for each of my events how could I run a command that'd restart only one of them instead of crashing everything?
is it a discord event?
yea
you got a reload cmd?
idk js
@slim heart clear the file cache
Is there even a dispose function in javascript? 
is there a way to simplify the addition of this thing
async (client) => {
const results = await client.shard.broadcastEval('this.getQueues()');
let connections = 0;
let queues = 0;
let moes = 0;
let quotes = 0;
for (const data of results) {
conections = connections + data.connections;
queues = queues + data.music;
moes = moes + data.moe;
quotes = quotes + data.quote;
};
return {
connections: connections,
music: queues,
moe: moes,
quote: quotes,
};
};

@slim heart delete file cache
@sinful lotus yes
use reduce
like ```js
const results = await client.shard.broadcastEval('this.getQueues()');
const connections = result.reduce((prev, val) => prev + val.connections, 0)
should be less of a pain
@restive silo owo thankies 
How do you make a user upvote a bot before using the command?
check if they upvoted
Yes
read the docsโข
const Discord = require("discord.js");
module.exports.run = async (client) => {
await client.user.setActivity(`${client.guilds.size} servers! OwO | !help`, { type: "WATCHING" });
/*await client.user.setActivity(`Maintenance Please Wait`, { type: "PLAYING" });*/
await client.user.setStatus("online");
console.log(`eyyy I am online. I am connected to ${client.guilds.size} Servers, ${client.channels.size} Channels and ${client.users.size} Users. thanks for the summon!`);
};
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL(MY TOKEN IS HERE.. LMAO', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
Thats my ready event
and it wont post the server count
sometimes in python the infinite loop stops looping after a while, most often after a day or 2, I might know the reason why this is happening, but does anyone know how I can circumvent that from ever happening in the future?
nice pfp
you already have client, why are you defining it again?
@quartz kindle I tried removing const client = new Discord.Client(); then console said client is not defined
like wtf
the code is outside the run function
oh
and client should be defined at the top
thats the ready event in some command handler thingy
so client is defined in the arguments of the run function
and I dont think the autoposter will work if you add it after the ready event
can you add it on bot launch?
So I create a new file called bot launch?
why wouldnt it work after the ready event?
@quartz kindle because the module waits for the ready event
So i put all the code above the ready?
cant it detect if the client is already ready?
I think I forgot and I wasnt sure how to check that
oh
@amber junco put it in the file you run when you start your bot
what's the command you start your bot with
run bot
Did you already have client?
const client = new Discord.Client({disableEveryone: true});
It has this
Yeah that's client defined
That must work if that's your ready event
module.exports.run = async (client) => {
await client.user.setActivity(`${client.guilds.size} servers! OwO | !help`, { type: "WATCHING" });
/*await client.user.setActivity(`Maintenance Please Wait`, { type: "PLAYING" });*/
await client.user.setStatus("online");
console.log(`eyyy I am online. I am connected to ${client.guilds.size} Servers, ${client.channels.size} Channels and ${client.users.size} Users. thanks for the summon!`);
const DBL = require("dblapi.js");
const dbl = new DBL(MY TOKEN IS HERE.. LMAO', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
}```
Try this maybe?
Wait
Put it in index js
Define a new ready event specially for dbl
@amber junco
Try only in ready event
Put it after you defined client maybe
which is what I just told him to do before you stepped in lol
is there a video or anything about using the api webhook setting to show how many servers the bot is in on the website
well this then
been trying for some days and cant seem to get it working
what lang you use?
.py
I suggest using either aiohttp or request libraries for API related stuff in python
I'm using aiohttp
basic way in my case:
async with aiohttp.ClientSession() as session:
await session.post(url, data = payload, headers = headers)
class DiscordBotsOrgAPI:
"""Handles interactions with the discordbots.org API"""
def __init__(self, bot):
self.bot = bot
self.token = 'dbl_token' # set this to your DBL token
self.dblpy = dbl.Client(self.bot, self.token)
self.bot.loop.create_task(self.update_stats())
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
while True:
logger.info('attempting to post server count')
try:
await self.dblpy.post_server_count()
logger.info('posted server count ({})'.format(len(self.bot.guilds)))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
await asyncio.sleep(1800)
oh you are using the actual dbl lib
done that but is the dbl the Authorization: token right
yes
but the token must be your bot's token on dbl, not the actual discord bot login token
it's hard for me cause I don't use the lib
I used to manually post server count
hmm
idk where you got that page from
it's actually in here
unless there's another page like that that I don't know about
welp i was there im dumb lol
been useing the wrong stuff all this time lol
ill give it ago this time see what gappens
welp
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
ImportError: cannot import name main
think i killed pip
well it dont let me use pip i had to use pip3 weird
if(command == "reload") {
console.log("o")
let arg1 = args[0]
if(arg1 == "config") {
console.log("oo")
client.config = require('../../config.js')
}
}``` Why isn't this working? Ignore the o's i was just making sure the command worked. For some reason it just doesn't seem to make a difference in client.config
@slim heart
client.config = require('../../config.js') > client.config = require('..../config.js')
Try that
well now "Cannot find module '..../config.js'"
Y: is bot directory:
Config.js: Y:/config.js
Index.js Y:/index.js > runs event message Y:/events/message.js > runs admincmds Y:/modules/commands/admincmds.js which has that code
humm
#topgg-api ? i think u should go there i may be wrong
this is for code problems right lol
il post in there then
still cannot find module
hmm
I don't know what you're doing but ../../config.js works fine here
yea
it doesn't overwrite it tho
idk sksk
oh u know what
I'm dumb
I need to clear the require cache first
I'm developing a webpanel for my discord bot. I want to filter guilds where my bot is in and where the user has Manage Server permission. How can I do this?(Note: Panel is hosted separately)
Thats too easy just filter what servers the user is in and if they have perms
How?
๐ which lang is your bot
js
Do you have any web experience and a database?
I do have web experience, but not much. And I don't use any database, but I'm going to use it.
ok
Hi !
I want to make a welcome message with canvas with avatar member and pseudo member but my code does't work
You can help me ?
const channel = member.guild.channels.find(ch => ch.name === 'welcome');
if (!channel) return;
const canvas = Canvas.createCanvas(700, 250);
const ctx = canvas.getContext('2d');
const background = await Canvas.loadImage('./wallpaper.png');
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
ctx.strokeStyle = '#74037b';
ctx.strokeRect(0, 0, canvas.width, canvas.height);
// Select the font size and type from one of the natively available fonts
ctx.font = '60px sans-serif';
// Select the style that will be used to fill the text in
ctx.fillStyle = '#ffffff';
// Actually fill the text with a solid color
ctx.fillText(member.displayName, canvas.width / 2.5, canvas.height / 1.8);
ctx.beginPath();
ctx.arc(125, 125, 100, 0, Math.PI * 2, true);
ctx.closePath();
ctx.clip();
const { body: buffer } = await snekfetch.get(member.user.displayAvatarURL);
const avatar = await Canvas.loadImage(buffer);
ctx.drawImage(avatar, 25, 25, 200, 200);
const attachment = new Discord.Attachment(canvas.toBuffer(), 'wallpaper.png');
channel.send(`Welcome to the server, ${member}!`, attachment);
});```
My code ๐
wath ?
My error is snekfetch is not defined but is defined and the second error is a blank and i don't know
If not you don't have code for a welcome message equal to koyabot ? @brittle nova or other people because i wander
First of all
Hecking define snekfetch then
const snekfetch = require('snekfetch')
first npm i snekfetch
Second
Instead of copying example code from djs.guide
Who knows how to detect when my bot doesnโt have the required perms for something
Python
:c
Do you know?
rave uses js iirc
Who uses python
same
๐
im learning go also
Good boy
How do ppl become certified dev
Where
you can find most of everything here for d.py https://discordpy.readthedocs.io/en/latest/ @earnest phoenix
๐
can anyone help me with making a bot
now i joined the server to put it on the bots list

@hushed berry help
@earnest phoenix sorry mate, its not that simple
What you've done there is create the bot account.
Which is quite short of the actual bot
To make anything more, you'll have to learn at least basic programming skills in a well known language
where im at
no no


