#development
1 messages ยท Page 574 of 1
in that vein, does someone have a stylesheet I can quickly add to my bot page that's not as butt-ugly as the default markdown theme?
All of my inline code blocks are barely even visible since it's light-red on white.
I know, I can just put the markdown through a parser to get working HTML, but I'd rather not have to go through developing an entire site theme if I can just borrow someone-else's stylesheet.
i just made mine myself, took a couple of mins ig

@amber fractal man adding the !importants didnt work
does the pc work tho?
nope
Ah well, guess I'll just see if I can put together something minimal that can at least fix the inline code blocks..
the background color aint even changing lol
Any idea why my c# bot no longer responds to commands. I tried to put a Console.Write in MessageReceivedAsync but that never writes so It's not receiving messages I assume. I know it loads the CommandHandler because If I put Console.Write in InitializeAsync it writes it
share your code...?
https://mystb.in/ogujiqufes.cs That's my CommandHandler
Any errors?
Nope
I updated my Visual Studio (haven't in a couple months
) and It hasn't worked since. That might not be why but 
I have only tried coding a discord bot with C# once lmfao, i dont think im able to help you with the code lol
Sorry man, but goodluck
Well, you could try rolling back commits on your bot until it starts working again, that may tell you which commit the breaking change was added in.
or debug
Don't use GitHub 
Then Debug
@safe steppe well there's your problem. And if you're not comfortable publishing your source you can always just use git locally without an external service like github.
Or subversion if that's more your style.
private repos are free now and amazing back ups
Wait they are?
yes
Yeah
private repos are free now
I guess I've had github premium for so long I'd never bothered to check...
I never knew they were free either
Is there a way to pass in a function as one of winston's transports? (winston aka the npm logging package)
so im trying to update every object inside an array inside every mongodb document as to add a new variable
each document is styled like { blah : [ { blah2: true }, { blah2: true } ] }
or what im trying to modify is
anyone know how to do that with mongo?
something similar to like
db.users.updateMany({}, {$set:{blah.$.blah2 : false}}, {upsert: true})
so that it updates every object in the array
that string dosnt work but i think its in the corret direction to modify all objects in nested array
Can you post a before and desired after
before
{
blah : [
{
blah2: true
},
{
blah2: true
}
]
}
after
{
blah : [
{
blah2: false
},
{
blah2: false
}
]
}```
i need to apply that with every document
db.users.updateMany({}, {set every object inside an array}, {upsert: true}})
Your previous code should've worked, does it not?
my querry selector needs to select all documents
but it dosnt seem to do so
military_goods currently also dosnt exist but upsert should handle that

upsert
Do not use the positional operator $ with upsert operations because inserts will use the $ as a field name in the inserted document.
oh
For now, you should prob just iterate every document
that's not much 
i mean programmatically
pull document, reinsert/update
querry wise
yea
ill probably write something to handle updating that array
for future use
or something
This positional operator with upsert is tracked as issue server-3326 in mongodb
So in the future, it may potentially be possible
kinda looks like a bot I was making then kinda stopped 
I'd have to guess they are way different tho
jesus, that issue was created in 2011
mongodb team ๐๐พ
mongodb step up
Nah, it was a thing where you make a castle, make treaties, form confederacies, raid neighboring castles, keep control of your people and all that shit
quiet often
nested objects inside array inside doc
interest*
when does dbl re-fetch bot pfp?
i updated mine rather a long time ago and it still uses the old one
Try refreshing with ctrl + f5
its not cache (on my end)
few days ago
Huh
How do you add html css in a bot's desc?
anyone know how to put 2 prefix on config.json(discord.js)
Can you add other things than html in the editor on yt?
@sand crown what?
@earnest phoenix just check for both prefixes
Check for both prefixes.
@sand crown write your css between <style> tags in your <head>
@earnest phoenix ```json
{
"prefix1" : "first_prefix",
"prefix2" : "second_prefix"
etc...
}
Okay how about you actually fkn learn JavaScript
ok
First you wanna require the config file, and then like you said, you use config.<name>
@earnest phoenix
yes
What??
@dull bobcat i want 2 prefix for use v;help and @native fulcrum help
what lib are you using
well you cant do that in a json file
Eu acho que tem um jeito de ser mais ou menos "v; | @native fulcrum" in the config.json
The prefix will be broken if you include unknown characters and spaces
some libraries give you an option to use bot mention as it's own prefix
He's on Discord.JS
@ruby dust
@earnest phoenix Just create a variable for the mention, then compare that variable to the first mention and if the member is mentioning the bot, the command will trigger, and if its not mentioning the bot then just use the else statement
Ok
Im not gonna give you the code, i don't think youre compable to do this thats why im telling you to learn JS, you dont even know how to call a module
Just search up on google "JavaScript and NodeJS courses"
Ok im going to search
๐ฑ 
is there any WAY that I can get a tag of a user while I have the user's default information to mention him
in example
if I know
message.member
can I get message.member.user.tag
ugh
but NOT
get by id
all you need is the user object, if the object doesnt have a tag property you can build your own by <user.username>#<user.discriminator>
^
the member who send the message
or use <user>.tag
???
let author = message.author;
message.channel.send(author.tag);
read the docs
^
var a= string
man
user has a tag property
^
I read that doc
you said this will be a discord.js question, this is most likely a general coding question
Thats literally what i said
@earnest phoenix Learn NodeJS or JavaScript, dot!
I think u guys didn't fully understanded my question because of my poor english
@dull bobcat I learned js
No
I will show the specific case
What are you trying to do ffs
a user sends a message like this @earnest phoenix
yeah?
so I get the @earnest phoenix and put it in varaible
and I want to get the tag by the varaible
oh
a user has a tag property <user>.tag
thanks message.mentions.members.first() was the thing I was looking for
This is literally what we have been saying to you the whole time
You really need to learn JS man
actually I did not had a user object, but a string
like var a=userobject.toString()

what are you trying to do?
let mentioned_user = message.mentions.members.first();
if (!mentioned_user) return //whatever the fuck you want to return here
message.channel.send(mentioned_user.tag)
``` @earnest phoenix
now, go learn NodeJS
.user.tag
https://paste.tscforum.com/vvhanfkemo.js It doesn't error but it doesn't add the role reward (around line 50)
just a piece of advice, better learn more about the js if you want to make a public bot. as well how to read documentations and such. It would save you a lot of effort
do mentioned_user.user.tag @earnest phoenix
@zinc pawn did you try experimenting where the code stops?
wdym?
basically put console.logs there and figure out where the code execution stops
asked differently: did you debug
yes because asking us what happened without any errors would be hard, so thats why we asked you if you debugged it
it stops on line 51
console log the result
cant do things with a result if there aint any
@zinc pawn what is result
what is results.length?
I'm logging now
probably 0 if it returns on like 51 lmao
^
debugging 101, if code returns on a line with a return statement the return condition is met 
hm its returning []
is there any reason for those awaits if you're just using callbacks?
yes
then why ask us 
im now working out why it isn't finding it
its stored like this {"serverid":"539058992136323082","reqlevel":"2","roleid":"539059104715374597","_id":"qzvq4GPKfQp3eWjI"}
the bot.rrdb is just a link to a nedb
Elemental31, what is "result" defined as
[]
I dont want to know the content
it isnt f inding what he wants
^
What are you trying to find?
so your issue maybe is on how you FIND what you want
yeah somethings wrong in the finding
specifically here await bot.rrdb.find({serverid: message.guild.id, reqlevel: curlvl + 1}, async (oopsie, result) => {
I never used that db so I'll be just saying try to debug how you find it. as well why await that
I dont think thats a promise
nedb doesn't even return promises, its irrelevant whether you have it
yeah i got rid of it
yes but I dont know why you await on non promise stuff
it can't find a result for {"serverid":"539058992136323082","reqlevel":"2","roleid":"539059104715374597","_id":"qzvq4GPKfQp3eWjI"} when its searching serverid: message.guild.id, reqlevel: 2
well maybe it needs the role id and the _id
correct me if im wrong but you're searching for a number while it's saved as a string
oh yeah thats a possibility ^
2 != "2"
nope, you cant use ${} inside "
no its inside `
it goes > reqlevel: `"${curlvl + 1}"` <
no man
it was discord formatting
remove those "
^
^
ok
thing: `"a"` -> thing = "\"a\""
thing: `a` -> thing = "a"```
oh it finally found it
if you want to store pure numbers, store it without ""
so that you woudnt have issues about that in future
new issue for(i = 0; i<result.length; i++){ if(!message.member.hasRole(result[0].roleid)) { message.member.addRole(result[0].roleid).catch(OOOH =>{}) } }
(node:5028) UnhandledPromiseRejectionWarning: TypeError: message.member.hasRole is not a function
we are not your debugging childs sighs, but I think its because member is undefine try logging message.member
is hasRole even a thing
there's no hasRole function in member
You wanna use Template strings otherwise it cant contain placeholders
just read.
try it
read the link i sent you
H
?
I can not make Test2 = Gall.Noms.indexOf(Dresseur.Famillier) and Test2 = "Blabla"
?
Do you need to save it
?????
๐
Test2 = Gall.Noms.indexOf(Dresseur.Famillier) and Test2 = "Blabla" is equal
is this js or py, the hell
But I must define the place of Aqua because it is not the same place in all the world
@keen drift
Bruh
feels like i'm getting trolled
Replace index in fishy's example with what you used for Test2
So ? : array["Aqua"] = "Aqua2" for this Test:"Aqua", "Magma" ?
do you not know what an index is
xd
Yes is know
@inner jewel i need some backup
@keen drift ?

wha
@dull bobcat what you want
i thought u needed help
then lets not talk in here more since its offtopic
i'd appreciate if you read the whole context beforehand
i meant our convo right now, but sorry
its not development related at all
so can we change either topic or channel?
new moderator? ๐ค
Yeah but we're not even talking about development right now @sick cloud
I'm just following the rules
How am i not
aka "mini-modding"
I am not minimodding, i literally asked if we could change fucking channel since this is off topic, i want to have discussions about development here
I can aswell just call the mods here
I was helping another user, when you randomly interrupted and pinged me and then proceeded to ask me to move to off-topic?
No, i pinged you because i thought you needed help since you said "i need backup", i already told you this
Now can we pleace change topic or channel, just drop it
Then I proceeded to tell you read the context
Yeah i know but i apologized because i didn't do that, and that i miss understood
But can you drop this
before i call a mod in here
๐ค lol
@keen drift and how i can delete a precise item in a array exemple i want delete Aqua in an array
exports.remove = (array, element) => {
if(!Array.isArray(array)) throw "Invalid input.";
const index = array.indexOf(element);
if(index !== -1){
array.splice(index, 1);
} else throw "Element not found in array.";
return array;
};```
or this
of course it would be function remove()
but you get it
How ? plz i have not really understood
i literally sent you a function that does it. i usually dont spoonfeed but you asking "how?" after we explained is just painful
Exuse me i have not see thanks i go test and understand
/money
Ok so, i use enmap and i wanna make a command called reset, this command is supposed to delete all data in the database, the method to do this is enmap.deleteAll() but i'm not sure how i can define which database to delete the data on, those are the files i got and i dont know how i can remove the data from those, i guess enmap.deleteAll() wont work just using that.. Anyways, any1 who can help? Please DM me because i gtg, ill brb soon, my files:
@dull bobcat Which language and database API are you using?
dont use enmap, easy fix tbh
they mean what provider
(Sorry, I'm just not too familiar with the node libs, I realize now that the second bit should've been obvious.)
why not interact with sqlite yourself
enmap is just a glorified wrapper really, and it takes more space
That or use a proper ORM.
I wanna stick with Enmap, are you guys gonna help or not?
What has enmap with the docs to do wtf
if you mean enmaps docs, they dont provide examples and explinations on how to use enmap.deleteAll()
Yeah
Now tell me, where do you see an exmaple?
Or an explination on HOW to use it
Have you tried just calling it on the enmap you're trying to delete all from?
i havent tried anything because i dont know what im supposed to do, thats why i asked for help lmao
Dude, just call the function on a test database and see if it did what you need.
Here's example code for how to delete all from an enmap called my_enmap:
my_enmap.deleteAll()
so i need to define "my_enmap" right?
you replace it with whatever db you want to use it on
basically filename?
You should already have an enmap object that you've been calling methods from to insert and retrieve values and whatever. Just take that object and call this function from it.
Ok, so look at the line of code in one of those command/event handlers that actually puts data into the enmap. Copy whatever code it's using to get ahold of the particular enmap object, and use that to get ahold of the enmap object in the handler that needs to do the deletion operation.
Then call deleteAll on that enmap object.
Jeez this isn't that hard.
anyone good at php/mysql
I'm pretty good at SQL, and I know enough PHP to do basic XSS and injection attacks...
const settings = message.settings;
const defaults = client.config.defaultSettings;
const overrides = client.settings.get(message.guild.id);
if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {});
``` This is what i use when i store data in the database
this is my "set" command
MySQL connection fail! SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers
do you know what im doing wrong?
posting an error with no explanation of what your doing?
oh wait
@dull bobcat Well, obviously client.settings is the enmap object here, so what you want is client.settings.deleteAll().
<?php
require_once('../function.php');
dbconnect();
session_start();
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (attempt($_POST['username'], $_POST['password'])) {
redirect('home.php');
}
else {
redirect('index.php?error=' . urlencode('Wrong username or password'));
}
}
?>
@sly wyvern That will delete all the settings though, i want to delete ALL data in the db
@paper zinc can you verify that MySQL is actually running?
client.settings = new Enmap({name: "settings"});
This is in my index
yup it is
what version mysql?
Server: MySQL 8.0 Server
PHP version: 7.2
If you're using more than one enmap, you'll need to delete everything from the different enmaps separately. Or, you can try just deleting the enmap.sqlite and associated files and reinitializing enmap.
No guarantees it will work but this is your problem not mine.
@paper zinc I take it dbconnect is defined in function.php?
function connectdb()
{
global $dbname, $dbuser, $dbhost, $dbpass;
$conms = @mysql_connect($dbhost,$dbuser,$dbpass); //connect mysql
if(!$conms) return false;
$condb = @mysql_select_db($dbname);
if(!$condb) return false;
return true;
}
happens a lot with mysql 8
really?
Also note that mysql_connect is actually deprecated, you should be using mysqli_connect instead.
(Assuming I'm understanding the docs correctly.)
so use the mysqli extension?
Yes, although you also need to do what @dusky steeple said first about your my.cnf.
ok
What OS and which package did you install?
I'd expect it to be somewhere like /etc/mysql/my.cnf but that's not the only place it could be.
Using mysqli isn't to fix this error, it's to avoid some other future possible errors.
No, really you don't want mysql, you want mysqli. For entirely different reasons from this issue.
you might need to contact the host and have them fix the error.
What?
who hosts your mysql?
Yes? whats wrong
If it's not localhosted, where is it hosted?
You need to make the configuration change there, not on the PHP end.
db4free 
CURRENTLY, not permanently?
Ok, yeah, that's not an actual solution. Just install your own local mysql instance.
That's not hard to do.
Well, I have.
It's just not accepting connections
idk how to fix it
Is it really a db error?
Are you unable to connect at all, or just not from your PHP code?
Just php
Because if it's the latter you probably just need to make sure your db roles are configured correctly.
And make sure that the db you're trying to connect to actually exists.
it does
(And all that fun db configuration stuff...)
Yeah, you need to change all the mysql_<something> calls in your code to mysqli_<something>.
Oh wait you're using an ORM?
wha
oh wait no PDO is a database abstraction layer not an ORM, nvm.
But if you're using PDO for everything, you shouldn't need to directly connect to the db with mysqli at all.
It's not wrong per se, just usually superfluous.
hm
@paper zinc do you have a github repo or anything so I can take a look at your code?
I can give you a zip
nah
why not?
that's too much effort for me.
It's the same as my username here.
How should I know?
because I just told you in my last message.
Sorry if that came across as overly passive-agressive.
Also, how are you connecting to your local DB that's not via PHP?
Ok, and you've created the appropriate user (trankery) with the correct password on your server, created the database (smm_paneling), and GRANTed your user the permissions needed to log in to and access that database?
yes
Also you should probably edit the dbconnect function to use the same $dbname and the rest of those vars to construct its arguments.
the same way connectdb does.
wait, do you not have edit perms?
Honestly it's better if I just tell you what's wrong and have you fix it, that way you'll learn.
okay
so what should I do
function connectdb()
{
global $dbname, $dbuser, $dbhost, $dbpass;
$conms = @mysql_connect($dbhost,$dbuser,$dbpass); //connect mysql
if(!$conms) return false;
$condb = @mysql_select_db($dbname);
if(!$condb) return false;
return true;
}```
this?
Ok, so that's actually not the function you' got the error message from.
The actual function is the one after that, called dbconnect, not connectdb.
oh ๐คฆ
$pdo = new PDO('mysql:host=$dbhost;dbname=$dbname', '$dbuser', '$dbpass');```
like that?
yeah.
Same message?
well that's progress.
MySQL connection fail! SQLSTATE[HY000] [2002] php_network_getaddresses: gethostbyname failed. errno=0
Neither direct ip, nor hostname works
Oh, you need to use a double-quoted string if you want variable expansion to work.
in the defined database values?
Single-quoted strings don't get expanded.
No on the PDO('mysql:host=$dbhost;dbname=$dbname', '$dbuser', '$dbpass'); line
the single-quoted strings are being passed in verbatim without any variable expansion.
$pdo = new PDO("mysql:host="$dbhost";dbname="$dbname", "$dbuser", "$dbpass");
yes.
Ugh you've got way too many double quotes. Get rid of the internal double quotes.
PDO("mysql:host=$dbhost;dbname=$dbname", "$dbuser", "$dbpass");
$pdo = new PDO("mysql:host=$dbhost;dbname=$dbname, "$dbuser", "$dbpass");
nvm saw it
New error!
MySQL connection fail! SQLSTATE[HY000] [2002] No such file or directory
Sounds like you didn't actually create the database on the server...
Like with an actual CREATE DATABASE query.
I mean creating it with the UI is fine too.
Can you make sure you've created the user as well?
IDK, can you open up a query shell?
Yeah. I'm more used to postgres and for that i'd be psql, but IDK what the equivalent is for MySQL.
try running the query SELECT User FROM mysql.user;. Make sure the result includes your trankery user.
query query or sql query
Also, try running SHOW GRANTS FOR trankery;
MySQL said:
#1142 - SELECT command denied to user 'trankery'@'localhost' for table 'user'
ok, and the second?
GRANT USAGE ON . TO trankery@%
GRANT ALL PRIVILEGES ON smm_paneling.* TO `trank...
Try SELECT default_character_set_name FROM information_schema.SCHEMATA S WHERE schema_name = "smm_paneling";
To see what the current character set actually is.
utf8
Ok, not sure what the character set issue actually is then... this is weird.
I know...
Can you go through the properties in the UI and make sure that everything is set to UTF8 anywhere it asks about a charset?
Honestly what you should do first is find the my.cnf file and change the character set appropriately there then restart the database.
It is the default one
Or if you're on windows it's actually c:\programdata\mysql\mysql server 8.0\my.ini
well, it is the default one...
Im a started in html. I use sqlite in javascript for a database. How would i use the database in html
wait, lets just try a different db server
You have the line default-character-set=utf8 in all of the relevant config sections in that config file?
looks like it
because it's possible for the client to be set to a different charset than the database.
@split hazel You can't query a database directly from HTML.
That's just not how it works.
That's why javascript exists.
Moved it to a different host:
MySQL connection fail! SQLSTATE[HY000] [2002] No such file or directory
Oh so I require it from the html file or something
And all the things are done in js file
For that matter, you probably shouldn't be querying the database from the client-side javascript either.
learn how web deving works
you dont even underatand html which isnt even a programming language so you should backtrack
is it alright if I'll load a json file after every command, or is it recommended to load the contents on startup?
@sly wyvern
Moved it to a different host:
MySQL connection fail! SQLSTATE[HY000] [2002] No such file or directory
@ruby dust how often is it updated
yes. should i use the ip or the hostname?
Probably the hostname.
nearly to never, those are just response strings
Oh wait.
New errors
Notice: Undefined variable: dbhost in /volume1/web2/smm/function.php on line 33
Notice: Undefined variable: dbname in /volume1/web2/smm/function.php on line 33
Notice: Undefined variable: dbuser in /volume1/web2/smm/function.php on line 33
Notice: Undefined variable: dbpass in /volume1/web2/smm/function.php on line 33
MySQL connection fail! SQLSTATE[HY000] [2002] No such file or directory```
I'm just afraid of overloading my memory, in case there's a lot to cache?
Ok, well there's your problem, you need to declare those as globals at the start of dbconnect the way you did in connectdb
yeah, that bit is what let the first function access those vars.
unless you are keeping the pentagon code in the json file i doubt text will overload the memory
fair enough
glad I could help
he helped me, fixing a panel
for around 4 hours
and it works
jesus thanks
Can I give you a vouch or rep or so?
mcm?
what? idk do what you want.
honestly, that's how large software run into problems like that, so 4 hours is almost nothing ยฏ_(ใ)_/ยฏ
Huge vouch for @sly wyvern. Good PHP/SQL Developer. Cool guy.
rip dude, he's not gonna give you a break now
@molten pewter Maybe you wanna install such module? lol
except it is installed
code?
hm
rip
@molten pewter Sounds like you've found your way to dependancy hell.
I guess just try rolling back versions on things until it works.
How can not let my bot send messages on this server. Discord.py Rewrite
ignore this server by id
There's probably a fancy way to do it with a decorator, but basically you just need to check the guild_id against a blacklist that includes this server's guild_id, and if it matches then don't do whatever it was you were going to do.

Like if you want to be fancy you could implement a custom send_message function that does that check for you so you don't have to modify your code anywhere else, but ultimately one way or another it's gonna come down to checking if the guild_id is in the list and if so don't send.
Why would this not work?
blacklist = ["520633847583604746"]
if guild.id == blacklist:
return False
embed=discord.Embed(title=f"Hello **{member.name}**, hope you have a good time in {member.guild}", description=f"Want this bot in your server? Go to fuzzybot.us.to", color=0x17B3FF)
embed.set_footer(text=f"Need help type {self.bot.command_prefix}help. Not in these DM's!")
await member.send(embed=embed)```
I don't know, does it not work?
no it dose not
oh actually there's your problem you need to check for membership not equality
i don't know what that means lol
if guild.id in blacklist: rather than if guild.id == blacklist:
it's possible you'll need to cast things to make sure they're of the same type
Also for performance reasons you probably want to use a set rather than a list.
so what will fix it?
blacklist = {520633847583604746}
if int(guild.id) in blacklist:
return False
I mean, you need to actually retrieve the guild object, it doesn't automatically exist.
It looks like member.guild is probably what you want, assuming the rest of the code is correct.
ok
so int(member.guild.id)
still dose not work ๐ฆ
uhm
blacklist = {520633847583604746}
if int(member.guild.id) in blacklist:
return False
embed=discord.Embed(title=f"Hello **{member.name}**, hope you have a good time in {member.guild}", description=f"Want this bot in your server? Go to fuzzybot.us.to", color=0x17B3FF)
embed.set_footer(text=f"Need help type {self.bot.command_prefix}help. Not in these DM's!")
await member.send(embed=embed)```
your logic is very foul
you're overwriting the list each time a member joins with only one entry in it
so... what's the point of a list?
just compare the ids directly
shouldn't you know
im bad with if statements
then backtrack and relearn that
dear god, he's been bashing javascript/node for the past 10 minutes or so
he claims that javascript outside of a web browser is trash
although javascript requries negative iq to use it hence why a lot of newbies just stick to it, it's still a language lol
yeah
there's no "real" and "not real" languages
well fuck
SyntaxError: Unexpected end of input
at new Script (vm.js:51:7)
at createScript (vm.js:136:10)
at Object.runInThisContext (vm.js:197:10)
at Module._compile (internal/modules/cjs/loader.js:618:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
at startup (internal/bootstrap/node.js:201:19)
if a programming language is a programming language, it's a programming language
he says he tried to use node once and hated it
he uses java btw
And he also claims discord is trash because it uses js lol
says discord is trash on discord
uses one of the most unoptimized langugaes in the world
bashes other languages for not being able to comprehend with them
^
Can someone explain why this is being dumb, or how to center the patreon button
I dont want to just transfrom it either, because that would make it look weird on other devices, wouldnt it?
Just align it to center using css
it is
This is my center tag
but patreon has a different one
same stuff tho
so idk why it'd actually change
margin: 0 auto;
Same
why not just <center> 
owo
@amber fractal have you tried justify content and align conten
Question-
I'm having a bit of trouble with the Oauth thing
I've gotten the code from the api/auth part, but trying to get the access token returns "invalid_grant"
Hm. Perhaps I'm going about this the wrong way then-
Trying to do the login portion of my site like how the bot list does
Where it logs into the discord
actually, ignore everything I say
Lol
I've never used Oauth2 for a website
I'm rather unfamiliar with it myself truthfully
From my understanding of the discord api, it's along the lines of authorization URL (scope identify) > request access token using the returned code > use access token for neat stuff
Problem being, using the returned code based on how they describe doesn't quite work
i'm going to cp you a tag i made in dapi
in hastebin probably
nevermind hastebin is being weird
anyway;
First you are supposed to redirect the user to /api/oauth2/authorize with the required url parameters (client_id,redirect_uri,response_type,scope).redirect_uri must be a value which exists in your app's redirect uri list.If and when the authorization process is done it will redirect the user to your redirect url with a url parameter named code e.g https://domain.com?code=x.
In order to exchange for an access token you need to make a POST call to /api/oauth2/token with these values in the body; grant_type,client_id,client_secret,redirect_uri,code. They need to match the values that were used in /api/oauth2/authorize (first request you made) and for code you use the code you got in the url parameter (?code=).
If the request was successful, you'll get a JSON response which contains a access_token and a refresh_token field. You need to cache it. Cache the refresh_token too if you want to do automatic token refreshes. Access tokens usually last for a week so you can choose whether you want to make your sessions last a week or if you want to do automatic token refreshes.
Skip this paragraph if you don't want automatic token refreshes
When you've made your request to /api/oauth2/authorize (request above) the JSON response will also contain a expires_in field. It's saying how long until the token expires in seconds. You can cache it or put it in a database, however don't lose it. Once the token is expired, you want to exchange the expired token for a refreshed one. Repeat the process above and make a POST call to /api/oauth2/authorize except you're going to throw out code out of the body and replace it with refresh_token which you should have cached as said above.
Anyways, you use that access token in authorization headers now. For e.g to get info about your logged in user you call /api/users/@me with the Authorization header set to Bearer token
Oh jeez
Right, so I've done that
I've got it giving the code from the authorization bit
I pass that through with all the info and can't seem to get the access token
Originally I was getting invalid_grant, but now I'm getting access_denied.
reassure the values match
client_id: blah
client_secret: blah
grant_type:authorization_code
code: thingy
redirect_uri:http://localhost:3000/login
scope:identify
That's the post body
e.g if the user authorizes a redirect uri that's https://google.com you must exchange the same redirect url in the post request
it has to be valid json
It is, that's just a quick copy & paste from bulk editing
ah
So I needa use the same URI from before, then?
Or a URI from the list
Ah-
That was it
๐
Big thanks man
Still wanna know why my css styling doesn't work well on the website, especially for phones
What are you trying to do?
@steel heath boล yere sizin EGGSY's Destek den banlandฤฑm -_-
Can someone help me in removing these table borders? I've tried literally everything.
and nothing, I tried that as well
just change the border's color to match the background?
@quartz kindle you can check my code on my bots page for @kind pelican
How did you change the background colour. Mine stays white @amber fractal
why css the background
Can't add background colour
Gotcha
dont use tables for ordering content
either make your own grid system or use a css framework e.g bootstrap
I tried floating
Why not use tables tho
if I knew what I was doing
I probably wouldnt have this problem
because that's bad practice
Reason?
@dense dove you mean the text overflow on mobile? Reduce the margins and padding and play arount with text-overflow, line-break and wrap rules
it's widely not applied, not strandardised, it looks ugly when someone snoops through your site's source and table appearance can be changed by altering browser's or os' settings
Im not trying to make a top tier site
which reminded me, tables are not responsive
I already know no one will go on it
grid systems are
grid systems utilize css' percentage system and max-width decorators
which makes your content responsive
you don't even need to spend time making your own
i'm pretty sure that at this point every css framework has it's own
to name a few; materializecss and bootstrap
I always make my own
how do i add my bot to the server?
Im on it on my phone right now, it looks the same tho
@earnest phoenix go to the website and click the add button
because you don't have a meta tag that tells the phone it's mobile friendly
Im not making a whole other thing for phones ๐คท
wat
No one is gonna use it anyways
who said you have to make anything for phones
@quartz kindle i'm getting an error
SyntaxError: Unexpected end of input
at new Script (vm.js:51:7)
at createScript (vm.js:136:10)
at Object.runInThisContext (vm.js:197:10)
at Module._compile (internal/modules/cjs/loader.js:618:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
at startup (internal/bootstrap/node.js:201:19)
exit status 1
Well if it breaks on phones, why add a mobile friendly tag
You have a syntax error in your code
hmmmm
well if it breaks on phones, why not fix the problem and not put a band aid over it and act as if nothing's wrong
The device scaling meta tag is so the website is resized correctly on mobile, else you get desktop versions on all devices
because I dont really care about the website that much
But if your website is not responsivr, dont use it
I dont plan on anyone really using it anyways
it doesn't need to be in my code
people look at the bot page on dbl for like 5 seconds, retention is shit anyways
also a protip;
if your website looks like it's from 2009, it will probably affect the user's mentality and drift away the user from the product
school marketing classes actually came in use for once woah
if you throw in your own code and it stops working you are at fault and not some random module you didn't write to begin with
@quartz kindle me: been coding a discord bot and still shit
People dont use a bot for the website
Dbl is not about retention, its about getting users back. Else they use other bot websites to search for bots
for a month*
TarpergonToday at 11:31 PM
People dont use a bot for the website
correct, but many do use a bot because it has a quality website
dw, people code games for years and they're shit 
why do you think bots like mee6 have such a huge userbase for generic features
Like EA
they have a rich and a very beautiful website
fifa n+1
fifa is all kinds of mess
yea cause its a football game, the sport itself is trash ๐
Skate 3 best game
fifa has been the same game with grass texture updates every year
skate 3 is full shit-funny glitches
Exactly
they update grass textures? 
I fixed it anyways
Why is not my bot inside the server?
luckly i have patience
^
to here?
@marble needle My bot has been approved but is not on the server
No in to my server
@quartz kindle I've set the width of the container quite less but it's not even working on phone
Reaction role is not currently available i think, ask fishy, hes the owner of reaction role
@keen drift Hello? Is the reaction role available now?
Why is not my bot inside the server?
@dense dove im on mobile right now, so i cant check, but you should be able to decrease or disable margin and padding from the description container, so it streches some more. Use the element inspector find what is making it so narrow
@solemn zephyr iirc reaction role is being remade, thats why Fishy temporarily shut it down, to stop its growth
Oh
@earnest phoenix did you add your bot in the website? Filled up the application form?
But in some severs they can use it
@quartz kindle yes
Like I cant invite it,.but some of my friends use it every day.
Oh okay
But ask him, be might give you a link
Thanks for the replay
@earnest phoenix now you have to wait until its approved. It takes up to 7 days. You will receive a message from Luca
@keen drift I whuld like to talk with you, please tag me when you have Time for me.
Thanks
Kinda the opposite problem of earlier, now I want to add borders, but what I'm trying isnt working, the headers is though is there a different way I have to select them?
Tables are kinda confusing, have you tried adding it to tr instead of td?
I will
Im on mobile, cant use the inspector now
or just don't use tables 
^
I dont even know what a grid is
Unless you have actual tabular data and want people to be able to copy paste it into excel
grids are actually a good alternative
Am I going to need to install something?
oh wait
is it just a tag (I dont know what it's really called)
markup language != programming language
I know.
Of course it works when I add important tho, idk what is over writing it tho
And now position: sticky; isnt working
Man I love html and css
Either way, I want to learn these grids
so I can make it responsive
I was just being dumb earlier
The easiest way to go responsive is simply inline-blocks with % widths
Also, now things are going over my nav bar when it has a z-index
Its very basic, but works nicely depending on your needs
Either way, I have this issue now
It's going over the nav bar
it wasnt earlier
And now its like my css isnt even updating the page
how many applications can I use one token on?
discord bot tokens*
running at the same time?
what
I'm wanting to connect my discord bot separately to my dashboard which both are connecting to the same bot token
is that considered api abuse or what do you reckon?
I still don't get what you trying to do with the token
What you mean how many applications
I've got my bot running as a separate application
and I'm building a dashboard which is also connecting to the discord api with the same token
as long as you don't exceed the ratelimits, you will be fine to use it anywhere
alright sweet thanks, question does discordjs auto ratelimit?
prob
ok
@stray wasp you will have problems, you need to only use a rest client to fetch data for the dashboard and a full bot for the bot part
Because libs also connect you to the websocket
a rest client on the bot itself?
For the dashboard
sorry I men't creating a api on the bot itself to get data and management
Then what
I'll look into rest clients thanks!
Hey, I'm trying to get rid of the padding for my logo on my top bar, it has the id and everything, but for some reason the padding is stiff there, am I selecting it wrong?
Rest client simply put is a http client for serialized data @stray wasp
oh ok
@amber fractal what code does the topbar use?
Do you want a screenshot or just a copy paste
@spring ember something like this https://github.com/DasWolke/SnowTransfer ?
Just to understand the concept better what would be some problems I would run into if I use discord js for the dashboard
Discordjs is meant to be a bot lib
yes but I'm planning on completing bot tasks like leaving a guild or is that possible with the rest client?
@spring ember
@stray wasp yeah just make calls to the api
mmmm alright
@stray wasp d.js will try to connect a web socket but to no avail because your bot is connected
But websockets are used for real time data which is not needed
Here
In this case
You will actually get two ws connection in which Discord sends data to both
and the sending of data is ratelimited aswell? from discord to client*
ok
@keen drift sometimes it just doesn't let me connect
Literally just trying to fix this




