#development
1 messages Β· Page 1041 of 1
and ditching school to listen to spotify and use discord
You writing smth long, I'll read it
const input = process.stdin;
input.setEnconding("utf-8");
console.log("hello, type a name");
input.on("data", data => {
console.log(`you chose ${data}`)
});
amazing how development has also turned into shitpost
First time?
amazing how development has also turned into shitpost
@topaz fjord thats discord bot developers for you
mutiple instances
You probably have a loop running (or infinite loop). Do you know where the embed is coming from and being sent in your source code.
no
if (message.content.startsWith(`${prefix}botinfo`)) {
if(message.author.bot)return
const help = new Discord.MessageEmbed()
.setFooter(
`Requested by ${message.author.username}`)
.setTimestamp()
.setColor("#FF4500")
.addField("Servers:", client.guilds.cache.size + " guilds!", true)
.addField("Users:", client.users.cache.size + " users", true)
.addField("Channels:", client.channels.cache.size + " channels", true)
.addField("Library:", "Discord.js", true)
.addField("Node Version:", "12.2.0", true);
return message.channel.send(help);
}
});```
@sudden geyser
Poobis
hmm
@surreal notch Probably because you didn't do if(!message.author.bot) return;
I think that's it
idk
dispose events need to be enabled in the collector options
what about remove tho?
https://discord.js.org/#/docs/main/stable/typedef/CollectorOptions i see the dispose
not sure, try it
but im pretty sure dispose:true works for both
actually, no, it shouldnt matter here
not sure if the filter is different for removal
i would doubt that'd be the case
aight
up that was it
its really odd that you gotta enable it though
i assumed it'd be only used as handler for when the reaction doesnt exist anymore
ty Tim
the dispose option is for all collectors, not only for reaction collectors. it also works for message collectors
Hey, I want to connect my mongodb database but it always says that it can't. What is the right way to connect it?
it basically defines if whateverDelete or whateverRemove events are to be ignored or not
Thats what i think is strange, the option is called dispose, but it affects dispose AND remove
yup
a bit weird, but i get it
if dispose is not enabled, nothing is removed from the collected items, so your collection will still return deleted items if they were deleted in the mean time
that makes sense
@compact echo show code
is there an easy way to make a bad word protection
Probably
there are so many variations of that, so not really easy
@spare mirage Just do something like if(message.content === "badword"){
computers dont understand your intentions behind those words, they just see words. so there are pretty much unlimited way of bypassing any word filter by conveying your bad intentions in different ways, ways that computers dont understand, but humans do
Often, your looking at matching a word 70% anyway.
Like the f word someone much write
F*ck
You can catch that by matching the same structure, and whatnot
Make a bot
I already make a bot but the people by top.gg have to verify him...
Did I have to wait?
yes
you will get a role when your bot is approved
OK thx for the support :3
Hey, just asking but how do I connect a mongoose Database? If there is a video, please tell me
i guarantee there are videos on youtube
Woo u changed ur avatar
but typically, videos are not a great source for those needs
Please help. I really want to
So ehm.
function parseData(message, type) {
data = [];
console.log(data);
} ``` ```bash
./src/components/DiscordMessage.js
Line 38:3: 'data' is not defined no-undef
Line 39:15: 'data' is not defined no-undef
Search for the keywords to learn more about each error.
(js obv)
Ur not defining data
omg
data = []; no let or var and you're also not passing it as an argument
Oh
This time it'(s different lines
BRUH
is not
Same problem?
It was showing the fancyness of react error.
You're trying to send an empty message
Alright
And also
Add a catch
You're sending a user a DM with DM's disabled
You can prevent this by using a .catch()
gotta catch em all
How to add blank field in discord.js v12
you dont, use some unicode

ok sar
i love catch blocks, its a lazy persons best way to cleanse your soul of guilt
just slap a .catch(() => {}) and all your problems are solved @quartz kindle
Best solution
"my command doesnt work, no errors"
@opal plank Don't ignore your errors handle them
@tulip ledge
.catch(() => { throw new Error("Oh, no!"); })
not cursed enough
.catch((err) => {if(err) try { function errHandler(err) {throw (err)}}})
just don't look at the console and there will be no errors 
.catch(e => throw e).catch(e => throw e).catch(e => throw e).catch(e => throw e)
perfect
error: syntax error
a.catch((err) => {
if(err)
try {
function errHandler(err) {
throw (err)
}
errHandler(err).catch (err => {})
}}
)```
it's a commonly used image
trust me it won't
somethingthatwillerror.catch((err) => {
if (err) {
try {
function errHandler(err) {
throw err;
}
errHandler(err).catch((err) => {});
} catch (err) {
throw err;
}
}
});```
just tried
this has to be some of the worst things ive done
What did it do?
it wont pass there, it'll try the function first and error
the catch block onto errHandler will error and void it
So I have this JSON file:
"potions": {
"health": {
"limitedtime": false
},
"strength": {
"limitedtime": true
},
...
}
Now I'm tryna get all the entries that have limitedtime set to true how would i do that?
Should I forloop the keys?
so tis always only strength and health?
But some potions have different properties meaning some have health some have strength and speed etc
And these potions have limited effects
so potions have different properties?
Yes
if so, yeah, loop for in
Alright
How would I make a login page on my website with MongoDB, node.js, and html?
Hi again π So, I want to make a bot status command and this is what I have so far: ```css
if (message.content === ${prefix}botstats) {
message.channel.send(Total members: ${message.guild.memberCount} \n Total servers: ${botGuilds.toLocaleString()}\n Total channels: ${botChannels.toLocaleString()}\n\nUptime: ${Client.util.parseDur(Client.uptime)});
}
But I keep getting an error saying ``botGuilds is undefined``
I think it is
(if your client is named bot)
@compact echo yes
but how idk
i would open google and search for it
O
oauth
wdym?
bot.guilds
@lusty quest ok, ty
is it a discord thing?
idk
what?
Is it?
how do you not know what your logging into
I don't know
you tell me why you want them to login
o
How do you keep the user logged in when they log in with Discord OAuth and close the tab? Are cookies an option in this case?
bot.guilds
@lusty quest ok, so when I do the command it out putsTotal servers: [object Object]
Tell me if you want the code again...
add .size
It
It's bot.guilds.cache.size
ok
Aja
ty
np
π
um..
now it says size is undefined bot.channels.chache.size
like that?
@compact echo
(ping)
sorry π¬
you spelled cache wrong lmao
lmao
it's ok

any reason why my bot might be sending an Empty Character in place of an embed?
Code?
@vernal basin
@snow urchin
npm i -g --add-python-to-path --vs2015 --production windows-build-tools
npm i better-sqlite3
and u presume im on windows?
Then install the build tools for your OS
Linux: sudo apt-get install build-essential
Mac: Install XCode -> Once XCode is installed, go to Preferences, Downloads, and install the Command Line Tools.
thats not related

Just asking but How do I integrate my discord bot into a website?
Like a dashboard?
Or if you're using mysql databases or external ones you can just make the users log into the website with oauth (also what u do when using express) and then use PHP to send MySQL queries
Oh ok
Mmmh
I've done a quick research
And as far as I've seen your node-gyp installed incorectly or one of the packages that has node-gyp as a dependency
There's 2 ways to solve it
didnt better-sqlite3 stop using integer?
Either by deleting package-lock.json and all the node modules and reinstalling them
Or by removing node-gyp and reinstalling it
I don't know
I can check
Is integer a dependency?
both of does have been done, this is the first install ive done, without a package.json and node_modules folder.
fails every time
I don't know
Mmmh
show your package.json
Well seems like you have an outdated version then
its worked on previous host
as soon as I have moved to this server, it dont want to install
Am I blind or do Inot see better sqlite3 there?
why is node version 8?
quick.db required better-sqlite3
i have my reasons..
anyone has a bot that auto kicks/denies the alt [less than 14 days] to join the server?
anyway callum why are you using node 8?
It's also against the ToS
how
Thats hwat I was wondering too
You aren't allowed to get any data from a user without there consent
then remove engines from your package.json
av done
That's technically against the rules
i want to auto kick them
@earnest phoenix You want them to be autokicked if their account is under 14 days old?
ye
Oh
<user>.createdAt
i thought u wanted to see if the user was an alt
is there no bot already?
I don't know
I am sure there is, have a look at https://top.gg
Have a search through https://top.gg/
Oh lmao
AltDentifier may be nice
@snow urchin your quick.db is also old, latest version is 7.1.0
which uses better-sqlite3 v6, which uses integer v3
your npm is trying to install integer v1 which is deprecated
probably because something else is outdated
Hi again! :DDDD So I have tried setTimeout command but it doesn't work... can I have some help? and if someone sends the command while they are on the cooldown, it will respond with a message
What have you exactly tried with setTimeout? Can you be more specific.
setTimeout(() => console.log("5 secs elapsed"), 5000);```
setTimeout(() => console.log("5 secs elapsed"), 5000);```
@restive furnace That doesnt work... am I putting it in the right place? π
me
@spare mirage ```js
if (message.content ===${prefix3}beg) {
const { begNames } = require("./begNames.json")
message.channel.send("You begged and got " + [Math.ceil(Math.random() * 100)] + " dollars from " + begNames[Math.ceil(Math.random() * begNames.length)]);
}
where did u put it?
@spare mirage I put it under themessage.channel.send
but I took it out π
do I need to install something?
no
k
wait a sec lemme test smtng Kian
//at the top of ur code somewhere
const talkedRecently = new Set();
//in ur command event
if (command === "commadnname") {
//command stuff
msg.channel.send("Wait blablab time before getting typing this again. - " + msg.author);
talkedRecently.add(msg.author.id);
setTimeout(() => {
talkedRecently.delete(msg.author.id);
}, <DELAY>);
}``` this will work
so do I just add like talkedRecently; to the if statement?
π ty
ok, that does not work.... I dont think... It sends that message along with the message above and does not wait the time.... π did I do It wrong...? ```py
if (message.content === ${prefix3}steal) {
const { begNames } = require("./begNames.json")
message.channel.send(You stole ${Math.ceil(Math.random() * 1000)} dollars from ${begNames[Math.ceil(Math.random() * begNames.length)]})
message.channel.send("Please wait 5 minutes between each command - stealing - " + message.author);
talkedRecently.add(message.author.id);
setTimeout(() => {
talkedRecently.delete(message.author.id);
}, 50000);
}
lemme get a pic real quick
whats the error
Use Math.floor instead of Math.ceil
why?
to get the random item
do you guys think itll be ok If I await messages with a 5 hour timeout time
Because with Math.ceil the index can go beyond the bounds of the array
and you can get undefined sometimes
use quick.db @gray zealot
for cooldown use quick.db its better
Interseting I thought ceil should work?
i thiink
Interseting I thought ceil should work?
@tulip ledge it does π
no, array indicies start at 0
did u know bots can be alive
but 
U sen the message before the timeout @gray zealot
talkedRecently.delete(message.author.id).then(message.channel.send("Please wait 5 minutes balblalb"));```
Oh true
Math.random() is [0, 1)
If you get 0 it rounds to 1 then
U sen the message before the timeout @gray zealot
talkedRecently.delete(message.author.id).then(message.channel.send("Please wait 5 minutes balblalb"));```
@spare mirage ok...
which means inclusive 0 and non-inclusive 1
bots can send there own message without commands
so beware of what ur doing when u add a bot
Justii what are u talking about?
bots can mess up ur server if u add the wrong bot
I know
ok
stuff
I know what webhooks are
But what d oyou mean no it's webhooks
Bots CAN fuck up your server
or through a bot directly
@spare mirage Im getting an error... TypeError: talkedRecently.delete(...).then is not a function
its possible
remove the .
π
ok
if I go
for (let i = 0; i < 10000000; i++) {
client.guilds.cache.get(id).send(message)
}
it will spam the discord
Untill it gets muted
l
yes
bots can mess up ur server
nah
There's records of bots kicking everyone in a guild
if they are given admin perms
^
They can do that
no they cant
idk
how long does the verify of the a new bot takes? π₯Ί
And all the bots who have moderation permissions can kick people
oklol
but only in #265156361791209475 prob
2-3 weeks last time i checked
2-3 weeks
yes
And all the bots who have moderation features have moderation permissions
isnt bot-hell closed
I think so
I think it is
Yo question
so long 2-3weeks really? :(
yup
:(
now this is an error π talkedRecently.delete(message.author.id).then(message.channel.send(Please wait 5 minutes before send this message again, ${message.author.username}));
^
why the hurry?
Discord's ratelimit
is it globaly for your bot 5 things per 5 seconds
or is it per channel or per guild?
btw is it possible for bots to add other bots
now this is an error π talkedRecently.delete(message.author.id).then(message.channel.send(
Please wait 5 minutes before send this message again, ${message.author.username}));
^
@gray zealot under the . next to thethen
its per route mainly, although some routes have additional rules
What?
weird
π
/guilds is one route, /channels is another route
Tim are u talking to me?
Im so bad at this then stuff
yes
Kian, then expects a function, not a promise
Im so bad at this
thenstuff
@spare mirage no π
Hello, does anyone know Turkish?
nopee
yes I am
I can run dialogues if I "close" the channel?
sending messages is /channel/id route, its 5 per 5 per channel id
yes I am
@spare mirage nopeee
I'm assuming that's the error since you haven't given us the actual error
better than me π
Ok ty
ok
if (message.content === `${prefix3}steal`) {
const { begNames } = require("./begNames.json")
message.channel.send(`You stole ${Math.floor(Math.random() * 1000)} dollars from ${begNames[Math.floor(Math.random() * begNames.length)]}`)
talkedRecently.delete(message.author.id).then(message.channel.send(`Please wait 5 minutes before send this message again, ${message.author.username}`));
}
I just saw someone say quick.db is good
what is talkedRecently?
a const
A set i assume
yes
yes
its a set
hmm
lol ok
Yes
just make a new line then
talkedRecently.delete(message.author.id)
message.channel.send(`Please wait 5 minutes before send this message again, ${message.author.username}`);```
How do i make my bot send a message then edit it?
docs
?
oh wait you edited it
@earnest phoenix <Message>.edit
i don't care lol just wanna know how i can save the sent message that my bot sent so i can do shenanigans with it
<Channel>.send returns a Promise which resolves into the sent message object, then, with the message object do <Message>.edit("New Content");
You wanna save the message?
- brain.exe has crashed smh *
Then save it in the cache or save the message ID ina database to then access using fetch
Wdym brain.exe has crashed? Promises are basic JS just like objects
now you get the point
i tried let sentMessage = await message.channel.send("hi"); but it gives an error
yes that
smarty pants
make the function async by putting async before it
what is async
an language feature
a keyword
oof
If you're using a command handler turn the run function into async or if you're using events use async before passing the function
lol I kind of find it funny actually
that makes the function asynchronous
async(
//code
):
//will this work
no
wth
async execute
no
No
show code
It won't work
}```
will work though
basically a function right
show code @earnest phoenix
yes
async is not a function
i deleted it ages ago
It's used to make a function async
async is not a function
@tulip ledge i mean the syntax
async function() {}
async execute() {}
run async (I think please correct if wrong) {}
async function() {}
async execute() {}
Are the same lmao
lol
module.exports.run = async (parameters) => {}
run is used in many people's command handlers
Question. I got a laptop and I want to be able to have my code synced with my desktop. How can I do this?
Can somebody send a picture or something other with a Java code for a music command /music bot
^
I'll look into it
But now he can code in school on his tablet
@tulip ledge imagine doing that would be so cool
hmm
Who cares lol
idc what others say
You basically turn a VPS into a desktop and access it through the internet
Then you have to download and upload it all the time
in primary i used google's $300 credits as a free trial to get a vps with a gpu and then logged into it at school pcs and played games lol
LOL
Well
and will edit files on the server
My friend also made an online code editor
If u want I can link u
it's possible because vsc is electron :p
Did somebody is π©πͺ
Hallo!
moin
nah im dutch lmao
Oh no
oh yes
they're basically the same thing except dutch has more keyboard smash 
hi ich bin der kuuhle junge
We speak the same language π¦
german is basically dutch but then people screaming
xD yes
it's more aggressive
i took two years of german and the only thing i got from that is how to sound angry while trying to say "my name is x"
SCHMETTERLING
Is there a way for me to make a bot change a user's role based on a trigger?
What kind of trigger?
I'm trying to make a puzzle server. The user has to be in a specific text channel to read a secret phrase. If they say the secret phrase in the right spot, they get a better role.
yeah, when you get a message in that channel, with the right phrase, you then give the role
all in the docs
without knowing the language and library you are using we cant really help futher
I want to automate it so a bot gives the role, but I haven't found one that does so.
Just add a condition, something like if message.channel.id == <right_id>: await message.author.add_roles(role) (Python)
make one π§ @worn sierra
const embeds = require('../embeds.json')
...
message.channel.send(JSON.parse(embeds.kick.confirmation));
{
"kick": {
"confirmation": "new Discord.MessageEmbed()..."
}
}
I just get it sent as a string, what shall I do?
this is extremely specific, youd likly need to make a bot to do this
yeah idk havent made the switch yet
Json is perfect for static configuration
json is just a structure
I have around 20 embeds bloating my code, that's why I put them somewhere else
π€
What about command handlers?
command handlers dont do structures
command handlers have nothing to do with json files
π€
no
u can put the embeds in the commadns.js files
JSON only stores primitive values like strings, numbers, booleans, along with simple objects and arrays
you should store your embeds in a javascript file
embeds can be structured as objects
@cinder patio Then require that specific function?
require or import
ok
Yeah, but like Woo said, you can use json files but you'll have to make the embeds plain objects
usually for multiple functions you'd want to use exports
Quick question, I want a command that when run will list all id's of all guilds the bot is connected to. This is what I have so far, but it does not work. I'm sure I did something super stupid, but I can't figure it out. Any help would be greatly appreciated.
async def bigboi(self, ctx):
for guild in client.fetch_guilds(limit=150):
print(guild.id)```
why?
^^ which is why i like using a json.
i think exports could be better, you could have a master embeds file, with all your embeds and require only the one you need
Quick question, I want a command that when run will list all id's of all guilds the bot is connected to. This is what I have so far, but it does not work. I'm sure I did something super stupid, but I can't figure it out. Any help would be greatly appreciated.
async def bigboi(self, ctx): for guild in client.fetch_guilds(limit=150): print(guild.id)```
@cosmic leaf I'm pretty sure client.fetch_guilds is a coroutine and you need an await before
Declare your variable before
x = await client.fetch
And then
For guild in x
You will have to use javascript files if you have any dynamic data that needs to be inside the embed
ok this hurts my brain im out
which imo makes a ton of sense to do if you have a lot of embeds across your bot.
So something more like this?
@commands.command()
async def bigboi(self, ctx):
x = await client.fetch
for guild in x():
print(guild.id)
how do i create webhooks and set them up and make them do stuff lol
@elfin flower serious? ask google
push to webhook urls
@commands.command()
async def bigboi(self, ctx):
print([guild.id for guild in client.guilds])
@cosmic leaf
No something like:
guildlist = await client.fetch_guilds(limit=150)
for guild in guildlist:
print(guild.id)
Or the solution above quicker
you dont need to fetch_guilds for this
Yeah I just wanted to fix their code
google is FILLED with discord js tutorials of what i need help with
but i use discord py
works the same
@commands.command()
async def bigboi(self, ctx):
for count in range(0, 150):
try:
print(bot.guilds[count])
except IndexError:
pass
first 150
with webhooks
what
there is probably a better way of doing that actually
what are you trying to do @elfin flower
make a webhook server or push data to a webhook?
@elfin flower
wh = await ctx.message.channel.create_webhook(name="cool webhook")
guys do the bump bots work?
you can make it send with
await wh.send("cum zone")
why cum zone lmao
so i have this and it works just fine but it doesn't actually leave when the sound ends i use discordjs v12
const pickedaudio = Math.floor(Math.random() * (audios.length - 1) + 1)
const dispatcher = connection.play(audios[pickedaudio])
dispatcher.on("end", () => {
channel.leave()
});
because its funny
A fellow cum traveller...
but what if he is in the dum zone?
@commands.command() async def bigboi(self, ctx): for count in range(0, 150): try: print(bot.guilds[count]) except IndexError: passfirst 150
print(", ".join([str(g.id) for g in client.guilds][:150]))
I guess
that will raise an exception if there are less than 150 tho
why does py hugrt my brain
true, but then you either print 150 or nothing
For some reason I get 0 responce from the command when using the code I'll post my entire cog file if this may help in any way. I am totally stuck:
import discord
from discord.ext import commands
class Servers(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
async def bigboi(self, ctx):
for count in range(0, 150):
try:
print(bot.guilds[count])
except IndexError:
pass
def setup(client):
client.add_cog(Servers(client))
throws up
print(", ".join([str(g.id) for g in client.guilds][:150 if len(client.guilds) > 149 else len(client.guilds)]))
would this work? lol never tried doing something like this in an index thingy
@lyric hawk
Oh lol never tried something that difficult
I think you can't do the :150 condition thing
it works in print statements and stuff, but not sure if it would work there
like you could do
print("cum" if cum is True else "no cum")
yeah, thats what was originally recommended
op wants to limit it to 150 guilds too
I don't care how many tbh
then just self.client.guilds[:150]
For some reason I get 0 responce from the command when using the code I'll post my entire cog file if this may help in any way. I am totally stuck:
import discord from discord.ext import commands class Servers(commands.Cog): def __init__(self, client): self.client = client @commands.command() async def bigboi(self, ctx): for count in range(0, 150): try: print(bot.guilds[count]) except IndexError: pass def setup(client): client.add_cog(Servers(client))
@cosmic leaf sorry its self.client.guilds not bot.guilds
then just
self.client.guilds[:150]
@modest maple wouldn't that raiseIndexErrorif less than 150 guilds ?
no
hmm
i always thought it does 
how would getting my bot on a raspberry py work
[:150] just means anything upto 150
well, mb
Ok, that works, but I need the guild id's not the guild names
how would getting my bot on a raspberry py work
@spare mirage and would it run well?
omg
python is taking over
print(bot.guilds[count].id) @cosmic leaf
It doesn't
@cosmic leaf its all guild objects so just do guild.id
is that right
Got it working, thank you all very much (:
how I get a message with the id?
fetch from channel
message.channel.fetch()?
is there a way to automatically restart ur bot every X hours
hmm
@earnest phoenix messages.fetch()
and where i put the id?
in ()
you have a process manager @spare mirage?
something that reboots it when its offline
work @NMW03#2110
no
if you have a process manager, you can just exit the process every x hours after startup
in production enviorments, something with a process manager is needed
anyone know a good single board computer (no raspberry pi pls)
whats the price
suppppppppppp
single board computers go up in price if its not a raspberry pi
you also get less supported programs unless you start looking at more expensive boards
raspberry pi is plenty for a small discord bot
lets say I get the bot to 100+ servers will it still work fine and nobt explode
honestly, home hosting stops making sense at that point
depends really
100+ servers can be a few thousand users, could be 100k users
π€
how do i fix this error
β C:\Users\Cools\Downloads\dogbotv12\node_modules\rex.db\node_modules\better-sqlite3\build\better_sqlite3.node```
lets say 25k users
ohno
i cant think of a way to formulate my question so im just gonna ask how i do findOne() properly in mongoose because its not working
error:
(node:23148) UnhandledPromiseRejectionWarning: TypeError: Guild.findOne is not a function
constructor/model code:
const guildSchema = mongoose.Schema({
_id: mongoose.Schema.Types.ObjectId,
guildID: {type: String, unique: true, index: true},
prefix: String,
w_gChannel: String,
info: Boolean,
ping: Boolean,
poll: Boolean,
uptime: Boolean
})
module.exports = mongoose.model('Guild', guildSchema);
error origin:
const Guild = require('../models')
const config = require('../config.json')
const data = await Guild.findOne({ prefix: config.prefix });
let Prefix = args[1]
if (!Prefix) {
let prefixEmbed = new Discord.MessageEmbed()
.setTitle('Prefix help')
.setDescription(`The guild prefix is \`${data}\``)
msg.channel.send(prefixEmbed)
} else if (Prefix.length > 10) {
return msg.channel.send('The prefix must be less than 10 characters (for now)')
} else {
return msg.channel.send(`The prefix was set to ${Prefix}`)
}
omg
:D
haiii i have a tiny problem that i didnβt know how to phrase in a google search
if i have a string, and i want to redefine it to start 5 characters in and end normally, how do i do that? right now i have item[5:-1]
D:
it also depends on your code, and stuff @spare mirage
@dusty onyx substring
hmm
@pure lion looks like you are finding by prefix?
aha i see ty
are you not trying to find by guild
lets say I start with a cheap vps will I be able to upgrade without losing my files?
yes
on what service?
?
i use aws free trial ;)
@solemn latch oh oops
if you want to use a rpi for now, and swap to a vps at a later date if needed. that works
ye
i dont know mongoose 
@pure lion ..models/Guild.js
mod bot is going well
nice
Does anyone know the exact restrictions on emoji names?
Is it just alphanumeric or anything else
any bot suggestions for my server
Hey, how do i make my bot make a channel if it gets a reaction to one of it's messages? i use discord.py
on_reaction_add event, guild.create_text_channel
hai , if i had a list [1,2,3] what could i use to convert each integer into a string but still keep it a list?
python btw
map str
ty!
map(str, list) is more expressive imo
Or does that not return a list
Can't remember
Β―_(γ)_/Β―
yeet a list function on it if you need a list out of the map object
aha :-) perfect
map(str, list) is more expressive imo
@devout wagon And apparently more performant
Ok nvm if you call list on it
Let me try without converting it into a list
>>> timeit.timeit("map(str, range(10))")
0.400901900000008
>>> timeit.timeit("list(map(str, range(10)))")
2.2276748000000453
>>> timeit.timeit("[str(x) for x in range(10)]")
2.4527858999999808
Yeah it's not that significant
imagine if ctx.channel.send in channel() works lol
gotta shave off that 0.2 of a second
does anybody have experience with pm2?
but imagine if we talk about lists with hundreds or even thousands of elements
talking abt lists?
I suspect it wouldn't make much of a difference either, I'd be surprised if that scaled differently. Should both be O(n)
But laziness is obv useful in some situations
I was wondering if running a bot on cluster mode would make any changes on performance, etc.
Embed some js in a script tag
As long as the browser is running your bot is running 
My interpreter is taking its time running list(map(str, range(10000)))
I sometimes forget how slow python is
I'm still waiting 
>>> timeit.timeit("map(str, range(10000))")
0.4504657999999999
I'm not sure if my interpreter just straight up died or it's really that slow
how do i fix this Error: Could not locate the bindings file. Tried: β C:\Users\scltxn\Downloads\dogbotv12\node_modules\rex.db\node_modules\better-sqlite3\build\better_sqlite3.node
I'm not sure what's happening but my interpreter is just refusing to work efficiently
π
why pinged me
yeah ok it breaks for any number of elements
what
no
why does it take ages to evaluate 10
>>> timeit("[str(x) for x in range(10)]")
2.4655141
for channel in message.guild.channels:
a = await channel.create_webhook(name = "why am i sending messages in all channels")
await a.send("why am i doing this")


and u think me can affor that
