#development
1 messages ยท Page 553 of 1
@lyric talon Use codepoints, not emojis
Also that code is ugly
Dicts are what you want
emojis work perfectly fine
I always used code points
rip you
it's the samething use emojis or codepoint
isn't it ?
and about dictionaries: The lists does the samething, how could i use dictionaries to do this ?
associate a key emoji to the embed ?
probably
I don't think that would be diferent
My problem is that my bot (seems like) is not recognizing the reactions
the site doesn't know your bot's status
ok
most of the time this is the result of your bot not being in this server
it was kicked for something, check #mod-logs
fix the issue and then ask a mod to add it back
internal/modules/cjs/loader.js:605
throw err;
^
Error: Cannot find module 'discord.js--commando'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\adamv\OneDrive\Documents\HelpfulBot\index.js:1:80)
at Module._compile (internal/modules/cjs/loader.js:721:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
ok
i mean is it just discord-commando
Has anyone messed with CORS it's been breaking my webapps for 4 hours now and I'm about to completely give up on everything
(Cross-Origin Resource Sharing)
@fervent oyster ive had some fucky issues with it, what's wrong?
No matter what headers I return on the server it denies all jQuery Ajax requests
can i have more context
internal/modules/cjs/loader.js:605
throw err;
^
Error: Cannot find module 'discord.js-commando'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\adamv\OneDrive\Documents\HelpfulBot\index.js:1:80)
at Module._compile (internal/modules/cjs/loader.js:721:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
help
i changed
install the module @void gale
I'm using jQuery Ajax requests to request server counts on a webserver on my discord bot, however even though I have the webserver return Access-Control-Allow-Origin: * it still denies the data returned from the bot
$.ajax('https://alekeagle.tk:2083/servers').done((data) => {//handle data});
@void gale typescript?
@fervent oyster im assuming you use node.js as a backend?
express?
Yes
No custom handling with https module
Can I ask why?
I already knew how to do it this method express confused me
Wdym?
how i use this thing minx xd
When I tried to learn how to use express it confused me
@fervent oyster what confused you
the reason i ask is because express makes life so much easier for web development and if you're not using it you're more than likely missing out
example in express:
const express = require('express');
const app = express();
app.get("/route", (req, res) => {
res.send("Success!");
});
app.listen(8080, () => console.log("Listening on port 8080");
Im not using it ๐
am I missing out, though
When I was trying to return data other than a file nothing told me how I could do it
wait i can just say "npm install discord
Can I combine it with the https module? @languid dragon
@void gale no
Still no.
discord isnt the lib u r looking for
npm install is correct yes
https://stackoverflow.com/questions/36239590/why-combine-http-module-with-express-module @fervent oyster
Thanks
to shorten it you can also use npm i <lib/package>
@void gale it literally tells you how to do it https://www.npmjs.com/package/discord.js-commando#installation
have you tried actually googling for your problems instead of constantly asking whether what you're doing is right or not
hey this my first time on js so ima be a noob
It also literally tells you how here as well: https://discord.js.org/#/docs/commando/master/general/welcome
literally if you read the docs and instructions you would have no issue 
okay ill ask google because even "npm install discord.js-commando" won't work
what
why not? have you tried reading the error it produces and googling the error or have you tried reading the error to see why exactly it's not working?
it worked fine for me
oh
its referring to the main
and is overwriting
and the error
SyntaxError: 'super' keyword unexpected here
at new Script (vm.js:84:7)
at createScript (vm.js:264:10)
at Object.runInThisContext (vm.js:312:10)
at Module._compile (internal/modules/cjs/loader.js:684:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:22:18)
super plain english
im gonna say this because I think this is where you should start instead:
read through a few of those, I think you should focus on learning how to code before you jump right into the development of a bot
learning to problem solve your errors and debugging your code is essential
Step 1: Look at the pins in this channel to find documents on learning JavaScript
Step 2: Learn how effective and fast Google can be as a debugging tool just with searching
https://support.google.com/websearch/answer/134479?hl=en
Step 3.a: Learn debugging
https://www.codementor.io/mattgoldspink/how-to-debug-code-efficiently-and-effectively-du107u9jh
Step 3.b: Learn how to effectively debug with stack traces in JavaScript
https://harrymoreno.com/2017/02/25/how-to-read-a-javascript-stack-trace.html
would someone be able to assist me in changing this to discord.js? ```import requests
import json
botToken = ""
channelID = [] # array of channel ID's (strings)
for id in channelID:
baseURL = "https://discordapp.com/api/channels/{}".format(id)
headers = { "Authorization":"Bot {}".format(botToken),
"User-Agent":"Discord Bot",
"Content-Type":"application/json" }
POSTedJSON = json.dumps ( {"rate_limit_per_user":2} )
r = requests.patch(baseURL, headers = headers, data = POSTedJSON)
print(r.text)```
is there someone willing to answer a quick question from a coding noob tryna program a bot? :p
Dont ask to ask.
okay
In python how would I go about getting a list of every user in that specific server?
are you using discord.py rewrite or something
async?
yeah
yeah ok, uhh
i think guilds have some kind of members property or something
you could try looping through it maybe?
i guess the question is more like, what command is used to check if a user is in a server
im trying to make a leaderboard style thing
i got the global one no problem but i cant figure out a server-exclusive leaderboard
ยฏ_(ใ)_/ยฏ
at least in js like terms, you'd get your users from your db or whatever, filter them by if their ID is in the server, then do whatever
ooo
const users = db.all() // or something
const in_server = users.filter(user => server.members.has(user.id))
i'd do it like that probably, but i have no idea how to convert it to python
a
Alright so
I have a res.sendFile so it stays on the file
but instead of sending the file
it goes to
/users/login
Ill send code
https://paste.tscforum.com/fghvtredix.js
So basically
after the sign up is done
I want it to stay on index.js
index.html*
and when they login I want it to send them to main.html
@zinc pawn what are you trying to obtain? The rate limit of users per guild? Because dumping is just going to produce a string or an object from that object. Just trying to gain clarification of its purpose
updating slowmode
I'm trying to change the color of the letter using CSS, but for some reason it's not changing when I go in Preview
Hm
What are you using to change the color of the letters? @graceful moat
I know CSS
but like
what part of css are you usin
h2{
color: blueviolet;
font-family: fantasy;
font-size: 50px;```
i tried in some ways, for example hexadecimal
ok it is
Now
Show me the full css thing
file*
Cause
h2{
color: blueviolet;
font-family: fantasy;
font-size: 50px;
}
It is supposed to have an } at the end of the h2 part
<style>
h2{
color: blueviolet;
font-family: fantasy;
font-size: 50px;
}
h1{
color : #5F04B4;
font-size: 50px;
}
h3{
color: cornflowerblue;
font-size: 28px;
font-family: inherit;
body{
background-image: url(https://www.chris-salazar.com/blog/wp-content/uploads/2013/02/black_background_leather-wallpaper-2048x1152.jpg);
background-position: center center;
background-repeat: repeat;
background-attachment: fixed;
background-color: #999;}
}
</style>```
Mk
Now
show me the html file you are trying to use that css file in
I think I know the problem now
you are passing the css file into the html file
so it can't access the css files properties
arent*
Oh wait
No
Take it style
if that is in a css file
i can send in private?
is html
I need help with a code from my Bot
Someone help me?
yes, description
then you need to learn "css specificity"
your problem is, that your style code is being injected into an existing page, not a new page
the existing page already has defined h1 h2 etc...
so for you to override the existing ones, your css needs to have the same specificity level, or more
Wait don;t you have to be certified to use Html, Js, Css etc in your bots description?
don't*
Ah yea
True that
But you could also just use
CSS for the interactive menu thing
Or CSS frameworks like Bulma, uikit, bootstrap etc
EH
Framworks are ok
but personally
I try to code the CSS stuff myself
But my friend has been wanting me to learn CSS frameworks
so I been using them a lot more
Don't know what that is
normalizer is like a small css preset
Ah ok
I do not know what the code is to ban a list of uids at the same time.
I mean for example: this is the prefix of my Bot p! and this I want to do, p! banids
and when they put that command ban a list of ids of people who spam or destroy servers.
I do not know what the code is.
Can someone tell me?
yeah you need to loop over the list of IDs and ban one by one
do like a forEach eh?
or whatever type of loop it is
I can't think rn too tired
xD
My problem rn is
I just integrated a Node background into my website
I just want to ban all the ids at the same time
just use a loop @scenic gull
just not directly at the same time
and I do not know what the command is to do it
which language/lib are you using?
js.
Knew it
Do you know JS?
so, for example, if you type prefix ID1 ID2 ID3 ID4 , you can get them into an array by using js let array = message.content.split(" ").slice(1)
Like at all?
@lusty dew Yes javascript.
LOL.
once you have the array, just loop over it then fetch the ids and ban them
really?
When people take me seriously
something like js array.forEach(id => client.users.fetch(id).ban())
or something
idk exactly because i dont have ban commands
a countdown while loop is the fastest js loop
let size = array.length;
while(size--) {
//code
}```
And I am bad at explaining things so
we aare in for aride
Alright so
I have a res.sendFile so it stays on the file
but instead of sending the file
it goes to
/users/login
Ill send code
https://paste.tscforum.com/fghvtredix.js
So basically
after the sign up is done
I want it to stay on index.js
index.html*
and when they login I want it to send them to main.html
So essentianlly
after they sing up instead of staying on index.html
it goes to /users/add
and when they login it goes to /users/login instead of main.html
and I have tried everything I know to fix it
cant you just redirect them, instead of sending the file?
Ill send screenshots of what I mean
I know
I was following a yt vid on making a node backend
and it did that
Not thinking hey I should probably make that but I didn't see a reason why if I am using a DB
Does't the post property
post the data inside the event to a file?
you should probably define different endpoints for each post
Wdym?
?
typo
OH
i mean, you have two functions being executed on the same endpoint
also Account โdosn'tโ exist
if they are supposed to be executed together, put them both in the same endpoint, else define different enpoints
magic
you're sending a post to /users/add
but your post endpoints are ""
you should probably set your post accordingly
I did
I dont know why it took out the /users/add
thing
I added it back
But my problem is
Then it does that
and the background normally has color
it isn't just plain white
and the url
because your html
<link rel="stylesheet" href="./orion_web.css">
its looking for orion_web.css
relative to the url
Oh?
so you have to set an absolute path for your css file
so I have to do something like
you have to use the full url, either localhost or domain name with http/https
in the html file
Gets confused
html files always look for files relative to the url
so change your css link to <link rel="stylesheet" href="localhost:3000/orion_web.css">
Oh ok
Also
it isn't supposed to say
localhost:3000/users/add
it is supposed to say localhost:300
3000*
you're sending the post to /users/add
So i should just send it to the url instead?
so either
- dont send them there, send them to
/and execute the function based if post data exists or not - send an ajax request
- redirect the user back to /
that should work too
I am just dumb
you can send the form back to the same page, and check if post data exists on page load
or use ajax, its fancier
I don't like ajax though yeet
I may use it later on if I have too
or if my friend forces me too
xD
i like ajax xd
how do you shuffle an array 
For 2 weeks I studied HTML, CSS, JS, Bulma, Uikit, Bootstrap and a few others
I need a break

inb4 array.shuffle()
if you're good at css and js, you dont need any framework :3
really
is anyone truly good at css
css is dum๐ ฑ
No it isn't
well
its annoying
timpls
oof
Ok
Hey tim
It is still sending me to /users/add
even though I have it set to /index
oof wait
I think I may be able to fix that
@quartz kindle Thanks so much โค
๐
Now time to figuer one other thing out
xD
I need to be able to get the username that used to sign up
and put it in the top right corner
as kinda like a profile type thing
you're storing the auth in a cookie right?
your best option would be to change from static files to dynamic files
that way you can generate the html you need
and inject data for example
Wdym
instead of sendFile(file)
use send("<html><body>blahblahblah</body>")
you build the entire html file as a string
so you can take data from your database and concatenate it with the html
essentially its the same as what php does
and node can be a php replacement
Could use a template engine
Eh
I was going to use ejs
but nah
I like it how I have it for now
When it comes to it I will change it up
the whole point of using node/php is to be able to change your html based on your needs
and build it the way you need
but you cant do that if you use static files
other than that
you can pass the data you need somewhere else
for example as a query parameter, or as a script file, or even in localstorage/cookies
and access it from client side
Reee
Lets just go with I like it how I have it
Thanks for the advice though :>
I will definitely change it up sooner or later I just don't have the energy to do so rn
you can even build your own templating
for example
put some pointers in your html file
for example "%%USERNAME%%"
Well
then import/require the html file as a string instead of sending it directly
and use string.replace
I wanted to make it so it said Username already exists
then send
but that didn't work
Guys, i want to use the invoke coroutine but i don't know how to use it. Could you help me ?
I want to call a command inside itself
do i need to define a callback inside the command ?
@quartz kindle
Ejem.
Can you explain something to me?
About a code that can not do it?
i mean, I do not understand how to do the code
The command will ban all raiders ids
In other words, for example: I make this command. p! nids the ban of 500 malicious ids has been successfully completed.
@quartz kindle
Ignored...
xD.
Stop spam pinging him
anyone else that attends me?
Not everyone is online 24/7
Good.
I've seen Bots that have that command and do nothing
?
How do I change the background of my description?
i told you before unicode
use split to get an array of ids, then loop over them and ban one by one
you will need to use .fetchUser and .ban
Is there a Discord API library documentation for TypeScript?
Can someone help me? I made a bot, but I do not know how to get to the coding part, I know how to code, but I dont have the link or how to get there.
@upper tundra No..?
Typescript is still javascript, so you should be able to use any javascript library
@earnest phoenix You will need to be way more specific.
Oh Okay
What language? what have you looked at?
iTexlo
@bright spear only discord has the right to determine and classify "api abuse"
I recently made a bot with the help of someone, but then they had to go

I finished making the bot
I don't know like where to code it
Where are you running it?
My discord server
You code it in a file
@earnest phoenix I said probably
You need to know a programming language
Amy I recommend learning a programming language. There are many examples online such as sololearn and udemy
@earnest phoenix pls stop k thx
It's advise
There is exaggeration for a reason
Just really bad advice I may add
You're taking it too seriously

Hoist this is a development channel meant to help people. You can't always assume
I take helping others seriously, especially people who appear to be clueless
the lessons cost money @night imp
Sololearn is free iirc
It was a clear exaggeration No need to get hot over a simple statement
there are some free courses in udemy
According to the reviews, yes they're pretty good
in udemy
what lessons should i take
I recommend JavaScript for beginners, then node if you want to code a discord bot
first you have to learn the principles and concepts of programming
then you can choose your starting language
such as javascript or python
you can make anything in any programming language (considering that they're turing-complete) however javascript and python are popular choices
technically, those are scripting languages
Never said they weren't
and actually
javascript is a high level programming language
Sure sounded like you called them programming languages ๐
same goes for python
scripting languages are also programming languages
^
those terms aren't mutually exclusive
Meh...thats a weak argument
Not really
it's well known across the development community.
some people may misinterpret their exact definitions
Scripting = Interpreted, Programming = Compiled
no

GG
I just lost 20 IQ from that statement. I'm outta here
See ya!
But thats how I learned it way back when, Im sure that hasn't changed
Yea it's a general misconception
here take a look at this post
wow
ninjad

"Scripting languages are programming languages that don't require an explicit compilation step."
Yes
"Scripting languages are programming languages ..."
It's a bit more complicated than that
I'd say
Btw Fishy I had a question
I know you use Go
Well then why even call it a scripting language, lol.
Lets just call all programming languages "programming languages"
why do you chose go for bot development? @keen drift
I was curious about it
Good answer
I mean not saying it's not suitable
just wondering why
I personally am not experienced with Go
Because its fast and easy to learn
Concurrency is easy, scalability is great
Hm
I myself am writing my microservices in go
was really looking to try out other stuff
how does it compare to C/C++, is to too "broad" / low -level
does it leave many things to the developer?
Go is still high level
or is it more abstract
I see
I mean technically C/C++ are high level
it still has cgo
You can call c code from your go app
last time i tried mixing c and go it didn't work at all
tho it was windows so 
I'm guessing it's built on top of LLVM
yes
fairly easy to learn tbh, but still premature
No, it isn't built on top of llvm
Huh
But there are ways to use it if you want
I think it uses clang?
let me see what it is inspired from
clang is arguably part of the LLVM infrastructure/toolbox
https://github.com/go-llvm/llgo
Here is a true llvm compiler for go
I see
It's not official aparently
That's okay anyway
goroutines are great by the way: they're fast, much cheaper than system threads, and don't take much time to learn
Hm
Also no semicolons in go 
So its a pain when Im switching between go and rust and JS
Because the latter use semicolons

there's still semicolon to separate statements
now just needs to get rid of the gc :^)
Js doesn't need semicolons tho
Well in most cases it doesn't
there was one with decimals
which was interestin
I read about it not so long ago
0.1 + 0.2 !== 0.3?
Rust doesn't have async in stable, ouch
Gotta use nightly for that
At least it's coming
which is a good sign
Isn't rust by moz://a?
Yep I think that was it @inner jewel
I saw in an article that yelp and cloudflare use it (discord does too)
@bright spear Yea I think they do.
rust is 1% writing code, 99% convinving the compiler my iq is higher than 5
my iq is lower than 5
it's pretty much this
@bright spear do you know what discord uses rust for?
they use it for backend stuff
Here's the image
Oh there's an official rust server
Yea Im on it.
https://discord.gg/rust-lang probably
Found it
spot on
when my bot pfp is floating.
it's kinda, transparent border there
how i can remove it
const discord = require ('discord.js');
class ServerSupportCommand extends commando.Command
{
constructor(client)
{
super(client,{
name: 'support-link',
group: 'simple',
memberName: 'support-link',
description: 'Sends a link to my support server! :D <3'
});
}
async run(message, args)
{
var SupLink = new discord.RichEmbed()
.setTitle('My Support Server')
.addField('Click the title to join the Support Server for my bot, but remember. Always follow the rules, and there will be punishments if you do not.')
.setColor('00FFFF')
.setURL('(discord url here changing this so it doesnt ``advertise my server``')
.setFooter('Thanks for inviting me :D')
message.channel.sendEmbed(SupLink);
}
}
module.exports = ServerSupportCommand;```
any reason why this comes out as: ```
My Support Server
Click the title to join the Support Server for my bot, but remember. Always follow the rules, and there will be punishments if you do not.
undefined
Thanks for inviting me :D```
the underfined part
The fields value is undefined
ty fixed it
so to test if a player has any of a certain three roles, and then if they have any of those roles, the command stops```
with this command:
``` let faction1 = member.guild.roles.find('name', 'Warlocks');
let faction2 = member.guild.roles.find('name', 'Dragons');
let faction3 = member.guild.roles.find('name', 'Hunters');
let chance = Math.floor(Math.random() * 3);
if(chance == 0)
{
member.addRole(faction1)
message.reply('You are now part of the Warlocks!', {files: [__dirname + "/FactionPics/warlock.jpg"]});
}
if(chance == 1)
{
member.addRole(faction2)
message.reply('You are now part of the Dragons!', {files: [__dirname + "/FactionPics/dragon.jpg"]});
}
else
{
member.addRole(faction3)
message.reply('You are now part of the Hunters!', {files: [__dirname + "/FactionPics/hunter.jpg"]});
}```
"name": "WelcomerDarkLegendBot",
"version": "0.4.0",
"description": "Welcomer bot for Discord",
"main": "bot.js",
"scripts": {
"start": "node bot.js"
},
"keywords": [
"discord",
"bot",
"welcome"
],
"author": "DarkLegend",
"license": "MIT",
"dependencies": {
"discord.js": "*",
"canvas": "*",
"snekfetch": "*"
}
}```
I am using this but it's not installing anything
idk why
Did you run npm i
Can u paste the error message
ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@2.3.0 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@2.3.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Utkarsh\AppData\Roaming\npm-cache_logs\2019-01-14T07_33_39_879Z-debug.log
What's your OS? Windows?
Installing Canvas to a Windows machine is different than others, you have to install some other things before installing canvas, check here: https://github.com/Automattic/node-canvas/wiki/Installation:-Windows
lmao node-canvas is a joke
same gross installation?
still works a charm
once you get the initial installation figured out, its pretty straight forward
how i can remove this icon vote
i somehow got a system where i can just npm install and it does it all for me without trouble
.is-flex .btn-like img
then?
wait...
@languid dragon css .is-flex .btn-like img { color: transparent !important; background-color: transparent !important; }
is it like this?
why dont you just do display: none ??????
people abusing !important as always xD
In javascript Map()s, can the value be an object so i can access an object with myMap.get(value)?
wot
both objects and maps support objects as values
but maps support objects as keys as well, while objects do not
and map's .get can be used on any property
So basically, if i want to store certain data for channels in a map
let myMap = new Map()
myMap.set(message.channel.id, myObj)
myMap.get(message.channel.id) //will this return myObj?```
yes
yes it will return the object
const discord = require ('discord.js')
class JoinFactionCommand extends commando.Command
{
constructor(client)
{
super(client,{
name: 'join_faction',
group: 'factions',
memberName: 'join_faction',
description: 'Upon saying join_faction, I put you into a random faction!'
});
}
async run(message, args)
{
let faction1 = message.member.guild.roles.find('name', 'Warlocks');
let faction2 = message.member.guild.roles.find('name', 'Dragons');
let faction3 = message.member.guild.roles.find('name', 'Hunters');
let chance = Math.floor(Math.random() * 3);
if(message.member.guild.roles.some(r => ["Warlocks", "Dragons", "Hunters"].includes(r.name))) {
return message.channel.send("You already have a faction!!!");
};
if(chance == 0)
{
message.member.addRole(faction1)
message.reply('You are now part of the Warlocks!', {files: [__dirname + "/FactionPics/warlock.jpg"]});
}
if(chance == 1)
{
message.member.addRole(faction2)
message.reply('You are now part of the Dragons!', {files: [__dirname + "/FactionPics/dragon.jpg"]});
}
else
{
message.member.addRole(faction3)
message.reply('You are now part of the Hunters!', {files: [__dirname + "/FactionPics/hunter.jpg"]});
}
}
}
module.exports = JoinFactionCommand;```
thats what the code is. but no matter what happens, no matter if i have the role or not, it sends "You already have a faction!!!"
Any help?
???
you should probably change it to look for roles of the member, not roles of the guild
you're checking if the guild has one of the faction roles
if(message.member.guild.roles
probably just member.roles
weird, it should work
member.roles returns a collection of roles
you should be able to use .some on them
Wouldn't it be message.guild.roles? not message.member.guild.roles?
.member also contains the guild property
member has a guild aswell it wouldve worked anyways i think

well, for checking if the factions exist, message.guild.roles would be better
for checking if a member has a role, it should be message.member.roles
Can I somehow add an empty line to a field value?
a new line or blank?
The field value already has stuff I just don't like how close to eachother the fields are
So I would like to add some extra space between them
\n should work i think
you should be able to add a new line at the end
It doesn't display the extra line if it's just \n
try \r\n
what if you start the next field with a new line?
Could you make a new field and have the name a zero width space?
yes
Starting it with a new line doesn't seem to display either
you canโt customize embed widths
oh ok
how to ignore dms?
you can check for channel type
message.channel.type
dm - a DM channel
group - a Group DM channel
text - a guild text channel
voice - a guild voice channel
category - a guild category channel```
tnx
ok fixed xd
Someone help me? 
Don't just ask to ask directly put your question
Iโve been Tryna Figure out How to Embed something for nearly 3hr Now And i donโt get how to do it If you could help me id apprecaite it if some one would Explain @here
<@&264889767072628742>
smfh
๐คฆ
this kid
tagging here and moderators at the same time
dont tag all mods @fringe rover
Wut mode shal i tag?
Ow sorry Bro Im new ๐ช
there are like 10k people in this server just have some common sense
White names == Newbies confirmed
@violet jetty stop, please dont attack whitenames
it makes the entire server look bad
Sorry sir 
Bro J WANT MY MESSAGE TO BE NOTICED?
Iโve been Tryna Figure out How to Embed something for nearly 3hr Now And i donโt get how to do it If you could help me id apprecaite it if some one would Explain @here
jfc
moot

called it
a
Does .fetchUser even if they arent in a server with your bot?
I could just test it
Lol
it should
So thats how people get users if they arent in serevrs with it
Alright thanks
servers*
Guys, how can i get a channel that the user called a command ?
read ๐ the ๐ docs ๐
Discord js? also ^
O
discord py rewrite
idk python, but i see people using ctx.channel or message.channel
you can probably find it in the docs
Hello, I'm trying to make my own bot using this guide https://www.digitaltrends.com/gaming/how-to-make-a-discord-bot/amp/ but I got this error and I don't know where I went wrong. can anyone please tell me how I'll be able to fix this.
do you know any programming languages @sonic robin
- Don't use discord.io
- Don't use outdated tutorials
- Learn a programming language
I'm sorry but all I'm doing is copy, pasting what the guide said.
Thank you Turtle and r0b0t for noticing me
that tutorial is outdated and overall pretty bad
I'll learn a programming language indeed
Id suggest dont copy either. You learn more by doing it yourself. Also debugging is good for learning, atleast it helps me.
were you guys aware of this:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_templates

Guys, is it possible to a bot play a mp3 file ?
Yes
๐ฎ
Ty, tim
Have any text in the documentation (discord rewrite) talking about it ?
No idea, i dont work with py. But discord accepts audio streams, so you need to open the file as an audio stream, possibly convert it to something discord likes, like opus stream
And then send the stream to the voice channel
Look for voice channel documentation
Anyone know how to host a bot?
check pings
depends on the language
I use node.js
but you first need a server, so read the pins
Ok
pins*
How do I make my bot list the servers itโs in and say how many servers it is in?
what lib and lang
Discord.js/discord.js-commando and JavaScript
<client>.guilds is a Collection of all guilds your bot is in
so <client>.guilds.size should give you the total amount of guilds your bot is in
how would i list how many servers my bot is in, rather than how many servers my bot has joined?
Can bots set the slowmode of a channel? I'm using JDA's setSlowmode() and it's not changing it, but when using getSlowmode(), it shows the updated number until changed manually through the discord client
define not changing
It's the same it was before he used setSlowmode()
if getSlowmode() returns the value you set
then it did change
because the values returned by the getters are only updated on events, in this case the event with the new slowmode value
Hello, Could someone give me a hand with this? the code and error are in this: Removed
Where?
I did, several times. its in that eval
then it's probably in your custom eval function
erm, anyone with express knowledge able to help out here?
C:\Users\ThatTonybo\Desktop\discussion\node_modules\express\lib\application.js:214
this.lazyrouter();
^
TypeError: Cannot read property 'lazyrouter' of undefined
at use (C:\Users\ThatTonybo\Desktop\discussion\node_modules\express\lib\application.js:214:8)
at module.exports (C:\Users\ThatTonybo\Desktop\discussion\router.js:3:5)
at Object.<anonymous> (C:\Users\ThatTonybo\Desktop\discussion\server.js:25:20)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:279:19)
never encountered this error and heck idk where it's coming from
how is this undefined 
dunno, it seems to be an express error anyways
did you do something like function.bind(undefined)?
no?
/shrug then
i haven't touched node_modules at all 
that's the only thing i can think of that could do that
i'm not modifying express's internal code
oh
router.js
try deleting node_modules and reinstalling
try sending router.js
bet
module.exports = (app) => {
/* account handling */
app.use(async (req, res, next) => {
if (req.session && req.session.user)
res.locals.u = req.session.user; else res.locals.u = null;
next();
});
/* routes */
app.use('/', require('./routes/app'));
/* 404 */
app. use(async (req, res, next) => {
return res.status(404).send('404');
});
}
okay send server.js as well
is there some way to initiate a phase, let's say using !start
and it sets a variable, say counter, to 0.
every time a person types !plus, the counter goes up one.
every time a player types !end, the counter is reset and !start is needed to restart it.
lang: js
is there a way to do it without databases
like maybe with a while loop that waits for another command? or does that not work
while loops will make your bot freeze
oh right, because it reads each command independently?
while loops block everything else, new commands will never come in
ah ok
you can do it without a database, you have one of two options:
is a text file plausible for this
do it in memory: fastest and simplest, lose all data on restart or crash
use a json file or another flat file to save states and load them on startup
how would I do it on memory
create a global object, and save data to it
for example js const database = {}
then when people use a command
database[userid] = some value```
you can use .txt, but .json is better easier to use
ok
but if you're gonna use files, there are a few best practices you should follow
for example, dont read and write to it every single time a command is used
so it gets a bit more complex
i feel like I should know this
but I'm trying to clear the contents of a file so I can rewrite oit
rewrite it*
i tried using RegEx but that didn't work
(js again)
what
what does regex have to do with clearing a file?
just js.writeFile/fs.writeFileSync it
?
those already overwrite all contents
So am I retarded? (Rhetorical)
Discord js, btw
I've tried using || aswell
but obviously that'd be true
you should really sourround more with parens @amber fractal
because right now its hard to visualize how you want it, and js has very specific OOO
well ... && (args[0] != "pet!help" && args[0] != "pet!adopt") didnt work either
After surrounding it
dont you need double equals because js is autistic
No
not with !=
Thats like strict not equal or some bs
Ill try it tho
if(!test || test2 == undefined && (args[0] !== "pet!help" && args[0] !== "pet!adopt")) doesnt work either
hello i want to help, guys.
i want to create a wep contorl to my bot, xd what's a language?
^3above, != is unequal
Thats what I want
I set this up if(args[0] !== "pet!help") console.log("not help") if(args[0] !== "pet!adopt") console.log("not adopt") and it does work, so idk why the inital one doesnt
wtf is that spacing
so why does it work here ;-;
because your logic posted above is probably flawed
Its copy pasted
Using this I think I found the error tho
nvm
I got it, it works with if((!test) && (args[0] !== "pet!help" && args[0] !== "pet!adopt")) now
@amber fractal do ||
$setrole Bot Developer



