#development
1 messages ยท Page 465 of 1
Yes
Then git ignore it
I did
well it wont be in there on next commit if you did it correctly
but it wont removeit from your git history
@earnest phoenix it will be there just won't in the repo
remove *, not sure if that makes a diff
It will be stored locally
It is.
wait, the data folder isnt in git lmao
it does
so it worked ๐
How do you run the code
more importantly: whats the error
i did
Just keep it running
Ok
its probs .gitignore
No I am pretty sure it was because you stopped the cmd at some point
gitignore doesn't affect local files
var botuptime = bot.uptime;
x = botuptime / 1000
seconds = Math.round(x % 60)
x /= 60
minutes = Math.round(x % 60)
x /= 60
hours = Math.round(x % 24)
x /= 24
days = Math.round(x % 24)
var uptime = days + ' day(s) ' + hours + ' hour(s) ' + minutes + ' Mins ' + seconds + ' Secs'
(discord.js)
Can someone help me with bot's uptime? I started the bot yesterday and today it shows 2 days 13 hours and so on, it literarly adds a day even if it's not passed, it's supposed to say "1 day"
I can't wait for when Discord implement profile API
๐
finally can get my profile badges without having to break ToS ๐
@earnest phoenix change the % 24 for days to / 24
Oh "/24" k
Yeah
wel.. i hate how JImp doesn't allow random numbers, which sucks cuz im trying to make a gif command and it's more cool if it can randomize numbers
so
i made a command (!settings) it only shows 2 options not 9 (in the code there is 9)
that clones when it joins a guild
so you can edit it
But it shows prefix,systemnotice
only
glitch
Send a hastebin paste
um
Make sure to not include a token
Ok where do you actually use this code
in the bot
Thats for permlevel (where the error is)
the other command works fine
just
!settings
shows 2 options
Send code for settings
Where does it show the options
I am confused as hell
the last option in a json literal should not have a comma at the end
Ye its a suprise it even shows 2
anyone know how to use sharppresence 
Lol, I can't even use rich presence
im just trying to learn it in C# thats all ty tho
How would I make a youtube music play command using a command handler?
Any idea?
u mean like one where you "say the number you wanna play"?
Yes
Where would I define the server object? In all the commands that are music related?
??
For anyone who is using pm2 and sqlite, and has watching enabled. Sometimes a file called <urdb>.sqlite-journal may cause your bot to restart and not make any changes to the database. How to avoid this:
Create a folder to put your sqlite database
Restart your bot pm2 restart <yourbot> --watch --ignore-watch <thefolder>
<thefolder> in this case is where you put your sqlite database
<yourbot> is the name of the bot's process when you started it as pm2 start mainfile.js --name "<yourbot>"
^ This could also be the main file if you did not name the process
let mem = message.author.username
mem.addRole("480364684743278622")
});```
Message is not defined
message is only defined in the message event
all you need is member.addRole("<RoleID>")
check member.guild.id if its your guild id
if (member.guild.id !== '480359296715063296') return
member.addRole("480364684743278622")
});```
?
yes that should do it
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' })
by password does it mean the webhook token?
ow yea
also i think it should be replaced by webhook token insted
since password confuses people
why do people use ifs without brackets
i dont like it lul
makes code look inconsistent af
and shit like this happens if you dont pay attention
//b will always alert, but suggests it's part of if
if (a===true) alert(a);alert(b);
else alert(c); //Error, else isn't attached```
And I don't use ;
if(true) { return; }
Like java
i dont use ; after } but i do on everything else
if(true)
lol()```
Lmao
//php
if(true) { return }
//error: unexpected "}"```
How are the bots in here able to set their own rich presence? I got a rich presence library to work, but it's setting my rich presence instead of my bots. Any help would be greatly appreciated
why is it setting your own
I'm using the sample code from here:
https://npm.runkit.com/discord-rich-presence
RunKit notebooks are interactive javascript playgrounds connected to a complete node environment right in your browser. Every npm module pre-installed.
I used my apps clientid instead of the one in the example
Is there something else I need to set it to instead?
TypeError: permissions.filter is not a function
at Permissions.missing (C:\Users\LoseJoe\node_modules\discord.js\src\util\Permissions.js:74:24)
at Object.send (C:\Users\LoseJoe\Desktop\Flexiboat\src\util\sendEmbed.js:7:35)
at send (C:\Users\LoseJoe\Desktop\Flexiboat\src\commands\help.js:110:40)
at Object.execute (C:\Users\LoseJoe\Desktop\Flexiboat\src\commands\help.js:33:13)
at module.exports (C:\Users\LoseJoe\Desktop\Flexiboat\src\events\message.js:69:15)
at Client.emit (events.js:182:13)
at MessageCreateHandler.handle (C:\Users\LoseJoe\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\LoseJoe\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\LoseJoe\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\LoseJoe\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
``` Discord.js is having errors?
The only thing I can think of is my bot is running on the same computer that I have discord running on
Show code @earnest phoenix
kk
And what d.js version
send(message, embed) {
if(message.guild.me.permissions.missing(16384)) {
deconstruct = embed
console.log(deconstruct)
} else {
message.channel.send({embed})
}
}```
and V11 I think
stable or master
can u check
how?
in ur package.json
thats stable
if (!args[0] !== 'wrg32342fgds')
Would this see if args is wrg32342fgds?
@quartz kindle how do bots do it then? I've googled countless times, but I'm apparently missing something
ok
you dont need a module for it @limber schooner
I'm using discord.js btw
use the presence functions in whatever discord lib you're using
kk I updated to 11.4.2
Oh that simple? Thanks @Tim!!!
@earnest phoenix https://discord.js.org/#/docs/main/11.4.2/class/GuildMember?scrollTo=missingPermissions
its fixed in latest fam
ok
thanks ;3
but still they have . missingPermission() as a shortcut to .permissions.missing()
How would I make a youtube music play command using a command handler?
Any idea?
ah fam its pretty easy
Doesnt seem it
you can just use a function in your play command
How would you call to a function thats in a different file?
require it then call it
or you can have a variable going between them
like lets say
you can use client
and then message.client in another file
I have a servers object in the main file. How would I get that?
set it to <client>.servers then you can get it in a module using message.client.servers
thats how my db works
guild = await message.client.tables.guilds.fetch(message.guild.id)
config = guild.config```
Something like this?
var indexFile = require("C:/Users/Andrew Cook/Desktop/GamerHandler/Kurosaki/index.js")
if(!indexFile.servers[message.guild.id]) indexFile.servers[message.guild.id] = {
queue: [], songlist: [], userSong: [], loop: [], volume: 50, playing: []
};
var server = indexFile.servers[message.guild.id];
Uhh sorry I g2g I can't really help but i don't think that'll work
Hmm okay
Anyone else able to help me please?
TypeError: permissions.filter is not a function
at Permissions.missing (C:\Users\LoseJoe\node_modules\discord.js\src\util\Permissions.js:74:24)
at Object.send (C:\Users\LoseJoe\Desktop\Flexiboat\src\util\sendEmbed.js:7:35)
at send (C:\Users\LoseJoe\Desktop\Flexiboat\src\commands\help.js:110:40)
at Object.execute (C:\Users\LoseJoe\Desktop\Flexiboat\src\commands\help.js:33:13)
at module.exports (C:\Users\LoseJoe\Desktop\Flexiboat\src\events\message.js:69:15)
at Client.emit (events.js:182:13)
at MessageCreateHandler.handle (C:\Users\LoseJoe\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\LoseJoe\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\LoseJoe\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\LoseJoe\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
post more context than just error in the console
well nice
Anyone please?
what
cant help you with your command handler if we dont know how you have it set up
say the question again pls
How would I make a youtube music play command using a command handler?
how do your other commands work with the handler?
They require a file and run that file
oh.
so.... do the same thing
Problem is, I dont know how I would get the server object from the main file
or call a function from the play.js file to the main file
the command handler should be passing everything you need to the file
You should have access to the Message object
iirc you can import a variable from one file into another if you make it global, but this is me with python as the only experience
Would just make a module which stores the data
How would you make a global variable?
Global variables are frowned upon. You could by doing global.yes = yes
If I remember correctly
globals aren't recommend
why
What so something like:
let serverObject = {};
var servers = client.serverObject?
or something like that?
i have a bunch of globals lul
why do people hate global variables so badly..
I mean that's the only way in python in order to access that variable from another file
I do bot.<whateverthefuckiwant> = something;
Since bot was accessible in all commands
But now I switched my whole bot into oop js
I can't seem to find anywhere on the internet on how would I be assigning a dictionary as a key value inside a dictionary in python
>>> s = {'hello': {'there': 'hi'}}
>>> print(s['hello']['there'])
hi
Global variables are mainly hated due to the fact it's inefficient, out of any exam I have done in python you get marks removed for using global variables unless it's absolutely necessary
it's easy to hardcode it like that, but try to do it only with variables @slender thistle
and why you should do everything by exam?
I've been using globals like there's no tommorow and I see no harm has been made so far, so why I should care about "vulnurabilities" like that?
I don't myself, I meant it as an example why so many people avoid it. I have noticed slower speeds with global variables but it doesn't mean you can't have a few, as one or two do not make a noticeable difference
Help miiiiiii I wanna add custom prefikses to my bot, @Trevor
yes, we can read
Code
you will need some way of storing those custom prefixes
i would recommend a database
My bot has the good old "!" prefix
and also we wont just give you code
one thing I can tell you
you won't be using your library's commands extention or whatever
Some people are fine with "!help", some are not.
you'd use a on message event checking if the content starts with the prefix
i remember when i first looked at a db i was like what the fuck is this thing
it seemed so complicated
sqlite3 didn't seem so complicated to me, even at first experience
did you fix the error
@earnest phoenix I recommend watching a youtube tutorial
most yt tuts are js
i've never seen any good youtube tutorial
they either
a) are extremely outdated
b) show extremely bad practices
it shows basics
most people are new to languages and personally it is better for them to go through a tutorial than having us to help them through
how do you send a dm to the guild owners the bot is in? (with .js)
<Message>.guild.owner.send('')``` i believe
what do you put in place of <message>?
what is the context?
dont
one specific server
how can you do it in a server with an id of 480437825624604672
how about... now this is gonna sound crazy
an ANNOUNCEMENTS channek in support server
client.guilds.get("480437825624604672").owner.send('floopity doopity');
but i want to send a dm to the people in the support server
there is a support server, but how do i dm
at how dimb that is
Pineapple how about you make an announcements channel
u dm with @ everyone
it is for more than one bot
LMAO
what?
And not spam everyone unnecessarily
If i had your bot and I got constant DMs from it i'd instantly remove it
client.guilds.get("480437825624604672").owner.send('floopity doopity'); how can i change .owner. for all members
Pineapple no
what don't you understand
DMing large amounts of people, whether it's everyone in a server or owners of guilds is not allowed
yOu ArEnT aLlOwEd ToO
Discord will ban your bot and maybe even you
^
well can i make a list of the members who want updates?
Still spam
yes with a role in support server
like make an ;update command
Doesnt matter if they sign up for it or whatever
nd mention ping
and i wouldnt do it often
The only bot that I'm ok with DMing me is that SpaceX one lol
Pineapple
it doesn't fucking matter
just mention people
mention that role
What arent you getting Pineapple
MENTIONS. ANNOUNCEMENT ROLE. SUPPORT SERVER.
^
You DM too many people at once your bot will straight up be wiped off discord and probably your account with it
THESE ARE THE 3 SPECIAL INGREDIENTS
@olive briar sends dms to all members who are in a server with it
๐
ok
no but if my all my friends did... whats the point
what
what about if i dont want an announcement channel
then tooooo bad
then ur members dont get announcements
that's your only option
have fun getting your bot banned
ok ill go
yt in name
mass dm
cant figure out mass dm code since never learned basic problem solving
must be dbk dev channel 
bye
yup @earnest phoenix lmfao
yeah
// Only try to join the sender's voice channel if they are in one themselves
if (message.member.voiceChannel) {
message.member.voiceChannel.join()
.then(connection => { // Connection is an instance of VoiceConnection
message.reply('I have successfully connected to the channel!');
})
.catch(console.log);
}
from d.js docs
hm

I'm guessing you can replace idle with online, dnd or invisible
Can you set it as streaming?
yes
what thing
Online, idle ect
yes
@spring ember for bot.uptime is for hours "% 60" or / 60 like in days? (i noticed it adds a hour when it is not a hour passed)
a day has 24 hours, not 60
im talking for hours
huh?
var botuptime = bot.uptime;
x = botuptime / 1000
seconds = Math.round(x % 60)
x /= 60
minutes = Math.round(x % 60)
x /= 60
hours = Math.round(x % 24)
x /= 24
days = Math.round(x / 24)
var uptime = days + ' day(s) ' + hours + ' hour(s) ' + minutes + ' Mins ' + seconds + ' Secs'
here's the code
oh you mean 60 minutes?
ye
when i type &botinfo it shows 2 hours when it's 1 hour
passed by
basically if minutes reach 50 or so it adds another hour
why are you using %
i dont know honestly

well with my python knowledge the % kinda fits there
well % works for seconds & minutes
it works fine but it sometimes adds another hour when it's not 60 min
What's the bots library?
how to use animated emojis in a bot?
I did that
and the bot has to be in the guild that has the emojis
and have permission to send external emotes in the guild it's in (DMs will always have it)
is there a video totual to dail a number from a dm message of a dailer without it having to have bot status
https://cdn.discordapp.com/emojis/476817651868499969.gif?v=1 thats one of the emojis
and i did
:online:
:online:
< a:online:476817651868499969 >
but all together
@inner jewel
if the bot is in the guild with that emote, it should work
How can I route ALL ACTIVITY from my app through a proxy?
I tried the module "tunnelingAgent" but it doesn't seem to work how I intended.
NodeJS ^
it is in it
also bot needs external emotes permission
Is it possible if anyone can figure out how to operate this coding for discord
what
wat
Suppose to be a dialer app that works like a phone but to firertc website
@worn hull don't add spaces
it wouldnt since its in this
i didnt ask for it
ik
well then why did you ping me
{"Id":722182658,"Username":"CharlesRBIX","AvatarUri":null,"AvatarFinal":false,"IsOnline":false} How would I separate things out?
What do you mean @earnest phoenix ?
what lang
It is NodeJS.
What is the object called?
<whatever you called it>.Id
Its being grabbed from a webpage.
var options = {
host: 'api.roblox.com',
path: `/users/get-by-username?username=${user}`
}
var request = http.request(options, function (res) {
var data = '';
res.on('data', function (chunk) {
data += chunk;
});
res.on('end', function () {
console.log(data);
});
});```
JSON.parse(data)
JSON.parse(data).Id```
๐
That would be the id
You will have to parse first, then you can get whatever object.
console.log(JSON.parse(data).Id);
:p
Yes
var options = {
host: 'api.roblox.com',
path: `/users/get-by-username?username=${user}`
}
var request = http.request(options, function (res) {
var data = '';
res.on('data', function (chunk) {
data += chunk;
});
res.on('end', function () {
var Id = (JSON.parse(data).Id);
message.channel.send(`**[BOT]:** *User Id: ${Id}*`);
});
});
request.on('error', function (e) {
console.log(e.message);
});
request.end();
var options = {
host: 'api.roblox.com',
path: `/headshot-thumbnail/json?userId=${Id}&width=180&height=180`
}
var request = http.request(options, function (res) {
var data = '';
res.on('data', function (chunk) {
data += chunk;
});
res.on('end', function () {
var link = (JSON.parse(data).Url);
message.channel.send(`**[BOT]:** *User Avatar: ${link}*`);
});
});
request.on('error', function (e) {
console.log(e.message);
});
request.end();
How can I transfer over my Id var to the second one
either a callback, a promise, an async function, or put the entire second block inside the on 'end' of the first one
@quartz kindle thx Ill go look at some docs
if (msg.content.includes(word1)) return msg.delete(); channel.send("Please don't say that!");```
would this work as a word block
it dont seem to do anything
ik its case sensitive
also msg.channel.send not channel.send
no that wont work
if (msg.content.includes(word1)) msg.delete(); msg.channel.send("Please don't say that!");
?
yes but with brackets
if(){}
if (msg.content.includes(word1)){msg.delete(); msg.channel.send("Please don't say that!");}
yes
any error? permissions?
console.log msg.content
log msg.content?
yes
i did that
to see if the message is showing up
and nothing happens
then the message is not being received
show full code
if (!msg.content.startsWith(keys.prefix)) return;
if (msg.content.startsWith(keys.prefix + 'create-invite') && !msg.guild.member(bot.user).hasPermission('CREATE_INSTANT_INVITES') || !msg.guild.member(bot.user).hasPermission('SEND_MESSAGES')) return msg.reply(`Uh oh! An error accoured executing command: I don't have one of the following permissions: Create Instant Invites or Send Messages!`);
if (msg.content.includes(word1)){msg.delete();}
console.log(msg.content)
if (commands.hasOwnProperty(msg.content.toLowerCase().slice(keys.prefix.length).split(' ')[0])) commands[msg.content.toLowerCase().slice(keys.prefix.length).split(' ')[0]](msg);
});```
if (!msg.content.startsWith(keys.prefix)) return;
this exits the function if it doesnt match the prefix
๐
so put if (msg.content.includes(word1)){msg.delete();} above that
i should've probably seen that
also
if the bot is here
maybe disable that for this server
or it'll get muted 
automatic interactions should be opt-in
if (member.guild.id !== '0'){code}
?
oh geez now my console is full of messages

if you want to keep it automatic regardless, then yes, ignore the guild id of this server (and any other bot lists or servers that forbid automated functions)
I just want it for 1 guild
then do if guild id === 'server' instead
okay so would this work as a word block for only the server I set it to
if (member.guild.id === '0'){if (msg.content.includes(word1)){msg.delete();}}
you can easily do
if(expression && anotherexpression) {
// code
}
if expression === true and anotherexpression === true execute code
it wont run the code if neither or only one of the expressions is true
@knotty steeple
if(member.guild.id === '0' && msg.content.includes(word1)) {msg.delete(); msg.channel.send("Please don't say that!");}
yes that would work
tyvm @knotty steeple @quartz kindle
np
guys i want the use nodemon(?) and log4js but how? i install it but they didn't work
cause of my os? maybe?
you gotta use it in the code?
(ubuntu 18.04 LTS)
nodemon is a utility so you start your bot with nodemon <file.js>
never heard of log4js though
look at their documentation
okay thx
np
Was there a new discord api update that lets you know which invite was used when a member joins?
Nope, it's still hard as to get them @surreal peak.
Discord probably won't ever add it, the same with invite events and such.
Hmmm weird
Why weird?
I joined a server and it told me which invite I used
it's possible to try
but unreliable
they're going to add the used invite to join events soonโข
i hope they do
Ahhh thats genius
as it says though, there are two big issues
and it ain't reliable/good with big servers
Temporary one-use invites (when right-clicking someone, and doing Invite To => Server). Those exist only for a few moments and cannot be tracked at all.
Invites created after the bot loaded. That would require fetching on a loop which is dangerous for API spam.```
I have this:
ROB:api.domain.com
How can I separate the things so I have ROB and api.domain.com
in separate variables?
NodeJS
yup
@earnest phoenix 1 will get you api.domain.com
also putting it in `` will make it text
Does anyone know c++ coding if so ping me plz
It does not have to be that particular program it can be any program
@vapid sun read the channel topic
ask your question instead of asking if anyone knows
We need someone to develop to get our bot online none of us know how to so we're trying to get help because our programmer left us
uh
learn to code
either find a programmer or learn and make it yourself
It takes too much time I need it done tonight
why do you need a bot by tonight
nobody here will make a bot for you
plus learning to code can be done quick enough if you just learn the basics well
yea
we don't spoonfeed or code for you
btw gaming is spelled wrong in your username
lmao
I can't code I don't have a computer
you just use mobile?
Right now yes
I have a computer
why do you need a bot done by tonight???
There's a lot of reasons why
We got a 5 hour notice
Alright I'm out of here you guys aren't any help
we help people who are making bots
you guys just want someone to do the work for you
which is stupid
We're almost done we just need to get it online which none of us know how to do I would do it but I don't have a computer
I have a computer but I don't have access to the bot
(Unless you pay them)
Mp4a.40.2 vs opus which is better sound quality?
But then why mp4a.40.2 sounds a bit clearer on discord
My friends confirmed this too
Anyone know how Dyno shows the server icon to the left of the title?
Also @outer niche your only choices are to either find a new programmer who understands the language the bot was written in or learn the language yourself and finish it
That field is author one
@long glade that's what I'm about to do I went out and bought a computer
@earnest phoenix Can you send me examples of both the mp4a.40.2 and Opus versions of the same audio?
@slender thistle Thank you, I'll look into it
๐
@outer niche It's a long trial and error process, you most likely won't get it done as soon as you want but you can get it done with enough time and patience
I've got someone coming to help me that knows the program that I'm using he's going to tell me what to do and we're going to get it done as soon as possible
In discord.js, when making a leave message, is there any reason we can't use a slightly modified join message code, it didn't work for me
@outer niche Good luck with that then
Just be respectful to the people here willing to help others out, no one's obliged to code for you
He's not doing it for me I'm doing it he's telling me what to do though
@outer niche if your looking for someone to do it for a commission I can do it in js
same
@long glade something isnt right, i retested it and its not the same, but here
@viscid falcon Can you show a sample of the code you're using?
Rip, not at home rn, let me get you my github
i take the something not right back, the voice of the singer is clearer
Here, it will be in index.js https://github.com/Magicperson1/FacelessBot
I just modified the client.on And the messsage.channel.send to make the leave message but it didn't work
@viscid falcon I'd assume it's a little something like this then:
client.on('guildMemberRemove', member => {
const channel = member.guild.channels.find(ch => ch.name === 'member-log');
if (!channel) return;
channel.send(`${member} has left the server!`);
});
^
It bassicly was that joshua
@earnest phoenix Which one did you say has the better sounding quality?
The .webm is the source quality (contains the Opus audio) and the .m4a is downsampled a little bit
It didn't work for me, idk why
Won't really be able to help out until you get the exact snippet of what you wrote
@long glade the voice of the singers in the mp4a.40.2 sounds clearer
you can always debug it yourself, set up a client on guildmemberremove with only a console.log(member), see if and what you get and continue from there
Is It ok if I ping you in like 30 min?
@earnest phoenix Perhaps the downsampling to m4a removed some extra bits that strained the sound of the vocals
Are you testing these two audio files locally though? Because when both get streamed to Discord they're downsampled to the same sampling and should sound the same
if something doesnt work, console.log everything so you can actually see what the code is doing step by step and where it breaks
@viscid falcon Yeah you can ping me if you need to, but follow Tim's advice first and do your own debugging before resorting to that
@long glade i tested it throught discord
And tim I did do that, but it didn't even do the console.logs
@long glade if you want i can let you test it through discord and see what i'm talking about
then the event is not being fired
@quartz kindle is the pfp you or me?
or you're not getting it properly
๐ค i and kicked and forced my friends to leave
@earnest phoenix wat
@viscid falcon lad i got banned from the discord api just for a joke
@quartz kindle is your pfp you?
How
yes
looks over sharped abit but nice
magic people cant take jokes
thats why i'm a bit low here
Add a fedora and you a neck beard
@earnest phoenix I can test both with my personal bot here in a little while, just not this second
@_@
@long glade i can save you the hassle but if you want then you can
Nah I mean I'm in another VC right now so I can't test it at all at the moment
What do you have your audio encoding set to? Bitrate, sampling, etc
i didnt download it, it was the bot but referring to the spec sheet
webm audio only DASH audio 165k , opus @160k
m4a audio only DASH audio 138k , m4a_dash container, mp4a.40.2@128k (44100Hz)
Yeah the webm is gonna be source quality I'd hope
I meant what is the bot streaming it as?
For example, this is what I have mine set to for my high preset:
var encodeOptionsPresetHigh = &dca.EncodeOptions{
Volume: 256,
Channels: 2,
FrameRate: 48000,
FrameDuration: 20,
Bitrate: 96,
Application: "lowdelay",
CompressionLevel: 10,
PacketLoss: 0,
BufferedFrames: 100,
VBR: true,
RawOutput: true,
}
1 sec, thats java script, mine is python
mk
I have
api.app.com:passwordforapp
those are in a text document
how would I split those?
noidejs
learn js
@shy rose
^
TypeError: line.split is not a function```
whats the value of the variable line?
@bitter comet eval "api.app.com:passwordforapp".split(":")[1]
oh still rebooting
wait nvm bots are muted in here?
yes
point is it works
thabjs man
wait
when I do both
it stops working
t:t
user undefined
pass t
console.log(`${line}`);
let pass = line.split(":")[1]
let user = line.split(":")[2]
console.log(`user ${user}`);
console.log(`pass ${pass}`);```
@shy rose top is console
comes in pretending i know how to code Y'know in light bot im on lvl 2-4 aint that impressive huh
you know i made that
you know i have personally met the team who made that
ree
try using || and get a freaking array.includes
using && means it'll fire if one is correct
On a second note why is "god" a swear
also could do
let lower=message.toLowerCase()
["abc","idk","lol","msg"].filter(c=>lower.includes(c)).length
that would be way cleaner
and to add more is jsut adding to array
Anyway to do a goto in node?
ew
do a function call
ye
depending on your lib check dm's
cause some libs dont have nsfw tag on dm channels
k i think that gives null
Eris, a NodeJS Discord library
dm not text
yes but any message sent will run through that same if statement
@shy rose I kinda NEED a goto
return if there isn't a msg.guild
no you really dont
afik theres only go to in the lang basic
probs wrong
but like if you need go to then your doing something wrong
well how would I loop with a function call...
Txt file
God what have I just witnessed...
ORRR chewy can help meh
In this case itโs way better than an if, but arrays are the solution
i had a bug that took 7months cause the error was about 2000 lines down from the real cause a missing break
Lmao
I had to scroll down a lot on my phone because of that code lol
@shy rose pls help ._.
how are you even loading in the txt?
fs
Tony I looked at the damn docs
fs.readFile('/memes.txt', function (err, data) {
if (err) throw err;
console.log(data);
});
trust me
then look at them again
i mean youve asked pretty googleable questions
what the fuck even is a goto
you dont NEED one
its aline jumper
eg GOTO 50 would jump the runner to line 50
its the most jank thing yould ever see
well
me
the only reason it exists is its needed for core machine lang compiling
thats how loops work at base level ๐
but like your looking at problem all wrong...
explain what you want to do not what you need
mk
I have my application taking the first line into a variable
but I want it to eventually load the second line into the same variable
so my thought was
I was going to have a goto script keep removing the top line
then reading the new one
fs.readFile('/memes.txt', function (err, data) {
if (err) throw err;
data.split('\n').forEach((currentLine)=>{
console.log(currentLine)
})
});
yeah
so its reading each line
one at a time
o.o
thanks
let me try something
^
TypeError: data.split is not a function```
send code snippet
if (err) throw err;
data.split('\n').forEach((currentLine)=>{
console.log(currentLine)
})
}); ```
is your file named memes.txt?
yes
try adding 'utf8' after the file name parm
or even jsut console logging data to check it loaded in
@earnest phoenix js fs.readFile(`./memes.txt`,`utf8`, function (err, data) { if (err) throw err; data.split('\n').forEach((currentLine)=>{ console.log(currentLine) }) });
this is what chewey ment i believe
yeah
t:t
t:t
t:t
t:t
t:t
t:t
t:t
t:t
t:t
Unhandled rejection ReferenceError: user is not defined
at roblox.login.then.catch (C:\Users\charl\Desktop\robloxapi\index.js:99:88)
at tryCatcher (C:\Users\charl\Desktop\robloxapi\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Users\charl\Desktop\robloxapi\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (C:\Users\charl\Desktop\robloxapi\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (C:\Users\charl\Desktop\robloxapi\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\charl\Desktop\robloxapi\node_modules\bluebird\js\release\promise.js:689:18)
at Async._drainQueue (C:\Users\charl\Desktop\robloxapi\node_modules\bluebird\js\release\async.js:133:16)
at Async._drainQueues (C:\Users\charl\Desktop\robloxapi\node_modules\bluebird\js\release\async.js:143:10)
at Immediate.Async.drainQueues (C:\Users\charl\Desktop\robloxapi\node_modules\bluebird\js\release\async.js:17:14)
at runCallback (timers.js:789:20)
at tryOnImmediate (timers.js:751:5)
at processImmediate [as _immediateCallback] (timers.js:722:5)```
see
...
oh
roblox
okay
๐
no wonder ur name is familiar
have you ever been on Void SB?
that's offtopic
Never heard of it.
take it to #memes-and-media
oh, okay lets get back on topic
Kk
C:\Users\charl\Desktop\robloxapi\index.js:99:88
also that stack trace doesnt match code sent cause never even use a variable called user
Oh
as can see though it did print each line
Wait wait wait
I did a //
yea i believe hes calling member
Nvm
Ik
Ik
member.user
ah,
wait still same question
who am i to judge xd
all of them have there purpose
i backup all my sql data into a json file
it works ยฏ_(ใ)_/ยฏ
cough
i mean that code works
Thx for the help guys
that error was from something else
Ik
i believe on like 88
line*
But I need to repeatedly use the variable from it
So I gotta figure dat out
gl
@earnest phoenix make a function that calls both user and what ever your trying to do
if its not scoped you could use it there and then otherwise push to an array
global.a = 'b'
console.log(a)
is b
lewl
Like so
It's a login api
So
Basically
The first line
Is the ur
L
So it's like this:
are you trying to make an authentication using roblox login?
URL:URL INFO
heck dont use txt for passwords
oh god
dude
not even encrypted
jsut no
md5 is bad
they found out how to deob
Well if I can figure out the reading
afik they only use rainbow tables
It's a personal bot
okay good
even then...
but not a good idea
plain text storage is phivbited on most/all services
Boi
whats the issue




