#development
1 messages · Page 492 of 1
new ClassName is pretty common
Haven't seen that before, my bad.
if u use debian package manager you can run sudo apt install ffmpeg
thats you posting wrong stats to dbl api
ok srry
https://cdn.geekhd.tk/images/65o4h.png
anyone know how to get this in JDA?
bots can't have rich presence
What do you do with JDA then?
wut
anyone know how to get this in JDA?
I want to get the time elapsed/time left from a users rich presence details
They you need to be more clear from the start
I thought it was pretty clear from me highlighting the time left in the image
You didn't mention that you want to get if from users' RP
well where else was I gonna get it from?
As for me, I thought you are having issues with Google Play Music and were asking how to show time elapsed XD
I apologize then
Member#getGame()
Game#asRichPresence()
my first three shards are unresponsive, but everything else is fine
tried restarting machine
running 8 shards
what language?
python on discord.py
i asked in the d.py server but they said it's likely a discord issue
it'd be documented and fixed by now though
this has been happening a few days
no errors
Do you know how to automatically update its status please?
(node:7940) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
at Url.parse (url.js:150:11)
at Object.urlParse [as parse] (url.js:144:13)
at Snekfetch.buildRequest (C:\Users\User\Desktop\No name\node_modules\snekfetch\src\node\index.js:27:23)
at new Snekfetch (C:\Users\User\Desktop\No name\node_modules\snekfetch\src\index.js:36:43)
at Function.runMethod [as get] (C:\Users\User\Desktop\No name\node_modules\snekfetch\src\index.js:247:12)
at randomPuppy.then.url (C:\Users\User\Desktop\No name\commands\furry_nsfw.js:19:17)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:7940) 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:7940) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process witha non-zero exit code.
I can't seem to figure this out
Make sure that the url you're passing in is a string?
If it's not returning anything that's because the string is empty...
What's your code?
No I mean
Sigh*
The code stops somwhere
I just don't know where
So where ever it stops is before the console log
So the console log won't even work
log it as soon as you can
Check the stack trace
Ok so I logged something else as a test so I know where the code stops now
What's the line that makes it error?
I can't help you if you won't show what the code is doing
Ok
const randomPuppy = require('random-puppy');
const request = require('snekfetch');
const fs = require("fs");
const Discord = require("discord.js")
module.exports.run = async (client, message, args, ops) => {
if(!message.channel.nsfw) return message.reply(`Sorry NSFW commands can only be used in NSFW Marked channels!`)
let subreddits = [
"yiff",
"Furryporndump",
"Furry_Porn"
]
let sub = subreddits[Math.round(Math.random() * (subreddits.length - 1))]
randomPuppy(sub)
.then(url => {
console.log(url)
request.get(url).then(r => {
let PokePornembed = new Discord.RichEmbed()
.setDescription(`${message.author.tag} here is your Furry porn`)
.setColor("#00ff00")
.setImage(url)
.setTimestamp()
.setFooter(`Command made using Reddit`)
message.channel.send(PokePornembed)
})
})
}
module.exports.help = {
names: ["furry-porn", "yiff"]
}
Which line does it break on?
I don't know now :/
It worked 2 times
I may have a theory of why this isn't working though
i have a feeling that for whatever reason, url is becoming undefined
so when you try to request.get(url) its breaking
either try and fix what ever is making url go undefined or just check to make sure url isn't undefined before you do the request
I have url console logging before it requests it
oof
No
I get that stuff
I get the links
BUT I was thinking
What if it is cause the stuff I am trying to get
is a video?
Cause it is reddit there are those types of things
yeah its logging undefined and then breaking, and that could be it lol
Well
It isn't breaking per say
Not anymore at least
You can use the command again and it works
I just didn't know why I got that error now I think I know why
@real ocean Is there a way I can embed a video? Like not the actual video it's self
I am trying to make a Pornhub command, I saw a bot called NSFWbot do that
how do i get out of opacity?
uh you can put a video inside an embed without uploading it afaik?
you might need to link to the actual video though, not the page
RangeError: Maximum call stack size exceeded
at rand (C:\Users\User\node_modules\unique-random\index.js:4:22)
at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\node_modules\unique-random\index.js:6:47)
I got this error
a function is calling itself recursively and failing to achieve anything
make sure that whatever line youre doing random stuff on isn't doing anything funky with its params
let sub = subreddits[Math.round(Math.random() * (subreddits.length - 1))]
It is only doing that
are you sure? the errors being caused by a package called unique-random
are you using uniqueRandom(a, b) anywhere?
No
although it could actually be a dependant on one of the packages you're using
I don't even know what unique-random is
random-puppy uses it to get its randomness
Ah ok
make sure the subreddit you're using is typed properly
I am using random-puppy
It is typed
I copied and pasted it
lol
SO it better be correct
So*
lol wut
how does it even run then
¯_(ツ)_/¯
thats nodejs for you
yeah probably
Ok doing so now lmfao
I hope I don't get random dogs instead of Furry porn
RangeError: Maximum call stack size exceeded
at rand (C:\Users\User\Desktop\No name\node_modules\unique-random\index.js:4:22)
at rand (C:\Users\User\Desktop\No name\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\Desktop\No name\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\Desktop\No name\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\Desktop\No name\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\Desktop\No name\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\Desktop\No name\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\Desktop\No name\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\Desktop\No name\node_modules\unique-random\index.js:6:47)
at rand (C:\Users\User\Desktop\No name\node_modules\unique-random\index.js:6:47)
I got that again :/
I have used this method a lot now I have problems with it Sigh
this is a super dumb question but does the subreddit have more than 1 pic
had to make sure
Any idea why my iframe's height is forced to 500px even though I set it to 300px on my bot's description?
<iframe src="..." width="600" height="300" style="height: 300px !important; width: 600px !important;" frameborder="0"></iframe>
It's still forced to 500px and looks like this:
Yeye I know XD
Any idea how to fix it?
Sure, I can leave it at 500 pixels height, but that doesn't look that good :3
Wow that looks awesome xD
What is it for though?
Does it go by like the Server region?
yeah.
Wow, that is cool
:3 ty
:3 yw
return prev = num === prev && min !== max ? rand() : num;
This is what is in unique-random's thing
Index*
On line 6
yeah
module.exports = function (min, max) {
var prev;
return function rand() {
var num = Math.floor(Math.random() * (max - min + 1) + min);
return prev = num === prev && min !== max ? rand() : num;
};
};
Whole hting
thing*
so i have a feeling for some reason its trying to get a unique random number which can only be one thing
so it keeps trying
How can I stop that?
Boyz, how do profile or other image with nodejs?
Wanna create a profile for my bot 😄
Maybe some link to guide, I rely want to learn that
not too sure @lusty dew, i can't spot anything in the source for random-puppy which looks like it's obviously failing, you can maybe try debugging it for yourself in there or posting an issue on it's repo i guess
wait nvm
What?
its the Furryporndump subreddit that's breaking it
random-puppy makes an api call to imgur, and if you try making that api call with aforementioned subreddit it returns an empty array
so random-puppy isn't getting any images
wait what?
wtf is that random function
its u n i q u e
that's pretty useless tbh
I didn't add it :/
and horrible practices
as long as if you dont get the same result twice in a row amirite
but ye, for whatever reason the api call isn't working
i dont really want to look at this subreddit
npm uninstall unique-random
module.exports = function (min, max) {
var prev;
return function rand() {
var range = max - min;
if(range == 0) return min;
var num = Math.round(Math.random() * range) + min;
if(num == prev) return rand();
return prev = num;
};
};```
Could I unistall unique-random
nah thats not the issue
the code is dodge but it works
try logging the arguments given to it
God help my soul looking at the subreddit thats causing issues, it looks like the posts are on dbox not imgur
also i wouldn't call this https://i-was-scammed-by.dabbot.org/500c87.png as "it works"
so the imgur api isn't getting anything
ok but if issue is caused by what it looks like it is, yours would do the same thing >.>
if i had to take a stab in the dark i'd say that the module is calling randomUnique(0, 0)
wait lol nvm i saw your error checking
brb
const r = uniqueRandom(0.1, 0.2)
console.log(r());
console.log(r());```
this seems to trigger it
function (min, max) {
var prev;
return function rand() {
var range = max - min;
if(Math.abs(range) < 1) return min;
var num = Math.round(Math.random() * range) + min;
if(num == prev) return rand();
return prev = num;
};
};```this would fix it
range < 1 -> return min
Oh
the issue is that the subreddit doesnt use imgur for the pictures
and random-puppy uses imgur
Furryporndump
Just makes sure that https://imgur.com/r/{subreddit}/hot.json actually has stuff in the data array
that means that it found pics
i need some ideas for commands
this is my first time coding with python and i dont really know how to add much
in HTML.
make a bot that repeats back everything everyone says
I want to update automatically put on the statuses
ok so maybe there is some way to do something periodically
like on an INTERVAL... crazy thought
google probably wouldnt have any results for that..... no... 
😦
function updateGameStatus() {
bot.user.setActivity(`*help | Users: ${users}`, {type: "WATCHING"});
};
setInterval(updateGameStatus, 30000);
updates every 30 seconds @stuck ravine hope this helps.
thanks !
sometimes spoonfeeds help, for next time.
well hes gonna come back asking why its not changing lmao
users variable aint gonna change itself
spoonfeed strikes again 
Do you not need to worry about sleeping on the thread in js? o.O
Or does set interval just run concurrently
ah
you just need to worry about not blocking the event loop thread
yes for example if u set an interval then put an while loop forever the interval wont happen 
Oh right
Any python developer here?
run it with python
how are you running it
do python bots perform better than Discord.Net ones?
ok, now?
with the folders ?
https://i.imgur.com/hKHSltG.png get the file location from here
i dont know pyton, but im pretty sure you cant send a message to true
you're doing send_message(author.id == "id"), which becomes send_message(true)
oh, how can i make that when the users id sends a message reply?, any message i mean
anybody here that works in java?
i dont get what you mean, but it should be send_message(where to send, what to send)
pretty sure you can figure out what you need from there
Hey Tim do you work in discord.js
doesn't everyone
Lol
@dim gate when the users id sends a message reply what
right now i only want the bot to reply, later i will decide what he'll reply
await client.send_message(message.channel, "I WANT TO REPLY.")
throw err;
^
Error: Cannot find module 'dblapi.js'
dont say to me do npm i dblapi.js because ive already done that, and the file it says the error in isnt even requesting anything to do with that, and it says the error is on a blank line, wtf could be the problem
Dblapi doesn't seem to be a module
NO SHIT
but nothing is requesting it
What do you need it for 🤔
@dim gate Get a better IDE.
The one that doesn't mix tabs with spaces.
Sublime Text (or PyCharm, not sure).
Your issue is using tabs and spaces for indenting stuff.
pycharm is only a 30 day trial
Or visual studio code
Sublime is light.
I like VSC for the itellisence
Preferences. /shrug
^
it does'nt work
yes @frail sierra
Ok
@dim gate https://puu.sh/BzKeo/922cb23a3c.mp4
How can I do if I want to add motion picture(gif) to my bot message?
let txt = doc.toString().split('\n')
for(line in txt){
if(txt[line].includes(approval)){
//string is on line
let text1 = txt[line];
let text2 = text1.split(":")[1].trim()
});
Why does that give me an error?
which one is line 42?
let txt = doc.toString().split('\n')
for(line in txt){
if(txt[line].includes(approval)){
//string is on line
let text1 = txt[line];
let text2 = text1.split(":")[1].trim()
if (text1 === undefined || text1 === null) {
var id = message.author.id;
var roblox = args[1];
fs.appendFileSync('verify.txt', `${id}:${roblox}\n`);
}
});
### COMMON FUNCTIONS (NO COMMANDS) ####
def set_balance(userID:str,value:int):
with open("data/coins.json") as f:
j = json.loads(f.read())
j[userID] = value
with open("data/coins.json", "w") as f:
f.write(json.dumps(j))
def get_balance(userID:str):
with open("data/coins.json") as f:
j = json.loads(f.read())
try:
return j[userID]
except:
return 0
def add_balance(userID:str, value:int):
set_balance(userID, get_balance(userID)+value)
def remove_balance(userID:str, value:int):
set_balance(userID, get_balance(userID)-value)
for i in res:
try:
if weekno<5:
await client.get_user(int(i)).send(embed=discord.Embed(title="VOTE",description="Thanks for voting! +5 hashes",color=0x000))
add_balance(int(i), 5)
else:
add_balance(int(i), 10)
await client.get_user(int(i)).send(embed=discord.Embed(title="VOTE",description="Thanks for voting! +10 hashes (weekend bonus)",color=0x000))
except:pass
Some reason the json keys duplicate. {"397745647723216898": 10, "397745647723216898": 10}
i need help setting up the api for so i can get my bots stats onto the website
@earnest phoenix that's what #topgg-api is for
I have a Problem:
I did Change the Name and the Avatar of my Bot but it doesnt change, only in the invite is the new name and new avatar
you are probably only changing the application name and avatar
how else should I change it?
go here and change it https://i.imgur.com/o3fU04a.png
how can i have 2 prefixes on my bot, so if i use -- or tag the bot
Use prefixes array and regex
if u wanna tag
u cud do smth like
if (message.mentions.users.first() && message.mentions.users.first().id = message.guild.me().id) {//do something}
idt u need the .id part
or u cud
Hm...
Why to loop, lol?
Is it a good idea to add a TOS command for a bot?

canvas
Yea
I know
I am talking about for the
XP bar and rank and level
Idk how to do that part
I don't know math well :/
yes
Ok
lets say bar starts from 0 to 100
max xp is 100
current xp multiplied by max xp divided by 100 gives you the value of the current xp bar
so if current xp is 70, it will give you 70 (70*100/100)
if bar goes from 0 to 350 (if you have its size in pixels for example)
70*350/100 = 245
I am trying to create something like Mee6
which is 70% of the bar
Lol
so I did change the Botname in general information and the bot tab but it is still named the old name
pls help ;-;
@earnest phoenix If you are trying to make the bot's prefix a mention also you need to do it by the bot's ID, also it won't work how you are doing anyway
Damn, show your code, I know ur trying to have multiple prefixes
that is the code, its in a config.json file
You can't do it like that
when you mention someone, the bot doesnt see @ username#number
I'm done
the bot sees <@ id number>
Yes
depends on the rest of your code
Yea
I have my set up by mention
But my method most likely won't work with yours without rewriting your whole json
Plus not allowed to spoon feed
repost: I did change the Botname in general information and the bot tab but it is still named the old name
thats the message event that grabs the prefix
const Discord = require('discord.js');
const config = require('../settings/config.json');
exports.run = (client, message) => {
if (message.author.bot) return;
//Prefix Handler
if (message.content.indexOf(config.prefix) !== 0) return;
const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
const cmd = client.commands.get(command);
if (!cmd) return;
cmd.run(client, message, args);
client.on('ready', () => {
setInterval(() => {
dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
}, 1800000);
});
}
@quartz kindle
Ur doing wrong
why do you have an module.exports thing in your index.js?
if you want a message event do
It should be
It should be in your index.js
Wait
Do you mean like a messageEvent.js?
new RegExp(`^(${prefixesArray.join('|')})`)
either an if/else, switch or ||
@earnest phoenix where in code do i put that
also, if you do indexOf just like that, you're matching the entire message content
meaning if the prefix is anywhere in the middle of the message, it will still work
and i doubt you want that
@earnest phoenix Have you tried learning JS?
You need to do something yourself, here you can just receive some hints
No one will code your bot for you
And, yeah, you should take a look at JS docs first
@open basin What would the shop contain?
- repost because my question is going down under the other questions : so I did change the Botname in general information and the bot tab but it is still named the old name
Try reinviting the bot
Also
imma try that
That just renames the Bot's role
In the bot tab
Oh wait
General Info
I thought you meant the actual tab called bot
OOF
When you can't read >~<
Hmm
A dict with items and stuff like that, I guess
Can someone help me? I've been trying to do this for over an hour! Im trying to code a kick and ban command and I cannot get it I'm using python 3.6
@open basin {'Sword': 1000, 'Stick': 10} etc.
@native folio What is your Discord.py version?
ive put the exact same code in config and config2 and done the same with message and message2 but, the only thing i changed in message2 was the config file and only thing i chnaged in config2 was prefix, the first one works but the message2 and config2 doesnt
someone help
@slender thistle 3.6
You need to show both, @earnest phoenix
what u mean
@earnest phoenix
show the files
the code
Message File Codes
Config Codes
check the config file for both
ye, i did...
I use yargs-parser for parsing arguments
and i showed u them @earnest phoenix
I see
You're trying to do a mention prefix?
ye
I can't see all of the code
Your editor is being sliced
const Discord = require('discord.js');
const config = require('../settings/config2.json');
exports.run = (client, message) => {
if (message.author.bot) return;
//--prefix Handler
if (message.content.indexOf(config.prefix) !== 0) return;
const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
const cmd = client.commands.get(command);
if (!cmd) return;
cmd.run(client, message, args);
}
thats in both but config file is different, and the first one works, just the one where i tag bot doesnt
Yep, thought so
the prefix isn't working because you're trimming the string
So the prefix isn't actually <mention> command
it's <mention>command
In order to get around this behavior, you need to use regex
mention command doesnt even work without space
how do i use regex?
actually, ima go now
Is there a way to make a richembeds embed colour fade?
Discord.js
Is there a package or something?
fade?
im guessing like
Like red to grey
edit the message and change the color
Changing colour
i think he means in one embed
But can it be red at the top and change to grey at the bottom
not possible
Not a package?
not possible
Ok
#CSSGradientInDiscord.jsEmbeds
how do I set default value with MariaDB?
Can someone help me with a giveaway command?
what lib?
Discord.js
Oo
Okay, then it's easy (4 steps)
- Create a reaction collector (or await reactions) using a duration that you set in a specific channel
- Wait for the collector or await reactions to end
- pick a random reaction emote from the collector
- Find the user of that random emote <reaction.message.member>
so like
Can someone help me with a giveaway command for discord.py 😀
Lol
You gave me a idea for my bot lol
XD
I've been trying and trying and I can't seem to figure out how to make a kick and ban command for python 3.6
I want my giveaway command like GiveawayBot's
I want my giveaway command like GiveawayBot's
-_-
Did you just copy me
I will end your life if you keep coping me
oof
Just having fun
oof
What is a bot editor
wut
Isn't c++ harder or somethin
Does this server support python because i have asked tons of questions and no answers
Do you code with python?
how about a bot that has custom chat tags you can put in
and if they find them it alerts/deletes them
Hmm possibly
OOF website I can't afford it nor can I code in HTML or css
Learn it in like 3 days™
ok i learned html+css over a weekend when I started out coding so not that hard if you want to try
wut
anyone here know how to make bots
XD
everything
Ok
ok
Tune in every Wednesday & Friday for Discord.js Videos! Go easy on Ned as it's his first coding tutorial in a while! :D SourceCode: https://github.com/The-So...
i got a potato bot
ok
Tune in every Wednesday & Friday for Discord.js Videos! Go easy on Ned as it's his first coding tutorial in a while! :D SourceCode: https://github.com/The-So...
Follow these
what lang
- Do you have a code editor
- Do you have a Bot app
- Do you have any knowledge on a lang
yes yes what is lang
language
coding langauge
almost none
programming language, it is what you write the bot in
Javascript, Pythom C#
like c++, c#, java
you should probably learn one before going onto this
I recommend either learning one with free things such as codeacademy or sololearn
it is a lot harder without any information
Or if you want to just experiment watching a tutorial online
for Javascript I would recc freecodecamp.org
I started without learning a language XD
codecademy, khanacdemy or sololearn like saddy said is good for python
Not saying you should o.O
khanacademy has python wait what
oof
Khanacademy is a thing?
I thought it was only for math o.O
XD
The more you know
Yeah they don't have a python course ok good
@lusty dew Nah, it is useful for a lot of things
Yea
I never used it for anything other then math
lol
Sad thing is I am still horrible at math
ie the grammar portion is at a 5th/6th grade level
Maybe I should start with 1st grade math*
neko what do you code in
Discord.js
saddy?
saddy takes years to respond
discord.js
lol
oof
only because I learned it
i use djs, eris and my own lib
from sourcecode

I want to create my own API, but I don't know where I could host it
glitch
amazon?
i literally hosted my api on glitch
@sick cloud pls
On the price range of broke person
lol
well its better than putting it on my dedi
@sick cloud invest in a $3/mon
do you have a credit card?

@lusty dew it is $3/mon
i already got $55/month
for a galaxygate vps
Ahem again Price range of broke person
galaxygate best gate
if that is too expensive where do you live nigeria
work™
Ahem
getalife
I am 14 years old
same neko
ask your parents
where am I going to work?
and i make money
you can work at 14
im 13 
Lol
I do too, just money stop coming in :/
I sell things
child labor laws are antiamerican
my mum pays for my nitro. i pay for everything else
but you can still work at 14
i'm aussie and i think here you gotta be 15/16..?
but idk
i just got a paypal and do commissions and junk
what sort of comms do you do
some
i do logos, bots, front/back end websites
nice
and sometimes i do banners
Damn
oh
gottem

wait this is development
oof me too
I spend about half my year working on sciencefair projects for scholarships
fuck
ohyeah
the other half making random crap
I used to sell bots that were half broken for 5$ 👀
People who make money and can afford them
oof
I target a lot of groups of people
- People who sell nudes
- People who sell products
- People who have a twitch and raise money to buy things for themselves***
👀
My old paypal got hacked :<
I had 4$ on it
Lmfao
Can someoen help me set up an Sqlite database for a coin system?
@native folio which language and library are you using?
which version?
how to check XD
i dont know, i dont use python
i just use python 3.6.5
i thought you said you didnt use python
im not him lol
no i think neko said he didnt use python
anyway, discord.py has message.author.bot which returns true if the message received came from a bot
but not all versions of discord.py have this, some older versions dont
so you have to check if the message received came from a bot, and if it did, dont run the command
https://gyazo.com/abdd2b5672d35367402df85659fcc5db
How do I change my terminal from being to the side to the bottome XD
Got it figured out ;p
how do you run code after a forEach finishes? (js)
not really sure but cant u just await the foreach?
well i got this code
client.YouTube.searchChannels(args.join(' '), 5)
.then(results => {
let res = [];
results.forEach(r => {
client.YouTube.getChannelByID(r.id).then(d => res.push(d));
});
const embed = new MessageEmbed()
.setDescription(`Here are the top 5 results I found. Type 1-5 below to show a result.`)
.setColor('#ED1B24')
.addField(`Results found ❯`, res.map(c => `${res.indexOf(c) + 1}. [${c.title}](${url})`))
msg.channel.send({ embed: embed });
}).catch(err => msg.channel.send(err, { code: 'js' }) && console.error(err));
but i keep hitting a message embed field can't be empty error
so yeah, its not pushing all 5 channels to the res array before the embed sends
and idk
i don't think you can
forEach isn't async
forEach isn't async
You can make any function you want async
results.forEach(async r => {
const channel = await client.YouTube.getChannelByID(r.id);
res.push(channel)
});
odd eror
MongoDB not running on the provided host and port
Can someone help?
I have already installed MongoDB Community servers
what u guys think?
still alot to work on but /:
@lusty dew Read what it says
Would tell you alot
Can somebody tell me why ${client.users.size} and ${client.guilds.size} don’t work now?
It only shows 0
@lusty dew Run the mongodb service
There should be something on their documentation
Tag me with the answer brb
client.guilds.size + " Servers", client.users.size + " Users"]; @earnest phoenix try that
if its for the activiity
idk
not entirely sure that'd make a difference
what's your reasoning behind that
thats what i use
`${value}`
and
"" + value + ""
is the exact same
mhm
const activities_list = [
"codiac.onuniverse.com",
`with ${client.users.size} people`,
`on ${client.guilds.size} servers`
];
client.on('ready', () => {
setInterval(() => {
const index = Math.floor(Math.random() * (activities_list.length - 1) + 1);
client.user.setActivity(activities_list[index]);
}, 10000);
});
Is there an error that cost it says 0?
how can i use this, the developers page gave me it
static void UpdatePresence()
{
DiscordRichPresence discordPresence;
memset(&discordPresence, 0, sizeof(discordPresence));
discordPresence.state = "ProxyBot";
discordPresence.details = "Coding";
discordPresence.startTimestamp = 1;
discordPresence.largeImageText = "Arabi";
discordPresence.partyId = "ae488379-351d-4a4f-ad32-2b9b01c91657";
discordPresence.partySize = 1;
discordPresence.partyMax = 1;
discordPresence.joinSecret = "NULL";
Discord_UpdatePresence(&discordPresence);
}
@earnest phoenix that's a really vague question
What are you trying to do, what lib, and where did you get that
Is that C#
looks like
p sure it's api abuse
Hi ! is there any way that i can get node-gp working on windows ?
Uh if there's 10 ppl it isn't abuse
what does this do<div class="image filtered span-1-75" data-position="100% 100%">
?
a div with 3 classes image, filtered and span-1-75 and a "data-position" attribute with value "100% 100%"
the data-position thing is probably used by javascript somewhere
i need
help
how would i make my website play a song when the button is pressed
i'm using html5
This channel is for bot development.
it's for any development really
The channel description says otherwise, but okay
Right
how do i make the music button bigger?
<source src="sound.ogg" type="audio/ogg">
<source src="sound.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>```
this
I love how you ask one thing and a few minutes later you ask another thing, even though no one answered to your first question yet
well, what can i do? i solved the first thing
so thats why i'm not repeating myself
that happens to me too sometimes, I figure out everything myself right when I'm in the middle of calling tech support xd
XD
12:24 PM
fs.js:113
12:24 PM
throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
12:24 PM
^
12:24 PM
12:24 PM
Jump to
Error: EACCES: permission denied, open '../privacy.json'```
What
read the last line
o.O
Im using a hosting service and idk how to give permission
Is there a way through the bash console?
how can i put a clickable discord icon
What lib
js
Discord.js?
yes
What version?
Oh I know only v12
how i can update?
How many guilds are you in?
i or my bot?
The bot lol
99
Then you don't need sharding
why?
It's irrelevant until you reach at least 1000 servers
someone has 300 and has
Welp he should not
But what does a shard do?
lol it's so simple
Not that much
Sharding on heroku 
hMM does anyone know how to refresh a JSON?
my bot has a password system (just a test bot not an open one) and when I "add" a new password it gets added to the json file but when I try to use it it dosent work. when i restart my bot and use the password again it works
that's kind of expected
First of all, I don't recommend json for storing passwords
Second of all make sure you update the cache in your bot
thanks, I dont plan on using passwords in any of my bots, I just use it as a way to practise json since i've never got around to using it
how would i make a side way list
omg
like a side way
i got it
woah
after
ages
cannot read property setStatus of null
?
.setStaus doesn't exist
It used to
show code
const Discord = require("discord.js");
module.exports.run = async (bot, message, args, admins) => {
if(!admins.includes(message.author.id)) {
message.channel.send('sorry, you can\'t use this command!').then(msg => msg.delete(3000))
} else {
message.delete().catch()
message.channel.send("Done!").then(msg => msg.delete(3000))
bot.user.setStatus('idle')
}
}
module.exports.help = {
name: "idle"
}```
That should work 

is while true do a thing on js?
while(true) {}
Callback must be a function?
setTimeout(25000)
bot.user.setActivity(`discord.gg/NOU | kh>help`, {type: "PLAYING"})
setTimeout(25000)
bot.user.setActivity(`discord APIs | kh>help`, {type: "STREAMING"})
setTimeout(25000)
bot.user.setActivity(`for commands! | kh>help`, {type: "LISTENING"})
setTimeout(25000)
bot.user.setActivity(`over ${bot.guilds.size} guilds! | kh>help`, {type: "WATCHING"})
}``` @smoky spire
cool
discord.js, I'm getting this error and it's because of my line:
let logchannel = message.guild.channels.find("name", "log");
Is there like a new way of doing this or what?

@slim heart pass it as a function instead
which would beeee-?
(ie. .find(c => c.name === 'Log') )
Np
you should learn js
@earnest phoenix
js has
do {//body} while (boolean);
diff with do loops and while loops is
do loops will always execute the body of the loop once
then check the boolean
very niche
How can I get my bot to not crash on any errors?
I mean there are many methods, but use this little tool
called pm2
If this is discord.js pm2 will help.
It auto restarts bot on crash.
My bot keeps crashing because of this stupid undefined message that don’t need to be defined
Discord.js?
Ye
That m
Crashes my bot
Okay, so
do npm install pm2 -g
in terminal
in the same directory
of that
let me know when its done installing
Done
@earnest phoenix
...
um
Well now open up terminal
change cd to whatever folder the project is in
Ye
do pm2 start filename
It’s in there anyway
filename is like where all the main code is
so like even tho the bot will crash when error comes
it will auto reboot
@sage spade uses it <<3
Okay I did that
just catch the error
k all good to go
that works too
I guess we’ll see if it work
Now we wait
It tells you a lot of info on the bad
Bot
If I wanted to restart it why do it do?
pm2 stop name?
@earnest phoenix
I’d just rather get my bot to restart I get so many errors on my bot
i know you aint executing a command
but just catching the error then returning the error to the console works
I think I should just now make random message it makes too many errors
Might not want to send your full error lol
um
well usually i have a an eval command
so i just process.exit(0);
and it reboots
but if you don't want to make one
try dream's method
both work fine
if (msg.content == "etst") {
try {
//your code here
} catch(err) {
return;
}
}```
god horrendously
done
but still work
s
LOL
It’s not a command tho


