#development
1 messages · Page 656 of 1
@languid dragon w3schools
can you send link
Sure 1s
Lighter color, round borders, same result
I spoke to Dreams in DMs about it twice, they said it was fine in both cases

wasnt w3schools the site that had obvious sql injection vulnerabilities in their sql examples
@hybrid ruin why would you speak to a mod about css?
my question is why it looks extremely similar to another persons design
and by similar i mean it's quite literally the same CSS + colours
Because I looked at it, liked the design, and wanted something similar, so I asked Dream if it was okay to do so, and they said yes
but you did the exact same colours and design :^)
Okay
copying someone elses work :^)
Ken isn't that like Evey Turkish bot tho
(Python) How can I emb a link in a Title? (I know how to do it in a descr or in a value)
Pls help
Embeds have a URL property which is what clicking the title will link to
So check the docs for your library
They'll probably have it as a separate property too
How do y’all feel about a website being made strictly in HTML5, CSS, and JS?
as in no stuff like react or angular or anything like that?
Mhm!
Fine but when it comes to really beefy sites like anything you see on the internet it’s better to do something like react or angular, even ejs
I’d say the steps would be
Normal Stuff => PHP => ejs => react then probably make ur own framework or something
for static sites its pointless
Well yeah but for genuine sites that’d be the route probably
Like for actually useful sites lol
should i bother implementing analytics in my bot? its a simple and small bot (~270 guilds) bot the people who use it love it. several people went out of their way to contact me and tell me that they like the bot and enjoy using it. since the bot is extremely small, i dont know if implementing analytics would be benefitial at all, or if i should focus on something else
You can use Marcos built in analytics for now honestly
It gives good insight and perfect for small creators who don’t want to dedicate their time to making analytics it’s just not very good for larger bots cuz it only keeps track of 30 days
im talking about more than just guild counts
for example activity in servers and by users
Hm, well, if it’s not too difficult to setup it is quite satisfying to look through large analytics like that
probably
i would love to add more to the bot but the concept itself is extremely limiting
12 lines of code
that includes stat posting to bot lists
Wym?
the concept is the following: you send a specific message, bot responds with specific thing
honestly, implementing analytics might be fun
but idk if its worth my time
and another thing is how much i want to know and what is considered being too nosey
i would love to know which channels it gets used the most in, but that would include collecting the name and idk if i want that 
im guessing listing all guilds and their channels would be breaching privacy?
guild names, channel names, channel topics
yeah but how do you know if a server is private or not
i dont want invites
@mossy vine what language do you programme in?
py
@mossy vine you can view them yourself just not release them
@slim heart okay good thanks
As long as they’re encrypted in a db u can view atleast
i was gonna dump them in plaintext and view them
Ok marco
Or you can make them accept a tos on join that says channel names can be exposed etc.
Hm plaintext might not be enough be tbf it’s not like discord can snoop ur host
yeah vim can encrypt text files
so if i dump them in plaintext then encrypt with that
and obviously dont share anything
i should be fine?
how can i make text in canvas be smaller if theres more text?
wdym
yes
@sacred minnow you can use the maxWidth option
maxWidth Optional
The maximum number of pixels wide the text may be once rendered. If not specified, there is no limit to the width of the text. However, if this value is provided, the user agent will adjust the kerning, select a more horizontally condensed font (if one is available or can be generated without loss of quality), or scale down to a smaller font size in order to fit the text in the specified width.```
and how can i make it put a line break every x characters?
there are no line breaks in canvas, you have to change the x/y coordinates to change the line. so you either split your text into sections based on character count, and each section gets its own fillText, or you can use measureText to get the size of the rendered text to make sure it fits the size you wish
can someone help me with shards
43
the one i have atm
ima gon be making a new one
rn
thats why i want shars
shards
i want it
Why is my 1.2.3 bot load the jsons, but not????
It is working in 0.16.12 somehow !!!!????
with open("filtersettings.json") as f2:
filteropts = json.load(f2)
I've got no errors, but nothing in filteropts.
filtersettings.json
Oh k
The problem fixed.
It was just the new discord.py int str thing
What the hell is up with bot.say in the latest Discord.py version
it's Messageable.send
Messageable is any object you can send a message to
Use ctx that you pass in function params
um ok
so what would I change await bot.send_message(bot.get_channel('539982011713191967'), 'Bot is now online! Time: ' + time.asctime()) to?
Oh, they are now?
Fucking hell.
I need to change all my fucking JSON files.
I don't have a real database :/
Or just iterate through each key, convert IDs to int and overwrite the previous data
alright, first I gotta change every single instance of bot.say or bot.send_message
whee
And game presence
That's proken too
broken*
I should've just stayed back at 1.0.1
or whichever version I was using before
rewrite didn't have str IDs
async didnt have async? what
Does anyone how to fetch a user by id?
in which library
discord.js
client.users.get(id)
it will attempt to pull the user from cache first, if it fails it's going to make a REST request to get the information about the user
why message 
did you not read the link
did you even look at the link cry sent
if you don't await it, test will be a promise
@bright spear async branch was, in fact, asynchronous
Unless I'm missing something
anyone ever get weird websocket errors from discord?
my bot crashed while i was asleep and console was a ton of discord server errors
i remember that yesterday people were complaining about 500 errors
can you even handle stuff like that? I'm not even sure what prompted it
it would be catching the "on event" code block I suppose
Question? For the Yui Bot how can you make self assignable roles like, press on a reaction for a certain role
Discord.js or Discord.py?
I'm not sure- Like I'm using it for a server
Looks for the support server on its page
it sent me here
wrong button then
@earnest phoenix I'd go and ask in their support server: https://discord.gg/eMPT8c9
oh ty
Someone sent them here for some reason
No they click on the Join Discord button at the top of the page, which takes them here
Is what I mean
oh
Oh, so I pressed that and it sent me here
for some reason?
but it's all good now
how can i make my bot to create a forever invite ? in discord.js
what do you exactly mean by that? like generate an invite when requested that doesn't expire?
yes
does anyone know if bots are able to send custom statuses yet
if so, which type is it
i don't think bots can do it automatically
wot
but you can generate 1 invite that last forever, oh i meant to knzo's question
oh, my bad
not automatically
wym @cursive dagger
the guild id parameter in the op?
i can attempt to mimic it, i just dont know if you can send it yet
custom statuses
..
i use this and i want the invite to never expire
message.channel.createInvite().then(invite => {
})```
okay ..
anyone here good with html?
Just ask your question and if someone knows how to help they'll drop by
Alright, Im trying to make an "Embed" like the discord.js.org link has above and im not sure how to. Or what to ever search to find some documentation on it
Ah, okay thank you
Alright
Is there a way to eval js code in rust?
@client.event
async def on_reaction_add(reaction, user):
message = reaction.message
if reaction.message.author == client.user:
if user.id != client.user.id:
if message.content == 'Will you participate?':
if reaction == '':
emb = discord.Embed(title='New Join!', description = f'<@{user.id}>', colour = 0x66d4af)
await message.channel.send(content=None, embed=emb)
does not recognize the reaction
pls help
you're comparing a whole reaction to an emoji object
API documentation for the Rust eval fn in crate js_sys.
ty
a stringified version of emoji, to be precise
ok ty
epic
lol
One vps for all bots or split them up 
??
I like having them all on the same but like if I want to upgrade it would be double what I have now
Which I really don't need 
I DONT KNOW????
/:
we can't do anything if you give us nothing
^
given a url link that contains a raw image, how do u save it to ur computer? Example url link: https://i.imgur.com//nnhQbpY.png
oh lol
thats an album link anyways
idk how to do that lol
which lang?
whats lang
language
python
idk python, but probably with aiohttp
Use aiohttp if you want to implement that in your Discord bot
then learn
any module that can do http requests really
lol idk means its from a yt tutorial?
Why does this command add like 500000 roles named 'Muted* when it should just add one role
async def mute(self, ctx, member: discord.Member=None):
for role in ctx.guild.roles:
if not role.name == 'Muted':
await ctx.message.guild.me.guild.create_role(name="Muted")
role = discord.utils.get(member.guild.roles, name="Muted")
await member.add_roles(role)
else:
role = discord.utils.get(member.guild.roles, name="Muted")
await member.add_roles(role)```
and requests is usually a good thing for sync code
k
lmaooo when you copy and paste a code but dont understand it
for every role in roles
if it's not muted, make a new role called muted
hmmm
Well obviously you are iterating through guild.roles and create a role
I understand it jack ass
Don't fight kids
how dont u see what it is doing then lol

i think you are creating a role every time a role isnt the muted role
^
if there isnt a role called "Muted" it will make one and give that
and then adding it
Instead you should fetch the role muted and if it doesn't exist create it
Instead of looping through all the roles
^
^
Honestly, discord.utils.get where the iterable is guild.roles and name kwarg is 'Muted'
Works just fine
why do people like adding a role silently lol
Because people are incompetent and can't follow directions
ah
For some reason, whenever I do export PREFIX="+" and do any of these tasks, I get those results:
echo $PREFIX in bash -> '+'
process.env.PREFIX in Node REPL -> '+'
console.log(message.content, process.env.PREFIX); during messageCreate event in my bot -> +help /usr/local
@client.event
async def on_reaction_add(reaction, user):
message = reaction.message
if reaction.message.author == client.user:
if user.id != client.user.id:
if message.content == 'Will you participate?':
if reaction == ':join:':
emb = discord.Embed(title='New Join!', description = f'<@{user.id}>', colour = 0x66d4af)
await message.channel.send(content=None, embed=emb)
pls help, it doesen't work again with the reaction
you made it even worse
rip
all you had to do was compare reaction.emoji instead of reaction
jesus christ
Can someone help me figure out why the last part happens?
When I either a) echo the env or b) log the env in node repl, it works fine... when I log it during the message event of my bot, I get /usr/local
I still have the same problem even if I change the env
This error is driving me nuts
what does yarn start do?
whatever it does is ignoring that env var
or overwriting it
Try running node directly
how do i fix this margin issue with textarea and width: 100%?
what are your margins on the body element
i got it, turns out i needed box-sizing
for discord.py, is there like a message.content for embeds
yarn is like npm but faster
anyways I strongly feel like the problem is with my node.js nightly builds
i switched over to a docker container with stable node and it works fine
can someone tell me why my rob command not working tho
let user = message.mentions.members.first()
let targetuser = await db.fetch(`bal--${user.id}`) // fetch mentioned users balance
let author = await db.fetch(`bal--${message.author.id}`) // fetch authors balance
if (!user) {
return message.channel.send('User not found.')
}
if (author < 500) { // if the authors balance is less than 500, return this.
return message.channel.send(`You need at least $500 to rob somebody.`)
}
if (targetuser <= 0) { // if mentioned user has 0 or less, it will return this.
return message.channel.send(`${user.user.username} does not have anything to rob.`)
}
let random = Math.floor(Math.random() * 500) + 1; // random number 500-1, you can change 500 to whatever you'd like
let embed = new Discord.RichEmbed()
.setDescription(`${message.author} you robbed ${user} and got away with ${random}!`)
.setColor("GREEN")
.setTimestamp()
message.channel.send(embed)
db.subtract(`bal--${user.id}`, random)
db.add(`bal--${message.author.id}`, random)
}
```
Do you get an error, or just nothing
nothing
Hi
@silver light message.embeds?
let emojiList = message.guild.emojis.map((e) => e.name + " " + e).join('\n');
if(emojiList.length > 1000) {
let emojiList = "Character count is too large!"
}
I get an error saying that the RichEmbed field is too large (the emojiList)
let emojiList = ...
if (...) {
let emojiList = ...
}
you are not changing the value of the first emoji list
Hi
as simply as
let emojiList = ....
emojiList = ...
Basic JS concept,
Please review your JS knowledge, clearly you are coding in blind here and have not sufficient knowledge yet
@steel trellis
dude i’m at an airport currently my brains gone to shit
It's still extremely simple as to what the issue would've been, brain having been 'gone to shit' or not
look the last thing i wanna be doing is fixing code on my phone, there’s a couple more errors i gotta get thru i’m just stressed, tired and pissed off
anyways thank you for helping me fix this little problem
I'm trying to send a 404 error in a small server with the HTTPS module but I'm running into some trouble here... ```js
const https = require("https");
https.createServer((req, res) => {
res.writeHead(404, { "Content-Type": "text/plain" });
res.write("404 Not Found");
res.end();
}).listen(4000);``````
$ curl localhost:4000
curl: (52) Empty reply from server```
const randomApi = require('some-random-api');
const Discord = require("discord.js");
module.exports.run = async (client, message, args) => {
if(!args[0]) return message.channel.send("**:x: `tb!lyrics artist-song`**");
var lyrics = await randomApi.lyrics(args[0]);
console.log(lyrics);
if (lyrics.lyrics.length > 2048) return message.channel.send(":x: Sorry, The lyrics were too long.");
let embed = new Discord.RichEmbed()
.setAuthor("Lyrics of "+lyrics.title+" - "+lyrics.author)
.setThumbnail(lyrics.thumbnail.genius)
.setDescription(lyrics.lyrics)
.setColor("RANDOM")
.setFooter(client.user.username, client.user.avatarURL)
.setTimestamp()
message.channel.send(embed);
}``` how to fix length problem using multiple embeds?
split the string by the latest possible space that doesn't go over the char limit
can you provide an example?
How can I send a DM message to a person by id? (discord.js)
client.users.get("id").send("I have send this DM")
its better to use fetchUser
cuz if the user is not cached it will fetch it from the api
(node:10948) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined
And that error comes when you send to an unfeched user^
Thank you very much!
Why it doesn't work?
client.fetchUser("id")({
}).then((user) => {
for(let i = 0; i < 5; i ++)
{
user.send("test message");
}
});
ERROR : TypeError: client.fetchUser(...) is not a function
The fuck is that
Why the ({})
Theres also one user from fetchUser
Oh nvm ur looping messages
How do I do this? I do not know well discord.js
Why would you pass an empty object to the result of fetchUser
yes
@proper inlet do it without the ({})
fetchUser is a promise @proper inlet
oh you are usiing ,then
didnt notice that
but that ({}) is certainly not needed
also why you want to send a user 5 messages
yes
it makes no sense lol
do you want to annoy them or something
well if I see that bot on queue I'll just 
I suggest you 
Anyone know how to get who deleted a channel - discord.py?
Audit logs should have that
@slender thistle How do I get who did it though, I can get which channel was deleted?
AuditLogEntry is returned from guild.audit_logs()
And that object has name property
The user who initiated this action. Usually a Member, unless gone then it’s a User.
brill thanks
Is there a way to let a music bot enter without commando summon, and then write play and he goes in alone?
(my english is not the top)
module.exports.run = async (bot, message, args) => {
message.delete();
if (!message.member.hasPermission(`ADMINISTRATOR`)) return message.reply('no permission!').then(msg => msg.delete(15000));
let user = message.mentions.users.first();
if (!user) return message.channel.send("Please mention a user");
const reason = args.join(" ").slice(22);
if(!reason) return message.channel.send("Please specify a reason.");
const logsChannel = message.guild.channels.find(r => r.name === "log") || message.channel;
if(!logsChannel) return message.channel.send("Internal Error");
message.guild.member(user).ban(reason);
message.channel.send(`@${user} was banned.`);
const embed = new Discord.RichEmbed()
.setTitile("User banned")
.addField("Banned user", user)
.addField("Banned by", message.author)
.addField("Reason", reason)
.setColor("f10000")
logsChannel.send(embed);
}
module.exports.help = {
name: "ban",
aliases: ["*"]
}```
it dont sends an message in the "log" channel
Is something sent instead, or no response
no response
nvm I'm an idiot
lol why?
Stable allows for <Message>.delete(ms) but master has <Message>.delete({ timeout: ms }). I don't see the actual problem unless it's something like that
Is the message sent getting deleted too (the top method)
@sudden geyser Ok
thx i will use regex
One message removed from a suspended account.
the command is undefined then
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
index.js
index js till line 19
One message removed from a suspended account.
Are you definite command.help or are you just defining command.name
because it can't read name of undefined and what appears to be undefined is props.help
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
If that's in your command file and there aren't any other errors then I have no idea what the problem is
godspeed
One message removed from a suspended account.
^
One message removed from a suspended account.
right after you define props in your command loader
One message removed from a suspended account.
that should log the contents of all commands
One message removed from a suspended account.
One message removed from a suspended account.
put it before the bot.commands.set
^
One message removed from a suspended account.
One message removed from a suspended account.
Are those the only commands
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
That’s why I have auto save enabled 
So I'm trying to make a temporary command for my friend's server to apply roles to everyone that's already there, except I'm not sure how to make it work right. Here's the code:
@commands.command(pass_context=True)
async def execute_macro(self, ctx):
await ctx.message.channel.send("Ok here we go")
for member in ctx.message.guild.members():
if (member.bot != True):
try:
role = discord.utils.get(ctx.message.guild.roles, id="600446514254577664")
await member.add_role(role)
role = discord.utils.get(ctx.message.guild.roles, id="600447866997178368")
await member.add_role(role)
role = discord.utils.get(ctx.message.guild.roles, id="600446000783425542")
await member.add_role(role)
await asyncio.sleep(1)
except Exception:
await ctx.message.channel.send("Something happened")
await ctx.message.channel.send("Executed. Any errors will appear on the console.")
And here's my error:
Ignoring exception in command execute_macro:
Traceback (most recent call last):
File "C:\Users\fires\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 79, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\fires\PycharmProjects\Chocobot\owner_cmds.py", line 97, in execute_macro
for member in ctx.message.guild.members():
TypeError: 'list' object is not callable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\fires\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 863, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\fires\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 728, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\fires\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 88, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'list' object is not callable
But is it possible to iterate through a list with a for loop?
That's what I'm trying to do
with for member in ctx.message.guild.members():
And I probably have to compensate for ratelimits better
the () makes it call a function
Its add_roles
oh ok
Which one is usually more memory efficient?
from .package import *
or
import package
```?
Let's say I'm making a bot command for class officers, and I want that command to have a default sendMessage output if I don't provide a second argument. How do I do this? This doesn't seem to work:
msg.channel.send('Officers:\nAdviser: \nPresident \n');
if(args[1] === 'president'){
msg.channel.send('The president is...');
}
else if(args[1] === 'adviser'){
msg.channel.send('The adviser is...');
}
else{
msg.channel.send('Invalid argument.');
}
break;
}```
check for length of args
how will i publish my html project
I did something like this:
if(args[1].length === 0){
msg.channel.send('Officers:\nAdviser: \nPresident \n');
}
and it doesn't work. I know the logic but I just can't seem to use the right syntax
Dont spam
im not spamming
bruh momentom
Everything in life isnt free
will any 1 help me to publish my html project
free hosting
Epic stop typing
What a joke
Epic is a LIE
#memes-and-media kty
free hosting is a lie
My Life IS a LIE😰
Let's not get too off-topic 👀
OH REALLYYYY?
its perfect for hosting static websites
so as long as its just html it will handle it perfectly for you
@mossy vine
GitHub gey
it works
.... IT SEEMS TO WORK VERY WELL
ok now stop using caps thanks
namasta
const bot = new Discord.Client();
const snekfetch = require('snekfetch');
exports.run = async (client, message, args) => {
try {
const { body } = await snekfetch
.get('https://www.reddit.com/r/dankmemes.json?sort=top&t=week')
.query({ limit: 800 });
const allowed = message.channel.nsfw ? body.data.children : body.data.children.filter(post => !post.data.over_18);
if (!allowed.length) return message.channel.send('It seems we are out of fresh memes!, Try again later.');
const randomnumber = Math.floor(Math.random() * allowed.length)
const embed = new Discord.RichEmbed()
.setColor(0x00A2E8)
.setTitle(allowed[randomnumber].data.title)
.setDescription("Posted by: " + allowed[randomnumber].data.author)
.setImage(allowed[randomnumber].data.url)
.addField("Other info:", "Up votes: " + allowed[randomnumber].data.ups + " / Comments: " + allowed[randomnumber].data.num_comments)
.setFooter("Memes provided by r/dankmemes")
message.channel.send(embed)
} catch (err) {
return console.log(err);
}
}
module.exports.help = {
name: "meme",
aliases: []
}```
Error:
Error: Cannot find module 'snekfetch'6:22 PM
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)6:22 PM
at Function.Module._load (internal/modules/cjs/loader.js:508:25)6:22 PM
at Module.require (internal/modules/cjs/loader.js:637:17)6:22 PM
at require (internal/modules/cjs/helpers.js:22:18)6:22 PM
Jump to
at Object.<anonymous> (/app/c/hof.js:3:19)6:22 PM
at Module._compile (internal/modules/cjs/loader.js:701:30)6:22 PM
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)6:22 PM
at Module.load (internal/modules/cjs/loader.js:600:32)6:22 PM
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)6:22 PM
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
Error: Cannot find module 'snekfetch'6:22 PM
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)6:22 PM
at Function.Module._load (internal/modules/cjs/loader.js:508:25)6:22 PM
at Module.require (internal/modules/cjs/loader.js:637:17)6:22 PM
at require (internal/modules/cjs/helpers.js:22:18)6:22 PM
Jump to
at Object.<anonymous> (/app/c/hof.js:3:19)6:22 PM
at Module._compile (internal/modules/cjs/loader.js:701:30)6:22 PM
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)6:22 PM
at Module.load (internal/modules/cjs/loader.js:600:32)6:22 PM
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)6:22 PM
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
did you try running npm i snekfetch
huh but... it worked before
One message removed from a suspended account.
One message removed from a suspended account.
Depends where they are stored
@mossy vine didnt worked but Luckily i had an backup that i made yesterday
how do I get the bot's thumbnail for an embed thumbnail?
One message removed from a suspended account.
One message removed from a suspended account.
Yes
Depends where those are stored
Like, if you store them at client.commands, you should log client.commands
yeah but the parameter. I got it now. bot.user.avatarURL
Is there a syntax for like, a certain command is only usable by users with certain roles in them?
"member.hasRole.equals(roleName)" is what I'm thinking
master or stable
how does that work?
11.5.1
is there a way for me to make a member object or I don't need to?
Members are objects
And why would you make one
A guild in discord.js has a Collection of GuildMembers
Mapped by ID
if(member.roles.has("Server Master")){
if(!args[1]) return msg.reply('Specify the number of chats to delete.');
msg.channel.bulkDelete(args[1]);
}
``` this should work right?
I have no one online in my server to test it with
A name is not an ID
Your user name is Viciou
Your user ID is 285060581176901633
names are not unique
IDs are
That's why they're used as keys
So first, you'd have to get the ID of the role
I suggest const serverMaster = msg.guild.roles.find(r => r.name === "Server Master").id
and then that variable serverMaster will be placed inside the member.roles.has(serverMaster) like this?
Yes
I get a ReferenceError: member is not defined
member => msg.member
You didn't define what member is

So the line becomes
if(msg.member.roles.has.....
ohhhh I get it now thanks!
msg.member means the sender of the message right? If I try to say it in plain English
well
there's two properties
msg.author
Literally "Message Author"
And msg.member
imo js is not very good for clear English
You gotta think in that object/property way
I am getting
Error:
/D:/Desktop/DBLMC/out/production/DBLMC/windows/source/mainScreen.fxml:9
When trying to load this FXML document
One message removed from a suspended account.
One message removed from a suspended account.
I have no clue, share some code
One message removed from a suspended account.
Are you using anidiots.guide
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
I doubt that since you can't even tell me where you store your commands
Which implies you have either a prebuilt command handler
Or none at all
One message removed from a suspended account.
One message removed from a suspended account.
Thanks
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
client.commands
One message removed from a suspended account.
One message removed from a suspended account.
:)
One message removed from a suspended account.
i need some help, let rep = await db.fetch(`rep_${message.author.id}`) does not output the rep of the author, why?
it outputs someone elses rep
Probably store it incorrectly.
Hey guys! I'm making a multi-language discord bot. So if you speak any other language than English and are interested in becoming a translator, dm me! 
@cursive dagger heck no 
Also, isn't this the right channel? I mean, it's about the development of the bot...
One message removed from a suspended account.
@sage bobcat well use it somewhere where your client is defined
Like in the index.js
One message removed from a suspended account.
No
They did, it says index.js:44
Client is not defined there tho
Well thanks for the conversation
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
But it's just a variable you can call it whatever you want
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Can you send the whole thing
One message removed from a suspended account.
One message removed from a suspended account.
^
So
not client.botcommands
console.log(bot.commands.keyArray())
At least that works with v12 collections, idk about v11
So uh, how do I make my bot msg.channel.send() markdown formats?
what
ohhh cool thanks!
var maxLen = 18
let memberid = args[0];
if(!memberid) return message.channel.send("**❌ Veuillez indiquer un identifiant.**")
if(memberid.length !== maxLen) return message.channel.send("**❌ L'identifiant n'est pas valide.**")
bot.fetchUser(memberid).then(u => {
u.ban()
}) ```
u.ban is not a function```
how can i do ?
@earnest phoenix fetchUser returns a user and users can't be banned. You should just fetch the member from the Guild object and then ban them
@twilit rapids yeah but if a admin executes the command, is for ban by the id user target
and the target isn't in guild
https://txtupload.cf/gpRl#1e6h
Does this make sense or meh?
someone here knows something about discord py?
Depending on what exactly
@earnest phoenix guild.members.ban(id)
@slender thistle so, I wanna make a quiz game but I do not wanna use on_message.. there's a way to listen to the answers without it?
What version of discord.py
and another question, my bot was not verified yet, but I was reading mod-logs and I saw that my bot can be declined if he changes status frequently, it is changing 2 status in 5 and 5 seconds, the minimum alowed is 12 seconds? (it will be good to know before someone verifies it, because I can fix it right now)
my version of discord py is the latest
Really thank you! I will adjust it right now
And... client.wait_for('message', check = etc) sounds like what you need
also you shouldn't hardcode ratelimits, they're dynamic and can change anytime
what often occurs is if you spam an endpoint too often and get ratelimited too often the ratelimits get more restrictive
Wherever you have access to Bot instance for
Does on_message work in the latest version of Discord.py?
But in your case adding it to cogs sounds like the most sense-making option
@waxen meteor yepp
If it didn't work, you wouldn't be able to handle commands jn the first place
so furuhashi, lemme show ya what I was trying to do:
Is there a decorator I need in the cog?
@commands.command(aliases=['QUIZ', 'Quiz'])
async def quiz(self, ctx): # command quiz
#QUIZA = str(QUIZ2)
#print(QUIZA)
await ctx.send('The quiz will start in 5 seconds, be ready!')
await asyncio.sleep(5)
QUIZQ, QUIZA = random.choice(QUIZP)
await ctx.send(QUIZQ)
#print(ctx.message.content)
#print(QUIZA)
if ctx.message.content == QUIZA:
await ctx.message.add_reaction(emoji=f":star:")
elif ctx.message.content == QUIZA:
await ctx.send(f'<@{ctx.author.id}> encontrou a resposta!')```
for events in cogs - commands.Cog.listener()
I just started this code, theres no loop yet
Yeah bot.wait_for sounds like what you need then
how would I implement it? i never used before
ok I think I fixed it
Docs should explain that quite better than I can rn
I tried
Nah
You can use it anywhere where you have access to yoie bot instance
(But it's a better choice to do it in commands or on_message)
instead of message I could use ctx
And also those examples don't use commands.Bot, so on_message is the only way to make a command
ctx has message property
not so sure if I understood the "And also those ex...."
Basically
The "API Reference" page is not related to commands extension. Those two have their own pages and stuff
So, in this case the docs are on API Reference, where commands.Bot is not used
So it cannot be used in commands.Bot? (that's what I understood about your message, sorry if I got it wrong) 
Basically yeah

console.log(literally anything)
This is a lavalink related question, but what bitrate does lavalink run at?
@topaz fjord I didn't mean log to console..
then what @scenic vapor
I meant log everything occurring in the node terminal into a file such as log_7-17-19.txt
Umm someone has a command which shows all members with a role (EX : MODERATORS)
Js?
Node js
loop through all members which has that role
@earnest phoenix if you're on discord.js, iirc you are; there's a <members> property for roles :D so for example <role>.members would return a colleciton of members. then just split it split after .map() of collections and boom !
Im currently looking for a small discord.js command that can send a single message to every servers default channel the bots in. The only method i found is outdated. Is this even possible with discord.js? Im mainly wanting to use it to send maintenance notices
Before the bot was public i just did it via client.channels.get method but now that its open i need a new way
what the FUCK https://b1nzy-pinged.me/vT.png
woah
@pastel spear Hello there 
iirc .defaultChannel property is depracated because new servers don't have such property
Also, making it do that could potentially abuse Discord API? because if your bot is in like 500 guilds thats like telling it to send 500 messages at once synchronously lol
ah. Never thought about when it gets big lol
@pastel spear "default channels" dont exist anymore
they were removed like a year ago
@earnest phoenix dmed you to look into it.
Ok
let reportembed = new discord.RichEmbed()
.setDescription('Reports')
.setColor('#15f153')
.addField('Reported User', `${rUser} with ID: ${rUser.id}`);
.addField('Reported By', `${message.author} with ID: ${message.author.id}`)
.addField('Channel', message.channel)
.addField('Time', message.createdAt)
.addField('Reason', reason);
Why do I get the error: https://i.imgur.com/JdPa5ka.png
nvm
remove the ; mid way
I feel incompetent for asking, but I'm currently (albeit loosely) following Peter Spelos' tutorials (.NET 2.0 version), but he hasn't done anything with commands, and I can't seem to figure it out myself.
I've got my command handler written up, but I can't figure out how to implement it into the actual program to read the commands.
are you sure it's net 2.0? that's ancient 🤔
net 2.0 was released in 2009
you're probably confusing net framework and net core
I believe so, yes.
you generally shouldn't follow youtube tutorials, follow the official docs instead
I did try that-
Should have read the first page, though. I was focused on commands, so I read up on that as I worked.
@tight heath but the id isnt in this guild
how i can overwrite permission of the everyone role in a channel?
i n w h i c h l i b r a r y
djs
@earnest phoenix the everyone role has the same id as the guild
@earnest phoenix
let role = message.guild.roles.find("name", "@everyone");
c.overwritePermissions(role, {
SEND_MESSAGES: true,
READ_MESSAGES: true
});```
@amber fractal oh k thx
@earnest phoenix already try
Supplied parameter was neither a User nor a Role.
^
defaultRole doesn't exist in djs
@amber fractal thx it's working
so message.guild
Also, @earnest phoenix when using .find make sure you use a callback not key, value. e.g. .find(role => role.name == 'rolename');
yeah
My bad, Who ever's code it is, Make sure you do what I just said.
express
@earnest phoenix I'm doing bot with discord.js. This is the dashboard.
Yeah. You're trying to call a directory that doesn't exist.
@sick heron send code.
const renderTemplate = (res, req,guild, template, data = {}) => {
const baseData = {
bot: client,
path: req.path,
user: req.isAuthenticated() ? req.user : null
};
res.render(path.resolve(`${templateDir}${path.sep}${template}`), Object.assign(baseData, data));
};```
error here. what should I do.
@warm marsh
what,
The variable templateDir
renderTemplate(res, req, "guild/stats.ejs", {guild})
path.resolve(`${templateDir}${path.sep}${template}`)```
templateDir is equal to/app/dashboard/templates/
?
res.render(path.resolve(`${templateDir}${path.sep}${template}`), ```
The error is here.
what should I do.
define it
What is template supposed to be equal to?
Also, You're missing a parameter.
@warm marsh Dm
const renderTemplate = (req, res, guild, template, guild={}) => {
}```
I won't spoonfeed.
I use lowdb :
setWelcomeChannel command :
let server = message.guild.id;
if(!message.member.hasPermission("MANAGE_GUILD")) return message.channel.send("**❌ Vous devez avoir la permission de gérer le serveur afin d'effectuer cette commande.**")
let channel = message.mentions.channels.first();
if(!channel) return message.channel.send("**❌ Veuillez mentionner le salon de message de bienvenue !**")
let channel_id = channel.id;
if(!db.get("welcomemsg").find({ serveur: server }).value()) {
db.get("welcomemsg").push({ serveur: server, salon: channel_id }).write()
message.channel.send("**✅ Le message de bienvenue à été configuré sur le salon " + channel + " avec succès.**")
} else {
db.get("welcomemsg").remove({ serveur: server }).write()
console.log(`.`)
db.get("welcomemsg").push({ serveur: server, salon: channel_id }).write()
message.channel.send("**✅ Le nouveau salon de bienvenue est maintenant " + channel + "**")
} ```
removeWelcomeChannel command :
```let server = message.guild.id;
if(!message.member.hasPermission("MANAGE_GUILD")) return message.channel.send("**❌ Vous devez avoir la permission de gérer le serveur afin d'effectuer cette commande.**")
if(db.get("welcomemsg").find({ serveur: server }).value()) {
db.get("welcomemsg").remove({ serveur: server }).write()
message.channel.send("**✅ Le système à été retiré de votre serveur avec succès.**")
} else {
message.channel.send("**❌ Ce système n'a pas été activé sur votre serveur.**")
} ```
But why when I put it in the json, I check and everything is well put (id of the server, id of the channel) but when I want to remove with the command to remove, it tells me that the system has not been configured (it does not find the server ID) knowing that I have checked and there in the json
hi folks - do bot have any limits on how much DM they can sand?
yes, there's a ratelimit on everything, in terms of message limit, no
dmall is illegal
if you are talking about mass dming users, simply dont
we're granting steam keys for our open beta when user joins our server
yeah, but bot is getting unauthorized
or do the bot with guildMemberAdd event
looks like after sending too many dms
@earnest phoenix or dont assume what library they are using 
messaging a user can fail if;
you have no shared servers with the user
the user has their dms disabled
you got ratelimited
user and bot share the same server, i assume most users have dms enabled
what are thos ratelimits?
they define how much of a certian action you can do within a timespan
if you cross it you get put on a cooldown and cant do that action for x amount of time
discord.py mostly handles ratelimits for you though so you don't have to worry about it much
yeah, but i just want to check the logs to confirm we're hitting those limits
any explanation in docs?
discord doesn't really document ratelimits
there's some known ones like 5 messages every 5 seconds but its unreliable
you gotta check the ratelimit header on requests
it's documented in discord, libraries don't document it though because they have no reason to, it's being handled internally
(mostly)
ok, this seems resonable but I'm now thinking about a way o handle it
try catch
or, try except in python
you should always try except dms to users because it's pretty much a 50/50 chance it's going to fail
hmm, ok but how try except can prevent our bot get rate limited? i dont get this
So, Does your bot actually have to be on all the time once its inside this server?
no, but it should be
Like, Will it get kicked if its offline for a x amount of hours
noone wants to use a bot thats down for hours every day
you're allowed to have downtime, but if it has more downtime than uptime it'll probably get kicked
Alright, Thanks.
how to use slices
slices?
How do i add how many server's the bot is in
Like i typed the ids it didn't work
In the website
in js
Hi @earnest phoenix , thanks for response I'm with @haughty thunder in team. Bot got unauthorized error while still being online. And when we try to restart it, we cannot, everytime gets response unauthized (403). I tried to regenerate token - it doesn't help. If I create new app, it's working for about 8h, and then got's unauthorized. It happened twice
403 is not unauthorized
unauthorized is 401
403 is forbidden, you can't message the user because their dms are disabled
How to fix how many server are the bot In the website
if you want to add them to the "servers that are using this bot" section, those servers need to be added to the dbl server list
if you want to show the total servers, you need to send the number to the dbl api
Is it possible to use Mongoose on glitch.com?
Oh
sorry cry it's not 403 it's 401
I digged in logs, and there one more thing:
File "/env/lib/python3.7/site-packages/discord/gateway.py", line 468, in poll_event
msg = await self.recv()
File "/env/lib/python3.7/site-packages/websockets/protocol.py", line 350, in recv
yield from self.ensure_open()
File "/env/lib/python3.7/site-packages/websockets/protocol.py", line 512, in ensure_open
self.close_code, self.close_reason) from self.transfer_data_exc
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 4004 (private use), reason = Authentication failed."
code 4004 (private use) - how can we set bot for non private use? What does private use mean? Is it time restricted?
no, we are on gcloud @earnest phoenix
can i make my mongodb a remote db?
@limber ore is your bot set to private in your discordapp developer settings?
we have our own app based on discordpy and aaiohttp
@earnest phoenix yes, if you can run a mongo server
regex still useful
this shouldn't happen mid-connection, it should happen when establishing a ws connection to discord 🤔
@quartz kindle do you mean this?:
yes
that's irrelevant
it only affects the oauth scope, part of REST, not websockets
@limber ore are you by any chance reading the token from a text file
did the same token work before?
also, check the email of the account that owns the bot
it may have been reset
unlikely, but not impossible
to start bot we have:
discord_client.loop.create_task(discord_client.start(TOKEN))
and TOKEN is.... hardcoded in source
@inner jewel yes - token was working before. I checked emails: unfortunately nothing
also "private use" above means that code has no meaning defined by the websocket spec - all 4xxx codes are reserved for applications
so they can mean whatever the applications wants it to be
@inner jewel sorry, I don't quite get it. 4004 is raised from discord.py. We do not handle those codes
that's the code sent by discord
I'll try reach to discord then, thank you @inner jewel
bot.on('guildMemberAdd', async (member) => {
if(member.user.bot){
let guilds = member.guild
console.log(guilds.members.filter(member => member.hasPermission('MANAGE_GUILD')).map(m=> m.user.username))
return bot.channels.get("535553754359922705")
.send(`@eve un membre viens d'ajouter un bot nommer ${member.user.username}`)
}
})```how to remove the bots from this list?
Hum

Did you install discord.js
It literally tells you the error
also "is there any personal info here" after posting the screenshot gg 👏 👏
post the related code and the exact issue
Sure.
one se
c
Going to upload the code since its too long
@mossy vine
Using pastebin because hastebin is having problems sorry
It doesn't error. When creating the channels the embed doesn't have the correct names and the wrong teams are given permission to see the channel
nice api key 
lol rip
might wanna reset that
did you just post your key again
Oof
@mossy vine
Final paste
Here is the problem I'm facing:
It doesn't error. When creating the channels the embed doesn't have the correct names and the wrong teams are given permission to see the channel
This bot uses the challonge (https://challonge.com/sl_s2) API.
Does someone's has discord bot join voice channel JavaScript
hey i am having a error in , could someone pls help me fix it?
thats master tho
no
Discord.js is a module for JavaScript to do things with the Discord API
Is there an simpel JavaScript command to edit last message bot send?
m = await message.channel.send()
m.edit()
With channel ID?
that was just an example
read the d.js docs for further info
also since you asked if discord.js is the same as javascript, i assume you dont know much about js
remember that google is your friend
and 9 out of 10 times it will answer your simple questions
.addField('Channels', message.guild.Channels)
^
SyntaxError: Unexpected token .```
Why?
Line 16
.addField('Channels', message.guild.Channels)
Code ^
Here is the problem I'm facing:
It doesn't error. When creating the channels the embed doesn't have the correct names and the wrong teams are given permission to see the channel
This bot uses the challonge (https://challonge.com/sl_s2) API.
@earnest phoenix still works
@tight heath ok
It's an API call which does not give a single shit about if the ID is in the guild or not
Member#ban is just syntax sugar
Yes
can someone give me a css i want to do a image are floating
@modest pendant You mean you want it to slowly go up and down?
Feel free to ping me back
Who knows about lowdb?
@ember atlas did you set the embed variable up correctly
Yes
@ember atlas Could you show the surrounding code
And message.guild.channels is a collection
I don't believe you can just shove that in an embed
You would have to map the collection or manipulate it in some way
true
@ember atlas its because you've probably put a ; at the end of the last line
Question:
Let's say I have a bot command a!note. And I want every args after the note command to be replied by the bot to the message author. How do I do that with ${args}?
what would the parameter inside the join() be? just whitespace?
whitespace if you want spaces
The param is the character to join with
So if I did args.join(',')
Args would become soemthing,like,this
It's the character to join the array with basically
Thanks! Another question though, how do I remove the note args from the bot's response?
I did something like this msg.reply(`Note: ${args.join(' ')}`); , but since the note command is part of the args, it would show something like Note: note <note here>. I want to remove the note part if possible.
thanks

