#development
1 messages ยท Page 446 of 1
if its being overwritten, specify the hierarchy: #id .class .class .is-flex
or use !important
ah thanks
more specific selectors have higher priority, so .parentclass .childclass will overwrite .childclass
use the element inspector
what do you mean?
use the css area of the inspector
this is whats important
you see, its a button element which contains an img and a span
yea
you can also test the css by writing it directly in the field below
if you write it where it says "element.style", it will apply directly to the element
so you can find which element you need to change
and if you click the + button, you can test the css selector, so you can find the correct selector to target the element
once you've found it, just copy paste it into your style code
but as you can see, the "up arrow" in the upvote box is not a text element, its an image element
so you cant do stuff like change the arrow color, but you could replace the image
What permission is needed to remove all reactions from a message?
manage messages lets you manage reactions on messages as well
cheers ๐
git pull doesn't help https://i.boring.host/8AIfwCp.png
Sorry for the SSH link in screenshot
Nvm recloning helped
Gg
@uncut slate, was just wondering if level can store objects, I had no success.
How do i install canvas?
How do you install canvas
npm i canvas @glass linden
Quick question, for <Role>.position, is higher the value the higher the role is in the hierarchy is lower the value the higher?
If my memory serves right, the higher the value the higher in the hierarchy, but I want to make sure
Thanks @sick cloud

that leads me to another question
How would I find the Role that Discord creates for the bot automatically
In cases that it's renamed & it's not the only one managed by external services
I guess what I could do is check the bot's self roles and get the first role that's managed
you can do that probably
.
How do i change the colour of the title.
I tried looking in inspect element but couldn't figure out which part of the css i need to add
@quartz kindle
for when a member leaves isit guildmemberleave
guildMemberRemove
ok
thanks
00F
(node:16824) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError: Cannot send messages to this user
(node:16824) [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.
you cannot send a message to a user which you dont share a server with
://///
hello,
does anyone know how i would go arround making a bot list all the channel ids from the servers that the bot is in
thx ๐
Me @earnest phoenix
On the bot page what css do i write to change the bot title,
hi
does anyone know how to make rpg bot
gb!help
gb!bars
gb!ping
Bots only have permissions to write in the testing channels
@sick cloud level only stores arbitrary byte arrays so anything you want to store has to be stringified

who can help me with my ping command i am using the program discord bot maker
You should learn to code on your own
But well... what's the code
And is it not working? Not working properly?
Numbers, Mason, what do they mean?
DBM is js for sure
People abusing
no
selfbots weren't even discord's idea, that's how they are not suppose to exist in the first place
that's the thing though, they are
but the thing is people can make them abuseable
so you can say "yeah i only use it for simple embeds"
but then create a raid command
either way, it's not for a normal user to decide how they want to automate a discord server, if they want such automation then bot accounts exist for that specific reason
I'm pretty sure discord devs came up with bot accounts just because they didn't like the idea how people were automating user accounts
Userbots' existence causes loopholes in Discord ToS
it was their way to give us what we wanted, and we love them for it
and a good way for them to control it so it doesnt go out of hand
if they wanted to, they could simply not allow bots in the first place
but that's not possible
but we love them because they didnt, while most other messaging services ban all kinds of automation
your account relies on api, if account will be restricted from using api then you won't be able to use discord anymore
the best thing they can try to do is to rebuild the client so it's no longer possible to open inspect element
exactly
you are still technicaly using a selfbot 
how old are you?
library?
fat python
and idk if you can 
oo
o_O
@ruby dust i dont think they can rebuild it so that you cant open inspect i dont think its possible
ik
you can
at least nwjs has a dist which doesnt include dev tools
probably electron has one as well
pretty sure discord uses electron
it does
^
library?
Pretty sure it's documented
English is a language used to talk with humans
Wait I confused myself even, I meant library
XD
Sweet thanks man, I will give it a check
Do keep in mind that this is an edit action on a VoiceChannel object, they have different parameters on what you can update than in TextChannel objects
Learn how to use the browser's search feature

No ken
Thank you too @ruby dust
anybody know how to use custom fonts with canvas in d.js?
what does d.js have to do with that
if I have the permission integer of a user, how do I check for certain permissions
you google it
i tried
Look through here: https://discordapp.com/developers/docs/topics/permissions
I'm not sure either
i normally let eris do it but as im doing oauth2 i cant do that anymore
๐ค
with sqlite3, does fetchone() return a list of tuples even though it's only one tuple?
What do people use to make the profile images?
its in the alpha version
question, if i applied to get my bot accepted, and then the denied it due to GitHub having my token, after applying back, am i on an extended wait list or are applications looked at randomly? srry just curious
it's not random, there's an order, you have to wait until we review bots before yours
kk, just wondering since the application processing period is longer than the first time around . Thanks for the answer and quick response btw
k thanks
Ohh makes sense, okay thanks @uncut slate 
is it possible to remove all perms from a channel for all users?
const getemoji = client.emojis.find("name", args[0]);
if (getemoji === null) {
message.channel.send('That is not an emote smh');
} else {
if (!args[0]) {
message.channel.send("I need an emote, I'm not arkinator lul");
} else{
message.channel.send(`Here's your emote: ${getemoji.url}`);
}
}
}```
This command works fine, but it only works if you write the name of the emote without the colons, is there any way to make it work with them?
Spice off the colons?
Hm?
const arg = args[0].split(':')[0];
Ohhhh I think I know why. Give me a minute.
replace split with slice
Nah, not that, custom emojis are different.
<:emojiname:emojiid>
they're stored as that
Hm
So what should I add in my code?
Oh wait
I had an idea
https://gyazo.com/25283fb996fb652f59298a43d622469c maybe something like this? @shrewd hedge @knotty steeple
(why did I pinged myself lol)
(why did you ping me lol)
I was intended to ping ThatTonybo
h
Also nevermind I tested the thing above and it doesn't work
hm
if you can extract the ID
@shrewd hedge done it
` (Args here)`.split('<').join(' ').split(':')[2].split('>')[0]
its messy but works.
gets the emoji ID
then just use .get(id) instead of .find( ... )
@hushed berry oi im looking at the rewrite rn
๐
Future are very limited
hmm, let me take a look
CompletableFutures/CompletionStages are a lot better
It does use CompletableFutures btw
CompletionStage is the interface to CompletableFuture so it would be the most "correct" one to be using
unless there is a reason to roll your own implementation
which I highly doubt
hmm
tbh, i would love to have something like JDA's rest action
but that seems really overboard
plz dont lol
lmao
CompletionStages are Javas async thing
right
Futures were the previous implementation which has ben superseded
Ok so
so should I change the return type to CompletionStage<whatever>
what JDA does is meh
Is this right?
hm
so should I change the return type to CompletionStage<whatever>
yeah that should be the goal
Alright ๐
luckily JDA offers submit() which returns a completion stage
no, my code gets the ID
JDAs queue() thing is bad because it encourages ppl to write shit code imo
Alright
instead of learning the proper way to use CompletionStages
lmao
smh. Remove const pp, = ... and replace arg = pp with arg = args[0].
Ok
Gonna test this
Hold on
https://gyazo.com/386e336278c888f6b9cfa95bb51f48c8 nope, I still get this
(I'm adding that note until I fix this)
@sick cloud
nik, other part of the code looks solid imo
one thing to watch out with gson is that it might have issues transforming longs correctly
lemme find the link
facepalm
Well there ya fuckin' go.
@sullen nymph, don't be rude to users that are asking for help.
@shrewd hedge Do you want to use the actual emote?
Yes
@sick cloud I'm not being rude lmao, i just said there ya go.
Basically
the problem is that JSON, or at least some JSON clients, interpret numbers as doubles
tbf, that isn't what you said.
you wanna be able to do:
hi!emoji <emoji>?
@shrewd hedge
so you need to be extra careful when sending discod snowflakes as longs
personally im doing what the discord api does and send them as strings
Yes
after getting rekt by gson
If you need it I cand send the full code of the command
@drowsy lily jeez, completionfuture has a lot of stuff hahhaha
its pretty dope
Is there a method in it thats like the .queue(successCon, failureCon)
hmmm
that takes a biconsumer though
well none of the methods take two independent consumers
but you could easily write a static wrapper for that
hmm
Meh, i dont care that much
also
whats the diff between whenComplete and whenCompleteAsync
the Async suffixed methods allow you to provide an executor on which the next step should be run
as an example: in case you wanna do some blocking thing it maybe shouldnt be happening on the databasethread that returned the previous result
@shrewd hedge I'll DM you the code
Are you using Discord.js or Eris or something else?
discord.js @sullen nymph
ahhhh, okay ๐
@shrewd hedge Great!
Yay
My bot is also kinda a challenge
Because, seriously, no offense, I love every bot, and I know everyone puts a lot of effort on them, but sadly many js bots are generic
*many bots are generic
FTFY
i agree, i like purpose specific bots much more
Can I show my current commands?
sure
Ok
- hi!ping look at how slow is my bot lol.
- hi!support sends an invite to my server in the DMs (to avoid other bots deleting it in the server.
- hi!invite allows you to invite me to your sexy despacito roblox server.
- hi!avatar (optional @mention) sends the avatar of the mentioned user (if there's no mentions I will send your avatar instead)
- hi!feedback (text) if you have any ideas for my bot, or you want to report something, use this command. Your feedback will be logged in my support server.
(WARNING: you can get blacklisted from using this command if you abuse this command for shitposting or making innapropiate feedbacks)
- hi!help-owner shows my owner commands, for if you're curious.
- hi!server shows your server's info.
- hi!about shows a boring text about me and Mama.
- hi!say (text) makes me repeat what you said, then I'll the message.
- hi!yomama just try it.
- hi!8ball ask something to the magic ball (you can suggest more answers!!)
- hi!hitomi sends a random hitomi pic (They are supposed to be SFW, however, if you want to report a picture, send a feedback including the number of the pic)
- hi!genoauth generates an invite link for the mentioned bot
- hi!stats shows my server/member/etc count as well as my uptime```
though tbh it looks like a general bot
whats the purpose of your bot?
my suggestion would be to think about something specific that you want to offer, and focus on that
for example, a bot for cryptocurrency, a bot for a specific game, a bot for scrapping a specific information
Meh
heck it means something different to each person out there
super meme creator using a genetic algorithm and using the entirety of google as a data base
But the bad thing is that I'm not that good at js, I only learnt it by doing stuff on my bot
๐
@flint river nice
it actually might not be that bad
have a meme template data base that can append new meme image templates from a few sources
How I started out: I accidentally stumbled upon discord.js.org, put the example in Atom, ran it and boom, bot. Wew, I made some fun with that.
i have a discord bot idea that no one has ever done
๐ค
then a neural networking app that takes the top text and bottom text while doing an image recognition software
and boom
memes
NN for a discord bot more like waste of cpu/gpu
i myself just have a Pathfinder Combat Feat Search Engine that scrapes data from the d(twenty)pfsrd website and organizes it and makes it accessible via the search parameters
-my "two" key is messed up so i couldnt use the actual number
ok im really upset realizing something ๐
d20pfsrd has a database page which wouldve much much more easily been scraped
worst thing with bot ideas: have an incredible idea that "no one has ever done", then find a bot that does exactly that
@hushed berry btw i think some of those dependencies can be removed from the rewrite. I didnt really find where you're using retrofit / jda / jackson in there
@quartz kindle i've searched >:3
when you remove jda youll probably have to add okhttp instead
Anyone know if there is a listener that detects who in particular added the bot?
no, discord doesnt give that info
^
Hmmm, was hoping to DM the user with information
@warm prairie the best you can do is DM the owner or send a message to the first channel in the new server the bot has access to.
@sick cloud thanks.
No problem.
I'd suggest the latter personally, seeing as it covers everyone + DMs can be disabled.
Or check who owns the server
@drowsy lily Would you say its a bad idea to have both org.json and gson as deps?
Also @sick cloud mind if you tell me your idea in the DMS? I promise I won't steal it or tell others about it
I'm really curious
depends
some things dont require using full blown objects
thats where json.org is great at
or rather mediocre
but still a lot better than to deserialize to objects
I can't actually get the Bot to send a DM to the owner on guildCreate
Hm
hmm, alright
thats what I tried, even logged out the promises and its not actually logging anything
guild.owner.send("Thanks").then(() => {
logger.info("DM Sent Successfully");
})
.catch( (e) => {
logger.error("Error sending DM ... ", e);
});
@warm prairie
try {
guild.owner.user.send('message');
}
catch(err) {
console.error(err);
}
^^works well if you use async/await
You can only send to a user iirc
you have to actually await it though
that could easily slip out because you aren't awaiting it
hmmm
Ahh got it working with my original code (was missing .user.)
On discord.js v2/dev/master, does roles.create accept hex codes?
msg.guild.roles.create({
data: {
name: 'Verification',
color: '#ffffff',
},
reason: 'created role',
});
ColorResolvable
Can be a number, hex string, an RGB array like:
[255, 0, 255] // purple
okay thanks ^
What exactly does user.createDM() do for me?
I think it returns a DMChannel @warm prairie, basically like using msg.channel, just your getting a DM.
So const dm = user.createDM(); dm.send('hello'); would make a DM and send it.
can you respond to the bot's dm ?
yes
hmm
the bot receives dms the same way as any other message, but the structure of the message is a bit different
it wont have message.guild for example
trying to figure out how to listen for messages from a dm
it will come in the same on('message') as all other commands
and can be replied with the same message.channel.send
a dm is also a "channel"
basically, all your commands should already work in dms, unless you specifically disabled dms
I'm logging out every message that comes to the bot, but it seems that when I send a DM to the bot it doesn't show up in the logs
Do you have a check to ignore messages that don't have a guild?
(such as if (!msg.guild) return;)
the logger is at the top of the listener before any logic checks
bot.on("message", async (message) => {
logger.info(`[${message.author.tag}] ${message.cleanContent}`);
...
}
oh wait
$help
woops
its coming now, never minddd
alright
Does anyone else know of an issue with YTDL-Core that wont allow them to skip more than one song without it glitching out?
You don't "skip songs" using ytdl, so no, than wouldn't even exist. Your code is probably calling the end/finish events or functions too much.
How could I fix it then? I only call the end function twice in all of my command files, and only once in that skip command specifically. I dont know why it would be that...
is doing (At)Name of the mod who checked your bot rood if i say i think i fixed the mistake?
*rude
if you fixed the mistake just readd the bot
you dont need to tell the mod since its not sure that the same mod checks your bot anyway
and we see why it was declined before aswell from other mods
read the bot? i think i fixed my error that was listed by him/her
then just resubmit the bot on the website
also, i used rood because i read too many memes

well the reason was not having an " (working) help command or obvious point of entry. Please make sure your bot has a help command or has an explanation in the bot description"
so im wondering if by adding an example me of running the bot (in the bot description) might address it, as well as adding notes to the bot posts on how you should respond
oh yea thats fine then 
How do i get my bot online im stupid
@earnest phoenix Wdym
Have you not done any coding?
Mk im very confused
Plz help
Okay
Do you have a basic knowledge of any programming languages?
nOpE
Idek what language u just spoke
I only understood languages
@earnest phoenix
Okay.
You're going to need to choose a lib to program your bot in
To completely honest, In my own personal opinion the api wrapper known as discord.py is the easiest to learn and use
Oof thanks
I have a few links if you'd like to learn the basics
Yes plz
If you have questions feel free to dm me
Aye thx
Is this support channel
is stacking setTimeout's bad practice
Someone can tell me how to create a clikable text?
yes
๐ค Sooo .addField([text],(link)) ?
Okk
in the middle of description, in the footer in the title, etc
I'll try
no it only works in descriptions
Oh ok
We aren't going to spoonfeed you
- @cinder stratus what is the error
- spoonfeeding isnt allowed nor a gud pratice
- ur not giving full information and asking us whats wrong
I don't think you need an await in the catch.
have you seen the code?
yes
yes
it's a send function on both
@lament meteor i am not asking to spoonfeed me
not saying u are but cause u dont give any other information except the code it makes it sorta of spoonfeeding
spoonfeeding means giving the whole code without them letting to think, but even they don't know what is the issue so that's why they gave their code 
yes
what doesnt work? any error message?
no perms?
yeah the bot needs the Manage Roles perm
and the role to give to the user has to be lower than its highest role
shouldnt await(rMember.addRole(gRole.id)); be await rMember.addRole(gRole.id);?
do u rlly need the await?
its called async
cause when i made a command like that i didnt need to use it
you dont need await, even with async
really?
because await means you're waiting for something, here you're not waiting for anything
you're just sending
well yeah true
when you put await you're awaiting the function to return something
thats what i remember
you would use await if you would send the message then do something with the message you just sent
cause i havent been coding for a while cause of holidays....
@quartz kindle right
in any case i've never seen await being used like await()
exactly
same
that will probably cause problems and could be the issue in his code
yup
hey if my bot will get authorized luca will message me
yes
unless u have dms blocked
Any idea how to use markdown inside of a link?
I tried this, but it doesn't work correctly:
you don't
you can markdown the whole link, which means putting characters around the link
but anything that you put inside the link will be part of the link itself
try \, idk
I tried, but I guess I didn't do it the correct way
hello where i get a code for bot, sorry i'm newbie
you won't "get" a code, you have to create/write it yourself
you can start off by learning a programing language
There are many free programs online. I recommend node.js for beginners
You can learn through things like codeacademy
(or udemy/sololearn)
python is a confirmed best choice for coding simple AI programs
if you use C# use discord.net
is discord.net actually good now
no idea, i dont know c#
better than d.js lol
so this works perfectly fine js bot.on("message", async message => { if (message.author.bot) return; let antiinviteset = JSON.parse(fs.readFileSync("./settings.json", "utf8")); if (antiinviteset[message.guild.id].antiinvite == "true") { if (message.content == "discord.gg") { message.delete() } } }); but it has to contain discord.gg and lets say the message is discord.gg/ it won't delete it, how can i fix this?
That does not work perfectly fine
- Reading file with sync method on every message
- will respond to bots
- .contains is not a property of the message
- checking if the value of antiinvite is equal to the string "true"

and more but holy moly

damnit i forgot i had .contains
i was testing
well
this was obviously the wrong place to ask
well im sorry to bother you
if you compare strings using "==" or "===", you're comparing the entire string at once
you have to use something like indexOf to compare a part of a string
message.content == "discord.gg" will only work if the message content is exactly discord.gg nothing more nothing less
or the other things i listed before trying to fix the command, probably more important
Hello. I'm having trouble putting my new bot online. I just installed the dependencies for my bot project in my project folder botF, using the Terminal command npm install discord.io winston --save and then I tried to run the command node bot.js in Terminal under the cd directory of my botF folder, but I recieved the error:
Here's bot.js in my botF folder
Anyone good with Rethink/rethinkdbdash? All my requests are returning this issue:
(node:6922) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded
at /home/tony/node_modules/rethinkdbdash/lib/term.js:2364:40
at Object.loopKeys (/home/tony/node_modules/rethinkdbdash/lib/helper.js:56:14)
at Function.Term.expr (/home/tony/node_modules/rethinkdbdash/lib/term.js:2362:12)
at /home/tony/node_modules/rethinkdbdash/lib/term.js:2364:40
at Object.loopKeys (/home/tony/node_modules/rethinkdbdash/lib/helper.js:56:14)
at Function.Term.expr (/home/tony/node_modules/rethinkdbdash/lib/term.js:2362:12)
at /home/tony/node_modules/rethinkdbdash/lib/term.js:2364:40
at Object.loopKeys (/home/tony/node_modules/rethinkdbdash/lib/helper.js:56:14)
at Function.Term.expr (/home/tony/node_modules/rethinkdbdash/lib/term.js:2362:12)
at /home/tony/node_modules/rethinkdbdash/lib/term.js:2364:40
at Object.loopKeys (/home/tony/node_modules/rethinkdbdash/lib/helper.js:56:14)
at Function.Term.expr (/home/tony/node_modules/rethinkdbdash/lib/term.js:2362:12)
at /home/tony/node_modules/rethinkdbdash/lib/term.js:2364:40
at Object.loopKeys (/home/tony/node_modules/rethinkdbdash/lib/helper.js:56:14)
at Function.Term.expr (/home/tony/node_modules/rethinkdbdash/lib/term.js:2362:12)
at /home/tony/node_modules/rethinkdbdash/lib/term.js:2364:40
(node:6922) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6922) [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.
@sick cloud are you trying to store a value that's size exceeds the set limit?
I don't even know if there is a limit.
Sorry for interrupting, but does anyone know how to get the URL for the last attachment sent in a channel?
@sick cloud are you trying to store an object that has a reference to itself?
@shell blade I think something allong the lines of ...
const attachmentUrls = [];
message.attachments.forEach( (a) => {
attachmentUrls.push(a.url);
});
are you logging out the contents of 'a' :MessageAttachment
@winged osprey, I don't think so. This is what I'm trying to do:
await r.table('giveaways').insert({
id: msg.id,
startedAt: startedAt,
startedDate: startedDate,
setTime: setTime,
endsAt: endsAt,
startedBy: msg.member,
prize: prize,
channel: channel.id,
});
Honestly I would recommend just storing the properties of the member object that you actually need and not the whole member
Is that what would be causing it?
@warm prairie no, I was just consoling the ended result. I'll try that.
I'm still getting nothing.
Well the member probably contains references to other objects that have references to themselves
Ah..
@shell blade you're sure you're sending attachments?
Yeah. I sent an image a few seconds before executing the code.
Hmm, i'm able to get the contents of message.attachments
is there any logic before your attachment check?
Only
if (command == 'test') {
const attachmentUrls = [];
message.attachments.forEach( (a) => {
attachmentUrls.push(a.url);
console.log(a.url);
});
}
Oh, you're adding it on a command
uhh
you are using a message object
I don't think that matters 
if the message doesn't have an attachment it won't have any ๐ค
const on arrays are fine
as long as you dont' try and initialize them again
^
You can't modify constants.
array.push() does work with const
same diff
anyway crazy, are you adding the attachement when using the command you specified?
That's why, you're trying to find something that's not part of that command
That's what I said.
lul
hang on, I know what you need
Okay.
Does it work
Or does it not
AHH
@shell blade message.attachments is a collection
not an array
@shell blade you'll probably have to do channel.fetchMessages
So you'll need to do message.attachments.array().forEach(...)
can't you do const thing = Array.from(msg.attachments);?
The message you're seeing is the message of the command, its not going to see the attachment from the previous message
@shell blade this is a bit dirty, but try this out
if (command == 'test') {
const attachmentUrls: any[] = [];
const chan = message.channel;
chan.fetchMessages({ limit: 2 })
.then(messages => {
const msgWithAttachment = messages.find( msg => msg.attachments.size > 0 );
msgWithAttachment.attachments.forEach( a => {
attachmentUrls.push(a.url);
});
})
.catch( e => console.error(e) );
}
@frail harness Traceback (most recent call last): File "main.py", line 9, in <module> client = discord.AutoShardedClient() AttributeError: module 'discord' has no attribute 'AutoShardedClient'
ยฏ_(ใ)_/ยฏ
Are you on async?
yeah I guess?
You need to be on rewrite
so do python3 -m pip uninstall discord.py
and then do python3 -m pip install discord-rewrite
โฌโโฌ ใ( ใ-ใใ)
Lol
rip now aiohttp is giving problems
pip install -U git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py[voice]
yeah
Anyone know how to change the colour of the bot title on the website to a colour-changing rainbow thing. Like I know how to set it but not changing
Ping me if you respond
CSS?
Yeah
But how. I said i know how to change it but not to color-changing rainbow kinda thing
Well I'm not that good in CSS so I don't think I can tell you much
But generally its using animations and yeah
i need help with the help of commands ๐ so hard if i must update my help command after i add a new command 
anyone have a way for me?
@earnest phoenix is your bot in 1 file?
I presume u know how to use fs then
Read all the files in โcommandsโ file and make that into your help command
how about the category
Guys i need help
With?
let memberz = message.mentions.members.first(); and message.memberz.avatarURL didnโt work since im new at coding and i suck at everything
Acutually im getting used to it i mean if iโm new why is my bot even approved
think that your let replaces with the value you put it as
so rn it's message.message.mentions.members.first()
O
Let me try
It didnโt work @quiet bobcat this happened: UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'mentions' of undefined
Hm
its message.mentions.users.first() @earnest phoenix not message.members.mentions.first()
Ok
Quick question: I'm a bit new to bot-making, but I'm doing it in JS. How can I access the channel object so I can access stuff like id and type?
if it's with message just do message.channel
well it is <MESSAGE>.channel then u can check the id by message.channel.id and so on
Yeah. Once I get channel ill work on other things like users, etc
Ill edit my code real quick, but here's what I have beforehand:
@turbid tiger i presume u should see https://discord.js.org/#/docs/main/stable/general/welcome
Haven't seen that webpage yet. Ill try it, thanks
I'll be sure to let u all know if it worked ๐
Now it said UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'username' of undefined
that means whatever you have before .username is empty
Secs ago something happened with avatarURL and now something happened with message.memberz.username
why are you doing message.memberz? if memberz = message.mentions.users then message.memberz = message.message.mentions.users
which is pretty much wrong
you can remove message in message.memberz.username
if first() returns the user collection, then all you need is memberz.username
K
depends what does first() give you
if it gives you the entire collection or something else
Sorry to interrupt, idk if I'm missing something here, but my console told me that channel is undefined. Here's a code snippet:
var Discord = require('discord.io');
var logger = require('winston');
var auth = require('./auth.json');
// Configure logger settings
logger.remove(logger.transports.Console);
logger.add(new logger.transports.Console, {
colorize: true
});
logger.level = 'debug';
// Initialize Discord Bot
var bot = new Discord.Client({
token: auth.token,
autorun: true
});
bot.on('ready', function (evt) {
logger.info('Connected');
logger.info('Logged in as: ');
logger.info(bot.username + ' - (' + bot.id + ')');
logger.info('CookieLord Bot is Ready to Bake some Cookies!');
logger.info(channel.client);
});```
The second-to-last line is where I have problems.
i've never used first() so idk
what do you use
i dont have any command that needs mentions from a message
discord.io isnt gud cause its outdated
Oh
yes
What should I replace it w/? ๐
or eris

Didnโt work UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'mentions' of undefined
post your code

that is some emoji right there
lmao
do bots have permission to change their nickname?
username yes, nickname depends on server permissions
no here
do they have perms here
no i said, the way you were doing was the same thing as trying to do message.message
which is what was giving you problems
Ok
why do you have message.memberz?
message.memberz is not gonna work
Then what
you use it properly in one line
you want the avatarURL, where is the avatarURL?
and wrong on the next
avatarURL is a propriety of the user collection
where is the user collection?
you assigned it to memberz
So just remove the message?
message.message.nentions.users.first()? wat
setAuthor(memberz.username) // correct
setThumbnail(message.memberz.avatarURL) // wrong
the piece of code i sent is also wrong
How is this now
also, js x(`${y}`)is the same asjs x(y)
idk

@warm prairie apologies for the late reply, I had to get off my computer. I'm getting an issue with const attachmentUrls: any[] = []; because of the semicolon. Did you mean to put that there?
Oh, okay.
What is bot
^
in .net, what is the type used to put who typed/sent the command into the embed response?
Yeah I was using Typescript @shell blade
@simple bramble Discord.Net or D#+?
in python, if I'll use continue in a for loop that is inside a for loop, will it continue the whole loop or the one inside it?
The one you are currently in
Any suggestions on wich NodeJS Discord library to use?
discord.js
Thanks
Anyone know what this is about?
throw err; // Unhandled 'error' event
^
Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object])
at Client.emit (events.js:171:17)
at WebSocketConnection.onError (/home/ubuntu/Kaneki/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:374:17)
at WebSocket.onError (/home/ubuntu/Kaneki/node_modules/ws/lib/event-target.js:128:16)
at WebSocket.emit (events.js:182:13)
at WebSocket.finalize (/home/ubuntu/Kaneki/node_modules/ws/lib/websocket.js:185:12)
at ClientRequest._req.on (/home/ubuntu/Kaneki/node_modules/ws/lib/websocket.js:641:12)
at ClientRequest.emit (events.js:182:13)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:546:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
at TLSSocket.socketOnData (_http_client.js:432:20)
``` Was working fine up until here and it looks like its a npm error. Im just unsure how to fix...
o. mk. Im confused with how to catch error in my command files... idk
Yo. Is there a way to check if user have voted for my bot using .net library?
@long forge
its an event
so just do it like all other events
and make it log the error in console
Add .catch(console.error); to the end or something then console.log(e)?
client.on("error", (e) => console.error(e));
client.on("warn", (e) => console.warn(e));
client.on("debug", (e) => console.info(e));```
thats a thing lol. or console.log idk
either work im assuming
@knotty steeple Each command file I have needs that right cause it wont just run from the main file?
no
TypeError: Cannot read property 'exec' of undefined huh?
let cmd;
if(bot.commands.has(command)) {
cmd = bot.commands.get(command)
} else if (bot.aliases.has(command)) {
cmd = bot.commands.get(bot.aliases.get(command))
}
cmd.exec(bot, msg, args, config)
chances are bot.aliases.get(command) isn't returning one of the command names

works on my other bots gud
and that errors when i run the main file
not when i try to run a command
OH JEES
@warm prairie sorry again for the late reply. I get this error when I run the command.
TypeError: Cannot read property 'attachments' of null
at chan.fetchMessages.then.messages (/app/bot.js:237:25)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:182:7)
AnyOne Know any good Meme Or Pepe Apis?
How do you guys handle restarting a specific shard?
Like via a command or like something else
i have a question
if my bot was denied due to being easily spammable
(my bot post embed Feats for pathfinder)
so it will post 5 feats, then ask you if you want to go to the next set of 5
would the issue be solved if instead of posting 5 new embed messages, i simply replace those 5 feats with the next set upon command
@autumn slate https://api.imgflip.com/get_memes
@flint river, you can just add all the results to one embed.
Sending 5 embeds at once is near on API abuse.
too much info
Then only send one at a time?
Or just send what the user requests, ie. !result 1 would show the first one.
but results can range in the 30's
so i thought that method might be a bit inefficient
but my method now is too inefficient and spam-like
Thanks @shell blade
np
what are pathfinder feats? are they text? an image? how big is it?
Why when i search my bot, is not found anything?
Is it NSFW / has the NSFW tag?
yes
read #announcements
Remove the NSFW tag or any NSFW content on the bot page. Also thanks Tim ^
message.content.length?
Thanks
barbar do you have nsfw commands in the bot description page?
I couldn't find it in the docs
my bot have nsfw command, i need to remove it to?
you dont need to remove the command, but you need to remove it from the description in the website
Pathfinder Feats are in an almost table format
the website does not allow nsfw content
but there is nothing nsfw in description or tag
then idk, ask a mod
;-;
@flint river almost table?
not physical table, but organized in the same pattern(i.e.)
''' Names: Feat Name
Category: Feat Category
Index: Feat Index
Prerequisites for Feat: Feat Prereq
but as text?
yes
because if is not something like 1000+, you can put more than one in the same embed
which is ideally what you should do instead for sending a separate message for each one
another option is to use pagination
the character count's upper average(most wont get larger than) is about 560 - 600 character
how would pagination work?
using emojis and message edit to make it work like pages
its a bit more complex to do tho
that is what i was considering(i think)
deleting old 5 embed msgs and then sending the next 5 in its place(but at he beginning)
thats still too much, better to send just one embed containing like 2-3 of them, and then go to next page and edit the embed content to display the next 2-3
some or most of the feat embed msg's character count is substantially lower, at around 100 to two hundred (my two key broke)
Are there any databases out there that have a web viewer like RethinkDB+Chateau?
a web viewer?
Yeah, where you can view databases/tables/data from a website.
Why doesn't <center> </center> work in .md files....
And what would you replace it with?
Because that's HTML lmao
Headings and everything else works in .md files ยฏ_(ใ)_/ยฏ
is that something you are planing on seeing in a production environment? or just for local dev?
That's for development only?
I have Chateau installed on my dedi, for development and such.
It shows all the records and such.
Most databases come with some sort of way to view their schemas
I've never found any that do.
RethinkDB has Chateau, but it's an external/optional thing to install and run.
RethinkDB has its own web dashboard
how do you even define per-server prefixes?
MongoDB might
@heady zinc, yeah but it doesn't show the actual data.
@ruby dust I'm using a datastore for that
@ruby dust, you literally store a prefix string for each guild, and on the message event get that guild's prefix.
ik that, but what's the code-base for that
well you can query it through the data explorer but i see what you mean
thats up to you to build out
on message
prefix = guilds.get guild.id
if no prefix for guild return;
else guildPrefix = guild.prefix
.. code
something like that lmao
lol
SQL-based databases have viewers iirc
I hate SQL tbh
i do too dw
I love sql
it's ugly rite
Rethink is awesome. await r.table('users').get({ username: 'tony' }).update({ awesome: true }); :3
mongodb doesn't seems to have a built-in web dashboard
looks like its based off the KnexJS framework
rethink is all but lightweight
But it run's on a different server than mine, so it's ok :^)
I've just been using Postgres, because Heroku has a very nice implementation
please get a real host
not a fan of PaaS?
so, would a bot be considered too "spam-able" if it can post 5 embed messages, then asks if you would like to go to the next 5, if you say yes, it deletes the last 5 embed messages, then post 5 more(1 to 5 more)
well after it posts 5 messages it would have to wait to send more. i think the ratelimit is 5msg/5s per channel or something
it is
so you would hit ratelimit fast
i know that bit, but is it posting too much
if ur hitting ratelimit from 1 command from 1 person yeah
well, my bot has a command that posts like 8 messages

its basically a database dump
it does have a warning and confirm dialog before tho
oh yeah i mean my broadcasteval command posts maximum 1 message per cluster
but its locked to me only
mine is essentially the same, it have around 4000 character - 784 terms - database that it sifts through and allows the user to search through it
but if i make it only do 1 term at a time when a search can have around 30 results, that is just a bit too tedious
use a massive embed (max 6000 characters through the embed) and have reactions to change page
and make it edit the message
^



