#development
1 messages ยท Page 579 of 1
What is a lib
library
Oh
the library you are using for your bot
Wdym a library
โ
Python - discord.py
there are other python libs
@upbeat solstice Can you mention the YuiBot you are talking about, if it's here?
and different versions of them
@earnest phoenix
Async
disco? Shit
how the fuck is that bot cert
It might be an embed image
they said attachment
Mk thanks for the link,
But I'm confused a bit
How do i make my bot send the embed image?
Embed
Okay
on your embed instance you'd call this https://discordpy.readthedocs.io/en/latest/api.html#discord.Embed.set_image
But in which part do i paste the link?
em = discord.Embed(title='My Embed Title', description='My Embed Content.', colour=0xDEADBF) em.set_author(name='Someone', icon_url=client.user.default_avatar_url) await client.send_message(message.channel, embed=em)
you cant use html as a url
I suggest you learn string formatting
the docs strictly say it needs to be a http(s) link to the image
that too what was said above
that is invalid python, you are missing quotes
Oh
and it cannot be a link to the website
Oh
it must be a direct link to the image
google it
that is still not a direct url
Then what is it
a direct will lead straight to the image and doesnt load anything else but the image
usually ends in an extension
Open the image in a new tab
I am getting. A very weird. And very annoying bug
Basically. My scp command won't recognise the number 334 specifically. Don't get any of the error responses. Just nothing
||Oof||
Thats what I get when testing the command
Tried it with a bunch of other random nums and get what I should do
Can show the code the command uses if its needed
It's probably something related to the API you're using
@earnest phoenix can you be more specific?
@restive halo since scp-334 does indeed exist, you should give us our code
I'd guess they are using the wikidot api
huh that seems weird
It should be working for 334, cause everything else works fine
this is really weird ๐ค
can you console.log() the text, just to make sure its working?
Can do but I'd have to do that later
Or console.log(response.statusCode)
Added the extra else to check for status codes
To see if there was an error other than null or a bad status code
Had the same issue with 999 but fixed it randomly when I was adding new stuff
Does anybody know if it's possible for the API to run a command on channel selection? For example, could I write a bot command if a user were to select Channel A, then another command if they selected Channel B?
what
Is the question not clear enough?
Channel selection... are you talking about clicking on channels?
it probably is but im too tired to understand it
@slender thistle yeah
Not possible
Ok, thanks
Wait
you can run commands in other channels than the one it's called int
in*
Like sending a message to a channel other than the one the command is called in
if that's what you mean
No, I'm talking about when a user physically clicks on a channel.
Only if they go into voice channels, but not clicking into other text channels
Poor soul
The issue was the returned text was 3k chars long
What is this?
``
(node:647) UnhandledPromiseRejectionWarning: Error: write EPROTO 140236323837760:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/s23_clnt.c:802:
at WriteWrap.afterWrite [as oncomplete] (net.js:868:14)
(node:647) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:647) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
``
it's an error log.
@earnest phoenix But did you even scroll up? I was trying to wait for you to answer but you just ignored.
thonk
i told you to google how to get a direct link from an image
and this:
``
(node:812) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:812) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 104.16.58.5:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
``
thats an issue with your code lmao
but where?
In your code

Youre welcome
lol

Anyone have an idea on why this weird anomaly occurs? When I change the first codeblock to the second, I get an error.js setTimeout(() => that.tick(), delta);``````js setTimeout(that.tick, delta);
setTimeout requires a function or something that resolves into a function. if you pass that.tick directly to it, it will resolve the value and pass the value, which isnt a function
oh
I thought it'd be similar to how you can pass in functions as callbacks to EventEmitter (node.js api) events
like js const readyFunction => console.log("Ready"); new Discord.Client().on("ready", readyFunction);
that.tick.bind(that)
I'm using Font Awesome icons on my webpage, and weirdly, there's this white line underneath them... any idea how to get rid of it?html <div class="hero-foot"> <nav class="tabs"> <div class="container"> <ul> <li><a>Learn More</a></li> <li><a><i class="fab fa-windows"></i></a></li> <li><a><i class="fab fa-apple"></i></a></li> </ul> </div> </nav> </div>
This is saying there's something wrong with internet connection, right?
But I can use Discord like normal, and there's nothing wrong with the code, this wasn't a problem yesterday.
And at node_modules/discord.js/src/util/Util.js, line 61, I logged the error: https://hasteb.in/irofutum.yaml
Show code @lilac geyser
The most common mistake that produces that error when using snekfetch is when u do .json() at the wrong place.
isnt snekfetch deprecated?
Yeah, you're supposed to use node-fetch
But discord.js stable uses snekfetch internally (master switched to node-fetch), so stable users tend to stick to snekfetch
Figuring to update to master soon
Yeah, master is eons ahead...
Just want it to become stable 
It's stable...
I've used it for a long time with no issues.
The last time I used stable was a couple months back, to try and reproduce an error someone was having
@opaque eagle Closed source, decided by other developer, sorry. But I'm very sure I used the exact same code several hours ago before I went to sleep and this wasnt a problem.
There's no .json() at any point
Are u calling snekfetch urself?
Nope
Hmm
This is a long shot, but did u go into ur node_modules folder and change the contents of the discord.js module? jk
Does that error show up as soon as the bot starts up, or when u do something specific?
Never touched the discordjs package until today when I added if (err) console.log(err) at line 61 as said above
As soon as bot starts
I dont think you got what I meant
over here i added line 62 just to see what the error is
and i made no other changes
So you went into node_modules/discord.js/src/util/Util.js and added that line in line 61?
added line 62
But did you change that file?
and got this https://hasteb.in/irofutum.yaml
The error was there before I changed it so I went there to get it to log the error
You shouldn't be editing the package.
And, adding that line in didn't tell you any more than what you previously knew.
Wait... is that an API ban? 
@opaque eagle I highly doubt
What are you trying to get a member count?
It's the existing member count bot you know, i hope
I tried to get a member count too and I kept getting an unexpected end of json input
P.S. if you wanna get the full error, instead of editing discord.js, you can just do: process.on('unhandledRejection', console.error); in your main file.
Same thing + edits you make to modules in the node_modules folder don't remain if you copy your code onto a vps or smth.
This is what I tried when it said unexpected end of input
yep it doesnt
I thought it returned json
(Instead of doing all that extra crap, just type in exactly what I sent)
Okay now this is a big question, npm install gets stuck as well
woah, thanks captain obvious
yeah
Man, ur bot must have like no dependencies whatsoever lmao @amber fractal
I've used the api endpoints and https module in separate projects, bot not in the same one.
What do I do :|
so many bot devs
thats how dbl earns a living
lol
That's my node test file
oh
I was able to do it now, but I had to slice "undefined" from the beginning
Which is weird
@opaque eagle Resolved by restart, thankssss
lol
The connection.play() method seems to always return that it's not a function no matter what
Is this a known bug or am I just missing something
module.exports = CurrencyCommand;
``` is anything wrong with this? i kept getting an error from this
is currencycommand a function?
I have a question, is it possible for me to make my bot make a new line every time XP is added? (like in the picture), instead of all being 1 line..
@quartz kindle
module.exports = class CurrencyCommand {}
@obtuse wind if you are trying to create a database like structure with json I HIGHLY recommend you look at other options such as sqlite or another form of data storage
@earnest phoenix try doing module.exports.CurrencyCommand = CurrencyCommand
Okay, i'll try
If that doesn't work, just send the error you get and ping me out ๐๐ผ
might be the incorrect file path to the database
on glitch, i think the db is in some data folder, and is called sqlite.db or something, if i remember correctly
it should be on the readme how to connect to the db
which readme
@earnest phoenix did you install quick.db?
oh yeah
i forgot about that
xD
Yeah you should do that
thank you zoro
it's working now

np
oi is quick.db just an in-memory db i aint never heard of that one
Hello, currently having a problem with the website if anyone could help me! @fossil oxide
At no point should you mention Oliy
The mods are here to help, also please move to #general @granite oracle
Alrighty
proceeds to ping all mods
Hloo
sorry for the long text :D
Hello, I was wondering if someone can help me with using async/await in discordjs
Basically i want to send multiple messages in succession
main.js
client.on('message', message => {
// some code here before sending it to a different file
command.execute(message, args);
})
ch.js
module.exports = {
...,
execute(message, args) {
array = [1, 2, 3] // build up an array of text here
array.forEach(function(arr){
message.author.send(arr);
});
return false;
}
}
problem is, I don't know where to put the async and await stuff.
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'quick.db'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\Edison\Desktop\Squiford\index.js:15:12)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
help
Already tried npm install quick.db, Did not work
On their npm page it says this is how you install it
Run:
npm -g --add-python-to-path install windows-build-tools node-gyp in powershell as administrator
Restart CMD prompt windows (Close & Reopen)
Run:
npm i quick.db```
Are you sure you did all those steps when installing quick.db?
if so check your node modules folder for a quick.db folder
I'll test, thank you.
np
I put the "Run:" ?
no
I'm not finding how to open powershell as admin
Could you explain how I can open it?
search for powershell in the windows search then right click to run as administrator
thank you
np
I'm still learning
good to know
hmm
Check node modules folder
for quick.db
also did you get any errors while installing quick.db
Yep
yeah
did you run this
in powershell admin
npm -g --add-python-to-path install windows-build-tools node-gyp
then try to install the package again
again?
---------- Visual Studio Build Tools ----------
Still waiting for installer log file...
------------------- Python --------------------
Successfully installed Python 2.7
wait
just wait a while until it completes
scratch that
run this instead, it seems to work better
after it is actually done then install quick.db
same mistake
are you waiting for it to be done
whats ur node version
last
v10.15.1
run this
in powershell ADMIN window
npm i -g --add-python-to-path --vs2015 --production windows-build-tools
and wait for it to be done
again?
yes
is the other install still running
it says its busy or locked which could be caused by the other install still running
Sorry, but i have to go, but someone can help you if you post your original message again
`internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'quick.db'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\Edison\Desktop\Squiford\index.js:15:12)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)`
help
Knowing how to do this
Did you copy paste code?
The code that is used to make the bot
Token?
I need to go to bed, good night
did you run npm i quick.db
of error
No. Did you actually do npm i quick.db
in the bot folder
installing windows-build-tools doesn't install quick.db
Did you install visual studio?
yes
Not visual studio code
Windows-Build-Tools needs at least visual studio community to function
Actually scratch that. It could be an issue though. It was necessary before with somebody else i was working with
npm install --global --production windows-build-tools
Use this line instead. It worked for me
Hello, I would like to get some tips regarding sharding. As my bot is about to hit 100k servers, I'm seeing this as an issue: it takes rather long to fully start up the bot. So I thought of two ways:
- Clustering, possible multiple instances of ShardingManager?
- This is regarding updates: shard migration. How would I go about doing something like, loading all the commands and events before updating the shards, instead of ending the process then start everything?
Or is there something else I can do? Thanks :p
i doubt that, searching your id on google doesn't provide any bots or anything, but okay
you can't circumvent the delay between each shard connect and disconnect
@earnest phoenix There's definitely got to be a way that we can get the shards loaded first, without connecting. Then after the loading finishes it then go on to reconnect.
no
...?
shards are just individual connections to the websocket
they need to connect to be ready
besides, shards should be independent of each other
you've probably been misinformed
bad idea
the library wouldn't handle ratelimits properly
you'd get kicked off from some connections
And basically what I wanted to do was to run the rest of the codes, then finally login, not possible?
stop trying to bypass something that's been put in place for a reason
well
it is
but again, shards should be independent of eachother
you probably haven't and you've probably been misinformed
CHamburrToday at 2:24 PM
And basically what I wanted to do was to run the rest of the codes, then finally login, not possible?```
for this, you could increment a number each time a shard connects and decrement each time a shard disconnects, you can then have an if check in your message received event to see if current shard count matches the desired number
if it isn't, return out of the function
but again
shards should be independent
if one shard, e.g in the US region dies, you're locking your whole bot
can you provide an example of where you have seen that
because you can't get shards ready if they don't connect
the whole process of them getting ready is them connecting
even big bots like ayana, rythm etc. deal with this issue
you can't possibly get the shard ready before connecting because the shard wouldn't be populated with any entities
How would i get rid of a string from a specific beginning character to an ending character for example
some !cool? string
How would i remove the string from ! to ?
@split hazel
var myString = "some !cool? string";
var myString = myString.split("!");
var firstpart = myString[0];
var myString = myString[1];
var secondpart = myString.split("?");
secondpart = secondpart[1];
console.log(firstpart + secondpart)
Result: "some string"
thanks alot
@split hazel
var myString = "some !cool? string";
var string = myString.replace(/!.*\?\s/, '');
console.log(string);
This is much cleaner
yeah, regex make shit simple
yeah more cleaner, thanks
Ok so I want reactions in my help command like people will react and the bot will show the next page of it.
When we will click on the reaction the bot will show next page of help command
How to do it?
Send the message, record message id somewhere. Listen for reactions on that message and edit the message accordingly
can anyone help me to make music bot in js
no
ok
You can download ready to use bots and learn from that
Download bots 
probably refering to the tiny bit of outdated code you can find on github 
Something's up with my command handler :(```js
module.exports = class CommandStore extends Map {
constructor(client) {
super();
this.client = client;
// eslint-disable-next-line no-console
console.log(this.client instanceof require("eris").Client); // returns true
}
/**
* Load a command.
* @param {string} cmdPATH The path to the command's file.
*/
load(cmdPATH) {
const command = new (require(cmdPATH))(this.client);
if (command.init) command.init();
this.set(command.name, command);
command.aliases.forEach(alias => this.set(alias, command));
}
};``````sh
/usr/src/app/structures/CommandStore.js:22
throw err;
^
TypeError: Cannot read property 'client' of undefined
at load (/usr/src/app/structures/CommandStore.js:18:57)```
how would you make something like this
--------๐---------------------
i use discord.js-lavalink
Math.
`internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'quick.db'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\Edison\Desktop\Squiford\index.js:15:12)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)`
help
He asked this yesterday
I try to download, only from the error.
@amber fractal I was sleepy bye
required visual studio ?
without being the code
anyone who has anydesk could help me?
help yourself, stop pasting code you don't understand
he understands the code
just doesnt know how to follow a fucking guide on how to install prerequisites for quick.db
@tiny fulcrum if you send me where you are getting the bot code from I can help you! ๐
instructions are clearly found right here https://i.imgur.com/osocApT.png
I already tried it yesterday
Well
Node gyp was messing up for someone yesterday too
I dont use it, idek what it does tbh
Yes
it's not quick db
Why are you installing it on system32?
How do i get the first 3 items from a collection
get the array of keys and get the first 3
@opaque eagle how are you calling load?
class MyBot extends Eris.Client {
constructor() {
this.commands = new CommandStore();
this.walk("commands", this.commands.load);
}
walk(dir, callback) {
for (const file of fs.readdirSync(dir)) {
const filepath = path.join(__dirname, dir, file);
if (fs.lstatSync(filepath).isDirectory()) {
this.walk(filepath, callback);
} else if (file.endsWith(".js")) {
callback(filepath);
}
}
}
};```
yeah, that won't work
var x = something.function; x() doesn't work
you need to bind x to the instance
var x = something.function.bind(something); x() works
oh
Hi i have a question,
First i start up my shards and all existing/new guilds get distributed between them. I wonder if after this initial assignment, can it be that a guild switches shards?
no
okay so im having some css issues
- this text is not aligned vertically in the div
thx
shard_id = (guild_id >> 22) % shard_count
- this happens
a guild only gets assigned to a different shard if you change the count
so it might rarely happen with auto shardcount
relevant code
<div class="top">
<h1>KTaNE Expert</h1>
</div>```
```css
h1 {
color: white;
text-align: center;
font-size: 2em;
vertical-align: middle;
vertical-align: middle !important
}
.top {
height: 5%
}```
it might happen every ~1k guilds + restart
but its not a problem in my case because the memoryalso resets
can anyone help with my css issues above ^
it looks like the header of a page, why not simply use margin top and bottom?
but with what values?
but the thing is that it doesnt work
adding margin-bottom or top to h1 doesnt change anything
margin-top: 5%;
margin-bottom: 5%;
delete the .top height attribute
delete the vertical aligns
delete the whole top thingy, div and css
but i plan to add more things in the div
that would be (also vertically aligned) on the right and left
what do you mean with vertcally aigned? where do you gain your height from? do you mean you have f.e. 3 columns where each element in vertically aligned (except the highest one ofc)
let me beautifully draw what i want to achieve
ok^^ is it for a webpage? can you use css frameworks?
yeah its for a webpage, and i dont want to use a framework for this project
excuse my shitty drawing skills
you shouldnt fixate on the 5% imho
this highlights the vertical alignment issue better
oh
then how should i do it?
i want it to take up a small portion of the screen
well the font size changes with the view ajyways
so it wont be 5% exactly but it will be ralative
try 1. delete every div and css except the h1 and textarea
does the textarea still overlap?
huh, no it doesnt
okey try to keep it basic. you should first create 3 columns, then insert text with alternating height (or buttons), then try vertically aligning those
sooooo a table?
if two html elemnts overlap, that are behind in your code, then its not clean
or some floating boxes or so
so instead of the div i need to make a table with 3 columns?
honestly i would go about it by searching for css only headers
in google
copy paste , everything set with example buttons and neat stuff
im actually kind of confused about how to go with the design
then take whats offered ๐
i only really need to switch between 3 tabs (not actual browser tabs), an faq href, and a grid href ๐ค
makes life easier
how would i align the content to be on the left, in the center, and on the right respectively?
@viral spade
https://hastebin.com/oxeregemil.js
Bot wont list the topics on google
I need help
just ask your question 
don't scrape google
they don't allow it and you'll get ip banned
scrape duckduckgo instead
honestly theres a low chance google will notice and ban you
For scraping idk if you can do this in js (your probb able to do that tho) but with Python you are able to add data so that the site thinks that its a casual user.
Anyone using Discord.NET here?
yes hello
Is there a way I can "flatten" the AsyncEnumerables the library implements ?
1.0 or 2.0
2.0
FlattenAsync
๐ค show your code
Literally just this https://i.imgur.com/9JV6B2J.png
Well okay but that method doesnt return a Task
Ok FlattenAsync does but its not compatible anyways because the types dont match
thonk, not really familiar with f# or how it works
that code should work in c# and vb
Welp guess ill have to cast it
@shadow dust what language is that?
python?
is it?
It doesnt look like it to me
Maybe tho
I dont use python
Python ^^
I dont think that's python
f#
is there like an easy way to check something in the name of something else so say like there
lol = {whatwfe: 2313, 1231234: 13535y4, 123123: 3125423463} //not really just ex
is there a way to like make it so i can check if(!whatwfe | !2313 instead of if(!lol.whatwfe | lol.2313 (replace | with || cuz heckin spoilers)
@slim heart in what, js?
yes
Just wondering, is it possible to extend the JDA client so that I can append some properties like hashmap onto it
yeah but Im not sure what kind of errors it throws
so Im thinking of a class that contains the client instead
I mean that obv would work, but it doesnt make sense why they wouldnt let you?
Huh. I guess not then
Well then I guess your logic of just putting client into its own class would be the best thing ya could do 
Would a shared database in microservices be considered an anti pattern
alright
how do you check if a message is made/edited/deleted by a bot?
@worn ridge hey.
So I was watching your code of @last onyx on github and I saw this:
# Xenon>bot>cogs>basics.py
@cmd.command()
async def ping(self, ctx):
"""Pong"""
ย ย ย ย await ctx.send(**ctx.em(f"I have a **latency** of **{round(self.bot.latency * 1000, 1)} ms**.", type="info"))
When I was looking for the type object in the message I didn't knew what it did.
When looking in the discord.py rewrite docs I couldn't find it.
(https://discordpy.readthedocs.io/en/rewrite/api.html#discord.abc.Messageable.send)
Would you like to inform me about what it does?
@ruby talon shortcut for ctx.message.channel.send
Nop I meant the type="info"
So with the type="info" the message gets embedded?
Yeah, I have a custom context class and em is basically a shortcut for https://github.com/Magic-Bots/xenon/blob/development/xenon/utils/formatter.py#L28-L33
Oh, thanks!
May I know what this refers to?
Invalid Form Body permission_overwrites[1].id I didn't use permissionsOverwrite anywhere in my code, checked thoroughly
@gilded plank
is node-opus installed properly?
I can not install it properly
@lilac geyser you might want to provide some more information.
Since we are unable to help you with the information you gave.
let channel = await obj.guild.createChannel(cName, 'voice', [
{
id: obj.guild.defaultRole || obj.guild.id,
allow: ['VIEW_CHANNEL'],
deny: ['CONNECT']
},
{
id: obj.guild.me,
allow: ['CONNECT']
}
]);``` This is the only code that I think concerns permissionOverwrites
@ruby talon ^
And I believe there's nothing wrong with that? and obj is basically message
I would guess js.
ye that is js
Idk I prefer python rn, and I don't know js, I'll learn js in this future.
Ooof
id: obj.guild.defaultRole || obj.guild.id what
You're using an expression as id ?
Expressions return true or false afaik
Hmm but even so it wouldn't return 'invalid form body', right?
Idk if defaultrole works, since its kind of a weird thing
And idk if using the guilds own id as a role id works either
Have you tried without that part to see if it works?
Its fine to use a || b
Its just a shortcut
what the frick
in discord.py, does await bot.process_commands(message) fully execute when the command has finished executing, or right after it starts executing it?
@lilac geyser also, have you tried obj.guild.me.id in the second overwrite?
So I recently got visual studio code as my editor, And this dumb program keeps opening automatically with a file named "cli.js" even when it's closed visual studio opens and that project opens, Anyone knows how to fix? The content is about how the program or such is free to use etc.
So I recently got visual studio code as my editor
even when it's closed visual studio opens and that project opens
you meant vsc there?
And this dumb program keeps opening
If I transfered a bot to a team, and do a command check for is_owner, will anyone on the team be able to use is_owner command checks?
Yes, I meant vsc
most likely because that was the file you were editing most recently?
stuff like that can also happen when you have multiple instances of vsc open at the same time
Listen, When I close vsc it opens automatically after 5 minutes or so.
what the fuck
Like it's 100% closed, but it opens automatically
maybe you have something that opens it in the background, like it's updater?
Idk, I run it as admin tho can that be a problem?
here is my suggestion: reinstall vsc completely, and if it still opens randomly, report it as an issue
Your vsc runs randomly?
Yea
maybe a bik virus?
that was my guess
A what?
but why would a virus make vsc open a bit after its closed 
some stupid virus by a stupid engineer, I assume
And open a specific project named "cli.js" and in there it states about license, free to use and such
And that I can read more in the license.txt file
I deleted everything in the file because it was some small code bit in there, As stupid as I was.
did you make cli.js?
Nope
I'll try reinstalling it then
Aight, I'll try sending y'all a screenshot of the file if it happens again
upload the contents to an unlist pastebin/hastebin instead, way better than having to look at screenshots
what the fuuuuck
wth is that
beautified
"use strict";
const bootstrap = require("./bootstrap");
bootstrap.avoidMonkeyPatchFromAppInsights(), bootstrap.configurePortable(), bootstrap.enableASARSupport(), require("./bootstrap-amd").load("vs/code/node/cli");
//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/1b8e8302e405050205e69b59abb3559592bb9e60/core/cli.js.map```
one thing is for sure
the packages required in the code are NOT the ones on npmjs.com, as they dont have the functions mentioned in the code
what the actual fuck is this
do i have that file in my vsc installation as well?
idk check, C:\Users\USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\
And you should be directed to a folder containing "cli.js"
I have no idea, I downloaded it from their website so there's nothing that can have gone wrong...
That one correct?
I did
does it still happen?
searching for cli.js in the vsc repos issues tab doesnt show anything relevant. your best bet is to report it at https://github.com/Microsoft/vscode/issues
if anyone else has an idea as to what the fuck is going on above, post it
does anyone know an answer to this? https://discordapp.com/channels/264445053596991498/272764566411149314/549601389895221252
Is anyone intrested in helping me code a bot in Node? I have like 2% experience in coding, I've used Discord Bot Maker (I know smh) where you need to use variables and connect different action etc but that's it. I have Atom, PyCharm, Visual Studio Code
how to make ascii art bot in node.js?
@neon plume google
As text or as image?
text
Discord's fonts are different from standard fonts, so regular ascii art generators do not work very well
ok
If you dont find anything specific for discord, then nothing you can do besides trying to make your own
i want to make simple ascii art bot
Ascii art is not simple
But you want to send as text right? So it will use discord's fonts
yeah
Go to any ascii art website, copy an art and paste it on discord
You will see that it will not show correctly
There is an application form in the website
ohk
@earnest phoenix Javascript is already simple enough, if you compare it to other languages like Java, Javascript just needs a bit of effort
Can some one help me?
for?
My bot.
just post the issue
what help @fringe rover
Thereโs no issue i just need help with a command.
what are you using
Node?
Post what you are trying to do, and the code you tried
ohh
Tim i donโt know The code though.
What do you want to do?
Youre using discord.js?
Yes?
Check discord.js.org
Ok
They have all the documentation you need
Ok, I'll check it out @sinful lotus
But its different from The commands Iโve been using.
What have you been using?
Yep
oofers
Lol
fast reset your token
Yep
Doesnt look any different to me
coz everyone can raid your server
it doesnt matter that its deleted
๐
i use python and node

node is just started
can i get some help from a staff member?
If your bot has admin permissions, people can ban everyone jn your server and delete all channels lol
So its all good
one of my friend got raid many times due to that problem
Rip
but its fixed now
Anyway, from the code that you showed before, you should be able to figure out role commands as well, since they are not that different
Unless your whole code is copy and pasted and you have no idea what youre doing lol
can anyone tell, how to make a good welcomer?
with code
my welcomer is not much good
^or that
@quartz kindle Erm yer that
but i am happy with what i have got
๐๐
you can host through servers
like glitch.com or heroku
Then you should start with basic javascript. Look up some online courses like codecademy or whatever
but
If you dont understand basic javascript you wont undestand 99% of making bots with javascript
Does anyone know if you can do multiple command.cooldown checks on a single command?
like this
@commands.cooldown(1, 30, commands.BucketType.guild)
https://discordpy.readthedocs.io/en/rewrite/ext/commands/api.html?highlight=commands cooldown#discord.ext.commands.cooldown
Ah, crap, hm, apperently its only one
A command can only have a single cooldown.
you dont understand basic javascript but want to make a discord bot with javascript
Then learn. Programming is something you need to study, its not something you can learn on one day
Slowly study and get familar with it, and slowly become able to do more things
And eventually you will know how bots work and will be able to make them easily
This is going to be so dumb but i'm new ok?
client.on('message', (message) => {
if(message.content == 'ping') {
message.reply('pong');
}
});```
When i run that it gives me an error saying "ReferenceError: client is not defined"
because client is not defined
you need to install d.js, import d.js in your file, then define a d.js client
just copypasting code and expecting it to work aint how you do things
learn javascript first
there are some great resources pinned
I'm watching a video not copy and pasting ๐
im guessing you still dont understand the majority of it, because of your lack of javascript knowledge and experience
What he said. client needs to exist somewhere. Did you create it?
True, I don't know where to learn java script tho. It's apparently much easier to code a bot using java script than nodeJS
There the same thing ๐คฆ๐ปโโ๏ธ
Wait a moment lmao
you dont even know what nodejs is holy fuck
Node.jsยฎ is a JavaScript runtime built on Chrome's V8 JavaScript engine.
^
and as i said, there are great resources for learning javascript pinned in this channel
like glitch.com or heroku```
no, don't use free hosting for public bots
I got it that's why the message is deleted ๐คฆ
Cyber can you give me a direct link to add the command to add roles for my bot in Discord.js Org
??
no
Slinky can you read docs
a) it isn't a link
b) we aren't spoonfeeding code
Theres an example you can copy and paste here lol (if you know how to use it) https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=addRole
Its righ there lol
message.member.addRole('193654001089118208')
.then(console.log)
.catch(console.error);```
?play
hey discord js has defaultChannel but it not working, how can i do a same command as defaultChannel
yes, i see that in discordjs documentation
then whats the problem?
how can i do a same option than defaultChannel
You vany
Cant
It doesnt exist
If I'm to guess, master doesnt have it anymore
You're probably on stable
yes i'm on stable version of discordjs
There is no default channel since people can delete it
What you can do it send to the first channel that you have permissions to send
Which isnt always a good idea either.
System channel
Or let users set up the correct channel for that
(moderators or admins)
Hello.
Before showing my problem you need to know that I'm using Python 3.7.2 64-bit.
My code:
[in the Moderation File]
from Extras.utils.files import Files
Error:
No name 'files' in module 'utils'
My file layout.
โ run.py
โ
โโโโExtras
โ Currency.py
โ Moderation.py
โ
โโโโutils
files.py
Fixed btw --

Is there any way to host I bot that was coded on mobile
Anybody know of a bot that is able to take information from a certain channel and automatically post a standard poll on another private channel?
For example, we have a graphic design channel in which people apply for roles such as "Junior, Intermediate, Advanced, Professional and Illustrator", when they apply in the #role-application channel we'd like a bot to take their application and create a poll in our #role-critique channel that has 5 emojis of the available roles for us to vote on
No but it would be easy to create
How much would that go for?
I mean if you have access to a server @outer niche you can likely run it on that
What language are you using?
Pydroid 3 @restive halo
Ah
I use js for mine
Not sure what you use to get a python bot running
How would I get a server
with money
^
Well I need to know where to get one
You can search for them online
And if you're gonna be doing it off your phone I'd recommend getting Termux
you can't reliably host a bot from a phone
Termux would just be for ssh'ing into the server
Actually hosting a bot on a phone sounds like actual pain
for those that know how discord.py works, if I request a user object from discord, is it stored in cache or not, considering that their information may change and not have a mutual server will only make it inaccurate in the future
@ruby dust discord notifies on user change afaik
what
Umm Users should be cached and updated on new events I think
I seriously doubt it caches users retrieved through rest calls
@quartz kindle @quartz kindle I didn't try with id, since the it doesnt return the error every time, just occasionally, so idk why :(
i've just made a webhook code for logging votes, but it didnt log the vote...
@dense dove don't ask the same thing in multiple channels. #topgg-api is the correct channel
how would I set up a reaction based help command, that if you were to hit the reaction to go forward it would go to the next page, and if you were to hit the back reaction it would go back?
What language are ya using?
yeah, there may be a prebuilt thing for it depending on the langerino
How do I host a bot with v3rmillion
I am just going to do a per page thing, if they do like ;help 1 It will show them the first page
so if I just set up the help command to give the list per section of commands would that be okay? like ;help displays one section of help ;help2 displays the second section and so on?
hello guys, someone know how I can transform 1 array to 3? (javascript)
[1, 2, 3, 4, 5, 6, 7, 8, 9]
->
1: [1, 2, 3]
2: [4, 5, 6]
3: [5, 8, 9]
plz ping me
you want to make 3 arrays?
Im thinking of manual method but split may work?
just google it like fishy linked lmao
finally got eval to work
no
why?
that exits node process
how can you be so sure
i host my discord bot on my samsung smart fridge- any tips to improve performance?

so whenever i need to check up on the bot, i grab myself a drink
anyways, back to my original question, any tips for achieving maximum performance with a smart fridge?
Can we please leave #development for more serious discussions instead?
rip my performance then but ok
@earnest phoenix that array would have been easy for me in 1988 but alas, too many years and loss of grey matter...
I did this in nodeJS I can't seem to fix the problem
So if I can't use import what am I supposed to use
Common.js
Ok
oof
Or wait I think u can run it with the --experimental-modules flag, if your node version is recent enough @outer niche
But I still don't get some of your syntax
It kinda looks like python lmao
https://hastebin.com/zefeyetofe.js
Syntax Error Cant seem to sort it
my code is just messy
That makes the issue about 1000x harder to fix
It's no wonder theres a syntax error in there tbf
Unexpected end of input is the error
so you're missing something
a } or a ) most likely
Which isnt surprising.
use beautify or smh
whats that
It wouldnt work anyways.
Because theres an unexpected end of input, it comes out like this
Well that wasn't beautifier*
The editor I use on my chromebook will auto format, and usually it's correct
hey guys how can i have my bot loop through an entire cast and send it as a message.channel.send?
for example let's say I have this cast array:
characters: [
"Narrator",
"Twilight Sparkle",
"Twinkleshine",
"Spike",
"Applejack",
"Granny Smith",
"Apple Bloom",
"Rainbow Dash",
"Rarity",
"Fluttershy",
"Ponies",
"Pinkie Pie",
"Mayor Mare",
"Nightmare Moon"
],
for (const entry of entries) {
// entry = entries[0]
}
ohhh i think i get it. i'll have to use Array.prototype.join for javascript is that correct?
Oh. That loop. Yes that. What Deftones said
depends what you're trying to send?
are you trying to send an organised user friendly list?
If you want to OUTPUT all of them, then do
m.channel.send(characters.join(' '));
yes i just want to output
Yeah. That joins them with a space
alright i think i have a better understanding...
You may want to do ```
m.channel.send(characters.join(', '));
that puts a comma in between each name
if so i'd reccommend using
Array.map((value, index) => `${index}. ${value}`).join('\n')
that's added to my future use file
I am having memory issues with discord.js, rss grows indefinitely and memory usage is way too high. I captured snapshots with chrome dev tools, and realised there's many of such objects, is this normal?
https://media.discordapp.net/attachments/404569720583618560/546345656336252941/unknown.png
If it is, then what can I do? I currently have 16GB of RAM for 80k+ servers and is running out terribly, crashing the bot every single day. forever is currently used to keep it alive, but definitely not a good idea.
@languid dragon Are you talking to... me? ๐
no
oh
@lilac geyser Theres nothing you can do other than to download more ram, I mean put more ram
I got 39k with 28 shards and my usage is already at 8.1gb
@sinful lotus So it's the fact that discord.js is bad at memory... :(
just rewrite to eris hahayes
lol @heady zinc at this stage im very familiar with discordjs and changing a library just seem... you know
a bit late
@sinful lotus Hmm, some stuff?
How do I do that ๐
nuking something blindy will cause you errors
