#development
1 messages · Page 451 of 1
I mean when you do ~mod help or something and the embeded writing you have is exactly like title text except that it isnt in blue when you look at it on mobile
Probably because my title doesn't have a link, you can just make it linkless.
It doesnt have a link in it and it is only on mobile this happens
Yes, that's how I did it I suppose.
I mean my embedded doesnt have any link in it at all but and it is completely normal on a pc but on mobile it is blue and emojis just come out as text
But yours does not have this problem (at least with the blue writing)
@uncut slate maybe you have an idea?
I can point you to the source code if you wish, I really don't know how embeds in mobile work, they are completely seperate from desktop ones.
-mod help doesn't have any hyperlinked/blue text, not on mobile or on desktop
Sorry for not being of help, I need to go, good luck.
..
can i put this as a side bar
....
yeah
Ive got another problem with my botlist command. This time its converting svg to png with node. It just crashes my bot
@anyone?
that isn't even a ping
Ik it was a joke lol

whats the error?
No error. The bot doesn't run
Well its obviously not logging the error now is it
The. Code again:
I will try catch my way through the mud of errors
@night imp how
how can i put this as a side in embed
can i put the picture
no
Can some help?
with?
what lang?
js
what database?
what are your options?
I personally like Postgres SQL
ok
you can make an SQLite Database, JSON ones tend to go corrupt after a while
RethinkDB ✨
how do I make an SQLite database?
k thanks
SQLite has some issues with file corruption too
JSON is worse
I mean, its really fs that ruins the JSON database, since in the long term some servers would be creating data, while fs would be saving data at the same time, meaning corruption. If you sharded though it would mostly prevent corruption
Postgres isn't exactly a JSON database anyway, it has JSON/JSONB support
@quartz kindle heres my try catch adventure that did literally nothing to help.
It does nothing the bot doesnt appear in its hoisted spot in my server, nothing
define "nothing"
does the command prompt stay blinking/active, or does it return to idle?
I run pm2 start 12 && pm2 logs 12 it starts up and when it tries to load the the dbl command, the process kills
are you sure the code you posted is the problem? try commenting it out completely, and see if it runs
Ye
comment out everything and uncomment one line at a time
to see which line is killing it
Yes @cunning orchid it dies silently
No it turns out it is not that file
I may have just restarted it too many times and went over the rate limit

Should still get an error
I am getting a discordapierror but its too skewed to read
@earnest phoenix send 
how do you check if a message was sent through dms in eris?
if the <Message>.channel.guild property doesn't exist
Ik: dont use eris
then it's dm
probably channel.type
in d.js channel.type returns text, voice or dm
in eris it should be similar
i answered the most intuitive solution
channel.type indeed exist but it uses the raw type number from discord's api
in the eris docs they have channel.type but it returns a number
so i should be able to do a if (!msg.channel.guild) return?
eg, channel.type === 1 means its dm
so find out which number represents dm
ye
me?
yes
no?
you just ignored what i said 
eh
aye
channel_log = ctx.message.channel.id
server_id = ctx.message.guild.id
await ctx.send(f'**{author}** set {channel_log} to mod log!')
async with self.bot.pool.acquire() as connection:
async with connection.transaction():
await connection.execute('''UPDATE uwu.serversettings SET modlogchan = $1 WHERE serverid = $2;''', (channel_log, server_id))
That doesn't add the channel id where the command was called to the database. I'm using asyncpg as the library and postgres for the database
idk the database part, i dont use postgre
but where are you getting ctx from?
usually people use message as the entry point
but if channel_log and server_id are being set correctly, then idk
@commands.guild_only()
@commands.has_permissions(administrator=True)
@commands.cooldown(1, 5, BucketType.user)
async def modlog(self, ctx):```
thats my async def
its not giving errors
have you tried to console.log channel_log and server_id?
no
try it just to make sure they are correct
ok
if they are, then the problem is with the db command, i which case i cant help you
now im having problems sending dms
with eris
im fetching the user dmchannel
then creating a message for it
but nope
is the dm targeted at the same person who used the command?
in d.js there's a shortcut for that, idk about eris
msg.author.send
i'm doing var chan = bot.getDMChannel(msg.author.id) bot.createMessage(chan, "text here")
gives me an error
TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters
according to the docs, you dont need to create a message
Get a DM channel with a user, or create one if it does not exist
i think it already creates one
but idk
so how do it send a message through it
getdmchannel().send?
.send ?
oh eris doesnt have .send
then if im understanding the docs correctly, it should be getdmchannel(id).createmessage(message)
i'm doing pretty much the same
var chan = bot.getDMChannel(msg.author.id)
bot.createMessage(chan,"ok")
in your code, try changing bot.create to chan.create
hm
also, according to the docs, its createMessage(content, file)
gives me an api error
so the "ok" part in your code is wrong
thats weird
i have another command that is working
bot.createMessage(msg.channel.id, "test")
that sends a message to the channel
because bot.createMessage() doesn't take the same arguments
channel.createMessage() actually pass the channel to bot.createMessage()
it just acts as a middle-man to be easier to use
bot.createmessage creates a message without a defined channel, so it needs to have a channel specified
var chan = bot.getDMChannel(msg.author.id) bot.createMessage("ok")
the channel is specified
while channel.createmessage doesnt, because it already has a target channel
ye
did you try chan.createmessage?
yes
bot.getDMChannel() returns a promise
because it requests from the api
so you have to await it
or use .then()
channel.createMessage() should work tho
ye it works
this is what i get TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters
if you guys are interested in shortcuts, you could always setup a browser with node, such as electron or nw.js and use the chrome console to interact directly with your discord code
thats what i do xD
@heady zinc can i dm you for a sec
sure cutie
owo ok
what code do you use exactly nao 
im getting something now
Error: No content, file, or embed
btw im not trying to send message to a guild
i wanna send a msg to a user through dms
ye my screenshot was in dms
k
this is what i have now
var channel = bot.getDMChannel(msg.author.id) if (!channel) return
what now?
this isn't right
if you have access to the message, you don't need to get the dm channel
because msg.channel already is the channel
oh then
Eris, a NodeJS Discord library
it says i need to specify a user dm channel
thats what i did
it returns a promise
//Either
(async() => {
let channel = await bot.getDMChannel(msg.author.id);
channel.createMessage("owo");
})();
//Or
bot.getDMChannel(msg.author.id)
.then(channel => {
channel.createMessage("owo");
});```
🥄
it isn't spoonfeed if eris voluntarily makes it stupidly hard to send a dm
@heady zinc giving someone code to resolve a promise has nothing to do with eris
and yes
how much shards do you put in a cluster
6-7
hmmm i see
i mean it has a little to do with it
if it was d.js you wouldn't need to resolve the promise
i mean at least catching it is better but see what i mean
they could specify in the docs you have to do async or promise
i dont think they did
the docs specify that it returns a promise
let me check
the docs indeed specify it returns a promise, it just doesn't give any example on how to handle it like d.js
ah it says it in the bottom part
@heady zinc just because d.js has functionality Eris doesn't, doesn't mean you can spoon-feed people code
not relevant
right
do you have any link to an article explaining promises in details though
i don't have any 
googling "how do promises work javascript" should do
I'd rather Google it and learn on my own than get spoon-fed
Whats the issue here?
anyways, off topic now
I can't get the bot to check if a member has a role on another guild. The bot is on both servers.
Here is the code I wrote:
var accepted = false
const checkguild = client.guilds.get("id-hidden-is-correct");
const acceptedRole = checkguild.roles.get("id-hidden-is-correct");
if(message.member.roles.has(acceptedRole)){
accepted = true
message.channel.send("Accepted!").catch(error => console.log);
} else if(!message.member.roles.has(acceptedRole)){
accepted = false
message.channel.send("Denied!").catch(error => console.log);
};```
lib = discord.js
It says Denied, even if you have the role every time
The command should check the author, no args or mentions for other users
message.member comes from the server the command is used in
ah
if your checking for another guild, you'd need the member from that guild
guild.members.get(author.id)
checkguild.members.get(message.author.id)
ah thank you
mine is more complete @sick cloud
yours is more 🥄 @bright spear
lol
¯_(ツ)_/¯
var accepted = false
const checkguild = client.guilds.get("id-hidden-is-correct");
const acceptedRole = checkguild.roles.get("id-hidden-is-correct");
if(checkguild.members.get(message.author.id).roles.has(acceptedRole)){
accepted = true
message.channel.send("Accepted!").catch(error => console.log);
} else {
accepted = false
message.channel.send("Denied!").catch(error => console.log);
};``` still returns `Denied!`
try changing has(acceptedRole) to has(acceptedRole.id)
ok
returns error TypeError: Cannot read property 'id' of undefined
since acceptedRole already defines the id
I believe
const acceptedRole = checkguild.roles.get("id-hidden-is-correct");
it gets the role property
role must be undefined
the role ID is an actual role, it should be able to be found
should I find the name of the role instead?
const acceptedRole = checkguild.roles.find(r => r.id === 'your id here');
if (!acceptedRole) return console.log('role not found');
Try something like this?
console.log(checkguild.roles.map(r => r.name))
see if the role you want is actually in the guild
or do the id
ok so you have the wrong id
you probably copied the message id where you sent it
could I put a backslash in front to grab it that way?
yes
okey
right clicking role mentions does nothing
console.log(checkguild.roles.find(r => r.name === 'role name').id);
hmm
ok, so I got the role ID via the backslash
however now its always returning 'Denied!' again
make sure the ids are a string
they are
then they dont have the role?
the problem is
if(checkguild.members.get(message.author.id).roles.has(acceptedRole)){
how do I fix it?
ah
didnt i say change it to .id 
🥄 @bright spear 
const acceptedRole = checkguild.roles.get("id-hidden-is-correct"); //not an id
if(checkguild.members.get(message.author.id).roles.has(acceptedRole)){ //doing .has on a role object :clap:
d.js collection extends map
besides whats the point of getting a role by ID, then using the id property
if ur not checkign that the role exists after
const checkguild = client.guilds.get("437966640332668928");
//const oldacceptedRole = checkguild.roles.get("469733141918253077");
const acceptedRole = checkguild.roles.find(r => r.id === "469733141918253077");
if (!acceptedRole) return console.log('role not found');
if(checkguild.members.get(message.author.id).roles.get(acceptedRole)){
accepted = true
message.channel.send("Accepted!").catch(error => console.log);
} else {
accepted = false
message.channel.send("Denied!").catch(error => console.log);
};```
still returns Denied!
how do I define a 'key'?
the key is the id
ok?
ok so is the guild id/role id gonna change or is it hardcoded?
const acceptedRole = checkguild.roles.find(r => r.id === "469733141918253077"); // this is a role
if(checkguild.members.get(message.author.id).roles.has(acceptedRole)){ //.has on a ROLE, wrong
if(checkguild.members.get(message.author.id).roles.has(acceptedRole)){ //.get on a ROLE, wrong
if(checkguild.members.get(message.author.id).roles.has(acceptedRole.id)){ //wow this works
comprende?
yep
so next time you open d.js docs and click 'Collection' on the side
and it says Collection extends Map at the top
so you go to MDN and lookup Map.get() or .has() and see that it wants the key
and in this case the key is the id
ah
so when you give it the id, it works 🎉
I need help setting up a database
I'm thinking of this
idk how to set it up though
no man json is great use json to store everythin
^ if you have only 5 or less guilds
no man gotta have faith in the object notation
my database is a series of word documents haha
but you could totally do that couldn't you word is just XML on the backend
word is actually json
pretty confident it's XML but I will check because I now doubt both of us
I'm putting random jokes as comments in my code for some reason
json is everywhere
funfact: windows forms use json
funfact: json made me lose my house, my car, and my wife
//It was at this moment he realised, he just got beaned!
member.ban()```
looks like json tome
its xml boi
how bout yml doe?
Anyone know how to edit a message? (send by the bot ofc) (js)
I defined the message as "const msg = message.channel.send(message here)
Then you can say "mag.edit(new message)"
OOOR
message.channel.send(message).then(msg => msg.edit(new message))
mag?
I'm on mobile but you get the idea.
Code?
client.on('message', async message => {
const prefix = jsonfile.readFileSync("memory/prefix.json")[message.guild.id]
if(message == prefix + "beg") {
const msg = message.channel.send('Hmm, let me think...')
setTimeout(decideandsay, 3000);
function decideandsay() {
const randInt = Math.random()
const parsedrandInt = parseInt(randInt)
if(parsedrandInt = 1) {
msg.edit("Here, have some coin")
if(parsedrandInt = 0) {
msg.edit("Nah, screw you")
}
}
}
}
});
ignore the fact I'm basically copying dank memer
put js after your three backticks to syntax highlight btw
client.on("message", async message => {
const prefix = "✓"
if (message.content.startsWith(prefix + "beg") {
message.channel.send("Lemme think on that...").then(msg => {
setTimeout(() => {//Code here. Be sure to use msg.edit here}, 3000)
}
})
//note: some notation i.e. brackets and parenthesis may be incorrect due to my current state of being mobile.
how can I put the whole code in the timeout?
because if isn't expected inside the timeout thing
oh nvm
I'm stupid
give me ideas for a discord bot
a bot that interacts with discord in a meaningful way
Music bot
this has problems
How do I edit messages?
I heard that message.Update was a thing
but that doesn't work
;-;
@earnest phoenix D.js?
yes
edit don't work
Should do
message.send("ummm")
setTimeout(editsay, 3000);
function editsay() {
message.edit("oof")
}
that doesn't work
yes because you are trying to edit the author's message
and you're not even calling the function
oh
functions need to have () at the end
message.channel.send("Hi").then(msg => {
msg.edit("Goodbye");
});```
are they good?
oh
... sexy hot?
all g
message.channel.send("Hi").then(msg => {
msg.edit("Goodbye");
});
changes the message imediately
oh I get it
oof
I'm stupid
nvm
if(message == prefix + "beg") {
message.channel.send("Hi").then(msg => {
setTimeout(decideandsay, 3000);
function decideandsay() {
const randInt = Math.random()
const parsedrandInt = parseInt(randInt)
if(parsedrandInt = 1) {
msg.edit("Here, have some coin")
if(parsedrandInt = 0) {
msg.edit("Nah, screw you")
not working
ik i'm probably doing something wrong
I just don't know what
you should pass the new message object into the function arguments
setTimeout(decideandsay, 3000, msg);
are you getting an error, or is it just not doing it?
How do you make a warn command using python?
@earnest phoenix we can't spoonfeed you code
if you need help on a specific part in making the command we're more than happy to help
@earnest phoenix = changes the constant's value to the second variable's value, while == compares the 2 variables values.
and === compares their data types and values
thanks guys
its working
@austere meadow I do need help with a specific part the code
whats up
well, then show code and explain your problem
we can't do anything without seeing what you've done so far
and on which part you're stuck
Guys, do you think a bot who gives the guild admins the power to make any command (even profile commands) unavailable (in that guild) to some / all users
await client.send_message (message. channel ‘ “%s” % (args.join [3] ))
If message.content.upper () . (“?SAY”)
: args = content.split (“ ”)```
@austere meadow ^^
Is that correct?
im not big on python unfortunately but i notice you're using the wrong quotes for strings
“ vs "
‘ is wrong as well i think
Oh also
await client.send_message(message.channel, "%s" % (args.join[3])) if I get it correctly
You are missing a comma there, otherwords
Ok
if keyword should be all lowercase
And the "indentation" is just kinda bad in your code
what are you trying to do Firefreak?
No idea if you code would work with that indentation, either way
Yeah, how is your IDE not lighting itself on fire
Well I basicly know nothing about coding bc I just started but I'm trying to make a warn command
Better to learn Python basics first, ya know
This is what PyCharm says about your code
I would recommend Bucky on youtube
https://www.youtube.com/watch?v=HBxCHonP6Ro&list=PL6gx4Cwl9DGAcbMi1sH6oAMk4JHw91mC_
Does he have python 3 tuts?
So, after watching these, learn fstrings and async notation, and you are good
I have been watching Foggy I/0
does anybody know how to make a bot put emojis on a server?
What language is the bot written in
made on glitch.com in discord.js
But is it <:name:id> in all languages 
Well I forgot the emotes formatting
It's what ever comes out when you put \ in before the emote
so, what code do i add?
@earnest phoenix Foggy I/O doesnt go over python in general. You should learn some python first
Ok
check the playlist I linked. Bucky / TheNewBoston is pretty good
The best
If I had known he actually does have python3 tutorials I would have recommended them to other people as well sooner
I didnt know before now, I just searched it up to see
he has everything dude
"How to build a car"
what code add emojis? discord.js
Are we allowed to link people to dapi server?
on-topic invite links to servers like DAPI are allowed
It doesn't seem anyone who knows d.js is online here right now so i'll just link him to there:
d.js offical server: https://discord.gg/bRCvFy9
discord api server: https://discord.gg/discord-api
@wide ruin
@neon swift is node widely used for discord bots?
I don't know anything about javascript
The two most popular libs are d.js and eris, I don't think you can download them via node
like two most popular libs across all programming languages or just for js?
@stiff urchin you want to use java to make a bot?
@wide ruin absolutely not, why?
sorry, didnt look back in chat
d.js is the most popular, I think one of the c# libs was next, then d.py, and then everything else, I think eris was only top 10
I can't find the source of that info anymore, I just know somebody compiled the list using discord bot list website
Thank you
Really surprised that javascript is that popular for discord bots
node is a mess
discord.js is just super easy for a simple bot
althought discord.py would be too if you already know some python
at this point any modern lib uses promises
and if it doesn't, there's always promisifiers you can use
I didnt know that, maybe I used some old libs
I fiddled with it in late may/early june, but the majority of the libs I used didnt use promises
yee, typical node callback hell isn't as prominent as it used to be
async/await is slowly taking over and I dig it
Cool, maybe I left it too soon
the d.js documentation looks really good as well
like really extensive
d.js docs are the best docs I've ever had the joy of using, not just for discord wrappers, for libs in general
d.js is great
Hey, I know this server ain't for help but I'm having a fuck of a time trying to get an index of an item in an array and wondering if anyone is willing to provide some... input. 😆
Show code
@ebon bolt The example code of array
var itzarray = {
ItzVariable: "ItzText"
};
//Print itzarray->ItzVariable
console.log(itzarray.ItzVariable);
um.. isn't that an object
like just an obect
Well I guess he's talking about objects
If you have a webapp/control panel for your bot, what do you use for that?
I have to choose between nodejs/spring/django/flask...
Currently I am planning to make it in nodejs, because it is good for webapps and I have some experience in it (but I only wrote CLI things). Spring with Java feels like a bit of overkill and RAM consumer but that'd be great to handle the huge traffic... And django/flask... I like Python, but it isn't so good in multiprocessing/doing things simultaneously. I know it is possible, but Python threads are not parallel, so I'd need load balancing with Flask...
So yeah, I need to choose 😄
Can someone help me out?
with?
your not giving any information to work with, also you don't have to ask to ask
ask to ask?
@earnest phoenix Dont ask for somebody to help you out lol
Just ask your question
oh ok
umm I made a prune command after it finishes deleting messages it sends a response then deletes it in 5 seconds but if i run the command twice it causes a error after 5 seconds...
show your prune command code
let mss = await msg.channel.getMessages(args[0], recentID); let msgIDs = mss.map(m => m.id); await bot.deleteMessages(msg.channel.id, msgIDs).then(() => { bot.createMessage(msg.channel.id,${short.reply} ${args[0]}); });
put your code in this format:
```language
code
```
uhh
let mss = await msg.channel.getMessages(args[0], recentID);
let msgIDs = mss.map(m => m.id);
await bot.deleteMessages(msg.channel.id, msgIDs).then(() => {
bot.createMessage(msg.channel.id, `${short.reply} ${args[0]}`).then(done => {
setTimeout(async () => await done.delete(), 5000)
});
});```
there
well the 2nd prune will delete the frists prune finish message
so after 5 secs the 1rst cant delete it
why are you awaiting and using then at the same time
you don't need the setTimeout to be async either
awaiting that promise is useless
you can just setTimeout(() => done.delete(), 5000)
what is the error
(node:16492) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
was the message already deleted before the code runs
at the end of the delete() call
Hey everyone ! Hopefully this is ok in here . I’m looking to have a bot for my discord channel to function in correlation to my project . I will compensate for assistance so if anyone is interested , please feel free to message me . Thanks everyone ! Cheers
It would help if you gave an idea of what we would be doing 🤷
Lol I don’t even know , I’m sorry . I was hoping to chat with someone and run ideas
Ah ok
I asked it once a while ago but I didn't understand
what does atomic parameter mean in discord.py's .add_roles?
Does anyone know what lexical declaration cannot appear in a single-statement context means?
No
Okay, im logging this to the console and it says undefined...
if(command === "cb") {
if(premiumConfigRow.premium === "False") return message.channel.send({embed: { color: embedColourVar, title: `Chatbot | ${message.author.username}`, description: `**Sorry, Only Premium Users have access to this!**\n**[--=====[Click to Purchase Premium]=====--](${config.patreonLink})**`}}).catch(console.error);
if(premiumConfigRow.premium === "True") {
let chatbotmessage = message.content.split(/\s+/g).slice(1).join(" ");
clbot.setNick("Gamer");
clbot.create(function (err, session) {
clbot.ask(chatbotmessage, function (err, response) {
message.channel.startTyping();
setTimeout(() => {
console.log(response)
message.channel.send({embed: { color: embedColourVar, title: `Chatbot | ${message.author.username}`, description: `:speaking_head: | ${response}`}}).catch(console.error);
return message.channel.stopTyping();
}, Math.random() * (1 - 3) + 1 * 1000);
});
});
}
}
@earnest phoenix what is undefined?
response
why do you have a setTimeout
For the Typing Icon
typing icon?
.startTyping()
you dont need setTimeout for that
It has a random stop time
I got it from Yorks Cleverbot Example. Dw
But I changed the code a bit
Seems that other bots respond with undefined with their cleverbots. Might be the cleverbot.io thats messing up

have you tried logging the response
if it doesn't show anything something's wrong
Yes. Undefined
Its not the code. Other bots with cleverbot respond with undefined, the api might be down
Then why did you ask for help lol
he didnt know before
I just realised when equilizer responded with undefined 😂
In that case you should probably send a message saying the api might be down or smth
Through your bot
Instead of just logging the errors
Meh, nobody uses my bot... Will just clean up the code and wait until its back online
Plus the command is for premium users only, I only have 1 Premium user atm
Lool
so, if i have a bot in production, and i want to keep it running while i start up another one for development/debugging, what happens? do any messages hit both the bots? does the first one get logged out? does magic happen and it will work just fine?
Pm2
And #development
Oh were in #development im stupid
I thot we were in #commands
i am about to add an npm search command to my bot... bye!
is anyone else having issues uploading their bot avatars through the dev portal?
Naw
i tried uploading mine but it gets very blurry
it didnt do that before
Hmm, take it up with discord
is there no way to go back to the old dev portal
?
Probably not
well that sucks
Theres a server where you can report buts like that
do you have an invite
Ill dm you an invite
I cant get an invite anymore. Seems as if they completely locked up invites
ah
darn
Damn you @cyan hill!
(Discord administrator)
help my token is right but when i want to testing my bot with cmder is not worked
help me
dont do JS
ok
i get this out put when i run my dbl command with dyno, it comes specificly from where the svg is converted to png buffer:
12|mini-me | Error: SVG element open tag not found in input. Check the SVG input
12|mini-me | at Converter.[convert] (/home/node/mini-me-stable/node_modules/convert-svg-core/src/Converter.js:202:13)
12|mini-me | at Converter.convert (/home/node/mini-me-stable/node_modules/convert-svg-core/src/Converter.js:114:40)
12|mini-me | at API.convert (/home/node/mini-me-stable/node_modules/convert-svg-core/src/API.js:80:32)
12|mini-me | at Object.exports.run (/home/node/mini-me-stable/commands/dbl.js:9:32)
12|mini-me | at <anonymous>
12|mini-me | at process._tickDomainCallback (internal/process/next_tick.js:228:7)
12|mini-me | TypeError: Cannot read property 'pipe' of undefined
12|mini-me | at ClientDataResolver.resolveFile (/home/node/mini-me-stable/node_modules/discord.js/src/client/ClientDataResolver.js:274:25)
12|mini-me | at Promise.all.options.files.map.file (/home/node/mini-me-stable/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:154:30)
12|mini-me | at Array.map (<anonymous>)
12|mini-me | at TextChannel.send (/home/node/mini-me-stable/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:153:40)
12|mini-me | at Object.exports.run (/home/node/mini-me-stable/commands/dbl.js:11:24)
12|mini-me | at <anonymous>
12|mini-me | at process._tickDomainCallback (internal/process/next_tick.js:228:7)
IT IS AN ERROR
Can someone help?
how do i make a discord.net bot ban/kick people
i don't finish yet
well if you want to fix the error remove it
12|mini-me | Error: SVG element open tag not found in input. Check the SVG input
12|mini-me | at Converter.[convert] (/home/node/mini-me-stable/node_modules/convert-svg-core/src/Converter.js:202:13)
12|mini-me | at Converter.convert (/home/node/mini-me-stable/node_modules/convert-svg-core/src/Converter.js:114:40)
12|mini-me | at API.convert (/home/node/mini-me-stable/node_modules/convert-svg-core/src/API.js:80:32)
12|mini-me | at Object.exports.run (/home/node/mini-me-stable/commands/dbl.js:9:32)
12|mini-me | at <anonymous>
12|mini-me | at process._tickDomainCallback (internal/process/next_tick.js:228:7)
12|mini-me | TypeError: Cannot read property 'pipe' of undefined
12|mini-me | at ClientDataResolver.resolveFile (/home/node/mini-me-stable/node_modules/discord.js/src/client/ClientDataResolver.js:274:25)
12|mini-me | at Promise.all.options.files.map.file (/home/node/mini-me-stable/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:154:30)
12|mini-me | at Array.map (<anonymous>)
12|mini-me | at TextChannel.send (/home/node/mini-me-stable/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:153:40)
12|mini-me | at Object.exports.run (/home/node/mini-me-stable/commands/dbl.js:11:24)
12|mini-me | at <anonymous>
12|mini-me | at process._tickDomainCallback (internal/process/next_tick.js:228:7)
once again i need help. i am testig my dbl command with dyno and i get this error when it tries to convert the svg it gets to a png.
wait for someone who can answer to help
ye
is there a way i can ban certain servers from using my bot
in Eris when I editPermission(overwriteID, allow, deny, type, reason) if i want to deny multiple perms how do i write it?
my configuration doesn't work
do u pass a string or file 
@earnest phoenix use an array i assume
😭
the documentation just says number
how can my discord.net bot ban people
@earnest phoenix you have to make your own blacklist feature
if bot is in server with a specific id just make it leave
@digital heath your token is incorrect probably
kinda how server blacklisting works
or your json is bad
no my token with my bot is exaktly
new JSON.parse() 
what's your json like
how can i make a discord.net bot ban/kick people
@digital heath also to require your config file just do var token = require("./pathtotokenfile.json").token
look ath the docs
if im not mistaken
no thats how
You may or may not have to include the .json format in your path
You were trying to parse the json file but that's unnecessary
What does your config file look like?
btw hide your token if you're posting the code
Lol
youe client is not Client
look at the last line
"Client.login" uppercase
not client lowercase
What does that mean
it means you have a client variable but you're not using it to login
how can I change that?
Make it all lowercase I think
rename to client
The last line
I got spoonfed yesterday and the mods tried to kill me yet I'm spoonfeeding rn

@digital heath learn how to code before trying to make a bot pls
what am i supposed to do?
Do you know which version of Discord.py you want to be using?
Google it
ie rewrite or async?
how to use pip
@cunning orchid he has no idea about what those are i believe
If he can't even use pip
I'm a real noob at python yet i know how to install packages at least
my friend has been helping me and we both dont know what to do
so you're both clueless

ig
Have you tried watching tutorials
There's quite the few on python
i have but it always says no module named 'Discord'
Diascord isn't not a module
Tf
Auto correct
You have to install the discord package for python before you can use it
Using something called "pip"

ok
How do I collect messages in Eris?
Use the docs. All the references are there. https://abal.moe/Eris/docs/
Eris, a NodeJS Discord library
https://abal.moe/Eris/docs/TextChannel There is a getMessages method.
Eris, a NodeJS Discord library
Oh have you used Discord.js?
Eris doesn't have an explicit method to collect reactions or messages over a span of time.
As far as I know
Oh. Not familiar with the command handler.
so I would just need to use getMessages?
You could. There are other ways like making a system use the Message event and processing it.
how would i check the ping of my eris bot?
i tried searching the docs for something like djs client.ping but nothing
iirc you get latency of shard 0
hmm
I had 0 luck making it
@knotty steeple so i just need to get the client's shard?
I get the shard of the guild
I used a ternary operator
getting both the shard 0 latency
and the guild shard
guild shard

yah
msg.channel.guild.shard.latency
can confirm its working
Nao
what
Have you tried making a msg collector in eris?
not yet
._.
im still new to eris
havent gotten used to it much
ok
is it hard?
idk
im having 0 luck making it
reading the docs it reminds me of djs
for some reason eris sometimes removes my bot status
weird
but once i restart the bot it puts the status again
bot restarting?
my uptime also randomly gets reset
havent checked that yet
but i noticed the status goes away randomly
hm
and never comes back unless i restart
What are you using to host it?
localhost node 10.4.0
oh
console shows no errors
¯_(ツ)_/¯
this is my ready event
run: (bot) => {
bot.on("ready", () => {
bot.editStatus("online", {
"name": "smth",
"type": 3
})
})
}
}
type?
yes
w
what was that again?
playing/watching/listening
oh
yea
3 is watching
i'll have to see if the bot is randomly disconnecting or smth
maybe a timeout function that logs the uptime
Is it possible to push all the guild members into an array of just their ID's whenever a bot joins a new guild. Then have it one by one add each user ID to a row in a database and then remove them from the list?
so you technically want to add guild members into a database?
Yes
why?
So the bot wont have to create a database when someone enters a help command
The bot sometimes returns nothing if they have not got a row in the database
this is in js btw
Sounds extremely inefficient.
but what's the point/benefit of that for you
yes but well sometimes people ask that stuff just because they want to log a lot of stuff for no reason
I just wanted to know if you are one of those
idk js, but what you can do is loop through guild member objects and attempt to add each of their ids into a db, assuming your table is set to have unique ids so it doesn't add the ones that are already in db
what do you use for db?
SQLITE
He was speaking to me

how did y'all make custom prefixes ?
Store in a database
Yeah
huh
Then when you get a new message, check msg.server:prefix
where can I read about that
You need to know which database you want to use and how it works
im using mysql rn
Im just confused cuz
bot = commands.Bot(command_prefix='-')
and I'm using python
and not rewrite either
idk if that makes a difference ._.
Well I would strongly recommend rewrite
It's just way better
For me it's like this Bot(command_prefix=utils.PrefixHelper.return_prefix, description=description)
how would i go on making pages for my help command
Which would call this funciton
class PrefixHelper:
def get_prefix(self, message):
guild_id = message.guild.id
try:
prefix = DatabaseHandler.db.get(str(guild_id) + ':prefix').decode()
except AttributeError:
prefix = SettingsLoader.config['prefix']
return prefix
async def return_prefix(bot, message):
prefixes = PrefixHelper.get_prefix(PrefixHelper, message=message)
return commands.when_mentioned_or(prefixes)(bot, message)
@knotty steeple That's a difficult question depending on lib, command structure etc
My help command autogenerates and paginates based on categories

categories are defined by folder name for me
i just store command description, usage and name in a collection
and i use discord.js
i also store the file name and aliases
[2018-07-23 22:00:32]: ERROR Uncaught Exception: TypeError: Cannot read property 'exp' of undefined
at Statement.db.get (/root/jarvis/events/message.js:17:19)
--> in Database#get('SELECT exp FROM users WHERE id = ?', [ '209479806620925955' ], [Function])
at module.exports (/root/jarvis/events/message.js:7:6)
at Client.emit (events.js:182:13)
at MessageCreateHandler.handle (/root/jarvis/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/root/jarvis/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (/root/jarvis/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/root/jarvis/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/root/jarvis/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:182:13)
at Receiver._receiver.onmessage (/root/jarvis/node_modules/ws/lib/websocket.js:137:47)
error: Forever detected script exited with code: 1
error: Script restart attempt #2```
const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('./db/levels.db')
var userid = message.author.id;
db.get(`SELECT exp FROM users WHERE id = ?`, [userid], (err, row) => {
if (err) {
return console.error(err.message);
}
if (!row) {
db.run(`INSERT INTO users(id) VALUES(?)`, [userid], function(err) {
if (err) {
return console.log(err.message);
}
console.log("added user to exp database")
})
}
var exp = row.exp + 1;
db.run(`UPDATE users SET exp = ? WHERE id = ?`, [exp, userid], function(err) {
if (err) {
return console.error(err.message);
}
db.get(`SELECT level, exp FROM users WHERE id = ?`, [userid], (err, row2) => {
if (row2.exp > row2.level * 10) {
var levelup = row2.level + 1
db.run(`UPDATE users SET exp = ?, level = ? WHERE id = ?`, [1, levelup, userid], (err) => {
if (err) return console.log(`Error in MESSAGE event : line 17`)
})
}
});
});
})
a little help here
i was wondering. my friend is trying to set the bot.users.size, does that show the current online or the people in the discords all in one?
or the people in the discord auth
@nocturne flicker, all the users the bot has access to that are cached.

sending embeds with eris is easier than i thought eh
just gotta pass it an embed object
z!help
z!help
🤔
@muted slate
z!ping
missing permissions to speak
apparently
oh wrong channel
i'm retarded sorry
i need some late night coffee
thus is when you would use that facepalm emote where the hand goes through the face
;-;

anyone know if there is tool to reverse the permissions bitfield into a list of permissions
hey im trying to make an embed with eris that adds fields as needed (fetching data from database then passing objects into an array), how would i program a for loop to add fields to the embed?
for every object inside the array i want to add a field to the embed
i was able to do this with djs but i cant remember how
nevermind got it
@noble elm
# discord imports
import discord
bot = discord.Client()
@bot.event
async def on_ready():
print(f"Logged in as {bot.user.name} - {bot.user.id}")
@bot.event
async def on_message(message):
if "procrastin" in message.content and message.author != bot.user:
await message.channel.send("Stop procrastinating >:(")
bot.run("BOT_TOKEN")
Can some1 code me a Bot like Dyno? For free Dm me
Can someone show me an example of how to write text on a image when using canvas?
can someone explain to me just why.... http://i-would-rather-you-dont.h4ck.me/471196912255762432/8.png
memes
type faster blake
no
plz
in CSS, is it possible to directly affect one div, but not another div inside the affected div? https://zblake.xyz/0wC8bbjj.gif
basically what i want to achieve is something where the background of the card is darkened, but the buttons stand out and aren't affected by the class
to {
background-color: black;
color: black;
opacity: 0.66;
}
right now the buttons are also being affected by this CSS, is there a way to negate just the buttons?
resigned
so you want to scope the affect to parent div but not child?
yeah
afik the only way to do that is apply the reverse effects to the child
cause css applys down the div tree so until something says other wise it keeps going
hmm
i guess i could apply a class that would reverse the effects of the one im adding but that just seems inefficient
nevermind this doesn't seem to work
even when using !important
pls help
I also need help with waiting for user input
So like
its says a message
then it waits for the input
and sets a variable to the input
Google is helpfull
Is this right?
if(command === "play") {
if (!message.member.voiceChannel) return message.channel.send(':no_entry_sign: Please join a voice channel.');
if (message.guild.me.voiceChannel) return message.channel.send(':no_entry_sign: Error, the bot is already connected to another music channel or a song is playing.');
if (!args[0]) return message.channel.send(':no_entry_sign: Error, please enter a **URL** following the command.');
let validate = await ytdl.validateURL(args[0]);
if (!validate) return message.channel.send(':no_entry_sign: Error, please input a __valid__ url following the command.');
let info = await ytdl.getInfo(args[0]);
let connection = await message.member.voiceChannel.join();
let dispatcher = await connection.playStream(ytdl(args[0], {
filter: 'audioonly'
}));
let playembed = new Discord.RichEmbed()
.setTitle("Now playing")
.setDescription(`${info.title}`)
message.channel.send(playembed);
}
looks right just that you can only play 1 song at a time no queue
Thats the problem rn
make a temp queue ie. var queue = {} then add songs per guild
u should make the thing that plays the music a function
Hey uhm like, how to make an array of strings that have a characters limit of 2000 in python?
Hoi
Hoi 👀

idk any builtin way to limit list length (why do you want to do this anyways) but you could probably loop through the list like for nou in list: and have a if statement if nou > 2000:
for nou in list:
if nou > 2000:
return 'no'
else:
pass
that's a code example
:p
hi how do i make a cool queue in discord.js v12 for my music system
just create a kool queue using discord.js v12, ytdl and simple yt api
hi how do i make a cool self-programming sentient 200iq bot
// main.js
const meme = new Map();
// on command stuff.
// make some code here that would check and join the channel.
// get the channel data / and other stuff you collected.
// Maybe make it an object then array stuff there so that we can store moar meme data like song queue
const obj = {
data: 'stuff',
moarmeme: []
};
obj.moarmeme.push(/*maybe the yt api data collected here*/);
meme.set(msg.guild.id, obj);
// get the data from the meme map then shape it according on what you want
omg now your bot's profile picture actually changes when you change it in the developer documentation
What about name?
Guys is there something wrong?



❤



wait why did i think blake was a mod