#development
1 messages ยท Page 726 of 1
:)
Depends on how quick you learn
Python is a hard start but easy to master
While js is the opposite
Does anyone know why I get an error like: Failed loading opus. Is opus installed? Ruby | Ubuntu 18.04
if(target.binds === null) {
target.binds = ""
}
let data = JSON.stringify(target);
fs.writeFileSync(`./guilds/${message.guild.id}.json`, data)```
For some reason if it removes the last thig in target.binds it will leave target.binds as null
that is a no no
how can i fix
Is target.binds an object? Or array?
array
??
let test = Object.defineProperty({}, "binds", {
value: [],
writable: false
});
Means the property binds cant be overridden.
Will always be an array.
delete target.binds[i];
let test = target.defineProperty({}, "binds", {
value: [],
writable: false
});
let data = JSON.stringify(target);
fs.writeFileSync(`./guilds/${message.guild.id}.json`, data)
}```
So it would look like that?
let target = JSON.parse(rawdata);
var i = 0;
target.binds.forEach(function(element) {
if(element.bindID == drole.content) {
delete target.binds[i];
if(target.binds === null) {
target.binds = " "
}
let data = JSON.stringify(target);
fs.writeFileSync(`./guilds/${message.guild.id}.json`, data)
}
i = i + 1```
So what part of that?--
Sorry, Ive just never heard of this
Binds is passed from a string.
const fs = require('fs');
let rawdata = fs.readFileSync(`./guilds/${message.guild.id}.json`);
let target = JSON.parse(rawdata);
var i = 0;
target.binds.forEach(function(element) {
if(element.bindID == drole.content) {
delete target.binds[i];
if(target.binds === null) {
target.binds = " "
}
let data = JSON.stringify(target);
fs.writeFileSync(`./guilds/${message.guild.id}.json`, data)
}
i = i + 1
I don't want to spoon feed but your top line. You could use const binds = { binds } = JSON.parse... and then create an object with Object.define...
Whoops.
Made a mistake. I hate mobile.
const { binds } = JSON.parse(rawdata)
Then create an object with that data.
is it possible to create a text database? I want each of my users to be able to create their own profile text or something haha
sql.prepare("CREATE TABLE scores (id TEXT PRIMARY KEY, user TEXT, guild TEXT, points INTEGER, profile TEXT);").run();
Yes it is possible.
Thankyou!! ๐ ๐
โ
yeah, somehash, i have no clue what you mean
you just gave me some code, with no explanation of what it is actually doing
Its creating or editing an object and adding a property that can be set so it cant be overridden.
I'll get some info.
You dont understand, it needs to be able to be overridden
the point is so that an object can be deleted from it
I just dont want the nulled part when it is overwritten
From what I saw your only deleting the data within the array not the array itself.
You're *
Exactly.
I only want to delete a specified data thing
but when it does tha
t
it leaves behind null
Yes so using object define property it will delete the data but not the array.
...
i only want to delete one object in the array
@warm marsh opus is probably a ruby library of some sort
thats the WHOLE point of this
I had a look but found nothing.
I've never used ruby so I'm not sure
Yeah no worries. Will continue scraping the web.
That doesn't accomplish anything I'm trying to do.
I got it, nodejs delete leaves empty space in arrays
nodejs splice doesnt
so uh
please dont link irrelevant information next time
Next time use the console or explain better.
Also splice is part of vanilla js not nodejs.
You should've asked for clarification in the future, I think I made it clear that me using delete left a null object behind and that I didn't want that
Console wouldn't help at all with that issue as no code errors were made
Console will always help.
hoi i may look dumb but i just wanna ask how do i add score.points a certain values?
score.points++; this add 1 to member points
and i have tried score.points + 23; to add 23 points but it didnt work

score.points += 23;
โ
anybody know a suitable replacement for fs.statSync that accepts file buffers?
@weary lark Great music bot! Perfect sound, Sometimes lag but its ๐
Thank you! @surreal sage yeah it lags cause self hosting atm
Same
will be getting a host at 100 servers
cause theres no need to do it early
ye we both do
same here
Rip..
and they wanna make more money
k you know what
What provider? We use solcon
self hosting is honestly better than some vps providers
yes
Yep
yeah
alot better
Like a old laptop is good
i use optus
You dont want to pay anything
ye lol
you never posted your sever count
???
you should ask this in #topgg-api since that's how you get help with interacting with dbl's api
k
blockquotes. put a > before it
egg
woah
okay stop spamming smh
Egg Pie
Stfu
ye stop spamming lol
ok?
but at least you're figuring it out
have you ever heard of test servers
???
nvm
๐ฝ
var newprofile = message.content.split(" ")[1];
client.setProfile.run(newprofile);
}```
I make a command that allow user to edit their profile to a new one but i got an error `RangeError: Too many parameter values were provided`
๐ข
you can set args limit
help me
!?
why data.botName is undefined
.
does anyone know a way to add a say command for a discord.py bot
e
I can use both d.js and eris at the same time on a single bot no?
a say command it is meant to repeat what a user says and deletes the command usage
like this !say <example text>
that would just be looking for the command
then if you have the message content an a list
printing the list without the command
i am new to coding so an example command line would help me a lot
i have looked it up and the code examples do not work or just are not clear on how to put it into a command
Okay so, im trying to get lavalink.py to work, i am using excactly the example in https://github.com/Devoxin/Lavalink.py/blob/master/examples/music.py but the music aint starting. No error whatso ever
async def on_message(message):
Split_Message = message.content.split(" ", 1) # splits the command away from the main text
Split_Message[0] = Split_Message[0].upper()
if Split_Message[0] == "!SAY":
await message.channel.send(f"{Split_Message[1]}")```
@tawny panther theres ur example code
@radiant jay can the bot actually speak (Perms), and can it actually find and process the song given.
hmmm
its rlly hard to find out cuz its not giving u an error
get the print statements out xD
are you sure you have lavalink running
lavalink.py is just a wrapper for the lavalink server
it doesn't play music
lavalink does
dbl.webhook.on('vote', vote => {
webhookname.send(`User with ID ${vote.user} just voted!`);
});``` where i get the webhook id and webhook token
from the webhook url
its a url
where i get token or id
from the url
@earnest phoenix yep it is and its reciving connections
i am getting error that dbl is not define
REEEEEEEEEEEEEEE
check if there is a newer build of lavalink
^
can we not taz
^
ReferenceError: dbl is not defined
``` geting this error
one second
Anyone knows why gifs won't load in my embed messages?
@earnest phoenix const DBL = require("dblapi.js");
@earnest phoenix thanks.
@glacial mango what is the size of the gif? Anything larger than 50MB will not embed
No
since its in here
You can still upload more than 50MB, but videos or audio files will not embed above 50MB
ahh
I don't know what the size is, I get random gif from giphy
^
TypeError: Cannot read property 'on' of undefined```
um
error
gif is 5 mb
@earnest phoenix show your full code, that doesnt tell us anything
oh I know why it's not loading
dbl.webhook.on('vote', vote => {
webhookname.send(`User with ID ${vote.user} just voted!`);
});```
I get a url like this: https://giphy.com/gifs/FILAUSA-RdI59AGZu52equuB3g
but to load it im embed I need it as this: https://media.giphy.com/media/RdI59AGZu52equuB3g/giphy.gif
How do I get that other url?
?
@earnest phoenix thats not your full code
@glacial mango just use https://media.giphy.com/media/RdI59AGZu52equuB3g/giphy.gif
I know
sec
I use this js const Discord = require("discord.js") const giphyRandom = require("giphy-random"); (async () => { const { data } = await giphyRandom('zUcGF9UPtUjIDjTkAk0Oy9ahUqVIEjXO'); const result = data.url const title = data.title const Embed= new Discord.RichEmbed() .setColor('#c111d9') .setTitle(title) .setURL(result) .setImage(result) msg.channel.send(Embed) })();
i just copy the code from appi and paste with my token and id@quartz kindle
the data.url = https://giphy.com/gifs/FILAUSA-RdI59AGZu52equuB3g
not the url you sent
he is defining it wrong, because dbl.webhook is undefined
Tazhys can you help me?
meaning his dbl is wrong
or used it wrong
@glacial mango what ya need
@earnest phoenix
yall need to learn how to read docs
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(vote);
});``` what i put in password
whatever you want
you create a password
and then you put this password in your bot's edit page in the website
i need a bit of help?
with a say command
here is the code i have for it
@ bot.command('say')
async def ping(ctx):
print(ctx.author)
async def on_message(message):
Split_Message = message.content.split(" ", 1) # splits the command away from the main text
Split_Message[0] = Split_Message[0].upper()
if Split_Message[0] == "a.say":
await message.channel.send(f"{Split_Message[1]}")
could you please specify
What do you think Split_message[0] is
noob at coding i am
So learn basics...
Trying to
... by creating a Discord bot?
sigh can you help me
@ bot.command('SAY')
async def ping(ctx):
print(ctx.author)
async def on_message(message):
Split_Message = message.content.split(" ", 1) # splits the command away from the main text
Split_Message[0] = Split_Message[0].upper()
if Split_Message[0] == "A.SAY":
await message.channel.send(f"{Split_Message[1]}")
i updated it
Test it
Are you using the bot.event deco on on_message
what do you mean?
Ya'll devs need to learn basics before getting to complex shit...
Do you know what a decorator is
And why are you not using the commands extension for your say command
bruh when i gave you example code i didnt mean copy it and expect it to instantly work
Giving example code nowadays equals to the "dev" expecting to be spoonfed all the time
yup smh
and while spoonfeed is discouraged, idk how else we are supposed to explain complex things when they haven't bothered doing the basics
hey i am trying to learn
Python basics, not a lib
when you dont know the basics
it not my fault that the guides online can't be freaking clear
It's not our fault either
because the guides are made for people who already know the basics
all of my knowlage i had to learn by looking at the code
like for example:
do you know what a subrutine is
what a class is
what inheritance means
how async modules work
what the basics like .upper() .lower() work
how lists and dicts work
hows var types work
i look up basic variable and get barely anything on it making it harder for me to learn those variables
you only need to go into the shell and have a play around
Don't look things up on the go
you won't learn to multiply just by looking at the results, you have to understand how it works
same analogy applies here
I started doing discord bots after i knew how Classes, subrutines, dicts all the basics worked
and even then when i first started it took me some time to understand what was going on
but i didnt expect to be spoon fed everything
cuz thats not a good way to learn
i keep the code at hand now i know which varible will do what once i see it run
for example i looked once at a basic response command and knew which variable triggered the command which one was reply
@quartz kindle where I put the password in the website
Note book
:200iq:
brain
Where in website
Your bot's Edit page, very bottom
if it isnt mentioned of course there isnt gonna be mentions (resulting in undefined)
how to handle this error ?
@vital lark
async def refresh_token(self):
auth = base64.b64encode(f'cool_id:cool_secret'.encode())
headers = {'Authorization': f'Basic {auth.decode()}',
'Content-Type': "application/x-www-form-urlencoded"}
while True:
async with aiohttp.ClientSession().post('https://accounts.spotify.com/api/token', headers=headers,
data='grant_type=client_credentials') as resp:
value = await resp.json()
with open('config.json', 'r') as g:
gg = json.load(g)
gg["access"] = value["access_token"]
with open('config.json', 'w') as json_file:
json.dump(gg, json_file)
await asyncio.sleep(3600)
hmm
@trim saddle I'll see if I can translate in dms
alright
@trim saddle I suggest you open the file once in w+ mode
i agree with shiv
you rlly should do w+
if the file gets deleted it automattically makes one
i'm never using this code again

can I use both d.js and eris at the same time on a single bot account?
yes, you can run 2 instances under 1 account
not sure why you would want to run d.js and eris
eris doesn't have await reaction function
or events for messageReactionAdd
what should i put here
Anything you want
which password
You create a password
then the bot will send the upvotes message
If password in code and password on the bot's Edit page match up, yes
where i put that password in the bot edit page
Do we have to point with arrows exactly where it is
The bottom of your bot's Edit page
lol
At this rate we will need to teach people how to breath by 2021
yup
I'll let you Google what "authorization" means
does any of u know how to disable ffmpeg opening console prompt using pm2/forever whenever u play a song
where should i put the webhook password
Do you know what "URL" stands for?
I'd rather we keep bs away from this channel
For all those people who find it more convenient to bother you with their question rather than search it for themselves.
@earnest phoenix
If you are not willing to help, keep your comments to yourself
Yes
do i violate discord tos if i log some messages to a website
If without consent, yes
the webhook password is just a way of confirming that DBL is the one which made the request
if they are bot commands?
Depends ig
You should request for the user's permission either way
If your bot states that the command usage will show the message content on a website, you should be good
ok ill just add something like that to the help embed footer
where
Nvm, the vote event has type attribute
What library do you guys use to create bots?
djs, discord.js
thanks, I'll check it out. I've been using kUtils but it's actually bad
2.4 End User Data. ...message content, message metadata, voice data and voice metadata.
what does "message metadata" mean in this context?
ok
I can't use iframes in my bot's description until it's approved can I? :/
@slender thistle but how it will send the message of upvotes
its not sending the message of upvotes
someone help
:/ no one is their
One message removed from a suspended account.
How are you checking it
include both <@> and <@!>
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
js
One message removed from a suspended account.
no error
One message removed from a suspended account.
this one
One message removed from a suspended account.
no
yes it is smh
its on github
One message removed from a suspended account.
yes, its in glitch lmao
ik, im just wondering why you would lie abt something like that
One message removed from a suspended account.
when someone vote my bot then it shoul send message in the specific channel like this
why does it matter it's glitch
facts
Not the biggest thing to worry about
so now what i do
// const DBL = require('dblapi.js');
// const dbl = new DBL(bot.config.DBLTOKEN, { webhookServer: server, webhookAuth: '' }, bot);
//dbl.webhook.on(`ready`, hook => {
// console.log(`Webhook is up and running at http://${hook.hostname}:${hook.port}${hook.path}`);
//});
//dbl.webhook.on(`vote`, vote => {
// var VotedUser = vote.user;
// console.log(`User with ID ${vote.user} just voted!`);
// try{
// bot.users.get(VotedUser).send("Thanks for voting!");
// bot.users.get(bot.config.ownerID).send(`${VotedUser} just voted for ${bot.username}`);
// }
// catch(error){
// console.log('Uh oh! ' + error);
// }
//});
no its not send the message
that will work
what should i change in this
what should i change in this ๐คฆ
step 1
uncomment all the code
step 2
change the fucking message
jesus
where i put the webhook link
do you know how to program in javascript?
dont put anything there
that setting is only if you already have an http server running
so the module will use the existing server instead of creating a new one
just remove that setting, and dbl will create an http server
I'm trying to test out a bot which is programmed by Discord.NET, What's the command of installing Discord.NET?
Ubuntu 18.04
@quartz kindle so how the bot will send the upvotes message in the specific channel
??
@copper wraith do you want to host your bot there or
Yes
then do what
of for crying out loud
why do i keep getting booted from the servers
;-;
error 401
What servers
the api servers
401 means invalid token/no token provided usually
yes
and i copied the token several times now
and regenerated the token several times too
What API are you trying to access rn
are you putting the token in GetEnvironmentVariable
Someone plzz help me in upvotes code
Environment.GetEnvironmentVariable("classified"));
await _client.StartAsync();```
yes
brb
GetEnvironmentVariable looks for an environment variable with the name you pass it
@earnest phoenix on vote, get channel, send message to it
the docs example says that the token is stored in an environment variable
// const dbl = new DBL(bot.config.DBLTOKEN, { webhookServer: server, webhookAuth: '' }, bot);
//dbl.webhook.on(`ready`, hook => {
// console.log(`Webhook is up and running at http://${hook.hostname}:${hook.port}${hook.path}`);
//});
//dbl.webhook.on(`vote`, vote => {
// var VotedUser = vote.user;
// console.log(`User with ID ${vote.user} just voted!`);
// try{
// bot.users.get(VotedUser).send("Thanks for voting!");
// bot.users.get(bot.config.ownerID).send(`${VotedUser} just voted for ${bot.username}`);
// }
// catch(error){
// console.log('Uh oh! ' + error);
// }
//});
This is the code
But where the bot will send upvotes message in the specific channel
How???
You are making your bot send a message to the user who votes for your bot
How do you defined server?
you seem to be misunderstanding how webhooks work
webhooks are requests to your own http server
you can do whatever with the data you get from them
i already told him to remove server but he copied the code from someone else lol
Thank you for manning this channel when nobody else will @quartz kindle i hereby award you best dev. Thank u for ur service
@quartz kindle what I put their then
I'm still pushing for a way to recognize you tim ;n; not all hope is lost
On peut parler franรงais ici ?
9:44 AM] Fusion Gaming: But where the bot will send upvotes message in the specific channel
[9:44 AM] Fusion Gaming: How???
The code should be self explanatory
If you knew JS, you would know where to put it
lmao spider
<3
@earnest phoenix remove this webhookServer: server
and why is your code all commented out?
I need help my sever listing is not working.
One message removed from a suspended account.
One message removed from a suspended account.
Can someone hekp me?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
English
One message removed from a suspended account.
One message removed from a suspended account.
@sage bobcat he's asking about adding his server to our serverlist
One message removed from a suspended account.
@quartz kindle ohk I have removed
I am getting the 500 code if i try to save it.
One message removed from a suspended account.
Here's how I know.
- Whitename, so not bot dev.
- He is asking in an unfamiliar channel.
- He said "server listing" not "server list command"
500 means server side issue, isn't your fault
@earnest phoenix how old r u?
children
try reloading the page, might be a CSRF mismatch
bad agebaiting
i was just going off cuz he looked fairly young on his YT
@earnest phoenix its not, shards die on dsl due to reasons and that translates to error 500 codes that eventually get resolved
w e w
So can it be fixed?
you'll have to wait it out (and possibly have a mental breakdown to waste time)
tru that
you should learn js
^
So this was my first time submitting a bot. It was declined bc the description was filled with "spam junk" ..not really helpful for correcting it. What should the description be filled with? I was under the impression it was for the commands?
no its the detailed description of your bot
so what it does
how it works
why its diffrent to all the others
examples of commands
customising the page
etc...
I could have sworn I wrote that. But a section on the submission i did copy and paste the command bc that's what i thought it was asking for.
Thank you for the direction @modest maple u rock.
np
Hey, I bought an Raspberry PI 2 days ago.
I set up all my bots there, but I wanted to create an website too...
So, I installed all of the packages (apache2, etc..) but:
My Raspberry Public IP (starting on 185.x) is not responding - and all things on localhost are going on!
Have you port forwarded?
No, how to do it? @modest maple
search up how to port forward using <Insert your router here>
Ok
One message removed from a suspended account.
yes
One message removed from a suspended account.
@modest maplei set it, but still not working.
i know what functions it has and i can recreate from there
GetEnvironmentalVariable looks for an environmental variable with the name you specified
you put your token as the env name
Is it me or did you just open all your ports?
some routers do that by defualt
which would mean you would have to have an environmental variable with the name as your token and the value as your token
the docs do it with environmental variables because it's safer
@earnest phoenix ports and hosting is my fortรฉ need help?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
i am root
something with hosting, ports, networks is my skill
@solar wraith what do you mean?
no
One message removed from a suspended account.
ah did you supply your external IP?

One message removed from a suspended account.
Yes
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
@solar wraith please don't try and help if you don't understand the information or circumstances on what's going on. Kinda chat filling at this point while this guy is trying to get help
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
and everyone here rn fuckoff u too dv
@solar wraith can you help me perhaps?
I have an iDrac system with Ubuntu installed which I access via a virtual console inside iDRAC/SSH, and the dedi boots into PXE. Im just not sure exactly how to reinstall Ubuntu on the machine. Trying to get rid of my current install and start fresh with a new Ubuntu
I dont see any options within IDRAC 6 enterprise that I can use to re/uninstall the OS
does it have a CDrom drive?
other wise you will have to create a bootable USB drive
Probably the server is in a datacenter nowhere near me
I use IDRAC to remote into the machine
I had a bunch of options for OS choice when i first booted it
PXE is network boot
unless your inside that network you cant
or know where they have stored their immages
But I remote into it during that boot so id have access to the machine as it boots
you would be best served asking for their help
Ah
yes but i have no idea how to help you
Yeah not sure where their images are
give em a call or an email
But PXE is where id reinstall right?
Or is there something in the virtual console inside idrac where id do it
you should be able todo it via virtual console
Sorry im server admin illiterate
providing its enabled
yes
Ty
eric doesnt actually know what he's on about 
One message removed from a suspended account.
One message removed from a suspended account.
thats it
dont act like you understand something, if you're just gonna google it
I'll go ahead and pxe it, thank ya
and if you have any issues with members not being clear on their intentions
One message removed from a suspended account.
he gave incorrect info
One message removed from a suspended account.
pls dm me with your concerns so that i can deal with it in a calm and directed manner
instead of just talking about it here
@earnest phoenix its still not accepting my token
what is your code
probably botched it
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Discord;
using Discord.Commands;
using Discord.WebSocket;
using Microsoft.Extensions.Configuration;
namespace tanki_online_alpha
{
public class Tanki_Online_Alpha
{
string value;
bool toDelete = false;
value = Environment.GetEnvironmentVariable("token"));
// If necessary, create it.
if (value == null)
{
Environment.SetEnvironmentVariable("token", "(had my token here)"));
toDelete = true;
// Now retrieve it.
value = Environment.GetEnvironmentVariable("token"));
Console.WriteLine($"token: {value}\n");
public static void Main(string[] args)
=> new Tanki_Online_Alpha().MainAsync().GetAwaiter().GetResult();
private DiscordSocketClient _client;
public async Task MainAsync()
{
_client = new DiscordSocketClient();
_client.Log += Log;
Task Log(LogMessage msg)
{
Console.WriteLine(msg.ToString());
return Task.CompletedTask;
}
// Remember to keep token private or to read it from an
// external source! In this case, we are reading the token
// from an environment variable. If you do not know how to set-up
// environment variables, you may find more information on the
// Internet or by using other methods such as reading from
// a configuration.
await _client.LoginAsync(TokenType.Bot,
Environment.GetEnvironmentVariable("token"));
await _client.StartAsync();
// Block this task until the program is closed.
await Task.Delay(-1);
}
}
}```
and is there an env variable named token
One message removed from a suspended account.
you are annoying at this point, @sage bobcat
well
what syntaxis do i need for that?
kinda
you are on the right track but you expect your code to read an environment variable that doesn't exist
to see how to set one google your os and append "set env var" to it
ah
i see
so i need to declare the environment variable and supply that with the token
correct
see when you take a programming language you know a sister of (in this case C++) it becomes much MUCH more easier :3
why dont you just hardcode it lol
cuz hardcode is gรฆ
not really
setting and getting it via env variables from the same code
lol
mobile scrolling dum
the whole point of using env vars is so you don't actually put your token directly into the code
Can someone send me kick command for bot
yeah, you put it in your system's environment variables
we dont spoonfeed here @earnest phoenix
xD
Where them?
i feel stupid
not here lol
@earnest phoenix not here
K
this is where the line between sysadmin and dev fade i geuss
@earnest phoenix if you want codes, go to stackoverflow lol
i knew it was a thing though
Is that server?
no, its a website
Oh k
how about you do some debugging? like print all your system's environment variables to see if your token even exists there
i suggest Console.WriteLine or debug with breakpoints to see if it's actually set
@fervent oyster yo cutie
^
ah i see what you mean
what
i think i've hit a snag
oh?
nice token leak
LMFAO
go reset
lmao
xD
One message removed from a suspended account.
One message removed from a suspended account.

const artists = []
for (const artist in track.artist) {
artists.push(artist.name)
}
em = {
color: bot.color,
author: {name: track.name, icon_url: bot.img},
description: `โฝ Album: ${track.album.name}\nโฝ Artist(s): FILLER`,
thumbnail: {url: track.album.images[0].url}
}
i think the issue is around the array part @fervent oyster
ok discord
@earnest phoenix was that token set up correct?
just indent how you feel
yes but reset it and update it @solar wraith
@trim saddle dont use const, it prevents the array from changing, use let
the array is basically read only now
with const
#development etiquette
- If you know something, and someone asks a question about that thing, don't shit on them for asking. Either help them or stay quiet. If you don't have anything nice or helpful to say, keep quiet.
- This channel exists to help people. If you're not feeling helpful, your not wanted in this channel.
- Keep in mind that we started as beginners once, so be nice. Helping people helps us all. The more knowledgable the development community as a whole is, the more we all benefit.
- Don't say random, un-helpful, unrelated jargon to try to make yourself sound smart, if anything it makes you look dumber.
- If you can't answer someones question, don't try to extrapolate your knowledge from something else, you'll most likely confuse everyone involved.
- Don't ask to ask (eg. "can I ask a question"), this channel exists for questions, you don't need permission to ask one.
- Keep inside jokes in responses to a minimum, they're likely to confuse the person asking for help.
- No language/library wars, it makes everyone involved look like a dick.
did moose just write rules for one channel
you're*
Rules were needed
restart the process/os
try to
execute command shutdown /r /f /t 0
sometimes it needs a restart to apply the change
you can also use array.map() to turn that for loop into a one liner
coding <-> setting up a server
How come I'm getting a 401 on https://discordapp.com/api/gateway/bot
Is it not an Authorization header with the bot token that you're supposed to add?
xD
@earnest phoenix same here
aaahhhhh
@quartz kindle was using the spilled token
so there we go
You're stuck on the same problem ?
yes
but you shouldnt acces the gateway like that
you should supply it with a token
are you trying to use the rest api or the gateway websocket?
rest api to get the socket endpoint
without a library?
bad idea
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
there are many libraries that handle that part for you, are you trying to make your own library?
I'm trying to use this as a learning exercise
I tried setting my bot token like an OAuth athorization header but that doesn't seem to work
krrggg huston we have a confirmed launch
How'd you set the bot token?
enviorment table
@solar wraith i love the file path xD
oauth token type is Bearer
bot token type is Bot
@earnest phoenix THANK YOU
and now what
not yet, this only give me back the websocket I need to open :p
now we gonna add a simple ping pong command
:3
wait
can i also get the bots name?
Maybe I should write my own library
you will most likely need to go to a therapist appointment while doing that
that made me laugh
lol, I believe it - going through all the documentation
discords api is so inconsistent and constantly changes
alright cry is there a way to have my bot name extracted from the api and printed to the console?
just yes or no
yes
you don't even have to make a request to the api
its returned through the gateway after logging in
ah
so its cached in the client property
@fervent oyster @trim saddle const doesn't make an array unchangeable
it's true you can't rewrite it like artists = 'I'm something else' but artists.push() still works
const means you can't overwrite the value itself, eg a new array
i never knew that
but you can stil modify the array lmao
same thing for object properties basically
hmm.
Dangit
i cant get it to call a different C# file
cuz i like code to be easy to look at
so general commands go into a file general.CS but how do i call this back to main?
Tell it to import it / grab it
Like you would python with import
Can't remember what C# is
Thing CPP is include xyz
yeah
i know
i know C++
i will look into it tommorow
other wise i will stare my self blind at it
Hey, I bought an Raspberry PI 2 days ago.
I set up all my bots there, but I wanted to create an website too...
So, I installed all of the packages (apache2, etc..) but:
My Raspberry Public IP (starting on 185.x) is not responding - and all things on localhost are going on!
let artists = []
for (const artist in track.artists) {
artists.push(artist.name)
}
this still doesn't work
because you are changing artist it cant be a const
wait wha
every time you loop you overwrite the value for artist
ohhhhhhhhhhh.
use let artist in ...
the artists array can be a const
const artists = []
for (let artist in track.artists) {
artists.push(artist.name)
}
Wait, what? What do you mean by "because you are changing artist it can't be a const"?
when you use a const you are not allowed to overwrite it
you are allowed to change what is inside a const list/object
Yeah, but what are they overriding in the loop?
the value of artist changes each time the loop loops
Yes, but I don't think that's their issue
I think they're looking for of and not in
oh, looks like i was wrong, the examples im looking at now are using const there
Wouldnt matter how you defined it really... It works with let and var too, just when it's const the value is, what do you know, constant
@quartz kindle do u have Bitcoin
a bit
coin
One message removed from a suspended account.
Hey, uh, I'm trying out ES6 modules and I get this error
@lavish shuttle You need to append a flag to use ES5 features
Which flag?
add type to your package.json: json { "type": "module" } and run with node --experimental-modules app.js
profile = client.getProfile.get(message.author.id); //Get the profile SQL db
let rest_of_the_string = message.content.slice("~newprofile".length);//removes the first part
profile.profile = rest_of_the_string; //set the new profile
client.setProfile.run(profile);
message.channel.send(`Your new profile is ${profile.profile}`);
}```
This is my command that enable user to edit their current profile, is there any way I can set a limit to how many characters counts is in their profile?

Use the substr function
Danish, check the length of a string if you want to check beforehand
Is it possible to store commands in a seperate C# file and call them into a main file?
just need Y/N
y
weird thing, I use require('node-schedule') then I set a task like schedule.scheduleJob(`* */8 * * *`, function() and it ran every minute
testing now with schedule.scheduleJob(`* 0,8,16 * * *`, function() but still idk if is the right way, anyone could help? need to set it to run every 8 hours
let j = schedule.scheduleJob({hour: 8, minute: 0}, function() {
thanks guys
just wanna ask, how much time does it take to approve my bot? thanks ๐
as much as it needs




Are you working with