#development
1 messages ยท Page 1556 of 1
Set a circular crop area, draw the image then null the crop area
yep, got it. thanks
Is there a Discord Bot that is able to monitor a specified Website to display if it is UP or Down for users?
no, implement yours :)
i wish - thanks!
its a basic ping script
Well, I know nothing of bot creation... ๐
If the fetch returns anything but 200 the site is having issues
2xx, there's other than 200 what is succesfull code
import axios from 'axios'
setInterval(
() => {
axios.get('website.url').then(ret => if(!ret) message.channel.send('oh no, site offline'))
}
, '1h')
eww, axios bloat
For most sites, 200 will be the most common response
no im not, i am bloat-free. re-implemented things what i've seen as bloat
huge overhead compared to http (node built-in module)
real devs use undici
the ONLY reason you should use axios is browser to reduce footprint and dependencies
axios API is 1000% better
i have exactly 1 explicit dependency, beat me on that
whoa
theres a shitton aciox does a lot easier than fetch
real devs use sockets
people really be bragging about having less dependencies
yeah what's that about
also multiple requests
you can do literally those by yourself tbh
people talking shit about axios
axios is good but too bloat for me
no thanks
actually
one sec
google might have a good thing for you
here
Real men use aligator clamps and timed electric pulses for requests
real men send a mail to the page owner's house and wait 3 months for a response
Real men have 5 hot ladies in their area
real men are men
men real are man
yes
real men are women
Just use fetch

just use a good handling lib
go use notepad instead of vsc then if you like doing stuff manually
axios has way too much handy shit that i wont be passing by
disclaimer I only use js for web dev and have no idea what you are on about
axios is an http lib
Yeah no idea what that is, have a good day
obviously i prefer fetch for small stuff in browser

but i find axios a lot better for the rest
got is better than axios in almost every single way lol
Game of thrones?
y
havent even heard of got
Imagine using game of thrones for requests
have you heard of sindresorhus?
Is there any way to make bot host a website?
so i can code peacefully on ur thing
sindre breathes open source, codes open source for a living, has 1k+ repos, is sponsored by a shit ton of companies
guy is a god
What host?
I Mena when bot is on to make website on too
Again, what host?
holy shit
If it's a vps, you can easily host both the bot and the site
I don't get it with what host
imagine being this guy
Heroku, vps, gcloud, etc
he has 200+ sponsors on github
What host u use?
and here i thought i was doing a lot with 412 commits last year
I have a self panel
this guy breathes code
That I hodt my bot there
yes
this guy is a legend
he has hundreds of npm libs
actual useful npm libs, not shit libs
Look, you must to have some kind of hosting service to keep the bot online
What host do you use?
Pterodactyl
wtf
Wtf is pterodactyl?
A vps then?
Emm yea
its LITERALLY lagging when i click on his repos @quartz kindle
lmao
Just host the site in that same vps then
I don't know how to do it..
oh shit i simp him so much for that
If you want to make the site be available only when the bot is online, use a websocket connection
@quartz kindle HE MADE NP DUDE
BRUH
i use np on a fucking daily basis
what the heck
and i didnt recognize the name
what a guy
Fuck Rem, im simping this guy. He's my new waifu
DJB2, SDBM, FNV and StringHash
swissmaps 
all of sudden i got this ts file
/// <reference path="index.d.ts" />
import { Client } from 'discord.js';
const client: Client = new Client();
client.on('ready', () => {
console.log(`Client is logged in as ${client.user!.tag} and ready!`);
});
client.on('guildCreate', g => {
const channel = g.channels.cache.random();
if (!channel) return;
channel.setName('foo').then(updatedChannel => {
console.log(`New channel name: ${updatedChannel.name}`);
});
});
client.on('messageReactionRemoveAll', async message => {
console.log(`messageReactionRemoveAll - id: ${message.id} (${message.id.length})`);
if (message.partial) message = await message.fetch();
console.log(`messageReactionRemoveAll - content: ${message.content}`);
});
client.login('absolutely-valid-token');
what this
typescript
i know
what's your question?
guys could someone help me please? I need to know if my bot is connected to a voice channel in a guild (discordjs)
guys how can i know if my bot is in a voice channel in a guild in discord.js
guild.voice
i have this: if(typeof Client.guilds.cache.find(g=>g.id===message.guild.id).voice.channel != "undefined" || typeof Client.guilds.cache.find(g=>g.id===message.guild.id).voice.channel != null) but when the bot is in voicechannel and then leaves and then its still says it is in a vchannel
dafuq is that overcomplicated code
Client.guilds.cache.find(g=>g.id===message.guild.id) can literally be replaced with message.guild
lol
and you dont need to strictly compare to null or undefined
you can literally just do
!message.guild
if(!message.guild.voice) return;
lol
also,typeof null returns "object" just sayin
how are you going doing?
he wants to check if the bot is connected to a voice channel
yeah
yeah bloat
ok thanks guys
@opal plank are you erwin
no hes not
what does his name state
isnt it obvious?
still not working
He's not erwin, he's erlose
not working
guild.me.voice?
It's the same thing
this works for me thx
i don't even know d.js lol
what about if (!m.g.v) return; (debloated variable names)
lmao
why would you even do that
although i've been guilty of doing that in the past
if(ytdl.validateURL(vid)){
if(message.member.voice.channel.joinable){
message.member.voice.channel.join()
.then(connection => {
connectionVar = connection.play(ytdl(vid));
message.channel.send(`Es wird abgespielt: ${vid}`);
});
}```
why does this dont play?
dude
to debloat djs
like i doont get any errors
that just makes it hard to read lmao
@cinder patio do you know how to make eslint shut up
disable the rules that annoy you
use xo
best eslint out of the box
why does this dont play i dont get any errorsjs if(ytdl.validateURL(vid)){ if(message.member.voice.channel.joinable){ message.member.voice.channel.join() .then(connection => { connectionVar = connection.play(ytdl(vid)); message.channel.send(`Es wird abgespielt: ${vid}`); }); }
we don't know
?tag help
Please provide full event. So we can see are you even checking the command correctly.
ok wait
Please never ever minify source code
There's a special place in hell for people who do that
not even front-end?
Source code, not production code
yet another lib by sindre lmao
You can minify production code as much as you like, but leave source normal
Variable names length doesn't even affect performance at all
they affect size though
It's not worth saving a few bytes over maintenance ease
when does file size matter
in front end atleast
^
okok
ye?
when you use travis ci to host your bot
is this efficient? https://alebot.is-inside.me/OyQcwPFj.png
lemme check mine
im in 20
http://paste.mozilla.org/ycDp7dr5 guys pls help
@pure lion my bot is at 98 servers and is at 41 mb ram
is that 26mb or 26gb lmao
what lang?
python
mb silly
@earnest phoenix you can arc some circle parts on the rectangle borders and crop the context, then draw the rectangle
at least that's what i can come up with
i could get mine into kilobytes prob but then i'd go native than intepreted though
@quartz kindle test this for me: Which is faster, array.push(...) or array[array.length-1] = ...
Also:
array.pop();
vs
const el = array[--arr.length];
they are both the same
but both are what the fuck
wtf is wrong with these times
let me test on browser
perf_hooks on node.js is VERY unreliable
what does "notable" member mean?
on browser i get more consistent results, but still roughly the same for both
this is not a fair test because pop removes the item from the array
pop vs splice is more fair
light mode AJhggggggggggg
I am meaning your role "notable Member" @Tim#2373
on 3 guilds now lol
I meant
const el = arr[arr.length-1];
arr.length = arr.length - 1;
So both are relatively the same?
it means i did something good i think?
yes, im still getting weird results on browser tho
from 170ms to 300+ms
for both
weird
.pop() is 30x faster
good to hear
๐ ,wow
Somewhere I read that rray[array.length-1] = ... is faster than .push
you dont need -1 for push
how is that faster ๐ค
also, yes assigning to array index directly can be slightly faster
cuz no ref increase when cuz no return type ๐
if you're doing something like copy the contents of an array to another array, using the for loop index should be faster
but from my tests they are still exactly the same
i mean its a insignificant amount of time diffrence
here's another thing you should never use
but why does the libary have such things when its slower?
eslint
there is no real alternative to .unshift()
to .pop()
eslint is good tho
ok
all this yellow you see here
is because eslint doesn't know what an implied return is
like what
whats the actual code its complaining about?
because i never had problems with implicit returns
i didn't actually put a return type for most of my functions
but that's because these functions have implied returns
you can disable the rule
i feel like this rule is supposed to activate on an any return type
in d.js, what's the difference between resolve(); and cache.get();?
So, it's been 2 weeks and I still haven't gotten a reply on my intents application 
oh buddy
I think when we applied for an intent that discord forgot to add not us no requesting it it took them about 2 months to respond and fix it 

i just realized bots probably won't be able to do voice commands
@modest maple discord doesn't really have any methods of listening though
yes because they're discord
Made a voice assistant AI bot using voice recv fun times
MEE6 has a built in recording function, so bots can recieve audio.
But there isn't docs anywhere on it, and MEE6 is custom coded I believe, so yeah.
Gl
it is, MEE6 isn't using discord.py or anything but just python and aiohttp (and other useful things) for their bot
Well its a lil more complicated than that but yes
well yeah front-ends and (if they're proxying:) proxies
Hey, in the Rules-Info channel, they say that the bot has to function under permissions=0. Am I good to assume that the bot doesn't need to fully function, just be able to communicate / not be a complete brick with default perms? That seems logical, but I figured I should check lol
i need help
Don't ask to ask, just ask
i have an application bot and I want to change the questions he says
how can I do it?
????
so how can I configurate a bot?
how?
welp
omg
in which web?
Learn a programming language
or app?
i recommend js
Hell no
oh ok ty
For a beginner Python would be much easier
well js is still relatively easy...
c++ 

Probably not for a beginner who never touched programming
java 

should i include zlib-sync as a dependency in my discord project? Does it improve performance just by being installed?
yeah
Error: accept EMFILE
at TCP.onconnection (net.js:1533:24)
Emitted 'error' event on Server instance at:
at TCP.onconnection (net.js:1533:10) {
errno: 'EMFILE',
code: 'EMFILE',
syscall: 'accept'
```I have express server, and now and then this happens
I have no idea how its possible
that;s weird. then why dont they just include it as a dependency>
EMFILE = too many files open
Oh thanks, how can I solve taht?
look for your fs code
make sure the stream is being closed
Because afaik it's a native module and it's not needed for the library to function
i think there is a .close() method
Ah thx
makes sense
https://github.com/isaacs/node-graceful-fs check out this lib
you should avoid file reads if you can. it's not a supported feature on some hosting providers
if i push get a free account i get my captcha but then i need to do it again and again how?
Are you an AI trying to learn how to defeat captcha?
If I do fs.readFile(path, "utf8", .... would I still need to close it?
createReadStream or createWriteStream anywhere?
do you have loops where you open files?
https://pastebin.com/qiHF6Yf7 do you think this would be working?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Yes
But it gets error after 10 hours
other so
I saw this on geeksforgeeks, and modified it
yes
I first read, then write
Because if user access token is already in my text file, i need to return
It worked thanks @proven lantern !
what worked?
for readFile?
that's weird. those should happen automatically. maybe it needs to be closed in the loop
hopefully it doesn't come back in 10 hours
Yeah
I probably just tested some code in the middle of my source
And forgot to remove it
that's how I accidentally made my bot leave all servers
can someone generally help abt javascript here
i uh am trying to make a leaderboard command for my bot
and i did it like this
i have a map,
and inside the keys are user IDs and values the stuff ill compare them by
hmm
then i used Object.entries
and then .sort()
aaaand it doesnt work
i put up a few console logs and smtn is not right at Object.entries
as it outputs an empty array
It literally just says
[ ]
Does your DB has an entry?
yes
you don't use Object.entries on a map
Array.from(myMap.entries())
np
And for the note, Map in JS is like OrderedDict in Python, it remembers the order of items you put into it. So if put items in order whne you iterate you will get them in the same order.
Also, if you like shortand syntaxes you can just do [...myMap]
Hello I wanted to put some color for my table and I tried to put this outside <table bordercolor="green" (for example) I put them outside it didn't work I tried inside it still didn't work is what you can help me I don't know how to do it
Is using CSS an option? If yes, look up here how you can color it https://codepen.io/jonitrythall/pen/odxwgw
@earnest phoenix yes. You can embed CSS.
Ah okey thanks I'm going to go test
<style>
table {
background: olive;
}
</style>
<table>
<tbody>
<tr><td>col 1</td><td>col 2</td></tr>
</tbody>
</table>
Silly question, how does one show the user's nickname in the server instead of the username? message.author.displayName?
Im noob.
It's giving me undefined
show code
module.exports.run = async (bot, message, args) => {
let bruh = new Discord.MessageEmbed();
let user = message.mentions.users.first()
if(message.content = user) {
bruh.setColor('#add8e6')
bruh.setURL('https://www.youtube.com/watch?v=AH0uV-ijGy0')
bruh.setTitle('BRUH?')
bruh.setAuthor(`Hi Rushia, can you please say bruh to ${user.displayName}?`, bot.user.displayAvatarURL())
bruh.setDescription(`**${user.displayName}** Rushia says bruh to you`)
bruh.setImage('https://imgur.com/jJctIAy.gif',({dynamic: true}))
bruh.setFooter(`${message.author.displayName}`, message.author.displayAvatarURL())
bruh.setTimestamp();
message.channel.send(bruh);
} else {
bruh.setColor('#add8e6')
bruh.setURL('https://www.youtube.com/watch?v=AH0uV-ijGy0')
bruh.setTitle('BRUH?')
bruh.setAuthor('Hi Rushia, can you please say bruh?', bot.user.displayAvatarURL())
bruh.setImage('https://imgur.com/jJctIAy.gif',({dynamic: true}))
message.channel.send(bruh);```
you're kidding right
read the error
displayName is undefined bcs message.member.author is null
its message.member
.displayName
Alrighty
does jda do webhooks?
Used to, now it's a separate lib
Just search "discord jda webhooks"
I don't remember the exact maven lib
So I want my bot to create a variable called the user's id when they say a command into json file. How can I get it to check if the user's id is already in the json file?
Ok ty
How can I make it so it creates a variable with the user's id?
Never mind I figured it out
Ok, I'm using python to develop a bot that receives a vote. However, the docs just cover bot voting. And the webhook for on_dbl_vote returns bot_id and user_id... but not server_id..
My bot is to get dbl votes on servers not bots so how would I do this?
#topgg-api @slender thistle will guide you
are you talking to me or someone else?
you
Can I ask about something?
No
Okay so bye and have a nice day

Hey guys, I'm getting an error and my bot just crashes, there is something wrong with this code. Any idea on how to fix it?

I already told you your issue, it's that you defined discord.js as DiscordJS but then refer to a variable "Discord" in your code
Actually I'm not sure what your client is defined as
What's underneath this?
DBM?
Yeah.
Discord Bot Maker?
Yeah.
you have to put it in initBot()
Let me get rid of it.
because thats the scope where you define your client
Like, in between the brackets?
si this
Yeah.
Bot.initBot = function() {
this.bot = new DiscordJS.Client({ blabalbalab i dont care enough to type });
// put your setInterval() fucntion here
};```
This code?
const client = Discord.Client() // Your discord.js client
const Topgg = require('@top-gg/sdk')
const api = new Topgg.Api('Your top.gg token')
setInterval(() => {
api.postStats({
serverCount: client.guilds.cache.size,
})
}, 1800000) // post every 30 minutes```
I'm sorry, I'm really dumb.
keep the const Topgg = and the const api = thing at the top of your code, but move the set interval thing there because thats the only scope you have client defined in
and remove const client = Discord.Client() because you already define your client in initBot()
const Topgg = require('@top-gg/sdk')
const api = new Topgg.Api('Your top.gg token')
setInterval(() => {
api.postStats({
serverCount: client.guilds.cache.size,
})
}, 1800000) // post every 30 minutes```
Like this?
n o
I'm literally spoonfeeding you 

Will someone have the files for a welcome and farewell bot ???
Require stack:
- /home/container/bot.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:893:15)
at Function.Module._load (internal/modules/cjs/loader.js:743:27)
at Module.require (internal/modules/cjs/loader.js:965:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/home/container/bot.js:17:15)
at Module._compile (internal/modules/cjs/loader.js:1076:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:941:32)
at Function.Module._load (internal/modules/cjs/loader.js:782:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/home/container/bot.js' ]```
I got this and then it crashed.
Install it
I did.
Wait.
It didn't upload.
Wth.
Hold on.
you can find open source bots in github
confused caht
?????????/
It keeps deleting it.
I did that.
or did you delete the const client line
both of them starts with const
Wait.
No.
yikes you included your token
Sorry.
LMAO
Hold on.
also please install the module top-gg/sdk
you haven't instaleld it in ur node modules
What did I do wrong now?
How can I activate a bot from visual studio?
I'm sorry for my stupidity.
Iara, that's what happens when you spoon-feed a user who uses discord bot makers
Lol.
Daily stuff in development
cries
How can I activate a bot from visual studio?
OH
-faq 13
the rest of your issue is becauase top-gg/sdk is NOT installed
your error basically says
"hi top-gg/sdk isn't installed plz install and retry"
Like this?
that indentation is gross but yes
I'm pretty sure discord bot maker doesn't allow other packages to be installed
Its correct?
time to move out of dbm
F
stop spamming
Sorry.

i just spent 20 mins helping you to know that dbm is the stupidity
spoonfeeding you *
But you have Discord.js, why use DBM? 
Your hosting has a console
That's the main file of the DBM, they did not write that
I guess your only way of doing this is to not use DBM
People say adam and eve were kicked out of eden because they ate the forbidden fruit.
That's untrue, they were kicked because they used dbd/dbm
Code it yourself
Bot makers are the root of all evil
Probably stupid question: In the Rules-Info channel, they say that the bot has to function under permissions=0. Am I good to assume that the bot doesn't need to fully function, just be able to communicate / not be a complete brick with default perms? That seems logical, but I figured I should check lol
yes
baiscally yes
so if it doesnt have the perms your bot should be like
yo give me kick perms
"Yo, shits fucked bro"
It needs to fully function or ask for required perms
or yo give me ban perms
Yeah, lovely lol
it shouldn't ask for admin perms or perms it shouldn't need for that command tho
Like, if they try to use kick command without kick perm you must ask that perm
^^Exactly. For the scope of my bot, I really just deal with embed & reaction based perms, but I've already got some handling in place for that. Just making sure things are up to some degree of snuff before I throw it at the top.gg reviewers
thanks guys!

Kudos for caring about reviewers
Heh, something like that. Tbh respect for top.gg/whoever worked on the entry requirements explicitly rejecting bots that don't have a certain level of effort put into them
we have strict rules, but we're not unreasonable
thanks
jk im not the only one that does guidelines stuff
lmao
^^ Entirely understandable, like I respect every single one of them honestly. Gives me a slight bit more confidence in bots from y'alls listings.
It's actually easy to pass approval, many other bot lists have way more rigid rules
Tbf, top.gg's approval rate is only low because "bot was offline" dudes
I mean I'd figure, but honestly the reqs even existing in the first place is a bit surprising to me
Lmfaooo, that's hilarious
we approve 20-30% of queue 
Would be 70-80% without offline bots
it's not that bad
, people are just stupid
for a lil while ye, back when queue was like 8k
now it's steadily faster
I'd assume 'people' has a subtext of "substantial amount of younger kids"
Not wanting to discriminate, but forbidding turkish bots was a wise move
Was there a legitimate problem with Turkish bots being exceptionally poor en masse?
That sounds oddly hilarious
we can't forbid turkish bots because literally half of queue is turkish bots
Yep, they for some reason just mass-produced copypaste bots
we just spent more effort + resources on trying to find clones, tracking clones, and searching for turkish staff
Turkish botums, copy pasted, offline or has the entire npm registry installed
Don't forget nekos.life
forbidding a language to me doesn't sound right
and this is someone that's tested thousands and thousands of turkish pain
Nekos life is basically not allowed
google results are... intriguing?
Pedo site that shows underage neko girls
It's an image api
It can return nsfw images of lolis and shotas
But it has pedo tendencies
Basically minors which is not allowed
Ah. I see

What a wonderful platform we reside on
Capitalist je(sus)
Please, please oh dear enlighten me
Basically a dude that self-declared being the messiah and demanded money
Was a fun day
wait did that actually happen
I-
I see.

It did
Gentleall
Have you guys ever like, wanted to dig in and find the root source of the turkish spam? Like, whether it's just one guy with way too much time on his hands somehow spamming garbage bots with shell accounts, or maybe some turkish youtuber somewhere promoting some kind of discord bot ponzi scheme?
Basically, 3 words
Because there's no way that just, out of some freak coincidence, turkish discord users all decided to make godawful code abominations to spam your website with, en masse. Right?
Scuffed YouTube tutorials
Yeah, youtube, stack and github
the internet has a really darn interesting influence
^^^^
I mean, it's entirely believable. Just very, very interesting that it caught on so disproportionately hard with a Turkish audience.
The issue is that people don't generally understand that coding isn't about writing code but understanding what you're doing
So they just copypaste
fax
Amen
Then proceed to ask spoonfeed in this channel
Most of them don't know english much so they just refuse to either read the documentation or the guide, so they decide to watch scuffed and outdated YouTube tutorials
Just following what they do
Hey how to set up dank sale item in my server say pls
what?
Dank memer?
And at the end of the day, their package.json file is like 1 billion lines
Dank sale items
Is it a bot?
Low hanging fruit
You could ask in their support server
This isn't Dank Memer support server
this server isn't for that
Idk if anyone here would be able to answer
Wish I could =P
Sometimes confused with a rock
@night coral If you don't have/can't find there support server, you can find it at this link. Someone there should be able to help you leagues better than any of us can.
https://discord.com/invite/meme
we actually know the cause
they have servers where they mass send out the bot codes around
some as a vote perk

yeah
the period when the verified badge was around was absolutely the worst for everyone
Tukish devs just rushed and copy pasting code just to make bots to get the badge
It was just basically hell
That's... wild lmfao. I guess just about anything is possible on this god-abandoned pile of fiberoptics & copper
Like, hilarious, but also just wack as heck. What dungeonmaster of a god thought side-story up
Anything is possible in dev universe 
Hmm. In a complete change of topic, does anyone have any cute/self deprecating splash text ideas for my info cmd shard-counter?
github
i use mediafire
Gold
Anyone know how to move a PostgreSQL database to a different server but still keep all the same data
do it within your code
get all values from one database
transfer it to another
postgres has a way to do this without code i think
you can use pg_dump
have no idea how to do it via the ui
What was the Server Name Field Code?
Javascript lib
what
I think he's talking about getting the name of a guild using javascript in an embed
i use process.env.SHARD_COUNT and it's working well. Maybe you can try it
It's python
Ok
alright
hElP
can someone help with a coding error
`def get_prefix(client, message): #first we define get_prefix
with open('prefixes.json', 'r') as f: #we open and read the prefixes.json, assuming it's in the same file
prefixes = json.load(f) #load the json as prefixes
return prefixes[str(message.guild.id)] #recieve the prefix for the guild id given
client = commands.Bot(
command_prefix= (get_prefix),
)`
what i need to change ?
I can't find anything online
why is your command prefix on the bottom
That should prob be on the top g
the client part is also in the wrong spot g
๐ค
Ugh
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'to_dict'
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'to_dict'
it's like
oh
what did you do? did you pass a string to embed kwarg or something
is this wrong ?
I can send you me code
my*
just like edit out the parts that have the token and my WIP website
just pass an actual Embed object doe
derp
hi
Is it wrong fully ?
Did you get any error? That seems fine I guess, except if someone invited your bot while it's offline, you'll get a KeyError error

hm
lemme try to redo the command thing
brb
I seem to have just changed the code to a working code LOL
Ya it have an error
And I'm now only coding my bot bot giving anyone to invite ๐

You'd better cache the prefixes in memory though, so you don't read the json multiple times. Actually, just use an actual db.
CACHE AND PROPER DATABASE PLEASE
The code circled is the one giving issues
value = f(*args, **kwargs) File "d:/bots/panda.pro.py", line 12, in get_prefix return prefixes[str(message.guild.id)] #recieve the prefix for the guild id given KeyError: '804269442866479144'
that file name tho
return prefixes.get(str(message.guild.id), default_prefix) will fix your issue, but please just use an actual db.
Someone sent me that
300gbddos


tysm
I'm kinda a python newbie in this stuff
where do I edit my code
exactly
Lol
Like which string
Learn python 
..
I'm learning as I go g
I've made most of this bot off memory
some I got some hep
help*
but that's all lol
but yeah @slender thistle Idk like
which line I'm editting
I assume the 2nd to last?
Learning basics on the go
๐ฉ
Bro?
So I have author, then what
it's not supposed to be "embed = 'embed'
correct?
Yes it's not
does Colour even work on python when making an embed
Yes
I had it change the embed color
Both color and colour work
bri'ish
JavaScript devs are gay then for only making color work 
give a nice discord.py learn link
๐ฅบ
huh? Just RTFD
oi
So like how do you refer to a variable
I'm retarded so
i-
stfu
@earnest phoenix give me a hug before I go crazy
it's almost 1 AM and I'm working this bot
You should care if you're working in Python
what the fawk ๐ค
Strings are text, variables are keyword names that are used to refer to stored stuff in memory
you have a variable embed that you need to pass to embed=
Instead, you are passing a STRING that says 'embed'
yo is this the discord for the bot that creates tradingview charts?
No
I don't have to go crazy tryna figure out some bullshit error the internet can't fix ๐
actually my full code for custom prefix is :
Eh I mean
It's very basic stuff if you think about it
sent that in a .txt
there really needs to be a rule about binning code
yeah
@earnest phoenix I think you were already told about codeblocks
People here are amazing
and thanks for the link i am gonna read it all
noice
if you read the source code, you'll find many things that aren't documented
message.member.roles.cache.forEach(R=>{
message.member.roles.remove(R)
})```
I now this code well be work but how I can write a code If bot can't remove member role return for nothing
check the bots position ?
No if you now
If the member role higher than bot role this code well be error and I wanna Fix this
check. bot. position
How ๐ค
forEach ๐คข
I don't like a .map
How?
The for...of statement creates a loop iterating over iterable
objects, including: built-in String, Array, array-like
objects (e.g., arguments
orย NodeList), TypedArray, Map,
Set, and user-defined iterables. It invokes a custom iteration hook with
statements to be executed for the value of each distinct property of the object.
never heard of that before lol
a fancy for loop
oh wait
does the indexing for you
I think I have
Thank you for this
also
Ok
your code will try to remove the everyone role
(you can't, it will error out)
so check if the role id is the same as the guild id
if it is, continue
How I can check just you can give me an example by code
take a guess
message.member.roles.cache.forEach(R=>{
message.member.roles.remove(R)
})
Check this
no, i asked you to take a guess on how to do that comparison
it's really simple and logical
if you're wrong, i'll help you get to the right thing
let member = message.guild.members.get(args[0])
if (!member) return;
In here i wanna add code if the bot can't remove member role just return
member.roles.cache.forEach(R=>{
member.roles.remove(R)
})
you aren't reading anything i'm saying
I don't now how I can take a guess
what do you expect
don't know ๐












well that's your problem

