#development
1 messages Β· Page 406 of 1
@tulip kraken process.memoryUsage().heapUsed / 1024 / 1024 in MB
thanks
wow
just noticed
im still running node 5.6
no good
no nvm
running 9.11.1
π
Yes
how would i add an exception to this code?
if message.content.startswith('?time'): timeinput = message.content[6:] tz = pytz.timezone(timeinput) gmt_now = datetime.datetime.now(tz) await client.send_message(message.channel, "The date and time in " + timeinput + " is " + str(gmt_now)[:16] + ".")
currently, this is what happens when there is an exception. the handler prints this: Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\soyou\AppData\Local\Programs\Python\python\lib\site-packages\discord.py-0.16.12-py3.6.egg\discord\client.py", line 307, in _run_event yield from getattr(self, event)(*args, **kwargs) File "C:\Users\soyou\Desktop\komaeda\bot.py", line 52, in on_message tz = pytz.timezone(timeinput) File "C:\Users\soyou\AppData\Local\Programs\Python\python\lib\site-packages\pytz\__init__.py", line 180, in timezone raise UnknownTimeZoneError(zone) pytz.exceptions.UnknownTimeZoneError: 'the moon'
i want my bot to send a different message when someone puts an invalid timezone.
seems i was just putting "exception" on the wrong ident lmao...
ty @spring ember !
Oh ok
?
Oh yeah my question was:
How do the webhooks work with dblapi? Are they like normal discord webhooks or?
I am a bit confused. If someone could help express it a bit more, would be appreciated.
dblapi webhook isnt a discord webhook
uhm
webhooks are basically a little request that gets sent everytime someone votes for your bot
you setup a webserver, or some other place to collect the HTTP request, then when someone votes on your bot, the webhook will relay basic information, like user-id and bot-id to you through the request body
anyone know a good API for anime gifs like Slap gifs
weebsh
Oh alright. I understand now, thanks. I was just confused on how they worked
no problem kyle
@tulip kraken u have to apply for a weeb.sh key
and ur bot has to be minimal 200 guilds
i only have an api for animal images and facts
@earnest phoenix are you trying to get info of the upvote sent to your discord webhook?
Not yet. I was just curious on how it worked for when I get to that area
ok, i wrote a page today to make it easy. still a work in progress, but if u create one it will give you a link to put in the DBL webhook field that will foward the userid to your discord channel
@tulip kraken @lament meteor we do make exceptions with who to accept into weeb.sh though ;)
This also goes for the guild count
aight
@peak mountain ik but im not a weeb
ik but i dont rlly feel adding weeb commands to my bot
and i know most of the stuff of weeb.sh
Where do i apply for an api key then?
yes there is stuff that is not weeb realted
REEEEEEEE
lol
Yep, add some infos like botname,guild count, website and so on
Makes it easier for me
Can someone help me? I made a page on my site of profile, now there is a huge JSON of your servers, I want to make a table with all the servers that the user has administrator permission in them (I made it in PHP)
someone told me "Use a foreach loop to iterate through every server and then add a check in the foreach loop to check if the server permission is above or equal to manage server perms and you're done" I just don't know how to do it
He probably implied a certain user.
@low owl nope discord oauth2
Ok, no idea
oww
hello
dev talk here
da u know da way
and it sends something like this
You could read that
iirc u have to detect the permisions for each guild
a for loop
idk
well it does so u can do a js forloop
ok
@upper ember bit checking permissions property
^
Use an API
Dumping data from PHP (echoing into HTML) is really bad
I've done that before and it's absolutely horrendous
I've moved away from PHP though now
<?php
$_SESSION['guilds'] = get_guilds();
for ($i=0, $len=count($_SESSION['guilds']); $i < $len; $i++) {
if ($_SESSION['guilds'][$i]['permissions'] >= 268438561) {
echo "<li class=\"list-group-item list-guild-item\">";
echo "<div class=\"guild-item\">";
echo "<a href=\"https://discordapp.com/oauth2/authorize?client_id=365958655926992896&scope=bot&permissions=2146958591&guild_id=" . $_SESSION['guilds'][$i]['id'] . "\">"; echo "<img src=\"https://cdn.discordapp.com/icons/" . $_SESSION['guilds'][$i]['id'] . '/' . $_SESSION['guilds'][$i]['icon'] . ".png\"/>";
echo "<span>" . $_SESSION['guilds'][$i]['name'] . "</span>";
echo "</div>";
echo "</a>";
echo "</li>";
}
}
?>
@lament meteor you can
Oof the php echos
Use active in css and js
hell no
Also just use one echo
I tried to use 1 echo... something fucked up when I do it...
@upper ember don't check permissions that way
you can't just do a >=
you should check the bit flags
if((permissions & PERMISSION_FLAG_YOU_WANT) != 0)
how do i downloa dsafety jim
<@&265158261945270273> <@&264889767072628742> how do i download saftey jim
ok for starters
try googling
for seconds, you dont need to tag the entire staff team
also you don't "download" bots, you invite them to your server
unless you mean downloading an open source bot from github
@earnest phoenix
@uncut pagoda i hope aly explained everything to you by now
Anybody know what type of numbers work for both Rich Embed Colours and normal embed Colours? Is it hexadecimal or what, I don't know what it is.
They both must be integers too
if you know the hex eg. #FFFFFF you can write it as 0xFFFFFF
well according to the docs the data type for color is integer.
so that should be the case for whatever library you're using.
That's if you posting directly to the api
also hex numbers are infact integers...
@uncut pagoda dont do that in develope pls, use any testing channel for that ( #commands , #265156322012561408 )
msg.guild.channels.get("440160451829956609").fetchMessages({ limit: 1 })
.then(message => console.log(message));
if i do this i get a collection
how do i get the message itself
i want this message https://vgy.me/gmKnxs.png
By iterating the list
how
doc is magic
in your case, .first()
bc there's just one elem
Whatβs the best for rest api (php) (apache2), MySQL or PostgreSQL?
How would i go about overwriting all channels with permissions for a mute role
Find all channels then loop through each
(Not sure if this is exactly the best place to be asking this question; would #topgg-api be more appropriate?)
Does anyone know why two of my bots' online statuses are showing correctly, but WrightBot's isn't? I already tried regening the token from DBL and updating the bot accordingly.
why is @finite tendon down
i really dont understand
@novel bronze it means your bot was kicked from the server, check mod log
How would I get the bot readded after fixing it, seeing that it was kicked after a programming oversight on my part?
Ask a mod
hey guys iβm bored give me something 2 code
π K
A discord bot that shares recipes.
oh
i mean something that is useful on a non-cooking discord server haha
but thanks anyways
command a pizza irl and deliver it to your home just for you

@austere meadow Sorry to bother you again.
I checked mod-log, saw what was up, and made changes to my bot accordingly.
Should I contact someone else next to get the bot back in here, or should I go and fill out the New Bot page again?
Whatβs the best way to keep a bot online
Depends on where you're running it
not shutting if off ?
^
I always leave my computer on 24/7 anyway so I just run mine right off of my computer
Not really an issue
Not such a great idea for people with laptops or something, though
usually either you let your computer run either you use a server
You can either pay for a server or find some service that lets you host your bots for free on their end
I know someone that managed to do the latter but I forget the name of the site he used, rip
I have it on a laptop and didnβt know if I can run it off a hosting cPanel I have for my websites
Yeah.... that's probably a shared webhost and you don't have server access
Any ideas other than keep laptop on to keep these on please
It was done via cmd
Or do u mean software like visual studio and python
If so then python
You can get a linux vps for like $5 a month
Thanks
Thanks for ur help
Np
Some people use rasperry pi ive seen. Idk how much those cost but i think they are fairly inexpensive
30 bucks for your hosting, not good for large bots though
Im hoping to get a lot to use one bot but the other I donβt expect many to use it
@novel bronze sorry for the late reply, just ask another moderator to re invite your bot here if the issue is fixed
Alr
@grizzled isle 30 bucks is a lot
Its better than 31
I pay only $10 for my bot
Hey, I need some help with arrays and lists
I have a var of commands, and I want to find the length.
var commands = {
//commands and stuff here
}
how would I find the length of the var?
you might wanna use const b/c its better.
if anything, try commands.size
ok?
??
Sorry, I was thinking it was a collection.
commands is an object
object.length will give you the amount
commands.<Object>.length ??
π€¦
<> is a placeholder
commands.length
It will return a number
it didn't
here's my code
ms!eval commands.length
...
It can only return undefined if commands has no properties/methods
can u check if it does?
here's an example:
var commands = {
balance: {
aliases: ["bal","money"],
usage: "ms!balance",
description: "See your MakerCoins balance",
permissons: "none",
category: "eco",
do: (message, content) => {
let embed = new Discord.RichEmbed()
embed.setAuthor("Your MakerCoins Balance",message.author.avatarURL)
embed.setColor(0xF8B90E)
embed.addField("Coins", data.coins[message.author.id])
message.channel.send(embed)
}
}
}
@young cradle
did you try .size?
Then use Object.keys(commands).length;
If you want to iterate those objects, you could count how many when iterating
can any one help me here, how would you send a custom emoji? this is for js
custom emojis are formatted <:name:id:>
ye
so how would i send one?
You need to get that string
i can grab the id
and then you can just tell the bot to send it as is
example?
Like how if you tell a bot to send <@userId>, it'll turn into a mention
hmmm
For emotes you can find the stuff to copy by typing \:emote:
so something like this? message.channel.send(`${id of emote} heres the emote`)
i tried that and it didnt work
So like for example
if you wanted to send

If you wanted to send that
you just tell the bot to send this string:
You send that as is.
Discord will automatically turn it into the right emote
so message.channel.send(`${:tickYes:315009125694177281} heres the emote`)
ok
it's literally justmessage.channel.send(" heres the emote")
thanks
π
Yo james the Dem Soc, dont want to ping ya, but how would you get the id of a gif emote?
i cant do :nitro emote: because it just gives back :nitro emote:
really anyone can help me out here
<a:emotenamehere:emoteidhere>
π€
yeah someone has to post it
Who has nitro
To copy the id
Or some inspect element trickery

do you know of this inspect element trickery?
wait u want the ditto emotes?
Oh I was thinking something different
`:ditto:`
::ditto::
<:ditto:>
Or you could try selecting it in the emotes tab with inspect element

And see if there is a salvable id
ok
how did you get the id?
Copied the text
@dusty sandal i found a easier way
whats that way?
i dont want to use a nitro middle man
well i need the ids in the first place which i dont have
do u use js?
yes
const emojiList = message.guild.emojis.map(e=>e.toString()).slice(0, 20).join(" ");
message.channel.send(emojiList);```
u can just run that
ok thanks
i did the slice(0, 20) so it doesnt go over the text limit
he is trying to get emote ids
also @dusty sandal iirc u can get emotes via the name
yes
Via code or just in general then?
whatever works
I mean if it's just in general a backslash before the emote is fine π€·
client.emojis.find("name", "name");
well i want to get the ids for nitro emotes
@elder rapids but it doesnt work for animated emotes
:ditto:
c
thank the lord
ik
They now properly check nitro and remove the raw emote
If you send an animated emote (escaped) you'll see for a VERY brief second that it shows <a:name:id> then disappears to :name:
Discord's bug fix in action π©
also @dusty sandal i shows u another example how to get emotes using a bot in #commands
ikr
Tbh they just made developing with emote stuff harder (You now need a bot to try and fetch the ID)
It's a mild annoyance but you know... when people abuse features then it affects everyone
i agree
hey i asked about this earlier--
https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.logs_from can you use this to store an entire servers history in a text file?
the reason i asked if you can download server history is because i want to run analysis on things my friends say without being constricted by the discord api
i dont see a reason why you can't.. except privacy reasons
what is it with bot devs wanting to be the NSA all of a sudden
I fucked up.
?
is there any way to get the user using a id?
im using discord.py async
i tried using bot.get_user_info(id_goes_here)
but once i tried to get the user name it just gave me an error
'generator' object has no attribute 'name'
...anyone got links to tutorials to get a python bot to play music? tried this one https://www.youtube.com/watch?v=FpRzDY0-I1o and ended up getting mad and quitting because i just couldn't get the extension/cog to work.
this is just a suggestion but dont use python for a music module as it isnt efficient try java cause it has a audio thingy
someone help get my bot to my server im nub .
get @random idol
when i click authorize it show beep. beep.beep. then nothing ....
youre probably right, is just everything my bot already does is in python
@bitter sundial help...
don't you see the captcha
check that you dont have an extension blocking captchas
oh
why would someone have a captcha blocker? whats the point?
Idk
idk i didnt do anything....
My bot will die soon.
reload the page
The apache log got deleted somehow.
@bitter sundial how tho.? im using SAFARI on mac
how to disable it π¦
@bitter sundial
try chrome
firefox should work too
jeff u on pc?
@bleak sapphire u missed the await
how would i make my bot send a message to the main channel upon joining?
in node js
Guild create event -> get guild default channel -> send emssage
I mean what's the lib?
You could search for general and, if it exists, send a message to it
true
no no no
You want the first channel that you have Send Message permissions to
Not every guild has general
What does .systemChannel point to?
.defaultChannel still works btw; you'll just get deprecation warnings
Also need to put it in a try/catch since new servers return null when you try to do .defaultChannel on it
System Channel sounds like the channel join messages are sent to
precisely
Hm. π€
MongoDB or sql vs enmap(with enmap level)? this is not rlly for discord bots but for a db in general
so really you're asking mongo vs mysql vs level
don't forget this thing
ok
Exchange colour and it should be okay
In pillow python. how would I add a border to a transparent image?
Mask on top?
oi
Not here please
Looks good
Not what I want though
The border needs to be even on every side
img = Image.new('RGBA', (128, 128), (255, 255, 255, 0))
font = ImageFont.truetype('/home/alice-bot/storage/KeepCalm-Medium.ttf', 110)
draw = ImageDraw.Draw(img, "RGBA")
msg = "1"
W, H = img.size
w, h = draw.textsize(msg, font=font)
x, y = ((W-w)/2,(H-h)/2)
draw.text((x,y), msg, fill=(255,255,255), font=font)
img.save(fullpath, 'PNG', quality=100)
img2 = Image.open(fullpath).convert('RGBA')
newData = []
for item in img2.getdata():
if item[3] != 0:
newData.append((0,0,0,255))
else:
newData.append(item)
img2.putdata(newData)
img = img.resize((112, 112), Image.ANTIALIAS)
offset = ((img.size[0] - img.size[0]) // 2, (img.size[1] - img.size[1]) // 2)
img2.paste(img, offset, img)
img2.save(fullpath, 'PNG', quality=100)```
Do you save and then reopen?
Stil thought, it's not about whether or not how it's coded.
It still doesn't work.
The border
Focus on the border
Saving it keeps the white
Anyways
I just need to know how to center it properly.
I need to resize the image more aswell
like stretch
Also the offset is always going to be zero
No
It needs to be in the center of the black #1
With offset (0,0)
What needs to be done is make the width longer aswell.
Or if aanyone here have access to photoshop and wouldn't mind adding the borderrs for me?
I have it to weeb
@young cradle @topaz fjord one of you, dm me
Why not here
Its wiz
I don't understand gimp, I know photoshop.
they're quite similar though
Β―_(γ)_/Β―
you're just making a scaled up copy of the original image?
that's not really a proper way to produce a border
I thought it would make it wider as well
oh
I just set up a simple site for my bot.
I still need to make some more commands.
Since my bot got declined.
not the right channel
oof
How would I get the dblapi to log to the console when it recieves a test
I think youd need a webook setup on your bot the check for test in the query string
I'm using dblapi.js for my webhook
check for test in query string
wtf does that mean
@frigid thistle https://discordbots.org/api/docs#jslib
at the bottom
WebHook events
My code: JS module.exports = (bot) => { const DBL = require('dblapi.js'); const dbl = new DBL(process.env.tok, { webhookPort: 5000, webhookAuth: process.env.whpassword }); dbl.webhook.on('ready', hook => { console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`); }); dbl.webhook.on('vote', vote => { if (vote.type == "test") { console.log("Test successful!") } else { if (vote.type == "upvote") { bot.channels.get('441710517460008960').send(`${vote.user} just upvoted <@${vote.bot}>!`) } } // Do what you need to do }); }
I've read that
but when I test the webhook on my edit page
nothing in the console.
if your using localhost idk if it works with localhost
I'm not using localhost
How would I get a hostname for my webhook
It's using the ip 0.0.0.0
@topaz fjord
π
so no need to ping
fine
but
Maybe I should open port 5000 on localhost..?
helloooo
@topaz fjord hello??
URGH
can someone please help me
turle was no help at all
I need some help setting up my webhook, so can you help me?
help moi pl0x
aaa pls
@uncut slate can u help
Read the channel topic
Do not @mention people randomly
https://youtu.be/NG6ktMVrX0U
π₯ What are WebHooks? Learn How to Setup WebHooks Using ...
Webhooks are quite easy to use and are very helpful in providing a callback to a source when an event occurs. A Webhook is a HTTP callback to a source, usua...
I recommend getting an understanding of webhooks first^
@frigid thistle https://www.pokecord.net/webhooks/ a little something i set up, im gonna allow custom webhook message soon. A few people use it now, just to send userid to their discord webhook when their bot gets an upvote
TY @mental solstice!
Only way to tell its a test right now is if your userid votes more than once in 24 hours
mhm
Is there any way to set the message that the webhook uses when the bot is upvoted?
I could do it in a little bit.. how do u want the message to look? Ill just add a parameter to the link youll put im the dbl webhook spot.. keep in mind it will only send userId botId query and type(which just says upvoted i believe)
@frigid thistle if you just use the password parameter with a current password youre using, you can set up to 5 webhooks with that password, and delete them as necessary
your bot would have to turn the userid into the actual user
but i can make it say 1234567890 just upvoted Hulkbot!
would be nice if dbl passed the username with the webhook
i notify players by grabbing the user id, and looping through _client.AvailbleGuilds and finding that user id
you can get the username from the id
How?
Or just sending <@${user}> π
that doesn't give you the username
No crap
that would need a human to read it
a mention is not a username, he asked for a username
a mention isn't going to be a mention either if the user isn't cached
But
@frigid thistle i lied
wat
k
@frigid thistle at the end of generated link you put into the DBL webhook field add &option=1
save it..wait a few seconds and try testing
cool.. glad i took the time to look that up
!ftn help
anyone else, feel free to use my link to create dbl upvote to discord webhook
You actually made a system which logs DBL webhook to a discord channel 
I find it sort of unnecessary. I mean do people really have a hard time making webhooks (even with open source projects people make specifically for it)?
ive tried setting up port forwarding, etc.. cant get it to send webhook to my bot.. so idk, found this way easier
its like 5 lines of code.. to send the dbl hook to discord.. i figure why not
it's been over 24hrs and my bot hasn't been accepted yet oof
oofio
mega oofio
wrong channel?
a possibility
off with his head!!
I would appreciate if I could keep my head
one cant simply post a statement in the wrong channel, and keep his head.. sorry
one could possibly catch a mute if they keep a conversation in here that has nothing to do with development
Im trying to ssh into my raspberry pi, i did >ifconfig in console, what ip do i use in putty?
local ip

Do you know how to read the ifconfig?
you'll want wlan/eth
wifi module: wlan
Ethernet: eth
eth = wired
wlan = wifi
Β―_(γ)_/Β―
@south finch has the fake-tonku bot banner been finished?
you mean bo
netmask, inet, inet6, broadcast are all ips in the section of wlan
im gussing inet?
IPv4 inet, IPv6 inet6, broadcast is broadcast ip, netmask is mask
But that's what you want to look for in a ifconfig
i probs forgot to enable SSH
Probably, or a firewall is just refusing it
i just gave my pi a static ip
but I doubt the firewall part because ... it's not blocking by default
Also same natan
192.168.0.200
Mines what you see above ;P
Worry about static later
it's in router settings
Just get your stuff running
^
okie
so
i need a monitor for hdmi
ill be on mobile texting now :/
cus i need to go to a tv downstairs
okay
SSH is working
but idk how to start my bot with "node index.js" once im in the path because once i exit out of putty it exits the bot
Either create a service (preferred tbh) or nohup and disown it
yeah nohup and disown
nohup node index.js
nohup: ignoring input and appending output to 'nohup.out'
idk what disown is
Yeah that works as well
how do i exit one? lmao
And you'll just need to kill it with the PID
eh
I prefer echoing the PID to a file so I know it later
honestly just use something like forever or pm2
Β―_(γ)_/Β―
Download: 3238.53 Mbit/s
Testing upload speed................................................................................................
Upload: 1407.26 Mbit/s```


Using
Sqlite3 (node.js, discord.js)
Want to
Check if row exists where name and id equal something
Error/Problem
No error. If I have if(row !== []) it sends false positives and if I have if(row == []) it never sends a positive. Row is equal to []
if (row[0]) {
exists
} else {
doesn't
}
wow I am dumb
because if there are no results
there will be no first result
otherwise it's always an array
and ur checking if it is an array or not
Yeah should of thought of that. Thank you
Β―_(γ)_/Β―
how do i send a message to a specific channel using shards in discord.js? I tried this:
client.shard.broadcastEval(client.guilds.get(id).channels.get(id)).then(channel => {
channel.send("message");
});```
but that didn't work 
doesn't it have to be a string
ids are a string not a number
how do i make a my bot send a message to a channel every 1 minute? i was able to get the channel id and store it in a database but i dont know how im gonna make the bot send the message using a on_ready event
heres my current code
im using discord.py async with mongodb
@bot.event
async def on_ready():
print("ready")
if db.messagetimers.find({"channel_id_by_timer"}).count():
i dont know what to do now after that
@dense cape wat wont download?
errors while downloading?
Yes
wats the error 
While downloading Dependents
does it need node-gyp?
integer@1.0.3 install C:\Users\user\node_modules\integer
node tools/install
C:\Users\user\node_modules\integer>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error
MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK vers
ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\user\n
ode_modules\integer\build\integer.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\user\node_modules\integer
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
@dense cape iirc node-gyp was changed to node-gd so thats why it is erroring node-gyp is outdated and depreciated
How does one fix?
use a different db
Cant
why?
This one is better than all of them
doesnt quickdb saves in a json
All formats
use mongo or sql or enmap
@bleak sapphire
maybe just
await bot.send_message(bot.get_channel("ID"), content="")
await asyncio.sleep(60)```
I'm using this for twitch notification and it works for me
well its working but its only sending a message in one channel in the database when there are two channels
@bot.event
async def on_ready():
print("ready")
#data = db.messagetimer.find({"channel_id_by_timer"}).count()
#channel = bot.get_channel(data)
try:
for names in db.messagetimers.find({}):
channel = names['channel_id_by_timer']
interval = names['interval_by_timer']
message = names['message_by_timer']
while True:
await bot.send_message(bot.get_channel(channel), message)
await asyncio.sleep(interval)
except Exception as e:
print(e)
current code
'channel' var is a list?
can one of you quickly test something for me (nvm)
channels is a list of IDs
ok srue
wait
im having issues printing it but it basically prints it like this
4
4
1
5
7
6
5
5
6
0
9
6
2
5
8
0
5
2
and it only prints one channel ID
@elder stratus
Could you send whole on_ready?
mongodb_host = "localhost"
mongodb_port = "27017"
client = MongoClient(mongodb_host + ':' + mongodb_port)
db = client['messagetimers']
bot.remove_command('help')
# Start
@bot.event
async def on_ready():
print("ready")
#data = db.messagetimer.find({"channel_id_by_timer"}).count()
#channel = bot.get_channel(data)
try:
for names in db.messagetimers.find({}):
channel = names['channel_id_by_timer']
interval = names['interval_by_timer']
message = names['message_by_timer']
for channelxd in channel:
print(channelxd)
except Exception as e:
print(e)
#payload = {"server_count" : len(bot.servers)}
#async with aiohttp.ClientSession() as aioclient:
# await aioclient.post(dbl_url, data=payload, headers=headers)
await bot.change_presence(game=discord.Game(name="Successfully connected"))
await asyncio.sleep(10)
await bot.change_presence(game=discord.Game(name=f"{len(bot.servers)} Servers | ts help", type=3))
it pretty much prints the last channel id
in the db
hmmm
wait i remember reading a stackoverflow post about printing the entire thing
lemem find it
I've never used db
Then it's the time to start lul
Yeah...
this is harder than i thought
getting the channel id and putting it in the db using a command was easy though
but damn it
lol

is it possible to run mongodb on heroku xD
Wait
I probably know how to fix this
try:
for names in db.messagetimers.find({}):
channel = names['channel_id_by_timer']
interval = names['interval_by_timer']
message = names['message_by_timer']
channels.append(channel)
for channelxd in channels:
print(channelxd)```
@bleak sapphire
lets see
It should work
btc

probably my local internet connection, because when I was testing, i was testing with GCP's IP
not with localhost
and my internet's quite slow here
hmm
maybe it was because of that
tfw your bot and dbl library aiohttp versions are incompatible so you manually post the server count with only aiohttp.
Yes. 
Managed to get more errors for one function than overall in my entire life. 

All those fucking multidicts and shit. 
At least it works.
Or not.
Yay, asyncio gave up on life.
It works fine on start but not after 30 minutes.
π¦
import aiohttp as snekfetch
lol
(DIscordGo) Hi, I need help. Can someone tell me how do I check response time for my bot?
DM me
Checkout DAPI
I know a good one
Hi
hi
hi
hi
bans = await guild.bans() is this the right way to get a list of banned users?
discord.py btw
Hey all. Which service do you use to host your bot? I tried Zeit, but it spins down the app after a few hours
I use DigitalOcean
Interesting. Never heard of it
my bot is on Vultr now
Are both free / paid?
paid
And do they sleep if no-one pings it in x amount of time?
they dont
How much, if you don't mind me asking?
lowest tier in DigitalOcean $5/month
Vultr $2.5/month (only in some regions, maybe, often out of stock; next tier is the same as above)
Cool. I don't expect anyone to actually use it, so I'll try Vultr
also
Ideally I'd like a free service that doesn't sleep with x free executions / month
are you a student
good luck finding a free one like that
they dont exist and if they do, only for a short amount of time
you can get $50 in DigitalOcean credit if you're a student
When something is free to you, someone else pays for it in some way
oh and protip
if you register a vultr account and wait, they'll email you a promo code to get $20 free credit
someone here knows vue and can help me with it?
you can host on github thing (forgot how it's called) for free if you are a student
skysilk has a free plan which is enough for a bot with like 500 servers
What u think is the best way to make a help command that looks the best?
Discord.js <-----
Try ```
I mean should I make it a embed or something else
For an image? You do what you like most
For bot command
Embed is for images
Probably other files as well
good beginning for my bot 6 commands
What is the safest way me to upload my bot to github?
Brb, gonna configure my bot
preferrably both
@spring ember still need that vue help? Can help in like an hour if it's not a quick question
lol
Been like past an hour but hi I'm here @spring ember
https://hastebin.com/fitejanage.js why doesn't my xp system work properly? It resets everytime the bot launches
pro-tip don't use files (json files) as a way to store that data
For scalability it is horrendous
It worked like 3 days ago though
json is never good as a db/storing data like xp
writing to a file thousands of times a second is terrible
You'll bottleneck pretty damn fast the way you're doing it
Ok
I suggest using a db instead of json because I can tell you from now, you'll most likely regret using json for a db
so it'd be xp.db?
no
oh
A database is a program
It's a program that runs in the background 24/7 that manages... the obvious of data
what program do you guys recommend?
Choosing a database is really up to what your needs are
rethinkdb, sqlite, etc are good ones
I need it to store xp systems
mongo is good too
but nothing else really
NoSQL is probably nicer for XP systems
Since you're writing a lot and remove unnecessary indexing and other relational stuff
now its not even adding xp to anyone
Depending on your bot size you're likely bottlenecking with this
prob
If several message events are being triggered you'll bottleneck VERY fast
True
You have to consistently keep reading the file and then consistently write to it
Both having a lock mechanism

Terrible on performance
so what database should I use and how would I get it to work with my bot?
You have to pick yourself
We mentioned Mongo and Rethink (NoSQL databases)
Do some research yourself and what might be best for you and what you'd prefer
Ok
I'm going to personally say I'm using MongoDB for everything in my bot and that means XP system too
rethink is easy
if he comes back and asks if something like sqlite is good imma kms
But I have oodles of other stuff on top of it
at least sqlite is somewhat better than mysql

just my opinion, don't murder me
understandable
Β―_(γ)_/Β―
pretty much
everytime i try to install better-sqlite3 i get an error
Can you post the error
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\oaf\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:125:13)
gyp ERR! stack at ChildProcess.emit (events.js:213:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\oaf\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\WINDOWS\system32\node_modules\integer
gyp ERR! node -v v8.7.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'C:\WINDOWS\system32\package.json'
npm WARN system32 No description
npm WARN system32 No repository field.
npm WARN system32 No README data
npm WARN system32 No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! integer@1.0.3 install: `node tools/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the integer@1.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\oaf\AppData\Roaming\npm-cache\_logs\2018-05-04T21_14_54_150Z-debug.log
did u install node-gyp correctly?
node-gyp?
it seems it is a prerequisite
use option 2
use option uno
one π
two
try both

because most people seem to succeed with option 2
One is just an easy one line install
delete system32 problem fixed
You can't
npm install --global --production windows-build-tools
well
dont want to argue
with novus
so do that
as admin
pls
turtle ish joke
yes ik
Obviously second is nicer because you'll succeed more
i installed build tools wrong then
But it's the problem that they'll have to pain with getting all the deps for it or the build tools to make it etc..
i still get errors
Error: Cannot find module 'better-sqlite3'
and i literally installed it like 3 times
Then check if this is the package name
it is the package name
Make sure it is in the node_modules
i installed it globally
i dont know anymore





