#development
1 messages ยท Page 1140 of 1
./db.json
def get_prefix(client, message):
with open('prefixes.json', 'r') as f:
prefixes = json.load(f)
return prefixes[str(message.guild.id)]
client = commands.Bot(command_prefix = get_prefix)```
thats my code
Add ./ to the left of prefixes.json
with open(./'prefixes.json', 'r') as f:
@drifting wedge cat ./text.txt would do the same as cat text.txt, u understand?
@misty sigil The reason why its 15 seconds is because a status can only change 4 times in a minute, 60/4 = 15. I have 4 total status's. And I want it to update when my bot is added to a guild is my goal.
yea
Je rae me
Json is so suspectable to corruption x_x also you can't write to it at the same time from multiple processes because it's a file
@stable nimbus I'd just advise using client.guilds.cache.size
as if you're using d.js all guilds are cached
would it work better?
@faint prism corruption has nothing ntondo with that, the errno clearly states that the file isn't present
any idea why im getting this error?
its on a vps
no
if i run it on my pc it works fine but on the server it says that
who
with open('prefixes.json', 'r') as f:
prefixes = json.load(f)
return prefixes[str(message.guild.id)]
client = commands.Bot(command_prefix = get_prefix)```
@faint prism corruption has nothing ntondo with that, the errno clearly states that the file isn't present
@earnest phoenix I'm talking in general. Not keeping up with the active convo rn
@earnest phoenix did you use /usr/bin/env/python3/2 instead of just python
@earnest phoenix I'm talking in general. Not keeping up with the active convo rn
@faint prism Ah, sorry.
@earnest phoenix the shebang
:) no worries
this isnt even python
def seems like python to me. I might just be an idiot since I've never used it.
lol, the def one is python
yes
Mentioned the wrong person
but the other code is js
Oh fuck I pinged the wrong person, sorry.

@earnest phoenix can you pipe to nl so I can see where the error occurred?
also backticks are not quotes @earnest phoenix
So I'm trying to make a list of embed objects but for some reason it's complaining over a space? I can't figure out what's wrong
@client.event
async def on_message(message):
if message.content.startswith('$starbae'):
mylist = [embed = discord.Embed(title="Endo, ###", description="1 station away", color=discord.Color.purple())
embed.set_author(name=client.user.name, icon_url=client.user.avatar_url)
embed.add_field(name="============", value='test', inline=False)
embed.add_field(name="Field2", value="hi2", inline=False), discord.Embed(title="Endo, 101", description="1 station away")
embed.set_author(name=client.user.name, icon_url=client.user.avatar_url), discord.Embed(title="Endo, 101", description="1 station away", color=discord.Color.purple())
embed.set_author(name=client.user.name, icon_url=client.user.avatar_url)
embed.add_field(name="============", value='test', inline=False)
embed.add_field(name="Field2", value="hi2", inline=False), discord.Embed(title="Endo, 101", description="1 station away", color=discord.Color.purple())
embed.set_author(name=client.user.name, icon_url=client.user.avatar_url)]
await message.channel.send(random.choice(mylist))
try this is member.displayName instead of member.author.tag
@earnest phoenix
member.author.tag does not exist
Might want to read the documentation for the library and the API lmfao
he tried. message.author.tag which only works in a message event
@earnest phoenix So
@earnest phoenix action commands like slap or hug, a rules command, a randomimage command that gets a random image from a site
Hmm that's a good idea
await channel.send(embed=embed)
AttributeError: 'NoneType' object has no attribute 'send'
async def on_connect():
embed = discord.Embed(
description='**NFO** Has Detected An Attack!\n\n**Location**: Chicago\n\nA Filter Has Been Applied To Protect The Server.',
color=0xee7000,
)
embed.set_thumbnail(url='https://media.discordapp.net/attachments/725272853565538416/742432548180852736/warning.png')
channel = client.get_channel(742452987435155586)
await channel.send(embed=embed)```
whys it saying that
channel = client.get_channel(742452987435155586)
isnt id a string?
In js it is a string and not a number
python
channel = client.get_channel(742452987435155586)
isnt id a string?
In js it is a string and not a number
@midnight blaze fuck weak typing
channel is a None value
wut?
so of course it wont have any useful properties
LOOL
oh no
@earnest phoenix what do you mean?
i'm working on a PingCatcher feature in my bot, how do i see if a message has a mention included in it anywhere in the message?
and that's the correct channel id?
yes
put it in a string
@earnest phoenix what do you mean?
- why would you have numerical values as strings
- In js,
"1" == 1evaluates to true.
oh just found that the docs says int
finally fixed my index
nearly 500 lines, down to 75.
When I fetch channels, I get them in strings. So, that was just an idea.
because js is a little special snowflake and supports numbers up to 53bits
I know that this is the case in js, but is it in python?
py should support unsigned 64 bits no problem iirc
When I fetch channels, I get them in strings. So, that was just an idea.
@midnight blaze channel contents or IDs?
i'm working on a PingCatcher feature in my bot, how do i see if a message has a mention included in it anywhere in the message?
@karmic compass which lib
long long ;)
py should support unsigned 64 bits no problem iirc
@earnest phoenixlong longwas a good idea
@faint prism fuck beat me to it
Heheheh
weak typing is the devil
I'm mobile rn too. That swipe to text is the key
@client.command()
async def changeprefix(ctx, prefix):
if author.has_permissions(manage_messages=False):
ctx.send(f"Sorry, you don't have permission to do this!")
else:
@commands.has_permissions(manage_messages=True)
@commands.has_any_role("changeprefix", 'adminperms')
with open('prefixes.json', 'r') as f:
prefixes = json.load(f)
prefixes[str(ctx.guild.id)] = prefix
with open('prefixes.json', 'w') as f:
json.dump(prefixes, f,indent=4)
embed = discord.Embed(
colour = discord.Colour.blue()
)
embed.set_thumbnail(url=f"{author.avatar_url}")
embed.set_author(name=f"{author.name}", icon_url=f"{author.avatar_url}")
embed.add_field(name=f"Prefix Change", icon_url=f"Prefix was changed to: {prefix}")
embed.set_footer(text=f"{member.guild}", icon_url=f"{client.guild.icon_url}")
embed.timestamp = datetime.datetime.utcnow()
await ctx.send(embed=embed)```
im getting a tom of errors
i just wanna make it so if you dont have the permission, it says you cant do it
if you do it sends the embed
Isn't it f'{stuff}' not f"{stuff}"
what's the errot
@faint prism No, weak typing in prigrammong
@earnest phoenix yeah that's what I'm referring to
the thing is
You don't have a command function there as well
i think the code is wrong
A good assumption, because it is
lol
^
how would i just send the embed if they have the permission tho?
And I pointed out all mistakes in that code
@golden condor there's zero difference between apostrophes and quote marks in Python
It's just that you'll have to escape apostrophes in a string surrounded with apostrophes and vice versa for quote marks
That's why I kinda asked instead of stated
@drifting wedge You can use channel.permissions_for in the command function
p.s. I'm on phone so you'll have to get the documentation yourself
ok
Also, you can't slap a decorator in the middle of a function
Those are supposed to be above functions, they are function decorators
@pure kernel br?
@drifting wedge sim
@client.command()
@commands.has_permissions(manage_messages=True)
@commands.has_any_role("changeprefix", 'adminperms')
async def changeprefix(ctx, prefix):
with open('prefixes.json', 'r') as f:
prefixes = json.load(f)
prefixes[str(ctx.guild.id)] = prefix
with open('prefixes.json', 'w') as f:
json.dump(prefixes, f,indent=4)
embed = discord.Embed(
colour = discord.Colour.blue()
)
embed.set_thumbnail(url=f"{author.avatar_url}")
embed.set_author(name=f"{author.name}", icon_url=f"{author.avatar_url}")
embed.add_field(name=f"Prefix Changed", icon_url=f"Prefix was changed to: {prefix}")
embed.set_footer(text=f"{member.guild}", icon_url=f"{client.guild.icon_url}")
embed.timestamp = datetime.datetime.utcnow()
await ctx.send(embed=embed)```
is this correct?
That's one way of doing it, yes
doesnt work...
icon_url doesn't exist in fields
It exists in author and footer
oooh
ok
sorry typo
how would i find the author tho
it said author not defined
author.author.avatar_url
you need to import discord py
is it message.author.avatar_url
or whatever ur using
and then u need to run the token
message.author.avatar_url
i want the author url
not to message the author
Why my bot offline
@earnest phoenix we don't know
is it message.author.avatar_url
@golden condor avatar_url.url iirc
or just fucking str(avatar_url) it
Would having nginx stop a discord client from connecting to discord?
Because avatar_url returned Attachment last time i opened the docs
i need help making a block of code that switches statuses ever 10 minutes, and there are 3 statuses that it switches between, ive tried setinterval and timeout but nothing happend
Hello, I am trying to get a value from json. Currently its case sensitive. But I want to make it so it isnt. The json im trying to read is from https://api.skripttools.net/v4/addons. The thing im trying to read is like mundoSK ASkAddon but I have to type it with the correct capital letters etc. Is there a way to make it non case-sensitive?
( javascript btw)
I don't use discord.py
embed = discord.Embed(
colour = discord.Colour.blue()
)
embed.set_thumbnail(url=f"{message.author.avatar_url}")
embed.set_author(name=f"{message.author.name}", icon_url=f"{message.author.avatar_url}")
embed.add_field(name=f"Prefix Changed", value=f"Prefix was changed to: {prefix}")
embed.set_footer(text=f"{member.guild}", icon_url=f"{client.guild.icon_url}")
embed.timestamp = datetime.datetime.utcnow()
await ctx.send(embed=embed)```
is this correct?
what is that? like python?
yes
idk anything about it
it says message not defined
require('dotenv').config()
const config = process.env
const mongoose = require('mongoose');
const { Client } = require('discord.js');
const client = new Client();
mongoose.set('useFindAndModify', false);
mongoose.set('useCreateIndex', true);
mongoose.Promise = global.Promise;
const dbOptions = {
useNewUrlParser: true,
useUnifiedTopology: true,
poolSize: 5,
connectTimeoutMS: 10000,
family: 4
};
mongoose.connect('mongodb://localhost:6969/better-dbl2', dbOptions);
mongoose.connection.on('connected', () => {
console.log('[NOTICE] Mongoose connected');
});
client.on('connected', () => {
console.log('[NOTICE] Discord client connected')
});
client.on('error', err => {
console.error(err)
})
client.login(config.token)
the discord client doesnt wanna connect
i wouldnt want to connect either
:(
lol
no message event, sad bot
It's ready
no ready event
what?
Okay I can finally start the better-dbl2
does the bot go offline when u go off ur pc
Thanks
Yes
if you dont have a vps
if you are hosting it yourself yes
Yeah
vps?
virtual private server
Hello, I am trying to get a value from json. Currently its case sensitive. But I want to make it so it isnt. The json im trying to read is from https://api.skripttools.net/v4/addons. The thing im trying to read is like mundoSK ASkAddon but I have to type it with the correct capital letters etc. Is there a way to make it non case-sensitive?
( javascript btw)
Anyone can help with this btw?
But I'm testing on my vps because I'm a madlad
does it cost money
@client.event
async def on_guild_join(guild):
with open('prefixes.json', 'r') as f:
prefixes = json.load(f)
prefixes[str(guild.id)] = '.'
with open ('prefixes.json', 'w') as f:
json.dump(prefixes, f, indent=4)
@client.event
async def on_guild_remove(guild):
with open('prefixes.json', 'r') as f:
prefixes = json.load(f)
prefixes.pop(str(guild.id))
with open('prefixes.json', 'w') as f:
json.dump(prefixes, f, indent=4)
@client.command()
@commands.has_permissions(manage_messages=True)
@commands.has_any_role("changeprefix", 'adminperms')
async def changeprefix(ctx, prefix):
with open('prefixes.json', 'r') as f:
prefixes = json.load(f)
prefixes[str(ctx.guild.id)] = prefix
with open('prefixes.json', 'w') as f:
json.dump(prefixes, f,indent=4)
embed = discord.Embed(
colour = discord.Colour.blue()
)
embed.set_thumbnail(url=f"{message.author.avatar_url}")
embed.set_author(name=f"{message.author.name}", icon_url=f"{message.author.avatar_url}")
embed.add_field(name=f"Prefix Changed", value=f"Prefix was changed to: {prefix}")
embed.set_footer(text=f"{member.guild}", icon_url=f"{client.guild.icon_url}")
embed.timestamp = datetime.datetime.utcnow()
await ctx.send(embed=embed)```
hosting indeed costs money
there's the option of looping through the keys and .toLowerCase them all
it says message not defined
LoC
welp this is annoyinf
We need more development channels to prevent cross posting
i wish it was online always
no we dont
@drifting wedge ctx.message
its gonna be more hell
?
i dont. hosting your own bots is a good thing
We need a stateful discord bot lib
Use ctx.message instead of just message
with middleware
hell x100
imma go add more pokemon commands
theres already one iirc
xD
my bot already has like 5 commands only
but, you know the actual docs website is faster
it is
wait wayt @slender thistle
but whats the fun about that
What's fun about a bot to do that @odd lichen
A website is much more fun
bots are tedious
eh ill just go onto my lsptop and not turn it off and just close the top
ctx.message is the message they invoked the command
not everything needs to be a bot
at least for me
ctx.send is a shortcut for ctx.channel.send
- its helpful to show people the syntax
Websites are more fun to make too
without having to send them a link
but what would i change then?
message in the embed methods
and they can go search the docs
the only reason you need to send a link, is if the user didnt look themselves
^
๐คทโโ๏ธ
But most people quit if you tell them to search the docs sadly
i also applied for my bot to be in this server
Which if a user doesn't want to do, they clearly have no motivation to learn
message.author?
too bad @odd lichen
yeah I guess
message.author changed to ctx.message.author
quick as possible getting of info
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'message' is not defined
embed = discord.Embed(
colour = discord.Colour.blue()
)
embed.set_thumbnail(url=f"{ctx.message.author.avatar_url}")
embed.set_author(name=f"{ctx.message.author.name}", icon_url=f"{ctx.message.author.avatar_url}")
embed.add_field(name=f"Prefix Changed", value=f"Prefix was changed to: {prefix}")
embed.set_footer(text=f"{ctx.member.guild}", icon_url=f"{ctx.client.guild.icon_url}")
embed.timestamp = datetime.datetime.utcnow()
await ctx.send(embed=embed)```
nope didnt wrok
ctx.member
ctx.member.author?
I know it well enough to use it daily
-ask2ask
Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.
Please read https://dontasktoask.com/ for an explanation on why this is an issue.
will i get pinged or messsaged if my bot gets accepted
dont submit until your confident your bot will be accepted
i mean im confident
and confident it will be online when the mod is reviewing
it eill be cool if it gets accepted
offline bots get denied
my bot eill be always online
since im on laptop so i can just close the cover and it wont power off
try to get it on a hosting service if you can
maybe
Mine would power off when my laptop went to sleep
Hello
yeah, it does that
i wanna help
heya
wtf?
thats pretty unreadable
thats so much
error messages can be long
looks like your unauthorized to do whatever your doing
How can I fix?
get proper authorization
i can look at any bots rn, in the middle of shrinking my index
Anyone know how to run a bot from another file
Like I have an index.js for a website and I wanna fetch data from discord with a bot
what
is that data just something u need for a sec or u need to store it
You're running two instances.
probably logged in twice
gonna spam log out then
is that data just something u need for a sec or u need to store it
@finite bough just stuff i wanna fetch
i want to start the js file from within another
you can require them
u made no sense rn lmao
if anythings wrong
lmao
u can do like
return client.users.cache.get(id)
}
then export the function to the other js file
pretty sure he is just running locally
which means he has a rouge terminal somewhere
@left nacelle
what
what is ur bot hosted on
nothing
turn it off and then check if it's working

do you have an extra terminal somewhere?
idk
lemme check
lemme restart everything
to check if it works then
now it sends 2 things on other commands
did you restart your laptop
having the program running twice
running
node .
then without closing the program, running
node .
again
works noe
doesnt send ir twice
hey woo atleast im not asking alot of questions anymore lmao
your probably were running it somewhere
in webstorm i added my vps details into it but i cant open up the files in the folder and edit them it only lists all the folders in the vps
the account you logged in with, does it have permissions to read/write these files?
clicking in the folders?
How do I match multiple things in regex
when you say multiple things, what do you mean?
you can just match discord.gg tbh
what about discord.com/invite/eewewe
ok yea but i'd rather keep my server ad free lmao
woooooooooooooooooooooooo why is my regex not working
๐คทโโ๏ธ
ah
/(https:\/\/)?(www\.)?(discord\.gg|discord\.me|discordapp\.com\/invite|discord\.com\/invite)\/([a-z0-9-.]+)?/i
^ could even keep going
Most accurate i could get
? your https
http works with invite links
it doesnt delete the msg
Hey if I'm sending a message across like 2.6k servers, what would be the best method. Cause I dont think client.guilds.cache.forEach(...) would be the best
das a prob on your side
api abuse
Hey if I'm sending a message across like 2.6k servers, what would be the best method. Cause I dont think
client.guilds.cache.forEach(...)would be the best
@vague kite I don't think doing that would be the best
thats api aboose
Yeah thought so
client isnt defined
well no shit lmao
if (/(https:\/\/)?(www\.)?(discord\.gg|discord\.me|discordapp\.com\/invite|discord\.com\/invite)\/([a-z0-9-.]+)?/i.test(msg.content.toLowerCase())) return msg.delete()
```confusedโข๏ธ
can i do it in dm? pana
No
Fine.
You have to match it @pure lion
oh
I don't think doing that would be the best
What would be the best way then??
but test is supposed to return a boolean
dont do it
use an announcement channel in your bots support server
those who want to know, can follow it
yeah doesnt work with match either
use an announcement channel in your bots support server
But what if the whole point of the bot is to deliver news and stuff
You would have to slowly send them
webhooks
Or webhooks
never use the bot to send announcements, that's all on one client
thats a big large reatlimtie
technically, you can send from every webhook at once I believe

every webhook would have different ratelimits no?
You just gotta do it right
if (string.match(regex)) do shit
how do i check the servers the bot is in/the amount of users?
in which library
discord py rewrite
Read the docs
hMmM
if(/(https:\/\/)?(www\.)?(discord\.gg|discord\.me|discordapp\.com\/invite|discord\.com\/invite)\/([a-z0-9-.]+)?/i.test(message.content)) message.delete()
tried on my test bot, worked fine
im using the ftp/sftp extension and all its doing is listing the folders
i mean i can edit each file, but i want it to be like the vscode ssh extension where when u connect to a host it opens up the folder in the menubar
pwease help i cant find anyone who uses webstorm ):
welp
today i got the github student dev pack thing and i was excited about getting access to webstorm
nice
Epic.
but now i cant even do shit with it
my bot is gonna take ages to finish
like all of it
cuz theres so much pokemon in pokemon
theres like 800-900
ok
cuz theres so much pokemon in pokemon
@left nacelle you should use an API instead of hard coding it
api?
you dont have to write every single pokemon info by hand
theres probably lists or apis that can provide that information
i sometimes copy and paste
My bot have every single item/block of minecraft, and just took 10m to code it
damn
mojang api already provide that info
theres probably any pokemon source where you can take that info
dont copypaste
just connect to the API
apis are so helpful, if you need help mayb I can give you a hint
Itโll save you a ton of time
I have like 20 api commands on my bot that wouldโve taken forever to do by hand
uh
a lot of bots create api's for their bots to even function. I was considering actually making all requests go to a local api
so i could port it to a website, or an app quite easily
im thinking about making my own public api but that takes EFFORT:(
this is confusing
im thinking about making my own public api but that takes EFFORT:(
feelsbadman
ive only made private api's at this point
who can hit me too
???
@solemn latch I never tried to make one or even read about it, is it hard?
i would like to learn more about authentication before making a public api
you can get a grasp on the basics in a half an hour tbh
what am i supposed to do in the skeleton code
well, you have any idea of connecting to an api?
you can use your own code
const { Client, MessageEmbed } = require('discord.js');
const client = new Client();
const prefix = '!';
client.once('ready', () => {
console.log('Ready!');
});
client.on('message', async message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();
// ...
});
client.login('your-token-goes-here');
yeah you donโt need it
it looks like this
```
oh ok
```js
code here
```
const { Client, MessageEmbed } = require('discord.js');
const client = new Client();
const prefix = '!';
client.once('ready', () => {
console.log('Ready!');
});
client.on('message', async message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();
// ...
});
client.login('your-token-goes-here');
woo do i need it
if I were to make an api. idk what I'd do with it
same lmoa
Can you link me that poke api?
but i done it
you can use some-random-api.mlโs
this one?
https://pokeapi.co/
or that
both the same lol
yeah i think
some-random-api.ml has ratelimits
but its only missing the gen 8
not since sword and shield
pokemon
and so does pokeapi tho
yeah
some-random-api.ml has ratelimits
itโs like 45 requests a minute
Well... my last pokemon was that green from GBA so
anyhow... you just have to make a request to that api
it was 60 requests / 1 minute before but it was lowered cause someone was nuking it 
also so woo do i need this part
and pass an arg or whatever on the request
const { Client, MessageEmbed } = require('discord.js');
const client = new Client();
const prefix = '!';
client.once('ready', () => {
console.log('Ready!');
});
client.on('message', async message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();
// ...
});
client.login('your-token-goes-here');
argh
No
so people can request an specific poke
code block pls
code without `` give me anxiety

uh
what
P.getPokemonByName('eevee') // with Promise
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log('There was an ERROR: ', error);
});
wat is this
litterally so easy
berry flavours too
not just pokemons
ok im switching
Who the hell made that api
soonโข๏ธ
he got a lot of time
lmao
data entry
might just add a command to access my counties public records cause itโs public 
it looks extremely straight forward
what are you trying to use @left nacelle
ooh this API is made for pokemon games I see
im trying to add pokeaapi
Do you have node-fetch installed?
yes
This guy up there just linked you a little tuto: https://github.com/PokeAPI/pokedex-promise-v2
or you can do what panasonik is saying and fetch the response
then response.json and all that stuff
oh i didnt know this was a tutorial
Spoonfeed isnt allowed right?
Correct
But I can explain him how to make it work right?
Yeah
Noice, so @left nacelle you here?
fetch or that poke?
if you have fetch you dont need the poke thingy
I'll try to explain something to you, if you lose me at sometime just say it, my english isnt the best
Who can kick my system pls?
ok
Well, first of all you need any link to fetch, lucky for you you find that PokeAPI that provides you a link to request information
on top of pokeapi.co
ok
ok
That link will provide you a block of information in JSON
and JSON allows you to extract the information that you need from all that block
which button
Button?
which do i press
how do i check permissions for everyone in a guild in discord.js? using a channel editing command but only want it to work if the channel hasn't already been edited
the top one
what
https://pokeapi.co/api/v2/pokemon/{YOUR POKEMON HERE}
thats alot
yep
its a lot of code
thats all the information available of a single pokemon
but just to add permission
i have the permission code
Yeah, put as I said, you can take whatever you need
just idk where to put it
what
Nevermind, you see all that code?
yes
you can now take per example the abilities
and print in a message all the abilities of that pokemon
you can request any pokemon by fetching it from the api
with a simple 10 lines code you can take every single pokemon information
and automatically get that info and make it readable for the user
bruh this is confusing
im too dumb to make a game
same, but you can always learn
i am working on adding battleship rn to my bot
thats what programming is all about
exciting stuff
my ea
im working on a pet system to my minecraft bot, but canvas prints are messing with me
anything canvas messes with everyone
i hate canvas
idk what canvas is
i spent 3 days trying to get avatar and username to show correctly without fucking up
ok
canvas makes it dumb easy to do stuff sometimes, and others its dumb hard
thats a canvas from MEE6
ok
ok
those images of welcome etc
made this in canvas aswell
woo ded

for real?
yeah
so cool actually
its my pride and joy
gifencoder?
Nais
um
20+ seconds for a gif to render in gifencoder
Looks pretty simple to make
idk what to do with the code
the only real difficulty is layering
2 million possible costumes
with my current code


i did nothing yet
oh.. 
im too confused
never worked with json?
the wrapper makes it really easy
Anyone help me
i hate spiders
know*
aaaaa
why are u on phone
coding in a phone
Teo @left nacelle

Yep
teo?
activeServers = bot.guilds
print(activeServers)
summ=0
for s in activeServers:
summ += len(s.members)
print(summ)
so..whats wrong here? the output is
[]
0
does anyone know how to check everyone's permissions in discord.js for a channel?
I tried supporting gif profile pics on my rank card but it ended up having potato quality so I scratched that idea
um
Token leak
How to upload my coding on my bot ??
@faint prism 
upload?
@harsh minnow you need to node {JS ROUTE}
Give me the link @ionic dawn
wait would if(message.channel.permissionsFor(message.guild.roles.everyone).has('READ_MESSAGES) {
message.reply('This channel is visible!')
}
work?
link?
var RoleListGenre = ["535579820088754178", "535579900955066392", "662724365095403577"]
if(RoleListGenre.some(role => { message.member.roles.find(r => r.id === role) })){
console.log("true")
}else{
console.log("false")
}```
its return me false while I have this role
wheres cry with the image explaining bots
a lot of code spam here
alright time to try to do something with the code of ditto
I am v11
wheres cry with the image explaining bots
@solemn latch
@ionic dawngive me the link
Didnt v11 will close?
yes
v11 is deprecated
then why still using it? 
lemme send a screenshot
Vo1d rply
idk what version im using lol
@ionic dawn https://i.imgur.com/frH0Xrg.png
ADI, as I can see you dont know how to even run the bot, so pls read how to first or watch a YT tutorial
I have a heavy code earlier, it will take me several days to switch to v12 and I don't really have the motivation
why is this giving me an error?
well, djs v11 wont work in a few months
roles.everyone is not a thing
who was the guy who posted the token. I forgot his name
just use message.guild.id
Want to remind him to reset it
It wasn't even the entire token
how can i fetch the everyone role @summer torrent ?
just use
message.guild.id
@summer torrent
Right, just to be safe
Good luck guessing the rest
i uploaded someones token to github today to reset it
oh
if we are thinking of the same guy
guild.default_role works in discord.py
guild's ID is same with everyone's ID
when discord tokens get put on github they get auto reset
If the repo is public
if(!message.channel.permissionsFor(message.guild.id).has('READ_MESSAGES')
this right or am i dead wrong
yeah it is
there is a bot which posting bot tokens to github iirc
yeah, if its in an image it has a hard time
I am from India I don't so much English
i manually type it in
@karmic compass try it and see
activeServers = bot.guilds
summ=0
for s in activeServers:
summ += len(s.members)
print(summ)
so..whats wrong here? the output is
0
What a gentlemen @solemn latch
again
i get this error when using message.guild.id
@karmic compass can I ask why you aren't getting the permission for a member instead of the role?
How would you make something like? So to record my bot up time and post it in a website like that https://maki.gg/status?
if you do !channel visible it changes the read messages permissions for everyone in that channel to true
@summer torrent gave me an error (look above for ss and sorry for ping)
@solemn latch i can help you
let me try it on my bot one second
Doesn't python have reduce
isn't logged in?
Guys help I need more custom commands ideas
no
a command to see how gay people are
its been done a lot
I like it lol
is this good for a coin flip?
async def flip(ctx):
variable = [
"Heads",
"Tails",]
await bot.say(ctx.message.channel, "{}".format(random.choice(variable)))
@client.command(case_insensitive=True)
async def coinflip(ctx):
variable = [
"Heads",
"Tails",]
await bot.say(ctx.message.channel, "{}".format(random.choice(variable)))
@client.command(case_insensitive=True)
async def flipcoin(ctx):
variable = [
"Heads",
"Tails",]
await client.say(ctx.message.channel, "{}".format(random.choice(variable)))```
it dpesmt wprl
work*
well whats wrong
can I add an image in an .addField?
No
can I have multiple imgs in an embed?
Full sized images no. You can add an image to the thumbnail, footer, author, and the actual image
ok... ty
This can give you an idea of what's possible with embeds
https://leovoel.github.io/embed-visualizer/
ok ty!
np
the only bad thing about embed titles is that you cant add links on them
like: Click here
you can do .setURL but isnt the same
@quasi arrow make it a command
@crystal socket worked, thanks man ๐
np
I wonder if this would work too. I haven't used python much
from functools import reduce
guild_members = map(lambda a : len(a.members), bot.guilds )
total_users = reduce(lambda a, b: a + b, guild_members)
print(total_users)
the problem was as @crystal socket said, the bot wasn't logged in
p!help
#commands #265156322012561408 for bot commands
how do i create a bot please teach me
go on discord.dev and create a bot
Watch a setup tutorial or go to the discorddev
OK!
ok sir
args isnโt defined
thats where you defined pokemon
i had help from @ionic dawn
looks like if else chains
const args = arguments excluding the prefix
how do i fix
hi
typically, command handlers make that easier
less likely to break multiple commands with mistakes
easier to find where errors originate from
Wish, I could stream so I can do a live tutorial of how to make a bot in C# ๐
how would i make a command be able to be turned on/off?
now my other stuff works

imma try again tho
Like disableable per guild? @drifting wedge
yes @solemn latch
ugh
im using sqlite
what does args do
Its the arguments of the commands
lets u do more than 1 work
its not letting me do any commands
i have smallest brain
idk what to do with args
i should go to sleep lmao
im too tired
but maybe
also i wanna try to finish the pokemon command in the next 30 mins or 1 hour
can someone help me
i have this code
https://sourceb.in/5cd8e43294
the second object is never added with the WordName
Um
@left nacelle
what
and there is stuff in discord.js about args
Theres an entire page for args
IDk how to do this
@left nacelle i recommend learning javascript before trying discord.jw
discord.js
?spoonfed
?help
ok
this is damn annoying
Helps to know the basics
Did you struggle to understand what this said?
const args = message.content.slice(prefix.length).trim().split(/ +/g);
I mean, someone gave you copy paste code
It means, make an array of each word in the message
And store it in the variable args
Any1 know how to make cooldown in code?
Js?
Yes
setInterval, right?
Thx
wtf does that mean



