#development
1 messages Ā· Page 554 of 1
ok
args is split by space. I dont want just any command. Only those 2 specific can be used if you arent in the db
It works anyways
Theres a reason i made it equal to pet!help or pet!adopt. If you trued to do anything else and you werent in the db itd break
Like i said though, all working, thanks tho
Whenever I attempt to add a bot into a server. It never allows me to add bots on this account. It always asks for an account that's not even in use or I have used before. I am not sure how to direct it to this account.
Wait. I was guided.
Gimme a moment.
I dont understand
My english is so bad
French and Russian
if its not development related keep it out of #development
Thank you! @languid dragon
can anyone help with custom server configurations pls???
<Array>.toString() will do that for you
to slow

@amber fractal yes
Hey how can I set my bot up so it sends a message to all servers notifying them of a scheduled maintenance?
(I am using the discord.js library)
dont do that that's considered api abuse
post a message about it in your support server
Or have a message that is displayed on the help command or on a common used command
^
^
need help
got this code
i type !ping
and no respond
but console look like this
bot is just unable to send messages but he got admin privileges
try !PING
not working
i upper case the message anyway
it gets in the if
its just not sending the msg
it worked perfectly fine yesterday
i just restarted the bot today and all is now fk up
So I'm using hyper crate, is there's a better way of parsing query string
https://i.imgur.com/bzevkkK.png
my problem is solved
i had to type "return" in front of every message.channel.send()
you shouldnt need to
for music?
quick google search.. would this be useful?
idk JS. So :)
it was command handler.
dispatcher.setVolumeLogarithmic(args[1] / 5);
i know,.
dispatcher is here.
yes
I had one bot with system for that but i deleted it (i use lavalink now)
maybe somone can say me how i can get date when i the user joined the server which sent the message?
lavalink gang
king salt have you checked the docs for your library?
^
you are defining something wrong then probably
Oh i actually still have that project somewhere on my pc ššš (if you really need to use ytdl)
can u show us your on join code
maybe i dont use command handler...
but thats gonna a little more harder
you should use command handler
You still can use it
sender..guild.joinedat = undefined
With this method i used xd
sender.Username is correct tho?
how
yes sender is message.author
he has lowercase mb
.joinedAt is a property of guildMember
yes you will have to define that same user as the guildMember object to get joinedAt
user and member are two different things
for example:
message.author = user (contains user account info)
message.member = member (contains user guild info for the current guild)
why don't they just merge them into one smh
ah ok
lemme try i
you cant merge both, because one is available in dms, the other isnt
unless you define a bunch of null properties
Hi, I bought a bot 4 days ago in the discord bot list but I still can't get the patent
Wait nvm my picture lol
i have a feeling english isnt his first language
i not speak englist
unexpected token return.
exports.run = async (lofi, message, args) => {
dbl.hasVoted(message.author.id).then(voted => {
if (!voted) return message.channel.send('dbl problem: vote the bot first, use `lofi upvote`')
if (voted) {
if (message.channel.type == "dm") return message.channel.send("unknown error: launched in dm.")
if (!message.member.voiceChannel) return message.channel.send("unknown error: join the voice channel.")
args[0].replace('/\%/g', '')
if (!args[0]) return message.channel.send('volume: please supply the number')
if (isNaN(args[0]) return message.channel.send('volume: not a number')
if(args[0] > 2) return message.channel.send('volume: it can be set in range 0.0 - 2. **`ex: lofi volume 0.4 (0.4 = 40%)`**');
lofi.connvoice.dispatcher.volume(args[0])
lofi.connvoice.dispatcher.setVolume(args[0])
message.channel.send(`volume: ${args[0]}`);
}
})
}```
I don't see the problem there
eww people who dont use brackets
try rewriting all those ifs as if(...) { code }
and you'll see the issue
ok
most likely when you call this module you don't have a break; before the client.login()
tabbing hell 
also args[0].replace('/\%/g', '') https://i-was-scammed-by.dabbot.org/7e7fe9.png
strings are immutable
that line is useless
so, am i gonna remove it?
take the string out of the array first
const [volume] = args :^)
hacks
also I'm assuming you're using JS which I have no knowledge of so it's sorta useless either way
@dull idol what is dbl defined as?
eto...
look at the docs
u gotta do something like const DBL = new dbl('token', client)
const dbl = new (require('dblapi.js'))(token, client)
tbh natan i hate npm modules that u hv to make a class when u don't need to
some one maybe knows how i can easy short this without the timezone?
@fiery nebula there is a timestamp property for embeds
setTimestamp(...)
iirc .joinedAt returns a Date object, so you can mess around with that
ahhhh
or use discord's built in timestamps
which adjust the time into each user's timezone when displaying
i just want the Date
xd

It can take up to 5 minutes to register each vote
iam to retarded to shorten it send more help
nevermind, it worked.
I tell someone to vote my bot. And, it worked.
So yeah.
Done, just wait some votes
(node:7536) DeprecationWarning: Collection#find: pass a function instead
what the hell is it
let role = message.guild.roles.find('name', argss);
find(x => x.something == somethingelse)
yes
setTimestamp(...)
can you make me an example?
@fiery nebula it's automatically posted the normal timestamp
.setTimestamp is available for Embed.
.setTimestamp(new Date()) is enough
ah ok
wow
And if i want to Include Text in that Line? Cuss i want to display "Member since: "
ah
if(!message.member.hasPermission("MANAGE_GUILD")) return message.channel.send("Vous n'avez pas la permission nƩcessaire.")
if(!args[1]) return message.channel.send('Utilisation\n`*roleall <rolename> add/remove`')
let role = message.guild.roles.find(r => r.name == args[2]);
if(!role) return message.channel.send('Role Inexistant')
if(!args[3]) return message.channel.send('Utilisation\n`*roleall <rolename> add/remove`')
if(args[3] === "add") {
message.guild.members.forEach(member => {
member.addRole(role.id)
})
return message.channel.send(`Ajout du role ${argsss} a **${message.guild.memberCount} utilisateurs**`)
}
if(args[3] === "remove") {
message.guild.members.forEach(member => {
member.removeRole(role.id)
})
return message.channel.send(`Retrait du role ${argsss} a **${message.guild.memberCount} utilisateurs**`)
}```
What is the error
I dont have error in the console
WTF is going on with discord
bots always go offline for no reason
JavaScript:
.addField("Invite", message.content.split(/(https?:\/\/)?(www\.)?(discord\.(gg|io|me|li)|discordapp\.com\/invite)/).join(""), false)
This when ran, returns four g's. Shown in the example below, however, I want it to display the exact invite. When posting an invite link, it only has 2 g's:
Anyone know how to fix this?
Btw, thats a fake link. It doesn't work. Kthx
"testetest"
btw thats a fake link
Ye
I just spammed test for the link
Pretty sure thats not actually a link š
Just, anyone know a fix plez?
Ow
I done it completely wrong anyway nvm
why are you asking me?
Bc i thought your th person who will know sorry about The ping sorry didnāt realise
Ow Sorry
Really
sorry
I didnāt see that
ā¹ļø
How do i Embed Something ?
You code.
Like Reaction Role
Thank you
...
let Eucid = new Discord.RichEmbed()
oh my fucking god
I have a tutorial.
How do I command it
It will help you how to command it.
@fringe rover what im sorry
.setTitle('Test')
.addField('Hello', "Hi", true)
.setFooter('Testttt')
console.log(Eucid)```
Politely but firmly
Look
@fringe rover This is long version: https://anidiots.guide/getting-started/getting-started-long-version
But easy to operate.
So, first. There was a command named Ping and you can try it by yourself. :)
I dont understand what do you want
I dont understand everything i dont speak english
What do I command it on

@last ferry It's like. How to command or. How to operate it.
But yeah, hope An Idiots Guide help Eucid.
I know I was just repeating what he said lol
How to operate it.
How to command discord bot

how to add two response in one command ?
ez
just put
How do i add MEE6 to my discord?
if (message.content.startsWith("ping")) {
message.channel.send("pong!");
}
if (message.content.startsWith("pong")) {
message.channel.send("ping!");
}```
Click invite on the bot page
no no i'm not stupid at this point xD just my english is bad, just when i make >ping this respond me "Ping" and when i remake ping command he rspond "Pong"
@faint topaz i dont understand
@earnest phoenix was a joke no worries
i make a roleall command and i want if i make command one times is add role to everyone and if i make command two times is remove role from everyone
uh
just
check if they already have the role
and remove it if they do, else add it?
@faint topaz kinda nsfw?
I don't think you're allowed to mass add/remove roles
nsfw?
?nonsfw -> one times -> added
?nonsfw -> one times again -> deleted
Oh. Add role to everyone.
define mass
I think it's prohibited.
but yeah it would be a lot cleaner to do it individually either way
Plus itāll get your bot rate limited a lot
Why would you add a role to everyone? If everyone has the role, the role is useless?
true
where I come from everyone is admin
mass anything is doing something for more than 5 times with no rational delay between the action
š
Mass -> Rate Limited -> Your bot get banned -> Your account get banned
Not banned, just blocked.
If everyone needs a certain thing
You know...
most libs prevent you from hitting discord ratelimits
Then just add that thing to the @everyone role
Then just remove that permission from the everyone role again
oh yeah
Guys, could someone help me ?
I'm trying to call back a function using the invoke command, but i'm doing something wrong.
https://hastebin.com/raw/ihakojeyid
sometimesimretarded
Oh no, it's python
Python
why mad

I just need help lul, don't need to fight
It requires 20iq when you're just copying shit
you don't need to fight *
Which also applies to any other language
Don't fight tho'
than your lifee
I almost picked python for Aikawa
good thing I didn't cause idk what the issue with your code is.
:/ ty, EXI
It's like the invoke command isn't working correctly
Because the bot delete the message
but not invoke the command again
Would anyone know how to make a NSFW channel check in discord.py (THE NON REWRITE VERSION) I have asked this before since discord.py doesnt include this feature and i was wondering if theres a web request i can make with the requests library that would use the discordapi.
So um whatās stopping you from getting the rewrite version?
The rewrite exists for a reason
Im trying to make a thing that checks for racist words in the names people choose for their pet on my bot. Obviously I don't want to allow them to do this, I know how to make a profanity filter for stuff like this, but how do I check for things like spaces and numbers or things like that in place of cetrain letters?
no google did not help
Regex maybe? Idk
word filters are useless, there will always be a way to bypass them
If they use it even once they get blacklisted eternally
I dont really care, I just dont want someone with a pet that has the n word as its name
You always get people like that
the 10 year olds who think they are funny
Make it toggle able
not everyone wants a word filter
No one needs a helicopter parent on discord
@slim heart it's probably cus they don't want to rewrite everything
Don't use quick db
On glitch
Problem solved
Why
Dont use glitch
Hmm
unmalform the db
?

How
idk lol, start from scratch. I've never even looked at quick.db perhaps you're adding invalid characters somewhere
This is database file
waw
oof ur on ur phone
Yeah
check ur pc
Don't fucking use glitch
@wanton walrus y
is quickdb json?
I dont want waste my money to vps servers
@mental solstice sqlite wrapper
@earnest phoenix use better-sqlite3
sqlite3 to be exact
thats the best
no
better-sqlite3
Sqlite is not a good choice for a discord bot lol
mine works fine
I use it
well i use enmap
enmap is fine tho
Huh
@earnest phoenix r u tryna do levels?
Yes
oh dm me
All quick.db commands are broken
dont use quick.db
what api
Discord.js
@amber fractal has your problem been solved?
anyone know how I can scrape a embed previously sent by my bot for information
message.embeds should give you embed information
split the received message into args
are you using js?
yes
you can split a message using message.content.split(" ")
that will give you an array of words
in my command handler
because im using a ch
module.exports.help = {
name: "help a",
aliases: []
}```
and this doesn't work xd
you have to use the help command
inside the help command you need to check if the argument is a or b
does you command handler have args?
do you have something like (client,message,args) or whatever
const discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
}
module.exports.help = {
name: "help",
aliases: []
}
yeah
instead of client bot tho
so args should be an array of words taken from the message
mhm
try checking the contents of args in your console
How do u do something simple like giving a role for 5 minutes and then taking it away
so
if you type help a you should either get ["help","a"] or ["a"] in args
@sturdy delta you can setup a timer
okay so I need to make a checker
but if the bot restarts or crashes, the timer will be lost
unless you use a database
if(args = ["a"]){
}
u mean => ?
oof
there are good resources pinned
string = "content"
array = ["content1","content2","content3"]
ehm
an array is a list of values
Could someone explain to me how to use a database
its not a single value
Because thatās the answer that everyone says to all my questions and then they donāt explain how to use a database
array = ["a", "b", "c"]
there are many database systems out there, so first of all you need to chose one
@quartz kindle im using it on a reaction event can i still use message.embeds?
@sturdy delta use a database, duh
for example, a simple sql database is sqlite3
it doesnt require a server, and its not hard to use
but you need to learn a bit about the sql language
its quite different from javascript or python
another option is to use a nosql database, that is easier to use, and more similar to javascript objects, such as mongodb or leveldb
mongodb is a bit hard to setup tho, and requires running a server
so first of all try googling a bit about databases, their styles and use cases
@desert bough you can do reaction.message.embeds
i think
@earnest phoenix do console.log(args) in your help command, then type something like help a
and tell me what shows up in your console
so wait
I got my help command ready
const discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
let hembed = new discord.RichEmbed()
.setColor("#ff852d")
.addField("test", "1");
message.channel.send(hembed);
}
module.exports.help = {
name: "help",
aliases: []
}
can u use this without the time?
try it š
oof im scared of it breaking
u can do ctrl + z
ok
aight tim
if it doesnt work, just put it back
I did this
const discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
var cmd = ["a", "b"];
let hembed = new discord.RichEmbed()
.setColor("#ff852d")
.addField("test", "1");
message.channel.send(hembed);
}
module.exports.help = {
name: "help",
aliases: []
}
Wait wasn't I supposed to do it
nope, you're supposed to learn how arrays work
how do you access a value in an array?
also, do you know how to use console.log()?
@earnest phoenix yo g
console.log is extremely useful to debug code yourself
yeah?
Console.log(args)
so you dont code blindly
if you're unsure whether something is working or not, or unsure about what the problem is, you can literally "see" the contents of all your variables and see exactly what values they are getting, modifying and creating
by using console.log
so you dont go around guessing things
oh thanks š
i told you to try using console.log(args)
so you can see exactly what args is, what values does it contain
and proceed from there
Yay I got it right š
weird
i dont see anything wrong there
except that you dont need to pass an empty object
you can just omit it
wdym
(accept)
ok
but that probably isnt the cause of your problem
do you have any other console.log ?
yes but for other commands
try .catch(e => console.log(e.toString()))
instead of catch(console.error)
although im pretty sure thats the the cause either
Thatās not even how catch work does it?
still [object Object] on output
Donāt you have to do catch(error=> or .catch(error) {}
im not actually getting an error its just outputting it as [object Object] for some reasoon
so .then is never being executed?
try to add back the timer then
put it on like 5 seconds
whats that in miliseconds
Try like error.message
wait a min
it works but problem is i dont want time to expire
you're not using async await, and not using .then on msg.react
but it also outputs the same thing again
so isnt the collector getting your own reactions as well?
yes
if you remove the timer, it stops on the first reaction, i think?
so it starts and stops immediatelly? im not sure though, i havent used awaitreactions myself
in the filter probably
else just wait for your reactions to finish before you add the collector
if you use async await, you can await msg.react()
else you need to msg.react().then(msg => msg.react()).then()... i think
const accept = (reaction, user) => reaction.emoji.name === 'ā
' && reaction.user.id != bot.user.id; would this work for the filter
i think so, or simply && !reaction.user.bot
still accepts teh bots reaction
ok
how does that even work wouldnt it have to be return boolstuff not just boolstuff
or something. idk
@desert bough
or am i just wrong
nvrm
im wrong :p
How to image manipulation in js
Like when u check rank on mee6
I've googled
But like
idk
If someone could point me in the right direction that would be nice
@late hill you can try jimp i think its called
@slim heart if it's a single expression you don't need return
yea ik im dumb :D
(a) => a.b is the same as (a) => { return a .b }
Anyone can help me in java script?
jimp is slow af
use sharp instead
or canvas if you're going to generate your own graphics
have any of you ever used a RPI?
i dug out my RPI3 and wanted to know if its possible to set it up as a music server that i can transfer music to, then when wanted my surround sound system takes it from it
canvas is great
@sick cloud well just make it store the files sent to it in a directory and then make like a localhost page where you can select the song and then connect to it over your local network then when pressed the rpi will play the music which should then have a built in headphone jack that you can use to connect to all your speakers or if you have a stripped down make audio lines go through gpi pins and solder it to a 3.5 jack etc.
can't hook up the system to the actual surround i think, but okay
why not?
my idea was the surround (which is a Sony, top line stuff) would stream it or something
we already use all the ports
you could use an external usb sound card that supports surround and stuff
use a split 
i'm trying to avoid using extra hardware or stuff
might read the manual and see if it has streaming
since it does connect to the wifi
well in that case itd be even easier lol
if it connects to wifi, it should support streaming
shouldā¢
inb4 connects to wifi for no reason
wait if i got a usb to usb, could i use the rpi like a usb?
not afaik
and i plug it into the system's external port and use it like that
what does that even mean
you'd need to have a dedicated partition and configure it accordingly to be accessible by external usb
the OS cannot make its own partition available
dang it
you can use the gpi pins and a usb connector
talk about painful 
https://www.hawkusa.com/manufacturers/pan-pacific/connectors/usb-am-bk use somethin like this
or if you want it to look nice https://www.onlinecomponents.com/bulgin-components/14193-10818899.html
or take a usb u dont care about and strip it to get all the wires and tin them or something to work with jumpers and stuff
hm ok
if you have some extra p2 cables you can try connecting them together
before:
<-- ================= -->
after:
<-- ========|======== -->
|======== -->
or something like that
afaik that should work
is there some easy way in discord.py I can limit users from using commands until the bot triggers on_ready event?
Guys, hello!
Why my bot can't handler the error ?
I'm trying to force this but it doesn't send any message:
https://hastebin.com/raw/bukovezulu
The MissingRequiredArgument
@ruby dust the bot won't even receive any events before it gets the ready event
it does, actually, it's just a bit slower when it's still in the middle of caching everything
Are you sure? Because iirc the ready event triggers and then caching starts. I'm pretty sure that's how it is
I think you are mixing the ready and connect events
Nope
there's on_ready and on_connect
Yeah I know
whats the proper way to create a guild invite in discord.js
Ah well that's another issue. discord.py doesn't fire the on_ready event as soon as the bot receives the ready event through the API
In that case register the commands in the on_ready event handler
hm
@earnest phoenix ^
gotcha i just found that : )
is there such thing as this to make something only work in a specific guild?
if (member.guild.id === "...") {
stuff
}
yes
Hey, so my bot has a hug command that if you mention someone (ie. @user1) it responds with @kyle hugged @user1!, but it also supports multiple mentions. While it works with two, like @kyle hugged @user1 and @user2, three or more gets odd, showing @kyle hugged @user1 and @user2 and @user3! and so on. Would anyone have an idea on doing a little bit of grammar to check how many users are hugged and change it to, say @kyle hugged @user1, @user2 and @user3!? It's node.js, thanks :)
you can use a loop and check if the next item is the last
you can also join(", ") and replace last instance of "," with "and"
need help with sqlite on why this might happen SQLITE_ERROR: near "280815367662731266": syntax error
Code: ```js
let userDataMap = [req.user.id, req.user.flags];
let placeholders = userDataMap.join(',');
let userData = 'INSERT INTO User(id) VALUES ' + placeholders;
// output the INSERT statement
console.log(userData);
db.run(userData, userDataMap, function(err) {
if (err) {
return console.error(err.message);
}
console.log(`Rows inserted ${this.changes}`);
});```
node-sqlite3 or better-sqlite3?
anybody know why this is throwing an error? var globalArray = [ "531983325389389847", "532750205070737430", "534928293078761473", "531983926961504291", "531983516255387650" ];
Error: ```
SyntaxError: Unexpected token var
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
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:282:19)
Development Suggestion!Allowing a reaction message to limit your amount of reactions selected by any number the message maker deems necessary.
not sure if possible, as far as I'm aware (with my very little look into reactions) you can only remove your own one at a time, moderators (those with correct perms) can only delete all reactions. again I've not looked into it too much so don't take my word as gospel 
anyone with the manage messages permission can remove specific reactions
users and bots
did they finally remove var lmao
nope
@earnest phoenix either ur putting that somewhere where it cant go, or u didnt close something above it
yea the fbi is gonna be at ur house any second
itās fine iāll just move it to a json or something
@earnest phoenix can u send more code
cuz it should work there
but your code above it probably has an issue
iām on mobile Iāll send it tomorrow if I canāt resolve it
the things you discover about discord every day lol
I used to do a movie night in a reddit server and had to clear reactions bc some peeps would type out 'fuck off' in reactions or some dumb thing like that 
const Discord = require(`discord.js`);
let user = message.author.username;
let avatar = message.author.diplayAvatarURL;
module.exports.run = async (bot, message, args) => {
var avatar = new Discord.RichEmbed();
avatar.setTitle(`${user}'s Avatar`);
avatar.setImage(`${avatar}`);
avatar.setColor(`#36393e`); //transparent color code -Emerald
avatar.setTimestamp();
message.channel.send({avatar});
}
module.exports.help = {
name: "avatar"
}
@sick cloud thats what I used but what about getting rid of singular reactions? isn't that what the person was asking about? like limiting a messages reactions to only 4 different emojis for example?
use the reaction menu
accessible through the same area, "Reactions"
choose the emoji and use the x
huh TIL
probably a thing in discord.net 2.0 and not 1.0.2
could be in 1.0.2 I just didn't look hard enough
@quartz kindle any suggested way of that? Still new to programming here so it's a bit confusing.
ąøąøŖ
I was trying to get the server count on the website to work, but I am a bit puzzled. I put in my token for dbl and all above this chunk.
what's in console?
I think it is supposed to yes.
Was there anything in the console like Tony said
No it just says she's online and it works.
I'm pretty sure, I'll check again.
iirc it asks for the token and client, are you passing both the dbl token and your actual bot client
You can add a dbl.on('error', e => { console.log(e); }) aswell incase it errors for any reason, unless you have it already
Either way, i gtg to bed, gn
I have that already unfortunately, I think I might know the issue give me a moment.
Ah no, It's still not working. I'm not sure if I'm putting the client Id in the right spot hmm.
Id?
You pass the client dont you?
Yea the entire thing
You dont need an id
const dbl = new DBL('token-from-dbl', client)
Yes that's how I have it is, with the client. It's still not working.
And im guessing it didnt post and just didnt log then?
No it didn't, correct.
Then, im not really sure. Might be a website bug, if everthing is correct. Sorry i cant help
No worries! I'll keep troubleshooting. Thanks for trying to help!
āØ
so on a scale of crap to shit how bad is it when ping localhost times out
does python have an equivalent to package.json files
Python can use JSON.
@sick cloud No I don't think so, they share a global dependency store
@keen drift wdym ?
oh
Which is why on a lot of repos, they specify the dependency prerequisites ig
so i list my requirements in a json file?
I seen people mostly list them on the repo readme
i just want people to be able to install the dependencies like pip install or something easy
There's not really an equivalent to package.json
Uses almost sam syntax as in js.
Most ppl create a file called requirements.txt and list the names of the library's in there.
@sick cloud Although you can prob look into pipenv
okayy
pipenv can read requirements.txt to generate Pipfile
Idk if you want use heroku but from what I know heroku uses the requirements file to import everything too.
don't think heroku will help with making a game lol

Ps
@sick cloud if you want to make it as easy as possible for your client to run it make a python file with os system executions.
So that the client can install everything with one double click.
ok
And I would add a version to your libary.
So that if libary's get removed or changed and a new client tries it it works because it runs on the right (older) version.
Any better way of doing Either return type
https://i.imgur.com/YJPdECd.png
Maybe some improvements to the code (Works)
@keen drift do i see rust there
@restive silo yes
How to make changable prefix
have some file or database that stores prefixes for each guild and then have a function that determines the prefix
What is DBL token and what does it do?
dbl token allows you to access the dbl api
some routes need authentication eg: vote checking
why that happen? Nothing is undefined
<span class="select">
<select name="channel">
<option>Select Channel</option>
<%guild.channels.filter(z=>z.type === 'text').array().forEach(x=>{%>
<option value="<%x.id%>">#<%x.name %></option>
<% }) %>
</select>
</span>
``` im using ejs
guild = message.guild in d.js
Its show up
i mean in the website/dashboard
Guys
lemme try it
My bot does music , and I run it in PowerShell so when something happens is shows me th error
The issue is
I can't play songs in other languages I would need the link
As PowerShell does not understand those other languages
so the problem is not the js code, but the html
try it in a computer and use the inspector
to see how the html is being built
i have no pc lmao
rip
yeah
without inspector is impossible to debug a website loll
Bplay Ł ŁŲ±Ų¬Ų§Ł سجار٠جارŁ
Yea
Youtube
PowerShell does not understand that language nor cmd
try url-encoding it
wdym inspector?
Ctrl + shift +I
the problem is not power shell or cmd, the problem is that urls do not support it
if you put that in a search url in a browser, the browser will automatically url encode it
but without a browser you have to encode it yourself
Mm
you're using c# right?
oh then its easy
Alright I will give it a try when I get home
@wicked summit there is html server I could invite you to
If that would not be considered as advertising but those people are legends
wait, you said you tried hardcoded values and it still dint work
what did you try?
I try it in <h1><%x.name%></h1>
no... i mean this
<option value="test">test</option>
a hardcoded value test instead of using the x variable
to see if it shows up
if test shows up, then the html is fine
Its work
yeah then the problem is the js part
if you console.log them, does it appear in your console?
if all else fails, try using string concatenation instead of ejs
Can u give me example?
let string = "";
....forEach(x => {
string += `<option value="${x.id}">${x.name}</option>`
})
then insert string into your <select> using ejs
but first try console.logging
....forEach(x => console.log(x))
to make sure the channels are actually there
yeah i tried log it and successfully
an i tried console.log(x.name) and all channels name show up
so try building a string instead of ejs shanenigans
Whatās with the %ās
It's ejs
Oh ok
Ok thx
found your problem
<%= Outputs the value into the template (HTML escaped)
<% 'Scriptlet' tag, for control-flow, no output
you can go back to what you had before, just do <%= instead of <%
yes
š
anyone knows how to exclude files from nodemon bot restart?
i dont get an error, but it doesnt log
ur code now?
...
Wtf my bot is not responding and i have this in the logs
2019-01-16T12:19:23.744111+00:00 app[worker.1]: [Symbol(kBytesWritten)]: 2687,2019-01-16T12:19:23.744112+00:00 app[worker.1]: [Symbol(connect-options)]: [Object] },2019-01-16T12:19:23.744113+00:00 app[worker.1]: _error: null,2019-01-16T12:19:23.744116+00:00 app[worker.1]: url: 'wss://gateway.discord.gg/?v=6&encoding=json',2019-01-16T12:19:23.744117+00:00 app[worker.1]: _req: null },2019-01-16T12:19:23.744118+00:00 app[worker.1]: type: 'error',2019-01-16T12:19:23.744119+00:00 app[worker.1]: message: 'read ECONNRESET',2019-01-16T12:19:23.744121+00:00 app[worker.1]: error:2019-01-16T12:19:23.744122+00:00 app[worker.1]: { Error: read ECONNRESET2019-01-16T12 :19:23.744125+00:00 app[worker.1]: at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' } }
And my bot is online tho
My bot doesn't respond to a specific command serverinfo but it was before. There is no error and I've no idea why this is happening
pls help
@smoky mica try return message.channel.send("Test");
I just tried that and its not sending.
@fiery nebula No idea why. Lemme try something really quick
show me the code
i knew it wasnt the code lol
i tried deleting the file (copied the code ofc) made a new file and pasted the code in it
idk some weird sorta glitch
tf
let target = message.mentions.users.first() || message.author;
.addField("Roles", `${target.roles}`, true)
isn't it .roles
A GuildMember has roles a user object doesn't
we're already 2
@wispy falcon
What's wrong about add/removerole? https://github.com/Madmadz16/FirstBot
Well addrole isnt even a js file
Btw, regen your token and dont put it on github
You can view past commits
@rocky dagger
Also using find without a function is deprecated
The token isn't showing for me...
tfw you manually update every file on your repo
Just regen it
I am new to github
Just regen the token,it will be fine
yea I did that
@rocky dagger and then to answer the initial problem like what Steven said look up .find because itās different now
How can i use a custom emoji on my discord bot and it work everywhere?
Can anyone help me figure out how i can use a custom emoji with my bot and it works anywhere without it having to be a custom emoji on that discord guild?
In discord.js
Get the emoji from client.emojis
@earnest phoenix ^
How would i use them from in my command handler
Get the emoji and then send it with the message
const Discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
var canal = message.guild.channels.find('name', 'incidents');
let member = message.mentions.members.first() || message.guild.members.get(args[0]);
if (!member)
return message.reply("Mention a user please");
let reason = args.slice(1).join(' ');
if (!reason) reason = "Mention a reason please";
message.channel.send("They have been warned!");
let embed = new Discord.RichEmbed()
.setColor('#00d7ff')
.setThumbnail(message.author.avatarURL)
.setTitle(`Warning Case - #mod-logs`)
.addField('Moderator:', message.author)
.addField('User:', member.user)
.addField('Reason:', reason)
.setFooter(`Warned by ${message.author.username}.`)
.setTimestamp()
canal.send(embed);
}
module.exports.help = {
name: "warn"
}
I want it to show the emoji before the "They have been warned"
@slim heart ^^^
Just get the emoji and then do emoji + āthe have been warnedā
i have the emoji id but then emoji would be undefined
whatāre you doing to get the emoji
client.emojis.get("idhere")
That's not š„
Kinda is
If they donāt understand how it works then donāt just give them the line of code to do it let them figure it out
let emoji = bot.emojis.get("441123513466748929");
???
he still has to figure out how to send it
Yes
I showed him how to send it already thatās the part Iād give because that can get a little confusing
Thank yall for the help its highly appreciated!
Yea
Yo How do I get My Bot Online ?
@slim heart the emoji shows as "undefined"



