#development
1 messages Β· Page 399 of 1
I live in wy, most people get a much better one
(round it down)
u dont unless u dl it
no not that, if you Math.floor it it wont have that ugly 33333333333333333333333332
dbl! ping
essentially removing stuff after the decimal point
:(
ohh so it doesnt include after the .
yes
heh
I'd remove the underlines, it makes it kinda hard to read, bot creator is missing discriminator and move mb part of ram usage to the end of the value
Will do, great ideas btw
Also probably want to check how it looks without code tags formatting?
yea might be cleaner
Do I have to make the bot download every users pic in order to do that :/
as far as the side by side edit log?
You can use snekfetch to make a request to the avatar URL, you will be returned with a buffer you can use within canvas
pretty sure old avatar will still exist for a while
man you guys are so much more helpful then most the discords im in
well cause most of the people here uses js and makes discord bots
Guys I want to know how to make my not gets info online
Because I want to make my bot gets games stats online
I want an api example
lang?
coding lang?
yeah....
@hot sleet What is the programming language that you're using?
Js
@low rivet @lament meteor Was that so hard?
try using snekfetch, i dont use node js personally but its recommended by a few devs i know
https://github.com/devsnek/snekfetch/blob/master/README.md you can see some examples here
if u are new to node.js then u can install it via npm install snekfetch
ill give u a fancy small example
snekfetch.get("link").then(r => {
console.log(r.body) //do r.text if it is only text
})```
the readme has examples
he cant read
I can strongly vouch for Snekfetch as a NodeJS developer (both professionally for work and casually for discord bot) btw ^^^
It really is http requests made simple and without all the bullsh*t other libs require
Hey guys, let's say I want to integrate graphs(not real time) in bot response messages.
Is there a way to do it? (besides generating image by another service and including in message)
coding language?
js
are u using node.js?
yep, discord.js
no node.js and discord.js is 2 differnt things
node.js is a runtime and discord.js a library and it is a npm package
I know man, ima professional dev =)
included API lib so you know on what base I've built the bot
u can make a graph using https://www.npmjs.com/package/canvas its a bit hard to to download but it is rlly gud
@lament meteor ok, but how to integrate in discord message?
@hot sleet
as for how to use it, adding to Telky's
const request = require('snekfetch');
request.get('https://xkcd.com/info.0.json').then(res => {
if(res.ok) { // is only truthy if you got any of the 2XX HTTP responses
console.log(res.body)
}
}).catch((err) => console.error(err))
Although I personally prefer async/await with try/catch coding:
const request = require('snekfetch');
const run = async function() {
try {
const res = await request.get('https://xkcd.com/info.0.json');
return res.body;
} catch (err) {
console.error(err);
}
}
run();
message.channel.send({files: {}})
something like that
@earnest phoenix u know request is also an npm package to grab stuff from websites
yes but you can assign a require to anything you want
yup
As for drawing can be a lot of hell on NodeJS tbh. I personally used Canvas-Constructor because it's .. well.. it's canvas but a lot easier coz it's a constructor. But that's just for a rectangle, not a graph 
Well I can use d3 with canvas, and produce png
and that can work as separate service
so it won't overload bot
dont rlly use canvas Β―_(γ)_/Β―
this is how I build a rectangle
const canv = new Canvas(80, 60)
.setColor(hex)
.addRect(0, 0, 100, 60)
.toBuffer();
hex being a variable of '#FFFFFF' type
then I convert that buffer to base64 string (canv.toString('base64')) and upload it to imgur with imgur npm package to embed it into discord (imgur.uploadBase64(canv.toString('base64'))
Oh image manip
It's gonna take a lot of fiddling but im sure you can build a graph with that.... the 0, 0 in my addRect are X and Y pos so you can manipulate where the rects go into the total canvas
I suppose something like 0, 0, 20, 40 then 20, 0, 20, 60 would work ?_? I forgot which values are X and Y tho but I mean a staircase shaped graph
If Canvas is like Graphics you'll be able to draw an image on top of an image
ye it can
Noice
if your first image is 50 by 50 and you place the second one of 10 by 10 at position 20 by 20 then it will be over the first one
coz well... 50 up from 0 << 20 up from 10
Have premade templates
@earnest phoenix the thing I don't understand completely, is what discord will allow me to embed inside message
It doesn't allow me to embed html right?
Only complete files
like png, or smth like that
What?
no, that's why I upload it to imgur
which returns an image URL
ok
can I upload like 5 images in one message?
if you want to see the full implementation of those snippets I showed before lmk coz my bot is open sauce
@earnest phoenix thanks man, I'll pm you If smth
but for now I don't see image generation as an issue
in any case, thank you guys for your time
wait so if i got rejected can I fix my bot and re-apply?
ping me if someone responsns, or I won't get it
alright I see to be too dumb to test the discord-bot webhook request thing and I honestly don't see the issue....in a nutshel I want to reward my users with voting for the bot and it seems to be recommended to use a webhook for this. My bot is currently implemented in python and my current approach is to implement a webhook via Flask aka. ```
python
from flask import Flask
import json
app = Flask(name) # Standard Flask app
@app.route('/', methods=['POST'])
def foo():
// TODO: data = json.loads(request.data)
print("YAY")
return "OK"
if name == "main":
app.run(host="0.0.0.0", port=8080)
I have a code in github you can use.
dbots-webhooks-py - Just an example for using webhooks for DiscordBots.org.
Has a rewrite example and a flaks example.
Stores everything in the json.
@hollow palm
thanks β€
would be helpfull if there would be an ooficial thing maintained / (or even referenced would help)
I can maintain this.
idk
dont run your bot as root π
I know, it's just an example.
Is there a way to multi-auth your vps with sms or mobile phone.
@spring ember @earnest phoenix discord allows up to 10 files uploaded/message, as long as the total size of them is smaller than 8 MiB
Unclosed connection
client_connection: Connection<('discordbots.org', 443, True)>```
Always getting this and a list of headers on startup
Connection to discordbots.org is unclosed?
I mean it kind of says it. Is it being closed?

I don't really know your whole language or library but I'm just giving an educated guess
So... python
yep
I don't really know much of it but my educated guess is a connection is unclosed
yeah i am as far as you
Maybe look for something that would hint to that
it only appeared after I switched to my VPS and turned off the old hosting
Anyone has experience with RabbitMQ and able to give me a hand?
anyone of you knows how to get a server id using the server name? im using discord.py
The only thing I can think of is enumerating client#servers
You could optimize the runtime performance of that by using a "dictionary", but ah
perhaps not worth it for ~1000 objects in the list or however you have
oh
Library discord.py
can anyone help me out on this
so basically i made a command which dms me all the names of the server my bot is in but i want it to include the server id so heres the code that i did
# Servers
@bot.command(pass_context=True)
async def servers(ctx):
if ctx.message.author.id == OWNER_ID:
lol = bot.servers
await bot.send_message(ctx.message.author, "\n".join([blah.name and blah.id for blah in lol]))
else:
emd = discord.Embed(title=noperm, color=0xff0000)
await bot.say(embed=emd)
but its only giving me the server id not the server name
Does anyone know how to use the C# System.Net.WebSockets and emit events when its connected etc.?
I do and have done that
i actuall found a good example but its using Actions over Events so i currently rewriting it
still thanks tho
Mkay
if anyone knows about ruby and bundler stuff, go ahead and answer this.
i'm setting up a mastodon and one specific dep is causing trouble (charlock_holmes). a specific flag lets gem install it, but bundler refuses to use it. how can i pass compiler flags to bundler?
^ nvm, found the option
How do I set multiple prefixes? Meaning for example ! and ?
example:
?help = !help
Code it
@ashen quail look at this: https://github.com/corpnewt/CorpBot.py/blob/rewrite/Main.py#L22 (not my code)
ok
Its not that hard to implement multiple prefixes
I still dont get the shitty webhook working with python ffs
get prefixes -> loop through them
Or do it the cool way with O(1)
HashSet<string> hashSet;
if (hashSet.Contains(string))...
if you have more than a couple of prefixes you have to worry about way more stuff
default, mention, custom
well, true
adding to a hashset would be less memory efficient and most likely slower
Β―_(γ)_/Β―
I basically abstracted Prefix
interface IPrefix
{
bool ContainsPrefix(IMessage message)
}
Then you don't need to care about the prefix type
can someone explain why testing the voting webhook from discordbots.org doesnt result in any visible requests, but when using the same url in hurl.it i can at least see an error message?
and performance doesn't matter anyways for such a simple calc
i just do some if-else chains
someone speaks Portuguese?
ligatures
Yea
font's firacode
I speak Portuguese
'-'
@inner jewel https://s.put.re/sSgmtxH.png ye, I have these vertical lines for that
It seems that only I speak Portuguese. π¦
i have them too but on some places they're still not enough
oh, they are kinda hard to see
What are you talking about?
Fonts and lines
Math.min(Math.max((all.head.toDouble * GuildMusicPlayer.normalSpeed).toInt, GuildMusicPlayer.minSpeed), 2 * GuildMusicPlayer.normalSpeed/*GuildMusicPlayer.maxSpeed*/)like this for example
π€£
colors help in that
True
You should keep this chat English only. For other languages please use #memes-and-media.
it does
webhook works for me
sorry caps
your code must be broken
I'm not even using my code π
ledgit just testing on webhook.site
tested with firefox, chrome...simply nothing
wtf is this then
does the "Test" works or the actual voting?
cause so far i just tested the "test" webhook
and there is simply no request comming in
both
does it needs to be unlocked for the bot or smth
why use a online tester
cause its not working....
it should also work when you use an online tester and no it doesnt work with code either
there is simply no request comming in
did you save before testing?
yup doesnt change anything
i am too
no I'm going to test with windows....currently on linux (which should not matter at all)
snooozer I think you're doing something wrong
Well i honestly don't see what i can do wrong with the testsite
Error: https://pastebin.com/um8vHgLp
Code: https://pastebin.com/eHif4h00
please someone help!
voting webhook works now (including with the testsite); havent changed a single bit so no clue what changed to get it working
each time I do shelp it is equivalent as -help anyone know how to fix it? dm me and I will dm you main.js prefix.json and help.js so that you can help me figure out WHY
send me
@bot.event
async def on_server_join():
await bot.change_presence(game=discord.Game(name="arc!help | {} users and {} servers!".format(len(set(bot.get_all_members())), len(bot.servers)), type=3))
embed=discord.Embed(title="I've just joined a server!.", description="New statistics", color=0xff0000)
embed.add_field(name="Guilds", value=len(bot.servers), inline=True)
embed.add_field(name="Members", value=len(set(bot.get_all_members())), inline=True)
server = bot.get_server(" 378463469038469141")
await bot.send_message(bot.get_channel("436750375220150283"), embed=embed)
@bot.event
async def on_server_leave():
await bot.change_presence(game=discord.Game(name="arc!help | {} users and {} servers!".format(len(set(bot.get_all_members())), len(bot.servers)), type=3))
embed=discord.Embed(title="I've just left a server!.", description="New statistics", color=0xff0000)
embed.add_field(name="Guilds", value=len(bot.servers), inline=True)
embed.add_field(name="Members", value=len(set(bot.get_all_members())), inline=True)
server = bot.get_server(" 378463469038469141")
await bot.send_message(bot.get_channel("436750375220150283"), embed=embed)``` These should print to my server but nothing sends and I don't get an error in the terminal.
How do I set a Listening activity in discord.py async?
It has the channel specified, just won't send.
@gilded thunder rewrite branch uses on_guild_join and on_guild_leave
and it should be activity=discord.Game(...
I'm on async.
@gilded thunder, switch to rewrite, your discord.py async code may not work soon, get Rewrite by doing pip install --upgrade https://github.com/Rapptz/discord.py/archive/rewrite.zip.
I guarantee you making a bot command for you (bot developer) is easy.
I did the asnc2rewrite tool and the code doesn't work.
Did you switch to rewrite?
no he didnt
Still on async.
why is it hard to trans to rewrite
is_owner() and is_nsfw() exists on rewrite
except for async
they dont exist in async
maybe make a file and import that
I need to stop with the bad answers before I get muted
I need to stop asking for help when I don't get any.
I am not sure what that means. Like Java? C#? Etc etc? Because if so, I don't really use any.
JavaScript is good
Learn js, it's the easiest and cleanest
everything and anything use it
I use java lol
i use javascript
So, how do I actually set it up, I have a bot in discord, but I'm lost on how to actually access any code for it.
script is good
python :/
Mybot.js file
Where do I find that?
npm install discord.js --save
@spring ember lol py is cleaner
Also I'm sorry for the stupid questions :x
Ok when you code a bot, you are creating an instance that responds to commands
@fossil osprey learn a language first. and then think about bots.
@fossil osprey get to know the language, see examples and build a bot not public but for you to get experience
Will do, I just didn't know how to access the coding was all. I have it set to a private discord, but didn't know how to actually work on it with the if thens or what not. All I wanted it to do was mention someone if a specific input was met.
But yeah, I'll go youtube it or something, thanks.
if you will learn js use IntellJ Idea
VS Code is probably your go to IDE when it comes to Javascript/Typescript
JS is like if (some thing ) do something
java like #if function not at all (something.and.something) wait then say and wait then sleep then do something
xxD
@spring ember
π π π π
That's bullshit Java's if statements are the same. At least it would be relatable... Also let's not start a conversation in development
it was a joke
Ik but it's not funny because it's too far from the truth that it's not relatable
@earnest phoenix does it work in other servers and not this one or it doesn't work at all?
Yeah I will check other servers
Because your bot doesn't work in this server yet, because it wasn't approved yet
Any errors?
np 
Nah it was showing just loading. And wasn't turning yellow or green as it wasn't coming online.
But now ...it's working just fine.
library?
π€¦
anyone have any idea how long rate limit bans last? lol
Ratelimited from?
discord
depends on the route
not sure which rate limit just getting 4008 rate limit exceeded
the people in .net api told me to ignore the preemptive rate limit, lol got 25 servers last night, and woke up banned.. its been 5 hours
Ah, usually you can ignore the preemptive ratelimits
voice channel join/leave/move/presence updates are WS
It's possible that someone abused your bot or you did something weird
i dont have voice stuff, idk
the 4008 doesnt have anything to do with sending/modify messages or reactions?
ok, idk.. ill have stop my bot from joining any voice channels i suppose
i emailed discord about it, just recently though.
https://hastebin.com/lezuzufuxa.cs beautiful, ain't it? π
Don't you love big ass switches
I never liked the ```stuff
stuff
{
}``` style
Well, preference
what bothers me is that I have to use these switches in order to restructure a bullshit JSON
https://s.put.re/t8GZ5bc.png who thought it is a good idea to have these mappings.
I literally have 20 of these code blocks, everything stays the same but ""StackableRangeName":" changes to reflect a new property
def simplify(n: Node): Node = n match {
case Neg(Neg(x)) => simplify(x)
case Mul(_, Int(0)) => Int(0)
case Div(Int(0), _) => Int(0)
}```and etc
it's not really that hard tbh
Mul(Int(0), _) => multiplying 0 with anything
so it just replaces with a 0
Oh shoot, I gotta go sorry. I was supposed to be somewhere in one minute.
How long can my bot be offline before its removed?
It won't get removed unless certified
Its not certified, but thank you.. Currently banned from discord for breaking RLs :(
Code https://hastebin.com/sotemujipa.js
Error: https://hastebin.com/ofexoneleb.rb
Can anyone help me?
Embed Title cant be empty
Yeah well what do I put in it?
A string
yes it can be
just an empty one? LIke this (" ")
Sure.. cant be ("")
okay lemme try that
Nani says it can.. but i had the same issue in c#
Title of the embed can be empty, but a title or value of the field can't
You probably have a null value somewhere here:javascript .addField("Bot Name", bot.user.username) .addField("Created On", bot.user.createdAt);
@ashen quail
okay, just keep in mind that you probably want a string there at all times
hello any developer here - developed a tipbot walletbot for simplewallet cryptonote/cryptonight ?
please message me -i want a bot for my coin
yo for discord.js, how would i test to see if a person has a role?
Member object?
?
I think it has roles
ok
guildMember.roles
i shall try that
@spring ember how would i list the roles? like guildMember.roles() or guildMember.roles[]
It is better to check permissions imo
That's not how you get a guild member
If it isn't an exclusive role
im trying to see if a member has a specific role
if(member.roles.includes(role))
Includes whoops

Java 
@night imp .has() actually
@dusty sandal it'd be .has not .includes or contains
Ye
so .hasRole?
ok thanks
Np
Error: https://hastebin.com/cozekovelo.pas
Code: https://hastebin.com/pivozaneyu.coffeescript
Anyone, please help!
use message.member.permissions.has()
Ok I will try that
I need help with images with my bot, I have all the code I think I need, some code for the image (that worked before) and code for the embed (that my bot uses all the time) and I need help figuring out how to put them together to make a working image command for my bot
Error: https://hastebin.com/isonisomop.css
Code: ???
code?
e!help
no
what is it then
its the id of who voted for the bot
user id
ok
hi natan
henlo turtle
heck
How do I wait for someone to react with Eris?
Eris doesn't have builtin reaction collectors, you'll have to write your own
wew
not very hard to do, you can use one of the many message collector mixins and adapt it
alternatively you could hook up a listener and then discard it immediately
const listener = (reaction) => {
Client.removeListener('messageReactionAdd', listener);
// whatever else u wanna do
};
Client.on('messageReactionAdd', listener);
but I'd suggest just using a normal collector
does anyone know how to get total user count in all guilds with Discord.NET?
Loop the guilds and get the total member count. Don't remember member count api top of head
About the best I can tell you
it should be SocketClient.Guilds.Count
Thats Guild count, im looking for Client count
you mean User Count
Wrong
Use MemberCount
Or whatever that api is, not the guild.users.count
In discord.net that is
client.user.setActivity(`=help | On ${client.guilds.size} Servers With ${client.users.size} Users!`);
The guild.users is a cache not a reliable item
that but in c# π
I have my client config set to cache all users so idc 
How would I go about making a reaction collector
in Eris
is there something to wait for an event
Discord.net is pretty good on memory usage even when catching all users
Error: https://hastebin.com/isonisomop.css
Code: ???
What exactly should I do?
.
function x() {
await y(); //BAD
}
async function x() {
await y(); //good
}```
I need help
Just ask the question if you need help
either im blind or im on the wrong site but i cant seem to find my bot
was the ui updated recently?
nvm
Leaves the server
I have nginx on port 80 and flask on port 5000. I can't remember how I did it, but how would I set port 5000 as my default one like
to just
x.x.x.x```
I'm using a namecheap domain if I can set a specific port for my main domain.
use a reverse proxy
with nginx
there's no such thing as "default port"
the browser uses 80 (http)/443 (https) if you don't specify one
Got an example of a reverse proxy?
server {
listen 80;
listen [::]:80;
server_name your.domain;
location / {
proxy_pass http://127.0.0.1:YOURPORT$request_uri;
}
}```
Should I set the domain as my IP or my site domain.
domain
Ah ok, so set @ and www records for my ip on namecheap
then do this
ty
It worked! @inner jewel
@inner jewel I have a problem. It mostly works, but after I login from discord into the dashboard, It rediects to the proxy_pass localhost:port url.
your redirect uri on discord
In developers?
oh
no
It redirects to alicebot.pw/callback
It's set to the domain.
I mad eone, have one.
to that
Same domain
it's is
It logins fine.
Once I login though, it should redirct back to dashboard but the domain is in place of the proxy_pass. @inner jewel
Β―_(γ)_/Β―
Once I login though, it should redirct back to dashboard but the domain is in place of the proxy_pass. @inner jewel
@topaz fjord
with the localhost and ip
Tutorial on how to use webhooks on discord bots?
is anyone gonna help me with code for images in embeds (discord.js)
@earnest phoenix
ty
ty so much
do you have a node.js one I could use? I kinda use both (it works but it is annoying to work with at times)
this is the code I have for embeds:
client.on('message', message => {
if (message.content === 'Ny.about') {
message.channel.send({embed: {
color: 0xff33cc,
author: {
name: client.user.username,
icon_url: client.user.avatarURL,
},
fields: [{
name: "About Nyro",
value: `Nyro is a Discord bot developed by 2 main developers named Safyre Lyons (the owner) and Logan.\n\Safyre: Hating Life576#6532 | Logan: Logandev_#9999`
}
],
}
})
}
});``` (taken from my about command)
and it doesn't seem that discord.js code I have (I been told it is discord.js code by the friend helping me)
I might go to him for help
oh ok
ack it is creating errors, I don't like discord.js, I am gonna wait until tomorrow to see if my friend (who is helping me) is online so he can help me, this is confusing af,
if you use an object like js embed: { description: 'whatever', image: { url: 'link-to-the-image' } }
well description doesn't even needs to be here
but anyway yeah there's a image property
check this out for reference
ok thank you
I got it to patially work, had to edit the code a lot
Hi, I started a bot using heroku, but when i deploy using heroku, the bot never runs
It does this:
-----> Installing requirements with pip
-----> Discovering process types
Procfile declares types -> worker
-----> Compressing...
Done: 44.3M
-----> Launching...
Released v27
https://peep-bot.herokuapp.com/ deployed to Heroku```
but then the bot never runs
halp pls
and yes the bot does work with the bot.py i set it up with
check logs
what logs?
heroku logs

i need help with js
not working
if (message.content.startsWith(prefix + 'prefix')) {
var args = message.content.split(' ').slice(1);
var prefix = "gco";
guildConf[message.guild.id].prefix = args[0];
if (!guildConf[message.guild.id].prefix) {
}
fs.writeFile('./prefix.json', JSON.stringify(guildConf, null, 2), (err) => {
if (err) console.log(err)
});
}```
Developed
@twilit wolf what
how do I setup the webhook?
My bot.js file throws the error in the image below when I attempt to run it and the log window shows 'Value cannot be null.
Parameter name: solutionDirectory'
Are there any pointers for this issue? Thanks! ^_^
how are you running it?
double-clicking the file in File Explorer
but I got the log window readout from Visual Studio as well
you need to use node for it
^
you mean open node.exe and like console command it to run kind of thing?
yes
cmd.exe or node.exe?
ok
so navigate to the proper folder and then just write 'node bot'? That's not seeming to do anything.
node bot.js as a command isn't doing anything either
ahhhh that might be it; node needs to be installed in the same path as the bot's project folder? I've got node in Program Files and bot.js somewhere down in a Documents subfolder
there's what I get for trying to be organized
@spring ember node help 
Lol I couldn't think of something else
is it alright if I pester you folks for help with what the file structure/relationship between the two should look like? I've got them in the same area-ish now but it's still not right.
Like now I've got Documents/nodejs and I've got Documents/SurvivalGuide (bot folder)
do anyone here can check heapdumps xD and tell me what they think or if there is a leak on it
@lilac path try using node -v to check if node is installed in your system, if it doesn't work, uninstall node.js then re-install it, but just don't change anything in the installer
@trim plinth successful response - v9.11.1
ok it's installed fine
that's why I asked about how the folders/files should be arranged in relation to each other
now just change directories to your bot folder and type node bot.js
or whatever your file is called
@trim plinth ```C:\Users\Dayne>cd /d C:\Users\Dayne\Documents\nodejs
C:\Users\Dayne\Documents\nodejs>node -v
v9.11.1
C:\Users\Dayne\Documents\nodejs>cd /d C:\Users\Dayne\Documents\SurvivalGuide
C:\Users\Dayne\Documents\SurvivalGuide>node bot.js
'node' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Dayne\Documents\SurvivalGuide>```
did you switch the node.js folder into documents 
^
so when you run node -v in C:\Users\Dayne\Documents\nodejs
it uses the node.exe in that folder
Powershell goes gay when you try node
right, Natan
But yeah what natan said
do you know how to modify environment variables?
the env vars are looking for node.js in the original path, not in documents 
that probably explains it
I don't, my dev experience is "some classes in college" and what I do fiddling around until 6am. Either way, it's installed in Documents to keep it close to the bot location.
you could add it either to system or user environment variables
i'd recommend user since it's on your user folder
you'll also need to close cmd and reopen after you update the variables
Can someone tell me how to send Messages with Java in Youtube Livestreams?
alright lemme see if I can manage to follow instructions π€
I've gone and done that- added it to user environment variables. And still, it acts up. ```C:\Users\Dayne>cd /d C:\Users\Dayne\Documents\SurvivalGuide
C:\Users\Dayne\Documents\SurvivalGuide>node bot.js
'node' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Dayne\Documents\SurvivalGuide>```
{ Error: Still spawning shards.
at ShardingManager.fetchClientValues (C:\Users\frisby\node_modules\discord.js\src\sharding\ShardingManager.js:187:70)
at Shard._handleMessage (C:\Users\frisby\node_modules\discord.js\src\sharding\Shard.js:138:22)
at ChildProcess.emit (events.js:180:13)
at emit (internal/child_process.js:783:12)
at process._tickCallback (internal/process/next_tick.js:178:19) name: 'Error' }
having this error in my discord bot
:/
probably trying to interact with shards like broadcastevak something while they are still spawning
maybe theres an event when they are done so just wait for that
okay thanks
@earnest phoenix you're trying to fetch values or broadcastEval while the bot is still spawning shards
its just giving me this error while im doing nothing π€
stats command?
ready event? (it'll be emited each shard)
bot is working fine but just giving me this error.
i dont know why
ofc it will work fine but you're using client.fetchClientValues somewhere before all shards are ready.
lemme check
which one could be giving errors ?
i need to learn more JS .-.
Probably this one
Fixed The fetchClientValues Issue Thanks !
now getting this great !
any good porn json apis?
π
cuz im proper horny rn

no
click on that path there
that is what is causing the error most likely, or is at least linked to it
oky thanks
Code: https://hastebin.com/cirujoqomo.swift
No error
The say command won't work!
whats wrong
Error: Please install sqlite3 package manually <--- how to fix that ?
Full Error If It Helps
Error: Please install sqlite3 package manually
at new ConnectionManager (C:\Users\frisby\Desktop\Bastion-master\node_modules\sequelize\lib\dialects\sqlite\connection-manager.js:31:15)
at new SqliteDialect (C:\Users\frisby\Desktop\Bastion-master\node_modules\sequelize\lib\dialects\sqlite\index.js:14:30)
at new Sequelize (C:\Users\frisby\Desktop\Bastion-master\node_modules\sequelize\lib\sequelize.js:239:20)
at Object.<anonymous> (C:\Users\frisby\Desktop\Bastion-master\bastion.js:43:20)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
at startup (internal/bootstrap/node.js:201:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
fixed nvm
i need some help for js. How do i get a bot to add a role to the person who typed in the command? If i do message.author.addRole() it doesn't work
Use a guildmember
message.member.addRole();
ok
i cant make embeds with my bot, this is what shows up :/
@inner jewel i got it working
π€¦π½
Hey guys, could anyone help me code this Discord API thing on Python? I tried to install the discord api via PIP, I'm using python 3.6, when I tried to tdo it, It said my aiohttps needed to be 3.4.2+ -----
Does anyone know how to make commands case insensitive?
!help
How do I host a lavalink server, I have java installed etc but when bot requests it to play it gives an error
, launches fine but errors on play http://everyone-on-planet-earth.can-fuck.me/putty_2018-04-22_08-00-56.png
what's the output of java -version?
root@ns391207:~# java -version
openjdk version "10.0.1" 2018-04-17
OpenJDK Runtime Environment (build 10.0.1+10-Ubuntu-1ubuntu2)
OpenJDK 64-Bit Server VM (build 10.0.1+10-Ubuntu-1ubuntu2, mixed mode)```
10 is not supported for sure
that's a certificate error
ok
could be spring for all i know
try without open-jdk?
personally i never had issues with oracle jdk
can anyone help me with some js? I want to be able to only run a command in one specific server. Basically it would detect - if command run is in correct server, run the command :: if command run in any other server, give an error message
Code: https://hastebin.com/cirujoqomo.swift
No error
wot
My say command wont work!
easier say command:
if (message.content.startsWith(prefix + "say")) {
if (!message.member.permissions.has("MANAGE_MESSAGES")) return message.reply("You do not have enough perms!");
const sayMessage = args.join(" ");
message.channel.send(sayMessage);
How do i add variables into my commands?
Like "&command [variable]"
@trim plinth
that would be ur args
Could you put an example?
@topaz fjord What do you mean? And could you give an example?
I'm trying to make my bot react to messages with cmds that dont exsists
like s.ehfywufg
var botCommands = ['purge', 'kick', 'ban', 'say', 'help', 'info', 'aha', 'ping', 'flip', 'd4', 'd6', 'd8', 'd10', 'd12', 'd20', 'lonely', 'sapou', 'rsapou', 'communism', 'ussr', 'no u', 'whisper', 'sdr', 'rules sdr']
if (message.content.startsWith(config.prefix + !botCommands)) {
message.react("437741493835530260");
message.channel.send(":x: Invalid Command :x:");
}
No err message
someone told me to watch a tutorial and i used the code
const Discord = require("discord.js");
const client = new Discord.Client();
β
client.on("ready", () => {
console.log("Booted up");
});
β
client.on("message", (message) => {
if (message.content.startsWith(prefix + "ping")) {
message.channel.send("pong!");
}
});
β
client.login("lol reset the token anyway");
because your trying to see if message does not equal <prefix><array>
@minor elm reset your token
lol
never show people your token
god damn
good job
good job me
get a config file
anyway
@minor elm paste your stacktrace
good job
good job
naisu naisu
Is it api abuse to make a cmd that sends a message to my cmd line?
wot
client.on("message", (message) => {
if (!message.content.startsWith(config.prefix) || message.author.bot) return;
if (message.content.startsWith(config.prefix + "whisper")) {
console.log(message.content.slice(10, message.content.length));
}
});
It's a modified say cmd, where the bot says what u said
hmmm
im surprised it worked
mmmm
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
@olive ridge I would limit it to yourself (aka your id) because that can be abused easily
its only my cmd line being flooded
yeah but still
extremely subtle sarcasm
can i add a cooldown
probably
so it only accpets a message evry 2 minutes
yeah you can
how i do that
using Sets and setTimeout
GOOGLE TIME
Wait this command just repeats what the person said into your command line?
i should make it delete the message
its just a dm basicly
but one sided
yeah it is pretty useless
https://hastebin.com/ufipopavuq.js
It is not sending me the embed and saying that it cannot read the coins of undefined
- don't save data in json
- don't save data in json
- don't save data in json
- don't save data in json
Natan i want ur pfp gif
But this is how a guy in youtube did it and it worked xD
if(!coins[message.author.id])->if(!(coins[message.author.id] && coins[message.author.id].coins))
so i change if(!coins[message.author.id]) to if(!(coins[message.author.id] && coins[message.author.id].coins)) Right @inner jewel ?
i only use simple embeds ;-;
In mysql, how would I change all columns in a table default value to " "
or just all columns in general to a certain default valuer
Or set a default value for a table? Dobnt that
doubt*
I can't answer your question so I will refer to my childhood friend: "Google".
Tried that.
has anyone here made a website on which you login via discord in js?
Can some explain to me autocommit in mysql in a dumb down fashion.
So, I recently moved to a newer version of ubuntu on my host and upgrade to latest version of rewrite. Apparently, aiomysql errors are loggin in on_command_error event unlike last time.
Therefore, breaking commands half way.(edited)
It returning a default value error and I do not want to assign a default value.
Is there any way I can get around this?
literally upgrading messed thibfs up
Guys im having an error in my console: UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'xp' of undefined
i did define xp so....
Nvm, I think I got it
Please help
You can't expect help without sharing some of your code./
OK then
What's ya code?
what
meaning what should I change? sorry im not that good with coding xD
meaning you would have to make a ulong variable and add too that
?
im not sure what type message.author.id is in JS.. but assuming is ulong.. try this
sorry I don't understand coding words xD
In python terms, you need format the variable into the string
xp[message.author.id].xpThat works in javascript?
is how I do it xp[message.author.id]["xp"]
let curxp = xp[message.author.id] + xpAdd;
so instead of
xp[message.author.id].xp = xp[message.author.id] + xpAdd;
I do that?
Ahh I see
on nvm
not that one
so instead of
let curxp = xp[message.author.id].xp;
i do that?
no that will make a string
so then what?
let curxp = xp[message.author.id] + xpAdd;
xp[message.author.id].xp = curxp.ToString(); // only if youre saving it again
brb and thanks
and...
if(nxtLvL <= curxp){
xp[message.author.id].level = curLvl + 1;
}```
oh that wont work because xp[...].level is a string
can anyone help me here (js)? I want to send an error message if a command is used in another server that's not the correct server (a command that only works in one server)
if(message.guild.id !== "425703997844881419") return message.channel.send('Sorry boyo! The `$buy` command only works in the **Official Boyobot Testing Server**!'+ '\nJoin the **Official Boyobot Testing Server** by using this invite\nlink') here's my code and i dont know what's wrong here
quotes around the guild id i can see off the bat
idk about JS syntax.. other than a semi colon on the end and the "'s the guild id number
i dont see why it wouldnt work
ok
JS doesn't need semi colon and guild ID has to be a string
iirc JS doesn't support unsigned longs
oh π
so how do i do the guild id as a string?
like this if(message.guild.id !== 425703997844881419)?
with the quotes would check it as a string
thats how he had it first
that didnt work
whats the error youre getting
@elder rapids js doesnt even support longs
That's why I said I don't think it supports unsigned longs
Those are unsigned long number
it just skips over it uncle,
it ignores the return
that's all
i want it to not ignore the return
are u sure ur using the right id
im positive
what if u use !=
i tried that already
hello im having an issue with my commands for my bot, the bot only responds to the commands when you have a second argument, how can i not have it do that?
https://gyazo.com/29079c43c8204470e9c16b077e6cd45b
https://gyazo.com/5c369b01aa65dc488b33960e2292aeca
your command requires parameters.. delete them/it?
if i do this if(!`${message.guild.id}` === "425703997844881419") return message.channel.send('error') then it returns this error TypeError: Supplied parameter was neither a Role nor a Snowflake.
you cant do !<id>
also please post it in codeblocks 
please help im very lost
since message.guild.id returns an string
@dusty sandal Hi Lost, I am saddy. Please post your question and I'll help
message.guild.id is snowflake.. does it automatically return a string?
would message.guild work
no
message.member.guild
is what you are looking for to get the guild of the message author
if(message.guild.id !== "id") return message.channel.send("yadadadada");
my issue is that the thing skips the return
it wont if your doing it right
thanks @topaz fjord i got it to work
there's also another bug with the embeds, they never work, i even tried copy + pasting from a visualizer thing
they never work...
How can I make it so a command only runs on a certain server? js
By checking the origin guild id
I've been fiddling with it all day, but navigating to the bot's project folder and then executing node bot.js doesn't do anything
Code: https://hastebin.com/isatazohep.js
Error: https://hastebin.com/esutequdin.pas
Please help my command won't work!
Because the DiscordAPI discord is such a toxic place, I'm going to try to find help here!
How does one check if the member is streaming? I tried now a couple things such as: member.activity == 'Streaming', member.streaming and member.activity.type == 'Streaming'but I seem to not figure it out. π¦
(I use the last version of the discord.py Rewrite branch)
@earnest phoenix never just copypasta code, if you have no idea how to use them
@glass linden usually you can like make a check; for python for example:
if guild.id == IDHERE:
#dosomething
else:
pass
also a couple message above your question, is an example for another language
Yw
Thing is like, you didnt mention what language you use, so I cant really help much
And also I'm not a pro, but these are just simple examples to do it
You just edited it? ;3
Oh that was before not rn
Like when u didnβt reply
That was like one min after I sent it
Hmm then my mistake, next time mention it more then just ? js
Ok
Oh
But with Js I cant help you much
Iβm going to text a few codes
I never really worked with JS and Discord
That I may know
if (msg.guild.id === guildid) {
//do something
} else { }
Not sure, but that can might work ;3
Hmm
For anyone doing node bot.js to have there bot up I suggest using forever instead of node
why would you put an empty else block there
How do you find ws ping for eris
client.shard.latency
Yeah I found it
guys im using discord py and im trynna use the discord bot list api
is self really required even though im not using rewrite?
Are you using Async or rewrite?
async
oh ok ty
All good.
nothing bad will happen right if i reduce the sleep timeout?
oh ok
I wanna make a web dashboard, what framework of JS should I use?
u could use express
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-eznnyo0l/logging/
! Push rejected, failed to compile Python app.
! Push failed
what on earth
nvm i think i fixed it
@gilded thunder it wont work idk why
logger = logging.getLogger('bot')
def __init__(bot):
token = environ.get('DBL_TOKEN')
dblpy = dbl.Client(bot, token)
bot.loop.create_task(update_stats())
async def update_stats():
while True:
logger.info('attempting to post server count')
try:
await dblpy.post_server_count()
logger.info('posted server count ({})'.format(len(bot.servers)))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
await asyncio.sleep(1800)
still not showing the server count on dbl
Β―_(γ)_/Β―
can u show me ur code (without the token ofc)
@gilded blaze nope i haven't
I haven't implemented it either.
I meant what framework for gui
frontend? Vue
Thx



