#development
1 messages Β· Page 434 of 1
?
pls tell us your issue
when i play my bot with the name of a music, my bot does not recognize and it even crash. I installed fs, ytdl-core and simple-youtube-api. on discord.js we said it worked and When I restart my bot. The same :/
My pc is out of order (I almost Peter the screen with this shit troll.) Can I send it to you as soon as I calm down in a private message?

Me actually

const Discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
if(!message.member.hasPermission("MANAGE_MEMBERS")) return message.channel.send("No can do pal!");
let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
if(!rMember) return message.reply("User does not exist!");
let role = args.join(" ").slice(22);
if(!role) return message.reply("Specify a role!");
let gRole = message.guild.roles.find('name', role);
if(!gRole) return message.reply("Couldn't find role!");
if(!rMember.roles.has(gRole.id)) return message.reply("They already have that role!");
await(rMember.addRoles(gRole.id));
try{
await rMember.send(`You have been given the role ${gRole.name}`)
}catch(e){
message.channel.send(`<@${rMember.id}> has been given the role ${gRole.name}. <@${rMember.id}> If you would like this message in your DMs unlock them!`)
}
message.channel.send(`<@${message.author.id}>, you gave them that role!`)
}
module.exports.help = {
name: "addrole"
}
always returns "They already have that role"
what is this command @west raptor
addrole
yeah I saw but for example for me the commands must have its for example if (msg.content.startsWith("-kick")) { but there is not even a code like that to activate the add rol command
no
!r
what about it
I'm trying to understand your code.
;_;
When I do this: if(!message.content.startsWith('@' + client.user.username) || message.channel.type == 'dm') && client.user.id != message.author.id) return; the bot doesn't reply when I ping it π¦ but if(!message.content.startsWith('!') return; does
assuming this is JS, you could do if (message.mentions.users.first().id == 'botid') {}
yes this is JS
also mentions show up as <@!userid> to the bot
<@id> or <@!id>
^
discord.js has a help server if you need an invite
DMed it
didn't get it
They got it
go there, scroll down, click discord
anyone knows how to change bitrate of audio on opusscript?
(https?:\/\/)?(www\.)?(discord\.(gg|li|me|io)|discordapp\.com\/invite)\/.+/
Someone gave that regex code to me somewhere, I was wondering about it. What invite links does it protect against, and is there a way to add certain ones like dis.gd and discord.com invites?
How to get how many uses a users invites has got (total) in the guild?
(discord.js)
I read that wrong. oof.
@earnest phoenix this guide might help you: https://anidiots.guide/coding-guides/tracking-used-invites
Thats in my opinion a loss of mem
Storing all invites to your cache
Especially for uses
Every invite on djs has a prop uses which is a clear indicator of how many times the invite has been used
You could in my opinion, instead store the invite IDs you deem to track as an key and the uses as its value
In a single array, map, obj whatev
map would be a simple use for it I guess
Which defo lowers your mem usage from it
Are bots not allowed to use the provider key in embeds?
no
Aw
(node:3640) UnhandledPromiseRejectionWarning: TypeError: (intermediate value).setTitle(...).setUrl is not a function
at Object.module.exports.run (C:\Users\fazin\OneDrive\Documents\Coding\Dream-bot-testing\cmds\test.js:8:6)
at Client.bot.on (C:\Users\fazin\OneDrive\Documents\Coding\Dream-bot-testing\index.js:67:31)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at MessageCreateHandler.handle (C:\Users\fazin\OneDrive\Documents\Coding\Dream-bot-testing\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\fazin\OneDrive\Documents\Coding\Dream-bot-testing\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\fazin\OneDrive\Documents\Coding\Dream-bot-testing\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\fazin\OneDrive\Documents\Coding\Dream-bot-testing\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\fazin\OneDrive\Documents\Coding\Dream-bot-testing\node_modules\ws\lib\event-target.js:120:16)
at emitOne (events.js:116:13)
(node:3640) 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:3640) [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.
oof
lol
Anyone know of a good file host that can host multiple .mp4 files and has an API?
I've only found http://file.io so far, but I don't like it.
the one your about to make
.-.
if you can get your hands on an OwO key, that'd be pretty great
I've used OwO to host files programmatically before
ohk
https://streamable.com can host .mp4 files, has an API, and links from there embed natively in Discord, and if your concern is being able to download the files the video player on their website has that as an option when you right click.
Idk about openload, pretty sure it does have an api
@glossy mason β€
my api works with any file except cmd/sh/exe and more executables 
anyone have any experience with mysql and javascript that can help me really quick please?
was wondering if you can UPDATE [table] SET [row]= Math.random() * 31 WHERE [row]= 0
(node:1711) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): TypeError: kickChannel.send is not a function

It's defined
Lol k
@earnest phoenix if you want to do it at an SQL level you can use RAND
kickChannel is probably not a text channel, most likely something else
Or just a raw channel
let kickChannel = message.guild.channels.find(`name`, "logs" );
yeah i would want math.floor(math.random) correct?
at an SQL level that'd be UPDATE table SET column = FLOOR(RAND() * 31) WHERE column = 0
ahhh ok thats where i was going wrong then thank you
Yeah, ignore me. Do what @earnest phoenix said instead.
does it work if you do .find().send() ? maybe find() isnt finding it
it should work tho if you aren't messing with it
log the var before the error occurs and see what's in it
Otherwise it'll break if you change anything
Gotta wait 15 minutes cause of glitch
;_;
So it doesn't send in that but It does in this one?!?
well if you want to logs messages its better to get a channel by id
(node:1711) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): TypeError: kickChannel.send is not a function
What is stored in kickChannel?
The entire channel, the name, the id?
@earnest phoenix
lol thats exactly what was being talked about a few moments ago
Ugh writing unit test framework for a library not really designed for it is a pain
Hello, I am french. I speak little english and I cade discord js bit please send command clear tchat svp
someone help
for my bot page https://discordbots.org/bot/424817451293736961
i'm trying to change the background
background-image: url(https://i.imgur.com/h5AD964.png) !important;
but the image is a real working image
and it only shows as a white background
i can't even scroll
it's like my page got a virus all of a sudden
What elements are you applying it to
background-image: url('https://i.imgur.com/h5AD964.png' ) the parenthèse? Guys
Makes no difference
O-o lol
oh here's my desc btw
<link rel="stylesheet" type="text/css" href="https://codepen.io/Joshuliu/pen/eMqppw.css">
<iframe src="https://app-bot.000webhostapp.com"></iframe>```
i'm putting it to my bot page
the body tag
this is just my opinion but uh
000webhostapp is trash
you shouldn't use codepen for permanent css hosting
000webhost is meh last time i tried, idk how it is now
the problem is that it's been working
000webhost user data was leaked not that long ago
And you should apply css directly to the page using style tags
What would the order be so that for example I ban a person or I purge his poster in log?
i'll try that
but the problem is that it's been working but only stopped working today when i changed the url
for the background image
ok I put everything in a <style> tag but it didn't seem to change anything
You want to create a code and put an image in it @primal adder
@earnest phoenix Yes if your bot is in it.
hi there, my bot reply thing doesn't work. it just replies with a mention
yes, and this is what it does:
code?
What is you code?
hang on
ok nvm I can't coffeescript
its js
Why are you making it type?
because it takes some time
so its my code and not the api right?
It is your bot
I have a ask
What would the order be so that for example I ban a person or I purge his poster in log
I try to create a log of the bot..
Wait what?
so whats the code that breaks it?
What is a poster?
it should work π¦
whats wrong with the split..?
You need to give it a string
it is a string?
Are you getting any errors?
nope it just replies with a mention only
If yes send the stacktrace
er, i tried fixing it and its giving a response but weird
Send the current code
What is / +/
it was in discordjs.guide to prevent the args thing (with the bot detecting lots of spaces)
yeah
But don't you need to put that in a string?
Nvm
Yeah yeah I saw
Wow I didn't know that ok
Umm tbh the reply is straight out of the api
its weird though like
https://nekos.life/api/v2/chat?text=dancing lemon?
click on that, it gives weird responses
Nobody can help me?
uhhh
idk how
since i'm just giving text to the api
and responding with text it gives back
@velvet jackal http://you.can-fuck.me/hhdnsMrDYwu2RYD0.png
encodeURI()
yes π
ok
well i tried it and it doesn't really work
msg.reply(decodeURI(body.response));
oh i have to encode it when sent
thanks
@misty river you cant thats not a field its using bold and this markdown
νκ΅μΈμ μκ³μ κ°μ
Who has already programmed a YouTube play code
@prime cliff It is, I just cropped it
Anyway I figured out how to do it
Well, someone else told me
Why command youtube bug me I think its my connection but which ones have a bot music what connection do you have?
show ur code
library?
@limpid cosmos
It's you ask?
@vast bane in pv?
@earnest phoenix no one is gonna give you their code lmao
No lol
π π
You don't have understand me
I have a code
Is fonctionnel
@earnest phoenix for musicbots I recommend lavalink
Which lib are you using?
Js
d.js?
if you use d.js voice i would recommend using master version since quality is 10x better there and way less cpu usage or an external service like lavalink
I use just opus script and ytdl-core no api and no d.js
no
like
you need a discord api library to actuall connect to the bot
and there are 4 libraries for js
you would need to use one if you dont write your custom lib
what i guess you dont
it has some patchy thing to make it work
idk
never used it
but yea its not really usable anymore
xD
π€ π
which library do you use
look in your package.json or in your code whats in the const Discord = require('lib here')
or however you called your Client variable
Const Discord = require('master') π€
no install discord.js master version from github (but care master has a lot of breaking changes)
yup yup
What is the best for youtube command?
What's best so that it doesn't bug anymore

π€
use master of d.js with ytdl-core or use an completly external service like lavalink with a library for your langauge
You can start by learning JS?
your choice
Okay I go try

@restive silo wuts the difference between d.js master and d.js stable voice?
Master is unstable 
master got anotherβ’ rewrite for voice what doesn't use ffmpeg and node-opus or opuscript for ogg/opus streams (that saves tons of cpu when using youtube as source)
this does reduce cpu usage a lot
also
they improved the system so it doesn't stutter anymore because of the cpu usage
i personally still use Lavalink since master voice has some bugs but i remember hydra fixed mostly all big ones
owo
Time to invest in lavalink nodes
same
@tulip coral
I read that if you get certified you can do more changes to the entire bot page such as changing the css of the whole page, etc.
How can you do so?
Would like to change the background of the page from white/black to a color which fits my bot better.
@restive silo how rggistre at lavelink?
Because He asks me the password lavelink
For example https://discordbots.org/bot/nekobot
They changed the background of their page
but how did they do it?
I believe it can all be found here https://discordbots.org/api/docs
mmh ok
can't find anything about it @tulip coral
the docs are only about the api itself
but doesn't write about bot descriptions
Pretty sure everything is also showed whenever you click on Edit on the bot page
Editing a bot page is like normal website editing
As cert you can also use JS to move elements or fully redesign the page to your liking
As long as the buttons are still there
Best bet is using the dev console to look for classes and id's
Guys why I have a error with lavelink?
nice thx @quasi marsh
/app/node_modules/lavalink/dist/core/Client.js:8
constructor({ password, userID, hosts }) {
^
TypeError: Cannot destructure property password of 'undefined' or 'null'.
i install lavelink and i have this error
gg
You don't say?
Can we in Js display youtube live ?
@earnest phoenix it cant get a password property from a null object
I put in the password and it still doesn't work
Put ` around the text you want
https://guides.github.com/features/mastering-markdown/ And move to #memes-and-media if you wanna test those. 
https://support.discordapp.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline- describes all of them
type your messages in one sentence pls
Guys for digital ocean, I created a droplet. I made the SSH private/public keys. I made a user, & disabled root. Installed python3, & then installed discord.py using pip. but I was met with:
async-timeout requires Python '>=3.5.3' but the running Python is 3.5.2
what do I do, please help. I'm desperate.
@topaz fjord I tried doing that, however it doesn't go above 3.5.2
What is the OS? 
ubuntu 16.04.4
okay still getting it
thank youu @slender thistle
I mean, Python 3.6 pretty much is compatible with Discord.py, isn't it?
with rewrite iirc
New Discord.py rewrite update requires Python 3..5.3 and higher. 
it says 3.6 installed but it's saying 3.5.2
Try python3.6
oh ok
Traceback (most recent call last):
File "/home/yousef/league/CTE/0.28 MAIN.py", line 1, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
do I do pip install
again
Yep. 
async-timeout requires Python '>=3.5.3' but the running Python is 3.5.2
I did pip3 install discord.py
I wonder if python3.6 -m pip install discord.py would work. 
That worked? 
seemed to do the trick

xD
Lol
Trying to install canvas
when i import canvas module it response Can't find module
Error: Cannot find module 'canvas'
npm i canvas
-_- read what i typed
i have discord.js already
The upgrade version
okay wait
install python
....
@inner jewel lol the code is in js
i use Js
@earnest phoenix read the error
wait till i check
python but i use js lang
okay ..
I have this body:
body {
background: linear-gradient(270deg, #363b74, #673888, #ef4f91, #c79dd7, #4d1b7b);
background-size: 1000% 1000%;
-webkit-animation: AnimationName 30s ease infinite;
-moz-animation: AnimationName 30s ease infinite;
-o-animation: AnimationName 30s ease infinite;
animation: AnimationName 30s ease infinite;
} !important;
But for some reason it won't change the background on discordbots even though I have the !important tag.
What am I doing wrong?
i dont think you can do that
you have to put the !important tag in every css rule
at least i havent seen it used that way yet
I did that, too, but it still won't work on DiscordBots
Do you know why? @quartz kindle
idk about the animation, but the background works for me, at least it does in the console
does anyone know how to use reactions to turn pages in c#/discord.net?
i've been trying to work it out but the best solution i came up with is to somehow return something from an event handler
A quick search pulls up this addon for paginated messages: https://github.com/foxbot/Discord.Addons.Interactive
javascript pls
^that seems cool and tbh im gonna look at that
the way I did it was like this:
- On the message send, react with whatever emojis are required for paging (like β¬ and β‘)
- Listen to reactions in an event. If they both are the same emojis you reacted with (these can be hard-coded idk) and they are on a message you sent (this can be done pretty easily, just put something unique to that command (like a "this is a paginated command for help" or something) and then check for it on the reaction)
then edit
i don't know where to put that last parenthesis
but yeah you should probably use that addon
I've never used this addon myself, so I can't vouch for how good it is, but it has a whole 10 stars.
i use that addon already and didn't realize that that's how the paginated stuff works
let's see if it uses reactions
Well my system doesn't use the addon
if that's what you're thinking
i've no idea how the addon works 
thats basically how i did my pagination, listen to reactioncollector on that message and edit based on reacted emoji
@earnest phoenix You have to do something like:
class Citation extends server{
// Code here
}
module.exports = Citation
Thats how I have my bot set up
You can verif my code?
I can't verify your code. That's something you have to do on your own
Okay np :)
i dont use module.exports so i cant help you there
Np guys
less about development, more about trivia logic but
there are 3 difficulties for trivia. Should the hardest have MORE or LESS time to answer than the easier questions? On one hand, less makes sense because it's harder, but more also makes sense?
just have three different categories, one for easy, other for medium and expert and assign it to a question.
I, I am
I'm talking about the time on the timer to answer
lets say easy has 10 seconds, should harder questions have 5 seconds or 15 seconds
Well these give you currency, so I'm trying to regulate how balanced the currency stays. I'll probably just make them all the same time amount
make it be like kahoot where the amount you earn goes down as the timer ticks :^)))

How do you get your bot to change its name and PFP to mimic a user in discord.js?
Like what UnbelievableBoat does with the suggestions.
Webhooks mby 
I want to do that. I'm using Discord.js but I don't know what that function is even called
If someone could guide me to the general area where I might find that info I would greatly appreciate that! β€
I don't think that is what I'm looking for. I think that the bot does that without webhooks
The owner won't tell me how it does it though
Or at least give me a hint
If it doesn't use webhooks and changes the bots avatar + name, it would be ratelimited on nickname and avatar change and would also reset back to the same avatar on client refresh. Webhooks can post a custom name and avatar through 1 webhook
Right
So, the bot adds a webhook every time it does that?
Actually, that just might make sense
It just needs 1 webhook
Wait... really?
Avatar and name can be changed on post
It's not ratelimited?
With the same webhook diff name
Ok. I see now
That's pretty cool
I wanted to do it but I couldn't figure out the ratelimiting
Thanks for the explanation!
for any d.js master experts out there, what's the point of this new property deleted and why is it on all of the main structures like GuildMember and Role? https://please.zbot.me/kZinmQfN.png
makes no sense
Maybe if there is a event triggered like a member joined you can check if the role exists I guess with one line extra
yeah but the weird thing is (to my knowledge, i dont know the d.js internal code too great) it's always false? https://please.zbot.me/153sXBdi.png
and this is the same for all of the structures
d.js's internal code makes no sense to me either lmao
@austere meadow https://github.com/discordjs/discord.js/commit/f0c4d0e834d66a4ad1c3cd766addfd8726ef2070 Might be of use to you
π
Anyone knows a good console logger for nodejs with color?
Yeah but I mean a logging library to handle log messages
like info, warn, error and debug events
@austere meadow its true when it got deleted on discord.
like emojis
there was no way to tell if that emoji got deleted from the object itself
and when you try to fetch an deleted emoji it would error
oh okay
wasn't aware of that
i thought if you fetched a deleted object it would just return null
@fluid basin https://github.com/klauscfhq/signale
i was about to link that
O.o
it seems pretty nice
I was faster 
same
who is this (node:9868) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit
(node:9868) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 guildMemberAdd listeners added. Use emitter.setMaxListeners() to increase limit
Anyone know java? Im getting this error when I try and load my plugin Could not load 'plugins\og.jar' in folder 'plugins': Restricted Name
O-o I have 11 lol π€
Yea put them together under one, @earnest phoenix
I don't have see lol
You can use if ... else if... else
if I want to replace undefined, i needs to be "undefined" or undefined?
like... its 'status code' or text?
yes @austere meadow
that's not possible
you can only use .replace() on Strings
unless you're talking about undefined inside of a string
like "hello this is undefined"
(notice the quotes)
undefined has it's own type separate from strings
const Haruna = require('eris');
const fs = require('fs');
const config = require('./harunaconfig.json');
const client = new Haruna(config.token);
// Binding it all to client to make it cleaner somehow
client.ytapi = require('simple-youtube-api');
client.ytdl = require('ytdl-core');
client.youtube = new client.ytapi(config.ytkey);
client.commands = new Map();
is it ok to bind stuffs in client? for a cleaner code
if you're 100% sure those namespaces will never be used, it should be fine. but i wouldnt do something like that
its basically making a mess out of the hierarchy
if you wanna do something like that while keeping the hierarchy intact, you could make your own superglobal and assign everything to it
you could use global but its kinda meh, why don't you just export w/e you want and import the file from w/e you wanna use those
you just mind circular dependencies a bit and it will be just fine
globals are a horrible practice
generally I wouldn't bind requires to anything at all, just have them at the top of your file
and don't worry about the overhead from having to re-require modules, as require cache will take care of that
you could just
const { Client } = require('eris');
const fs = require('fs');
const config = require('...');
const YoutubeAPI = require('simple-youtube-api');
class Haruna extends Client {
constructor (token, options) {
super(token, options);
this.config = config;
this.commands = new Map();
this.yt = new YoutubeAPI(config.ytkey);
}
}
const client = new Haruna(config.token);
(possibly split the Haruna class into a different file)
I see, got it thanks
gotta learn how to use classes xD
does anyone know a way to manually call sendMessage or createMessage in d.js master
i currently have this setup but it loops because it's calling itself over and over https://please.zbot.me/H9omw0Lx.png
i want to manually call sendMessage to prevent this loop
theres probably another way to stop it but look its 1am
you are overriding a method?
yes
umm why do you need sendMessage?
because message.channel.send() calls sendMessage
what happens if you change sendMessage directly?
Can you directly access Shared?
Not with the / in require?
maybe call sendMessage yourself but with your stuff?
Just to locate the folder it's in
Then do require('discord.js/whatever/folder/its/in')
or add an event when you write a message, edit it to your liking 
im pretty sure that doesn't work @topaz fjord
i dont know what you're saying @spring ember lmao
yes pretty good
@restive silo i can't seem to extend Message properly when trying to extend message.reply, i just get TypeError: message.zreply is not a function https://please.zbot.me/x0uZPXWV.png
oh fuck
im so dumb
ok im so sorry
lmfao
thank you for reminding me 

I made this beautiful html thingy for my bot so i can put that in the description but when i use the same code there it looks like shit :?
And idk why. im still a beginner in html btw
and this was it looks like on the site https://gyazo.com/2a69076a4b502d364e89c3b182811955
π
background: -webkit-linear-gradient(left, #ff69b4, #8d1cff);
background: linear-gradient(to right, #ff69b4, #8d1cff);
my background color is not working :?
π
Im screwed
Hello, when I execute my order, my bot connects then disconnects... Can I get some help?
How would i pick a random line from a txt/pastebin then dm a user that line?
codes
Is this pastebin supposed to be edited?
By others
Otherwise I'd say put it in a json and get a random line
yes
how
Like load responses.json and the name will be a number
And you choose a random number
with Math.random
Yeah could do that
There's probably something like random.choice
To choose a random item from an array
nah
I mean in Python it's just random.choice
Math.random * howmuchitems_in_the_array
Could do that
Would that work?
what
Unless it goes into decimals
it does go into decimals
oh kk
thats why i said you have to round it
ye sry
like Math.floor(Math.random * (number))
how
Math.random is a function
so just Math.random() * (number)
but remove () around number
oof
i forgot about that
alright so how would i get it to send the user the text on the line
have the lines in an array
preferably in a json file
then just require that json file and whatever you have defined as you array in that json just do whateveryoudefinedjsonas.yourarray[TheRandomThing] :v
https://lordejerry.com/I/AUpZS5Ul1XTW237F.png how would i fix this 
make sure you use the correct token
Is there a way to force a right to left lettertype to behave like all others? I have one server with that type and it is showing weirdly :
no thatβs an discord error with Arabic text
leave the server? :^)
I was hoping on a more user friendly way xd but ok
I have a bot setup with an events folder and a commands folder, how would i go about making it so my command scripts are linked to the message event in Node?
I'm using djs
I have a ready event in the events folder and one for the message event too
But I want to know how would I integrate the commands
Command handler. There's a few guides floating around.
https://discordjs.guide and https://anidiots.guide have good handler guides, I'd follow one or the other :p
Do i rly need to read the whole thing
Because i already know to do the events
I just need help with the individual commands
Yeah, both guides will show you how to do commands and the other things.
plus, you code could be different so we can't give code and it'll work.
i get Error: Could not locate the bindings file. when i try to require better-sqlite3
why?
and how to fix
npm i node-gyp
cd node_modules
node-gyp rebuild
then
npm i package-name
Try that. looks like it could just be a Node-gyp problem. Not better-sqlite3
@high lava no
How this look: https://discordbots.org/bot/reaction-role
how is this related to bot development 
please #memes-and-media


ub!!
ub!!help
ub!!help
ub!help
ub! ! help
.-.
@earnest phoenix
ub!!help
ub!!help
.-.
go to testing channels
So I have an array with this kind of layout:
watchChannels: => [{ channel: <>, guild: <> }, { channel: <>, guild: <> }]
..and there are multiple entries.
I'm adding them all on the ready event(discord.js) like so:
watchChannels.push({ channel: c, guild: g.id });```
..and I was wondering how do I access them? Do I do it like this maybe?
```js
watchChannels[{ channel: <> }]```
I'm totally unsure, so any help is appreciated. Thanks :3
you're looking for https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find
Thanks o:
Hello, when I execute my order, my bot connects then disconnects... Can I get some help?
the problem is that on my console I have no error
try {/*code*/} catch(err) {console.error(err)}```
put your code in a try
then if it errors console will get an error
@gilded blaze ytdl is not old and buggy, its the best. and its getInfo is just crazy
@velvet jackal if no error was thrown during runtime it won't throw in a try catch
@hexed whale promises inside an async function, that isnt awaited will cause that
how to get guilds id with evenbot.on("ready",?
cz message.guild.id message not defined
wdym? which guild(s) do you actually want to get?
Ok thanks @sinful lotus
little question
if I quit the discord server
will my bot be unlisted from the website ?
no but you dont recieve any updates on if your bot is muted/kicked/deleted
np 
if Regex_IsMatch(Message, "[.*]?invite&s;link[.*]?") == true then
return {empty=false, message = "https://nicolediscord.wordpress.com/"}
else
return {empty = true}
end
end```
One of Nicole's modules
I have to figure out a way to make her only enable an NSFW module in only an NSFW channel
Check the nsfw property on a GuildTextChannel
x.x how would i get her to check that?
Are you using Discordia?
Discordia? Don't think so, she's using a lua reader
Hmm
Hmmm I'll look into this further and see what I can do
You could do a GET on /channels/Channel_ID
Send a header with {'Authorization' : 'Bot your_token_here'}
And read the nsfw property from the returned JSON
Well, she's not using JSON, she's using LUA
JSON is mostly used for web requests
It's a default for getting data from webapi's
{
"key": "name",
"nested" : {"key": "name"},
"array" : ["key", "key2"]
}
Looks like this
nods
So make a request like this, and you can fetch the nsfw property if the way you interface with discord doesn't allow this natively
Note the second to last line with the nsfw property
Whatβs the git
Didnβt Donkku say to learn about the git
Oh yea
So I asked what it was
Err
Git is a version source control system
Ok yea thats better
Uh ok...
It allows you to branch your code and work efficiently with your team
It's also a great place to store code
lol what if ur working alone
Doesn't matter
I am almost always working alone 
And why canβt I just save the code to my computer
You can
Why not
Saving it to your computer is if yoy want to run your bot locally
To make a discord bot run, your machine that stores the code must be online
Oh ok
That is unrelated to git though
People store the code in github cause they want to deploy their code to another external server or vps
Yea
True
So why do I need this to start programming?
You don't
Oh
Idk I put code there to version everything and keep it simple
Also it is easy to transfer between devices
A repo is a place to store your code
Where do I download the client from?
There are many git client around
Just search it up on the net and see which one you want
Somebody help me please
i have problem with check permissions in cog
I write bot in Python
I haven't learnt python yet...sorry can't help
k no problem
I found this...Git for windows
Yea that works
k
What do I do here
it gives me 3 options. Use git from Git Bash only
Use git from windows command prompt
Use git and optional Unix tools from windows command promt
@earnest phoenix k I downloaded the git. What next?
? Whats next?
What do I do now
Isn't git bash for linux?
I mean the site Iβm on is git for windows
Oh wow
Want me to send a pic. Maybe that will help
Git for windows actually has a git bash emulator
Emulator? For a git
Iβm confused I thought emulators were for like old gaming console
Ok
so I open Vs code?
Nah emulators are fro everythinf
Everything
Yea go ahead start using vs code to code
K
Rivan
Aye hello?
Anyone here know much about rethinkdb? I got a issue i canβt seem to figure out, Iβm either dumb or just stuck
just ask your question
Alright, so i've made my rethinkdb in a db.js file, which has functions, for example: addGuild, deleteGuild, guildSettings etc, then i'm exporting that and using that in the command handler, everything seems to work apart from it returning undefined when i do like delixdb.guildSettings(guild).prefix, and when i do the same but having that function in an async/await it returns Promise { <promise> }
Any idea on how to fix it? I'm either dumb or i've fucked it up
Promises occur due to JavaScript being asynchronous.
instead of .then you can do await
Yeah, i looked into that and tried it makes no different
This is literally all i'm using
do something like let guild = await delixdb.guildSettings
then for prefix do guild.prefix
so your saying use an async in the function & use it in the command?
Yeah
use what i said in the command
Yeah don't work either
Just returns undefined man
how to create a invite link with guild id in discord.js?
@earnest phoenix yeah Git for Windows installs cygwin as well
@earnest phoenix with only guild id you can't
do you mean how to generate a invite link for a specified guild, please note that you need to have permissions for that
on giving permissions
on giving permissions sorry i hadn't understood what do you mean π€
like this
updating a message every 60 seconds is not considered spamming the api right?
explain please π€
click on ur sever settings choose the channel and user, then edit their permissions
in my server all can make invite links
OwO, get a channel from the guild then call the createInvite method and ur done
what's OwO
guild.channel
^
example?
if you have a message event, and want the channel the message was send in you can do msg.channel
console.log(msg.channel.id)
})
I want my bot to make a invite link of specific guild when i message is sent from other guild
but idk how to do that π€
var parrot= bot.guilds.find(g => g.id == "448434988333924353")
var channel = parrot.channels.find(c => c.id == "457160657473896448")
channel.send(`Inviteurl`)
u wot
Parrot is in this case the guild you want to send it to, channel is the channel
bot is the client
where's the invite code?
read
pls not here
ik
π€
read that nani
I meant i want my bot to make the invite code @granite hedge
just look it up
if I learned how to make a small payload, then you can learn how to make that invite code
channelguild1.createInvite().then(invite => channelguild2.send(`I was added to ${guild.name}, invite: ${invite.url}`)).catch(console.error);
@earnest phoenix PLEASEEE just read the docs
Helpful links:
https://anidiotsguide_old.gitbooks.io/discord-js-bot-guide/
https://discord.js.org/#/docs
π€
@abstract crystal weeb
this is #development pls
yeah you will have to learn to work with the docs
it's kinda hard at first
keep in mind that docs can be hard to navigate through at first, but when you know your way around they become your friend
sometimes
spent an hour making a bot but it wasn't friendly
lost all that work tho
anyway this link for d.js is the best starting point: https://anidiots.guide/
Im achieved lol
I made a bot where when someone says cookie a cookie emoji pops up and when I say milk a milk emoji pops up
omg why
have fun getting your bot that mute if your bot gets in the server
how to remove these shapes on the bot page 
display: none;```
ty
np 
how to do a ban command
check the docs please
anyone got a forever restart command working?
how
to
do
a
ban
command
the d o c s
k
ok
What's this weird line, or am I the only one seeing it https://illuminate.ngrok.io/5b2c0ac9c1fa0b0f2ea031c9.png
no ads are there
I dont see a line there
maybe it's a rendering error of that line there in the background?
What's the website? Can try to see if I see it too
its the bg image
its visible in higher / wide res
and if you open the bg image in chrome it'll hide them because the bg is dark and they blend in xD
@topaz fjord I have no idea what u were trying to say other then have fun so...thanks?
for reference
when i try to install quick.db (npm i quick.db) it returns an error
its above char limit










