#development
1 messages ยท Page 597 of 1
How do i return the guilds bot count in discord.py
async or rewrite
rewrite
using discord.py rewrite, how can i make the bot be able to send join/leave messages on all the servers the bot is on?
or configurable so that if they want them they can set it up
@earnest phoenix bot.guilds is a list of Guilds your bot is in. Use len() on it
@earnest phoenix A database with keeping all the data
By data I mean the channel the messages will be posted in, boolean value for switching the feature on/off
And etc
okay thankyou
would you still have to have a database for 1 server if i was to put it on my server first then maybe doing all that later?
I would recommend starting with a database
Umm
I'm talking about displaying number of bots in a guild
i know how to display guilds the bot is in, lol
Oops

Iterate through guild members and see if member.bot is True
A list comp probably would do in your case
yea, i tried {len(guild.members.bot)} and it didn't work
A for loop
For each element in guild.members, check if member.bot is True
If yes, either add necessary info to a string or append to another list
@glass atlas, I don't know if any other methods from the top of my head.... is there some way you can have a print statement help you?
Nvm It worked
Awesome!
so ive got a urban dictionary cmd that works but how can i filter it or w/e and make it so nsfw words cant be searched in sfw channels
What library and language are you using?
D.js
message.author.displayAvatarURL
(node:1412) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body embed.footer.icon_url: Not a well formed URL.
I still get that error
With the same code snippet from above?
Yea
except replace
member with author
.setAuthor(message.author.tag, message.author.displayAvatarURL)
.setAuthor(message.author.tag, message.author.avatarURL)
That doesn't work
That says the footer is wrong. Not the Author
There is no url in the footer?
what is the footer
.setFooter("Requested by: ", message.author.tag")
Ah shit
It's text and then icon
Yeah. Lol
.setFooter(`Requested by: ${message.author.tag}`)```
ik
where is the best region to host a vps
china
Pls search
lol
you lost?
using `` but also using brackets
Smh do you understand JS syntax
i forgot that `` formats it as a dumb array xd
Wut
`` is so stupid in js
^
How tho?
How so? I find it quite useful
basically, it outputs an array of everything around template literals and a list of template literals
when you call it that way
its hard to explain without examples
Ahh I see now
x`a${b}c` == x(["a", "c"], b)```
its why you can do something like str.split`` and get a string split by every char
^ yes
if you wanna play with it, use thisjs function x(a, ...b) { console.log(a, b); } x`pass stuff ${here}`;
Never realized that was a thing
i learned about it because .split`` and .join`` saves you 2 chars each in golf
Go shit on PHP
no php is better than js
then stop doing shitty codegolfs?
cries in binary
>>> me.lurking_status
True
Yes, no php is better than js because js is better than all php
console.log(php > js) //expected output false
see?
Well the char codes are higher
Not a fair comparison
Incomparable results
Also it was evaled by a weeb bot 
And those are strings I wasnt using strings nerds
I had it defined in my mind
so like if they were using a command like -volume 0 and I am trying to set a limit between 0-200
how can I check if what they say is between that?
if (input > 0 && input <= 200) {
// adjust volume
}
You also might wanna use an else statement ^
you dont need to put else there 
unleess you want to inform someone about the possible choice
but he didnt ask for that instead he just wants to know if its between that
Ah thanks
I just gave a suggestion
I won't be needing an else though
just answer what the person asked because adding a lot of things can get it confusing
So what do you do if input is 0? @lusty dew
if you want to include 0
That if statement wont work with a 0
put = on input >= 0
Yea
but lmao just let them choose between 1-200 because 0 is essentially wasting your resources
Also, if input is a text instead of a number, it would crash :)
Thats why u wanna use else
what
There would be no point in making it 0 might as well just stop or pause the song at that point
that wont crash
It will
How?
it wont
It would just error
Well, yeah that ^
It is
oh look It CrAsHeD
But if the user puts a text instead of a number betwen 1-200 you would get a error
Tf u talking about, you guys have misunderstood me ffs
God
Oh shoot
It wont work because you inputted a text
Using big boy words now
Yes
the condition will output false
and WILL NOT EXECUTE THE CODE INSIDE {}
Lel
so it will not crash
Rip
smh answering questions when you dont have enough knowledge of js
Jesus christ the command wont work, it wont execute if the input is a text
Im black though wtf
No shit
ofc, it wont
We already established that
Scroll up and reread what i said
@dull bobcat doesn't change anything, please leave that kind of terminology out of here
If you repeat this it'll be a very extensive mute
@languid dragon literally told him that and he said it just to spite me 
YEAH READ WHAT I SAID AFTER



Wut you said after was
before you answer please do research instead of arguing / saying banned words in here
"It will"
Arguments are worthless without examples and evidence
"It will"
"it wont"
"it will"
"it wont"
does literally nothing
Saya provided evidence
I was joking...
if you want to refute their argument, respond with something intelligible, not the n word.
๐
im talking to him, not you
Oh
ye
Lol
SO basically like that?
*oof
did not mean to post the whole thing
Oh ell
LOL
Hm, it doesn't seem to be working.
No errors at all
show code for better debug
const Discord = require('discord.js')
module.exports.load = (client) => {
client.commands[`volume`] = {
conf: {
name: "Volume",
desc: "Sets the volume of the bot",
usage: "-volume 1-200 or @Clap Bot volume 1-200"
},
async run(message, args){
let input = args[1]
const player = client.music.players.get(message.guild.id)
if(!message.member.voiceChannel) return message.reply("You need to be in a ``VOICE CHANNEL`` to use this command")
if(!message.guild.me.voiceChannel) return message.reply(client.user.username + " is not in a ``VOICE CHANNEL``")
if (input > 0 && input <= 200) {
player.setVolume(input)
}
}
}
}
parse the input first
const volume = args.slice(1).join(' ')
if (!volume)
return await msg.channel.send('')
const parse = parseInt(volume)
if (isNaN(volume))
return await msg.channel.send('')
if (parse >= 1 && parse <= 500) {
if (!queue.songs.length) return
queue.player.volume = parseInt(volume)
queue.player.lavaplayer.volume(parseInt(volume))
} else await msg.channel.send('')
Use this as your reference
instead of parseInt you can use Number() but depends on what you want to acheive
works eitherways
basically converts the string into number
if you input something like 9a it will output NaN where in parseInt will output 9
well if you input 9, Number will output 9 in integer
Yea
I honestly forgot when using if statements
you didn't have to use {}
if you are going to only do one line of code for that if statement
if (true) stuff()
yea
if(!input)
return await message.channel.send("You need to supply a volume between 1-200")
const parse = parseInt(input)
if(isNaN(input))
if (input > 0 && input <= 200) {
player.setVolume(input)
}
SO basically this?
and replace
innput in the setVolume
with parse
btw yea it was the internet
you can use Number instead
Ah okie
if you dont want it to work that way
so basically Number(input)
then
const parse = parseInt(input)
if(isNaN(parse)) {}
use {} on isNaN because you have another if statement inside of it for the readability of your code
if(isNaN(input))
if (input > 0 && input <= 200) {
player.setVolume(input)
}
the second if there is your second if statement
or if you want to shortcut it
if (isNaN(parse) && (parse > 0 && parse <= 200)) player.setVolume(input)
if(!input)
return await message.channel.send("You need to supply a volume between 1-200")
const parse = Number(input)
if (isNaN(parse) && (parse > 0 && parse <= 200)) player.setVolume(input)
dont use input use the parse on setVolume
you are making the parsing of number useless if you do that
Ima test it out now
My bot told me I had to pick a number between 1-200 even though I put 2
UwU
wait @lusty dew isNaN means is not a number in ur code uh... u made it so it only sets if it is not a number
volume works between 0 and 1
0.1 would be 10% volume
are you appropriately setting the volume between 0 and 1?
or are you setting the volume between 0 and 200
I didn't know that is how the volume worked oof
what you should do is
let volPercent = volume * 100;
// do something with volPercent / set the volPercent with a new value
player.setVolume(volPercent / 100);
or something along those lines
im not sure how well Javascript handles decimals
so you're not using the dispatcher provided by d.js?
okay i was referencing this https://discord.js.org/#/docs/main/stable/class/VolumeInterface?scrollTo=setVolume
1 sec
yeah i figured
@lusty dew could you show what the const parse in console.log ?
@languid dragon uhh ur code is basicly doing nothing cause u multiplied by 100 then divided by 100
??
wait did he multipy it
// do something with volPercent / set the volPercent with a new value
o
i was referencing the way i handled it with my bot where i would get the value as a 0.4 or 0.5
i would then need to multiply by 100 to get it to a percentage and handle the percentage for ease of adjustments
the way my volume command worked is that it would slowly increment the volume by 10% until it reached the desired amount
so it needed the round numbers because added 0.1 to 0.1 is a nightmare with javascript IIRC
oo
@sinful lotus It logged 0
i feel like it would be similar, have you tried setting the volume with decimals?
@lusty dew what was your input? 0
completely ignore my help, i apologize lmao
const Discord = require('discord.js')
module.exports.load = (client) => {
client.commands[`volume`] = {
conf: {
name: "Volume",
desc: "Sets the volume of the bot",
usage: "-volume 1-200 or @Clap Bot volume 1-200"
},
async run(message, args){
let input = args.slice(1).join(' ')
const player = client.music.players.get(message.guild.id)
if(!message.member.voiceChannel) return message.reply("You need to be in a ``VOICE CHANNEL`` to use this command")
if(!message.guild.me.voiceChannel) return message.reply(client.user.username + " is not in a ``VOICE CHANNEL``")
if(!input)
return await message.channel.send("You need to supply a volume between 1-200")
const parse = Number(input)
console.log(parse)
if (!isNaN(parse) && (parse > 0 && parse <= 200)) player.setVolume(parse)
}
}
}
could you log the args for me
when you used the command?
because if parse is 0 then it could be messeing it input up
you want me to log input?
yeah try
wait a second
how did you console.log parse
if it returns in return await message.channel.send("You need to supply a volume between 1-200")
then the problem is your args
Alright
I think I fixed it
instead of args.slice(1).join(" ")
i just did
args[0]
xD
why not just
// assuming args is an array and the first argument would be the user's input for volume
if (args) {
const player = client.music.players.get(message.guild.id);
const toSet = Number(args[0]);
if (!isNaN(toSet) && toSet > 0 && toSet <= 100) {
player.setVolume(toSet);
} else {
// handle invalid number error
}
} else {
// no args error
}
xD
i was writing something up to help you understand the code and read it a lot easier
wait you copied my whole code?
I parse my args differently lmao
you shoudnt have copied my args.slice()
I was just doing whatever tbh
It is almost 12am
I am ready for bed
xD
Yeet vvolume is working
Thanks!
if (message.guild.me.voiceChanel) return message.reply(client.user.username + " is not in a ``VOICE CHANNEL``")
Alright so it says this message when it leaves but if you do it again, it says the message again even though it has already left
I can't seem to figure out how to make it only say it when it leaves
Should I make a second if statement?
and just check the opposite of what it is checkiing now and send different message
spelling
Hm?
You typed chanel instead of channel
Also that will error if the bot is in a voice channel
add !
I did
did you correct the spelling?
Yea
that would return if the bot isnt in a channel
party*
hah its a party than 
Yea
Ya didn't get the invite?
Also yea
I used the same thing for my join channel cmd
Which I just thought about
I could have used that as reference
can someone help me with making it so u cant use the urban dictionary with nsfw content in sfw channels? using discord py rewrite
channel.is_nsfw()
Hi
if (xo03.content("KYOGRE")) does not work
let xoargs = message.content.split(" ").slice(1); let xo03 = xoargs.join(" ")
๐ค why ur doing content("") dirently like that ;-;
?-?
i havent dont much checking of msg content but i think its something like:
if(xo03.content == "whatever"){
} else {
}
ยฏ_(ใ)_/ยฏ
AH bruh xuse me i'm stupid
normally it would be soemthing like that ๐ค
i hope u know this: but the else is completly optional xD
https://pastebin.com/VXiz9ypz doest not work, i'm stupide or tired ?
else if (xo03.content == "RAYQUAZA") { is not detect ๐ค
๐ค
T.T
mdr... jai juste fini le classe de francais.... -_-
๐ค @lofty hamlet just to make sure... u did add the pokemon to ur data files right?
๐ค nvm read code a bit wrong xD
do the other "pokemon" names work or not?
@rose mesa what where is the error ?
thats my question is a way also, since i dont even know what error codes u gettings xD
cause telling me just it wasnt dected doesnt really help :3
thats code ๐ค not the error code -_
I have no error
๐
Run ..
xo03 is a string already
you don't do "a".content == "a"
you just compare directly
You respond me it's not a random, ping
i mean its not that random of a ping, more of a follow up asking a question that was already answered
@uneven laurel add .js at the end and try not to hv spaces in file names
So I know that urban dictionary should only work in NSFW channels but what about Oxford dictionary?
fek thats white af o,o
Does anyone know what redis is?
Yes,
What is it?
uses it
cause*
Ah mk
I will try and figure out how to use it in lavaqueue
I am pretty sure I can add onto my already lavalink manager code
that has the same function just needs the redis added on
just keep the queue in your bot
an array can be used
redis is overkill unless you have a microservice bot/want to persist queues across restarts
To anyone who has experience using IPC with NodeJS, I'm trying shard my bot across totally independent (non-child processes) processes. Where each process is a shard. I've made the actually logging in as one shard part, etc. work fine, but I've come to the point where I need to have my shards communicate with each other. My current plan is to build a central process that acts as an intermediary and which all shards communicate with via IPC when they need to execute something on another shard, etc. I'm having trouble with getting IPC to work through the node-ipc module. As of yet, I haven't found much online that covers having a more two-way relationship between the processes, most of what I've found has been on essentially one way IPC pipes. In order for this to work, I need to be able to have two-way communication between each shard and the intermediary process. If anyone knows any good ways to do this or can point me in the way of helpful resources on the topic of two-way IPC communication in Nodejs, I'd greatly appreciate it.
(Please tag me if you respond)
https://medium.com/@NorbertdeLangen/communicating-between-nodejs-processes-4e68be42b917 @zealous veldt
Hoping this helps
I've looked at that article, the stuff they have didn't work for me, and it's not really as two-way as I need it to be
Make an api ez
Too slow
Oh
I need this for inter-shard communication
Would a localhost websocket work?
It either doesn't work or is too slow... 
@zealous veldt why do they need to communicate?
how about a pub/sub realtime database?
how about just a message broker? lmfao
Use fork() and the attached IPC
I don't think you're gonna find anything if a localhost ws is too slow
It's a separate process but because it's a child you keep the communication channel
Also, any IPC solution is not going to work if you ever want to spread the bot across multiple machines
well
i guess techincally normal http requests are ipc
but you get what i mean
Wouldn't ws done right work fine?
yeah
but
that is def not the route i would go
id look into the reason why you need intershard communication in the first place
I think for node.js it's probably one of the most practical for cross process communication
tbh, you could even use rest for smth like this
How do i set the CAN_VIEW voice channel permission for a certain user to false?
with what? @earnest phoenix
Discord.js
Also, How would i send a message to every guild my bot is in?
No, I am not trying to make a spam bot, I am trying to alert server admins about an update to the bot.
that is still spam
I plan to use it once.
does it change the fact its spam
put it in the status, send it once when a command is executed, lots of options
I would beg to differ on the definition of spam, But we all have different definitions.
alert your users through a central guild/bot playing status/commands
but global messages will ratelimit you to hell
and it is spam
it's not a subjective definition
Bot rate limits are per server?
it's what discord defines as spam
Or is there a global rate limit in general?
there's a global ratelimit
Ah
and per-route limits
What is that rate limit?
whatever discord feels like
usually 50/1s
but they can be anything and change at any time
Bot is in less then 50 servers atm
no strict definition, all ratelimits are dynamic
adjective
( lowercase ) Digital Technology . (of promotional content on the Internet) irrelevant or misdirected:
The search engine delivered spam websites that had nothing to do with my keywords.
would the message be misdirected or irrelevant to the bots' users?
I would assume not as it alerts all users of the update, As it is a pretty big update.
we also have the definition:
( lowercase ) Digital Technology . to execute (an action) or use (an item) rapidly or repeatedly in a video game:
but i mean
if we just exclude the video game part
you are kinda executing the command 50 times
My message would be a simple;
Hey! I've been updated! [insert new features], Server admins, to disable these do [command].
post the message in your support server
Relevant to the bot, Relevant to the users.
It has like 5 members lol
The bot is in 46 servers.
@latent willow i agree
my message content could be hi or a copypasta, but it wouldnt matter if i started sending it in every guild i am in
um
wrong chat?...
hahaha wtf
Also, While some people are here, Could someone provide me with the code to move a user into a specified voice channel? (discord.js) Thanks!
oof
@earnest phoenix even if it is in 5 guilds your bot will most likely grow and you'll hit ratelimits pretty fast if you spam like that
Also ppl will recognize new features if they use your bot alot and might join your server in the future
bot.move_member(user, channel)
Oh, I only plan on doing this once as i am adding like 20 new features to a currently 1 command bot.
using the docs tm
Thanks btw!
then they will defenetly recognize it ^^
Announce in support server / add to commonly used commands
users usually don't care if you added something
if they do and want to be notified, they join the support server
otherwise they eventually find out if the command is listed in eg help
Fairs.
tbh you may lose servers by sending out mass messages
and sending update messages will lead people into kicking your bot from their guild
exactly
no
if you want to run python run it with python or python3 and -3 isnโt a argument
I need help with a matchmaking system. I already have 2 arrays, a lobby full of people waiting to be matched and another one with people already matched. I am using discord.js. I am unsure of how exactly I should go about it. I have tried several iterations (which have all failed).
Any way to suppress this without @ts-ignore?
No, idk where you heard that @smoky spire
https://discord.js.org/#/docs/main/master/class/MessageMentions?scrollTo=has
Well I think adding .id will solve ur ts problem
Well the error says it isn't assignable to User | GuildMember | Role | GuildChannel (so string isn't an option).
Hm idk then
Ty for trying
Uh, I need some help about lavaplayer. My bot just stopped working with music by itself and I really don't know why... Lavaplayer is up ot date, I tried to run my jar locally and everything is just fine BUT on my VPS no music get played and the bot keeps going connected/disconnected in the vocal channel...
So I think my VPS is the problem but I litterally didn't do anything..
whats the difference between <@userid> and <@!userid> im just curious ๐ค
ok...
The ! Is for nicknames
Hello can I make like, You spawn a photo of something else and then you catch it and then the thing gets to your collection
the codes actually
P.S I use discord.py
If anyone knows pokecord, it's the similar thing I am saying
So literally what pokecord does 
I can't explain
like a image appears and then you do a command to add to your collections and it gets added
Somehow that
Send the message, save the details of the latest of whatever that thing is, on a successful "catch" refer to that data to add the thing to the users collection
It is entirely possible, idk how in py tho
Going to repost it here for like the 3rd time
I need help with a matchmaking system. I already have 2 arrays, a lobby full of people waiting to be matched and another one with people already matched. I am using discord.js. I am unsure of how exactly I should go about it. I have tried several iterations (which have all failed). Ping/DM me if you think you can help. Thanks in advance
you what
let lobby = []
let groups = []
Lobby has users waiting to be matched
Groups has players already matched
How do I make it so that people can be matched from the lobby, added to the groups and put in a DM group
[[a, b, c], [d, e, f], [g, h, i]]
```?
nice
oh fun
my discord bot just got temp banned from discordbots.org for "ratelimiting" Funny that as i have no where near your rate limit!
You're stopping my bot from even running fml
when are you sending requests to it
?
do you use the dbl api?
Yes
dblapi.js
how often do you call it
once every 10 min max
Hi, how can I fix this problem? (https://bountybaezebes.is-inside.me/btlIlvXs.png)
You're using js right?
you did something else that got cloudflare angry at you
a dbl ratelimit would be a 429
Was talking to Eare
DDoS protection?? Honestly kill me, I didnโt realise sending 1 request/10 min was a DDoS
Iโm gonna set up a logging system so I can see just how many requests it is sending because I refuse to believe cloud fair thought I was DDoSing.
all requests to discord are also sent to cloudflare
Service
I have a few other bots, including the backup of the bot that got blocked running on the same VPS, they all work.
i think this sounds like a stupid question but how do you check if a bot has certain permissions in d.js?
ok thx
Yo, my bot should be unrestricted now, right?
Anyone have experience with lavaqueue?
I'll answer my own question - No, It's still blacklisted.
@lusty dew what about it?
I am trying to implement a queue system with it
and I am curious how it works with the lavalink module if it does at all
Lavaqueue is an implementation though
constย {ย Client:ย Lavaqueueย }ย =ย require('lavaqueue');
constย voiceย =ย newย Lavaqueue({
ย ย userID:ย '',ย //ย theย userย thatย willย beย sendingย audio
ย ย password:ย '',ย //ย yourย lavalinkย password
ย ย hosts:ย {
ย ย ย ย rest:ย '',ย //ย yourย lavalinkย restย endpointย (includeย portย andย protocol)
ย ย ย ย ws:ย '',ย //ย yourย lavalinkย wsย endpointย (includeย portย andย protocol)
ย ย ย ย redis:ย '',ย //ย yourย redisย instance
ย ย },
ย ย send(guildID,ย packet)ย {
ย ย ย ย //ย sendย theย packetย toย theย appropriateย gatewayย connection
ย ย },
ย ย advanceBy(queue,ย {ย previous,ย remainingย })ย {ย //ย optional
ย ย ย ย //ย calledย atย theย endย ofย aย trackย whenย theย queueย isย otherwiseย unawareย ofย howย manyย tracksย to
ย ย ย ย //ย advanceย by;ย returnsย aย number:ย 0ย toย repeat,ย negativeย toย advanceย inย reverse,ย positiveย to
ย ย ย ย //ย advanceย forward
ย ย },
});
ย
asyncย functionย connect()ย {
ย ย constย resย =ย awaitย voice.load('someย identifier');
ย ย constย queueย =ย voice.queues.get('someย guildย ID');
ย
ย ย awaitย queue.player.join('channelย id');ย //ย joinย theย voiceย channel
ย ย awaitย queue.add(...res.tracks.map(tย =>ย t.track));ย //ย addย songsย toย theย queue
ย ย awaitย queue.start();ย //ย startย theย queue
}
ย
asyncย functionย skip()ย {
ย ย awaitย voice.queues.get('someย guildย ID').next();
}
ย
asyncย functionย stop()ย {
ย ย awaitย voice.queues.get('someย guildย ID').stop();
}
Example from the readme.md
oof
that's kinda the point of this channel
it is really not
How will you help him with code problems without seeing his code
Please explain
I need to learn your telepathic ways
Right, let me just spin up hastebin for a single snippet that fits in here just fine
that's for very long pieces of code
Which slows down everything because then anyone that wants to help has to use hastebin as well
short code you can use codeblocks
Instead of using the feature built into discord
@earnest phoenix hi friend, code blocks are here to share code
we allow that
thanks
lmao
thats cool to know
Lmfao
we allow them though

ur cute tbh
heheeee
yall wondering why so many low iqs are here and it shows why ๐คท T
Yeah why are you here
@scarlet bane i lead a 1.8k guild bot but killed it because why not
you're a monster aren't you
my excuse is i know js but i make a bunch of errors
We don't need excuses to be better than some cocky showoff who thinks he's head of discord
lmao
press x to doubt
still didnt ask tbh
all i asked was not to clutter the chat, not demanded, asked, because it's annoying on mobile and yall be triggered as fuck
@scarlet bane just flex tony on him
remind me again but we're arguing right now because of simply asking not to clutter
lolk
i'm not sure where you got triggered from, we're just trying to help
Yeah thas all
yes
alright, go ahead and move to #memes-and-media
or return to the topic of development now please
passive agressive much
shh
don't push matters here
i'm not in the mood for this
i added a comand of ping to my bot,but when i try to do it work it DOSEN'T work,what do i do?
it dosen't work,but it says that the bot is online
;n;
api might be dying
what
;n;
plase help me,i need to add comands to my bot,i added the comand of ping but it dosent work,What.do.i.do?
you can start by sending the code
asking again without giving details won't make it magically work
:b
what library are you using?
possibly, according to some people
Okay, have we been given any official news?
you will usually see info about downtimes on discords twitter or status.discordapp.com
Oh, i was talking about the dblapi
they have to. manually update the status page though so its not realtime
o my b
I should have specified.
what
tfk
what
I'm able to run my bot, but the second i try to run the same bot with some commands the bot gets blacklisted from dblapi
I'm just done
It thinks i am ddosing
with 1 request a minute
what even
are you using a shared/free hosting
No
hm
Private, my own VPS
thats really weird then, no idea what could be the cause
The bot works, but when i change the code, Same token and all, It works for 2 minutes and 32 seconds then closes without telling me.
Contaboo
The strangest part is
Same bot, Same token, Same API key, Works fine, I add in some new code - that doesn't contact the api - bam i'm ddosing?
just dont use dblapi then
yeah, try without dblapi
Ignoring exception in on_member_join Traceback (most recent call last): File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.6/site-packages/discord/client.py", line 307, in _run_event yield from getattr(self, event)(*args, **kwargs) File "<string>", line 17, in on_member_join File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.6/site-packages/discord/client.py", line 2916, in add_roles yield from self._replace_roles(member, new_roles) File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.6/site-packages/discord/client.py", line 2887, in _replace_roles yield from self.http.replace_roles(member.id, member.server.id, roles) File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.6/site-packages/discord/http.py", line 196, in request raise Forbidden(r, data) discord.errors.Forbidden: FORBIDDEN (status code: 403): Missing Permissions
He has all perm...
Role hierarchy?
What?
how roles are positioned
Ok idk why I am getting this error from enamp but its driving me nuts. If im reading it correctly it is telling me that the key 264445053596991498 does not exist but my catch for it would have gone off and i have tested it before on other servers. SO idk what is going on. (node:5960) UnhandledPromiseRejectionWarning: EnmapTypeError: The key "264445053596991498" is not of type "Object" or "Array" in the enmap "guild_data" (key was of type "String")
It exists, but it's data is a string and not an object or array I believe is what that error is
Did anyone respond to me about the lavaqueue thing?
I fell asleep right after asking the question
youll have better luck in the official support server for enmap
they have none
im fairly certain evie has her own server and if not, she offers enmap support in the idiotsguide server
there should be links in the docs
isn't the idiotsguide server down?
because there is no active invite i can find at least before
heres a link to her server as well
good luck :)
dont know if posting these servers counts as advertising but im not affiliated or anything
it doesn't
the rules say you can post invites if it is relevant to the conversation
or maybe that was the discord.js server
i forget
It was relevant and helpful
Do you have an eval command?
yes
Is your enmap global or does the enmap exist in the evals scope?
wdym by in evals scope?
Does eval have access to the enmap
yes
Try this !eval <Enmap>.get("264445053596991498")
Change the things to your stuff obviously
ok
Tell me if it returns the error or something else
Ok so itโs returning but itโs missing things
But my code handles it when itโs missing items
What is it returning though?
just starboard config stuff
But it is an object?
Oh
The value is missing data
I think it may have corrupted or something
The second one is a normal server
Makes sense
You're trying to get a property from a string
Which uHh afaik doesnt work 
Lol but Iโm not trying to get โstarboardโ anyway
But for some reason thats the only thing in that one
:+1:
Thank you for basically solving this for me
I probably would have never figured this out
I've had the error before
Ahh
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1117:14)
April 3rd 2019, 11:09:09 pm :: Clap Bot has been put online.
C:\Users\Aj\Desktop\Clap Bot\commands\play.js:35
await queue.add(r.tracks[0])
^^^^^
SyntaxError: await is only valid in async function```
II got two errors
the await one
I understand
the ioredis one I don't
I can see it had an error
connecting
I just don't see why
const Redis = require('ioredis')
const redis = new Redis()
module.exports = (client) => {
const voice = new Lavaqueue({
password: 'kawaiipanda',
userID: '561619932442394627',
hosts: {
ws: "ws://localhost:2333",
rest: "http://localhost:2333",
redis: redis
}
Is redis actually installed and running on the host?
That would be the first place to start looking
Looking at the documentation, try first doing src/redis-server in your terminal
And then do a test write with redis> set foo bar
If it says OK then it's running
operable program or batch file.```
Wait what
Do redis-cli
I forgot to do that actually
Oh
I installed the files
@lusty dew you need to run it in WSL
You had to extract and then run make in the extracted folder
It requires a Linux environment
And yeah, you need linux
MongoDB bb
MongDB is good
Mongo is for a different purpose
actualy there are better alternatives to bongo for each purpose
Hey guys, am I missing something in the discord.js documentation to check if a user has unchecked "Allow direct messages from server members."?
The only solution I've found is to catch the error but I'd like to check beforehand...
I doubt you can
Weird... I figured it'd be a property of the User or DMChannel
alright, I'll just keep the try/catch block then!
I don't think that's even in the API @upbeat maple
It does give a unique error...
(node:17439) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send messages to this user
But probably not
When you try to send a msg in the client it just gives you the standard message fail error 
Weird. Seems like a pretty global property of each user. it'd be nice to prepare the destination without needing the Discord API to throw an error
extremely rare case but still
How do I make a redis server?
Download redis
Run redis-server program
Done
Also systemctl enable redis recommended
Hey
anyone know how to make it so when you do !help your bot thinks it's !commands? Im using javascript
@warm wigeon you mean aliases?
Probably make a map from each alias to its original name and forward it in the command handler
Rip
I have this error at my python music-bot (ffmpage - stream)
someone knows to fix it ?
Can you send it in a code block or upload it to pastebin
#!/usr/bin/python3
#imports
import discord
from discord.ext import commands
from colorama import *
import asyncio
import youtube_dl
#Variables
prefix = '!'
bot = commands.Bot(prefix)
bot.remove_command('help')
voice_channel_id = "562699711275073566"
options = {
'format': 'bestaudio/best',
'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s',
'restrictfilenames': True,
'noplaylist': True,
'nocheckcertificate': True,
'ignoreerrors': False,
'logtostderr': False,
'quiet': True,
'no_warnings': True,
'default_search': 'auto',
'source_address': '0.0.0.0' # bind to ipv4 since ipv6 addresses cause issues sometimes
}
#start
@bot.event
async def on_ready():
await bot.change_presence(game=discord.Game(name='iloveradio.de', type = 2))
init()
print(Fore.GREEN + Style.BRIGHT)
print(" ============================")
print(" Bot Name: " + bot.user.name)
print(" Bot ID: " + bot.user.id)
print(" Discord Version: " + discord.__version__)
print(" ============================")
print(Fore.YELLOW)
channel = bot.get_channel(voice_channel_id)
botvoice = await bot.join_voice_channel(channel)
player = botvoice.create_ffmpeg_player('http://stream01.iloveradio.de/iloveradio1.mp3', options=options,
before_options="-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5")
player.start()
#run
bot.run('XXXXXXXXXXXXXXXXXXXXXXX')
Did you copy the code
โซ
That's not at all helpful or complimentary to this conversation @proud pivot
Im looking for a new host, Has anyone used SkySilk?
Same there
Any problems? I am looking at taking advantage of using the 50% off sale
I've had no problem so far
how i add a comand to my bot?,beacuse i tried to add him the comand of ping but i dosent' work (it says that is online but the comand dosen't work) the comand that i tried is ping
@earnest phoenix what library are you using for your bot
And please, some code, just asking for help doesn't allow us to actually help
Let's rephrase that since it seems they don't know what a lib is
Discord library/module that you use in your programmnig language
visual studio code(?
That's your text editor
Omg
because you dont know how to code
you were given a decent tutorial and you were told to read the tutorial in #502193464054644737
if you followed that tutorial you would know how to make commands work
Learning a programming language off a Discord library inb4
:v
It's not an awful way to learn, since discord bots really are not very hard
I would say it's not much of a good way to learn a lang either
they still need to know the basics
its quite hard if you start from nothing
yup
Yeah ofc they always learn the basics before attempting things, I'm just saying using discord as a way of progressing your knowledge isn't too bad an idea
:v
when you make a discord bot, youre primarily learning a lib
learning the basics is much more useful than learning the lib + some crap that makes no sense that youll copy/paste
Lovely! My bot has been offline all day, Finally started it up again and it was instantly ratelimited by cloudfair!
and it will save you a lot of stupid questions if you start with the actual language
nice \n lul
Also knowing basics will in fact help you create a good Discord bot
yes that too. your bot will be ass without knowing the basics
their everywhere
and you will want to improve it, but to do that youll have to ask stupid questions and get answers that say "learn <insert lang>" or answers that go miles over your head
lmfao what a style choice
lmao
How do I use ifs in d.js smh
'Too Many Requests'
that looks like it might contain some information
nah fr though, ask a staff member or something
inb4 is spamming api post requests from an infinite loop
haha yes





