#development
1 messages · Page 663 of 1
What's your question
Why bot responsing ever prefix
every prefix?
Yup
idk whats your prefix
@smoky mica thanks but I solved it
nice
when you send a webhook test does the "user" return the bot owner id?
just curious 🤔
user = ID of user who voted/tested
bot = your bot's ID
at Map.[check] (/rbd/pnpm-volume/db1ffd3b-edf4-4166-8949-e213164599e4/node_modules/enmap/src/index.js:947:31)
at Map.get (/rbd/pnpm-volume/db1ffd3b-edf4-4166-8949-e213164599e4/node_modules/enmap/src/index.js:229:19)```
if(client.guildSettings.get(message.guild.id,"deletemessage")) message.delete()```
have you thought of the fact that you never insert data into the enmap
refer to enmap docs
nope
@client.event
async def on_reaction_add(reaction, user):
message = reaction.message
if reaction.message.author == client.user:
if user.id != client.user.id:
if message.content == 'React with:':
role = discord.utils.get(message.guild.roles, name="Destiny-join")
await user.add_roles(role)
``````AttributeError: 'NoneType' object has no attribute 'id'``` pls help
Role not found
What is bot prefix CSS code
wat
@uneven pond wym
you mean this?
DiscordBotListAPI api = new DiscordBotListAPI.Builder()
.token("TOKEN")
.botId("ID")
.build();
api.setStats(jda.getGuilds().size());
It throws ClassNotFoundException, why?
Class is imported: import org.discordbots.api.client.DiscordBotListAPI;
is the class file in the right place
@indigo geyser I think you've incorrectly defined client, make sure you have this somewhere in your code
Client = discord.Client()
client = commands.Bot(command_prefix = "prefix")
and, also that the client you are running your token in is the same that you define your prefix in
how can i map regions? discord.js
@Just_Allexx#8095 I resolved
@Just_Allexx#8095 and no
It isn't the error
Rip
@slender thistle yes
Sorry
It was j and not J
The role name
utils.get/find returns None if nothing was found by given conditions
Might wanna note that
Because it finds something
thanks
left my token in
Lel
anyway
import discord
import random
from discord.ext import commands
from discord.ext.commands import Bot
import asyncio
import time
Client = discord.Client()
client = commands.Bot(command_prefix = "")
@client.event
async def on_ready():
print('ready')
exit()
client.run("token")
Works fine
NO errors
Yes but why would you have Client and client
And when you will add something on the on_message, commands will stop work
idk
Which are also different
Congrats, you were following a shitty tutorial
@halcyon nymph ush, copy and past isn't a good thing
I was learning!!!
Mission failed
Oke
i just copied over the skeleton, and when i made new bots copied over the imports the clients and the run
Anyway I suggest you remove what you don't need
what do i not need?
Whatever you don't use
discord.Client
In your case, Client
idk
i just manually check for the prefix
it's not that much extra effort
I feel like I'm exposing myself as a really bad programmer rn
You only show yourself as a bad coder only if you don't listen to advices
okay, well I've gotten rid of Client and nothings broken
Why would you not use command_prefix though 
I'm pretty sure i tried, but it'd run on_message regardless so it was kinda redundant
wdym
having
if message.content.startswith('prefix'):
message.content = message.content.splice('prefix')
works
It's just plain weird to check prefix in on_message but define it as empty string in commands.Bot init
It doesn't do anything though, the only reason i kept it defined in commands.Bot was because that's the only way it'd work
Are you also using on_message with ifs for commands
yeah, python doesn't have switch's like node.js
Why use commands.Bot when you don't even use its commands extension
idk, but i'm actually pretty confident that my bot needs on_message
and idk how to use the commands extension
Yes but why exactly commands.Bot when you don't use the built-in commands
what are the built-in commands
commands extension
bot class has an extension which handles commands automatically(?)
what does it do?
so instead of writing all the if checks
Yes, hallo
you can just kinda write functions and not worry about the if checking
okay
Either use discord.Client if you cba to figure out the easier way to use commands or read more about commands extension on https://discordpy.readthedocs.io/en/latest/ext/commands/index.html
oh then don’t use it
Better looking code, better understanding of it
and an actual use of what commands.Bot was created for
it’s entirely flexible and up to you
imo having all my commands in one continous if statement makes it more compact
you can do whatever
Compact != Better
whatever works for you though is best
readability may be a concern if you have several people working on it
i don't
Imagine all your ifs when you have more than 50 commands 👀
if that works for you though then by all means
but definitely good to consider where you’re going
Going through a lot of ifs does make it slower
Code is more than "if it works, it works" though, Alex
@slender thistle whats your point?
May you want to ask for help regarding a bigger class some time, it shouldn't scare other developers off
His point is that code goes from up to down, meaning it'll go through 30 if lines before it reaches the command you want, and then go through 20 more if statements to look for the right arguments and whatnot
It slows things down, it's not efficient and it's bothersome to read
yeah, but python does that in an instant
- Readability issues
- Importing commands.Bot when you don't use commands extensio
- Better and/or easier arguments handling
That's where you're wrong
don’t worry about it then
Blocking is an issue there
If you have 100 users use one command and your code goes through all if statements at once, it's gonna be ineffective
Sending feedback to even 20 users at a time won't happen in an instant, I can guarantee you that
Laziness < Better code
@halcyon nymph if it’s worth the time for you to do so then definitely try it
Okay, i've glossed through the docs and I'm confused, if it works without on_message and doesn't need to be called by the program, I can't use it because my program recquires looping of on_message or otherwise i don't understand
Heyo
hi
What's the problem?
Why would you need to loop in on_message
I'm trying to fix my janky ass code so that it doesn't have to run through loads of if statements but I ain't sure if it even works with what I need
If you use the on_message scommands doesen't work?
@halcyon nymph how does it work currently? You mentioned the if checks but is there anything else on top of that
@slender thistle For the purposes of my bot, at the end of a succesful game the program would run
await client.on_message(message)
@stone dust it just makes sure the message startswith my prefix otherwise returns and then yeah, a couple of if and elif statements
yeah you may just want to write a different function to handle it
idk what that means?
on_message is primarily reserved for handling incoming messages
so right now the bot is going to call on_message behind the scenes whenever a message is sent
(via web magic)
process_commands
Fixed tnks
OK, so this question is really about the server, but if my bot was approved, is it in this server
yeah I think*
might not be then i guess
It could be kicked
Your bot was likely muted because it broke one of the "bot rules" listed in #rules-and-info.
To find out why your bot was muted and by who, use the search feature in #mod-logs:
Approved != 100% for it to be in this server
import discord
import random
from discord.ext import commands
from discord.ext.commands import Bot
import asyncio
import time
bot = commands.Bot(command_prefix = "!")
@bot.event
async def on_ready():
print('ready')
@bot.command()
async def test(ctx, arg):
print('running')
await ctx.send(arg)
pretty much copied and pasted from the docs and it's still not working
I'm not getting any errors, but nothings happening when i run it
Does your bot contain imports like this?
from discord.ext import commands
from discord.ext.commands import Bot # this one is redundant```
We regret to inform you that you're the latest victim of a bad youtube tutorial.
Aha
ok
Does print(discord.__version__) return 0.16.12
yes
Alright, even better
command decorator requires pass_context if you want ctx along with it
and it's <Client>.send_message for you
(commands.Bot subclasses <Client> so it doesn't matter which one you use)
Nope
still not running
just checking, it is bot.command(pass_context=True)
the docs doesn't say you need pass_context, so...
@halcyon nymph Yes they don't because that's 1.2.3 version docs and you are only on 0.16.12
I thought I was on the latest version
Anyway, can you link me to the 0.16 one then
I have no idea where to look for these kind of things
0.16.12 version docs don't have help for commands extension
They don't explain the commands extension
update
DO I LITERALLY JUST HAVE TO GUESS?
Two choices:
- Find outdated examples
- Update and migrate to new discord.py version
don't make things harder
Migrating sounds like effort
just
update
it’s not too bad
a couple bugs may pop up but there’s also some info on migration in the documentation
Ah right, rw+ migration has that thing
yeah, but like, I only have 13 commands in my bot, if i get more I'll have a look at it again
But rn I can't be arsed
lol
it’s just a speed bump
odds are you’ll have to get over it at some point and it’s just gonna build up
0.16.12 is discontinued anyway so it won't work at some point if Discord stops using the same API endpoints
or API version
I'll cross that bridge when i come to it
tbh, the only thing I use in 0.16 that isn't in the latest is client.send_message
hey guys quick question, for this server, would DMing a user if their (example, hunger value) gets less than 0 (which they can disable, but on by default) be allowed in this server?
That'd be considered unsolicited messages which we don't tolerate
Your bot would just get kicked for that
maby if they have to run a command like "startlife"
or it could be off by default and it's an opt-in feature
const dbl = new DBL('Your discordbots.org token', client); where would i find the token?
hi, quick question... does permissions=0 work in the bot invite link? discordbots.org sets it like that by default
but i was under the assumption i need the "send messages" permission plus a few others
In the on_message is there any way to return bot calls?
For fix respond to other bots
I know I have to doif message.author == ????
message.author = Member
Member = subclass of User
User = Has .bot property which returns a boolean value

author.bot
not literally user.bot I hope

Yes yes I understood thanks
How would I make the server count appear on my bot page?
DBL api
I tried so much and it wouldn't work
@slender thistle thx
Don't thank me
How long can a fields value be?
1024 characters
Per value?
Yep
Thank you.
Does anyone have a working example of the dbl api in discord.js
Promise { <pending> }
How do I fix this problem
Await?
Resolve the output, use from there
@lusty dew either use the variable in a .then() callback or await it
async res => console.log(await res.json(message))
Mk
I'm awfully confused at this part. Do i just copy and paste this code somewhere in my project? Do I save this as a file and import it instead?
do you know how maven or gradle work?
I've used them only once in eclipse and I can't exactly remember how to access them
I vaguely remember something about a pom.xml file
How do I change the color of the box at the bottom?
(Where the description is) - everything changes instead of the color of it.
@amber cobalt You're using maven, copy the maven one in your pom.xml file.
okay, I'll try looking for that
@earnest phoenix inspect element
What?
f12
Does it automatically apply after I change it?
it should yea
But I already changed the background-color, it still doesn't work.
of what class though
Oh I see, but after closing the console it disappears.
that makes no sense
are you clicking save
or are you actually entering it in the inspect element
Ok got it, thank you.
Okay so would that mean i'd need to make a maven project to get a pom file up and running? @earnest phoenix
Are you using Gradle or Maven?
maven but I don't know which one is easier
Hey i have a problem
When i test my bot with and without perms all commands work, everyday
But when my bot gets reviewed some commands stop working all of a sudden
that's the second time now idfk what is happening
does this look good @earnest phoenix?
I don't know how gradle works, sorry.
ah okay
HOW TF DID THAT HAPPEN
.column {
float: left;
width: 33.33%;
padding: 3px;
}
This causes it.
But why?
I just used it like that:
<div class="column">
<h1>English</h1>
<img src="IMAGE-HERE">
</div>
Alright fixed, changed the name. Looks like they got a class named like that too
column is the bulma class for grids
?*help
@unreal cape I would suggest building in some logging
I'm working on a userinfo function for my bot using RichEmbed, does anyone know how I would find more stuff in the .addfield part of it?
Found out how to show the user name but I want more stuff like time on server, roles, ect
addField is a method
it doesnt contain any information about the user
check out d.js docs to see all of the props a user has
https://discord.js.org/#/docs/main/stable/class/Message @wheat carbon
Look properties
Ok thanks a lot
Also when I use message.bulkDelete and then a number, it only does 1-10 messages and no more, is there a way to make it more?
For when I do =clear (Number of messages)
Message.channel.bulkdelete*
bulkDelete means it will mass delete messages, going above 10 would probably be considered api abuse
making some progress @hybrid ruin but came across this error when I downloaded the library
hm, the only dependencies i have atm are the ones I copied from the github
Oh yeah and when compiling it, I was also told to download this pom file along with the library
is that what's missing?
gradle
@valid frigate Therae a Discord API endpoint for bulkDelete
allows to delete 2-100 Messages in 1 request, ( kinda 2 as you need to fetch the Messages before but yea )
weird
I'm gonna restart eclipse
im using maven in my project but i would assume gradle would resolve the dependency tree for any of your dependencies too
That's what I thought
I don't know why i was linked a maven file when i was setting up the project through the gradle
yeah that's weird
I got a question what do I need to get my bot started on this website here? https://discordapp.com/developers/applications/
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Do I need to download anything
question how do I make a bot like mee6
Do I need to go to another website
I want it kinda like mee6 but not at same time just close enough.
Code
refer to the link above
Y’all no help at all you keep giving same link I looked at all ready
you looked it, but have you read it
and by read i mean actually read, not skim over it
if you had read it you would have already had all the info you needed about your question ergo you wouldnt be complaining
What's the point in trying to explain the same thing if it's written out well and in more detail in an already-existing page
Guy straight up left

lmaooo
I bet he'll become a great dev
he'll create mee7 watch out
``` let fetched = db.fetch(prefix_${message.guild.id});
if (fetched === null) prefix = 'k.'
else prefix = fetched
```
err on else prefix = fetched
May i ask you to help me test an API i am writing?
Ok
chucks me an error thats its unreadable and Ik its cause of formatting but idk what format or how I should put the link for the picture inside the json file
Well you’re doing ${} template outside of a template string
js has encodeURI and decodeURI functions, and what berry said
Guys, I'm requesting emergency help
My bot was shut down because the hosting service was shut down. Is there another free hosting service that you know other than Heroku?
DM me pls
there's no good free hosting; don't use free hosting
either selfhost or buy a vps
@cold canyon, Your PC.
Can someone help me with this
Incorrect token
Check if you removed/added any characters
Okay fixed it
GreenInklingToday at 2:34 PM
Its the user id of the bot```
client ID will not always be the same as the bot ID
It is
Didn't it use to be two different things before, @earnest phoenix
correct
oauth apps which have been created a long time ago and just now create a bot for example, will not have the same id
I have my bot in two servers, how do i make it stop sort of cross posting the join and leave messages? :/
check the guild id
quick question for js
if your writing an object and want to refer to a variable inside
is it this.property
or just property?
this.prop
for ex: js something : { thing1: 'lol' } You would access thing1 with something.thing1
sting: {
reqLevel: 1,
mpCost: 2,
errorStr: "Sting requires 2 MP.",
cast: async (player, message, target) => {
let spellDmg = Math.floor(player.maxHP / 20);
target.currentHP -= spellDmg;
await message.channel.send( `${player.name} casts **STING** on ${target.name}! Damage done: ${spellDmg}! Remaining HP: ${target.currentHP}/${target.maxHP}` );
player.currentMP -= 2;
return true;
}
},
yeah
so in my case here
${this.mpCost}
yeah
ty
oh even inside the block?
its always objectname.property
I'll have to test it a little bit before I kill casting on my bot 😄
just cleaning up code
that's definitely how you do it outside of the db
im trying to make a command that sets the bots activity, ive done it kinda
atm i do !set blah and it sets to listening blah
but im trying to make it !set listening, to blah
TypeError: Cannot destructure property `reply` of 'undefined' or 'null'.```
That it mean
@maiden mauve yes but how can i make a command that lets me set the type of activity and the actual activity
It's send this err when I run k.eval let d = db.get(`prefix_${message.guild.id}`) message.channel.send(d) command in eval
oh, you want to concatenate them?
yeaaaah
kinda wanna do like !set listening, to ur mom
if not i guess ill just have to have 2 separate commands
not sure, they may be reserved for the links with spotify etc
Can u help me
const spells = {
test1: {
prop: true,
prop2: 2,
func: () => {// this.prop, prop, test1.prop all "undefined"
let var1 = spells["test1"].prop;
let var2 = spells["test1"].prop2
console.log("Inside the block ",var1, var2);
}
},
};
console.log("Outside the block ", spells["test1"].prop, spells["test1"].prop2)
spells["test1"].func();
@broken shale
I guess it's just global only way to do it 😄
@pallid zinc Is that the express syntax?
undefined message means your variable isn't populating correctly
I'm not sure if "eval" has a built in async method
but that's usually the problem
in mongoose syntax it would be
let d = await db.findOne( {"dbVariable" : message.guild.id} );
message.channel.send(d);
Also try it in console first to avoid a roundabout error through discord
@tranquil drum I'll do what you've done then
Is it just a case of making a maven project in your own project and doing everything from there?
I use IntelliJ so it sets up the maven pom and project structure for me
Ah right
Think last time I used maven, when I ran the project i was given options like install, build etc
I imagine i install everything first try and then i can just run it normally
I think you can just mvn package
Install will copy it to your local repository which probably isn’t necessary
ah okay, I'll try that out
Hm, is it possible that i can't use the discordbotlistapi until my bot's been verified?
@amber cobalt yup
that'sssss whyyyyyy
cause I'm trying to just show my server count but downloading the libraries just ain't working on my end

@tranquil drum I'm trying to make a help menu
So I can use =help to show a menu (That works)
But if I do something like =help version it still only shows the help menu
double check your logic for figuring out which menu to display
also make sure you're able to figure out if they typed =help version
Help Menu:
case 'help':
const embed = new Discord.RichEmbed().addField('Help Menu', 'This is the help menu!');
message.channel.sendEmbed(embed);
Help Version menu:
case 'help version':
message.channel.sendMessage(version)
Shouldn't that work or do I have to use args?
You really have to use args
what are you switching on
Looks like he's switching on the entire message
if hes not though that would explain why both only show the help menu
The "issue" with that approach is that "help version" contains "help" so the first case will always trigger
Args work like this right?
case 'help':
if (args[1] === 'version') {
message.channel.sendMessage(version)
}
java doesn't have strict equals i dont think
wait is this java
i thought this was java the whole time lmfao
=== is strict in javascript
I used Node.js and Visual Studio Code
Yeah js
you dont need strict in java because types
JS is Javascript right?
Yep
you can have ambiguous types in java
🤦
if args[] is populated correctly then that code would probably work
also consider converting to lower case before checking the arg so your commands aren't case sensitive
So would this work:
case 'help':
if (args[1] === 'version') {
message.channel.sendMessage(version)
}
if (args[1] === 'ban') {
message.channel.sendMessage('You can ban a member by using example!')
}
if (args[1] === '') {
const embed = new Discord.RichEmbed().addField('Help Menu', 'This is the help menu!');
message.channel.sendEmbed(embed);
}
break;
if you split on spaces, switching over a single element won't work for args

So wait a moment
i think he's switching on args[0] @inner jewel
yes
which means case 'something with spaces' will never work if the input is split on spaces
yep
So this will work?
case 'help':
if (args[1] === 'version') {
message.channel.sendMessage(version)
} else if (args[1] === 'ban') {
message.channel.sendMessage('You can ban a member by using example!')
} else if (args[1] === '') {
const embed = new Discord.RichEmbed().addField('Help Menu', 'This is the help menu!');
message.channel.sendEmbed(embed);
}
break;
yes for the first two
if you're actually splitting on space then args[1] won't exist
the last if can be just removed
if you only type =help
Oh ok
So delete the } else if (args[1] === '') {?
I think you could just make that the else
} else {
const embed = new Discord.RichEmbed().addField('Help Menu', 'This is the help menu!');
message.channel.sendEmbed(embed);
}```
although you might get an array index oob
If the if statements from above are false, it'll simply send the default help message
So things such as help ffff will still work and display your help menu
idk what js does if you reference an array index that doesnt exist
ya i only mess with js if i have to
js has no out of bounds error
It works, Thanks lot!!!
neat
> const arr = "some string".split(" ");
undefined
> arr
[ 'some', 'string' ]
> arr[2]
undefined```
I see
@amber cobalt I missed your ping earlier, sorry. Did you figure out your gradle issue?
hello who is can help me for rols
discord.js
return message.reply("You Have To Need This Role").then(msg => msg.delete(3000));
};```
Hello First Sorry For My English 😃 İf U Have This Role U Can Use This Command
İ Dont Have Any Problem But İ want With Name İ Dont Want With Role İd
How Can i Do This ??
İ Say Sorry For My Bad English Again
If I'm correct
I believe js has Guild.roles.find("name", "rolename")
if (!message.guild.roles.find(r => r.name === "rolename"))
Or that
//Replace role is with this
message.guild.roles.find(r =>["rolename"].includes(r.name))
that's also an option I think....
But the first 2 are guaranteed
Try all of them and see which ones work Kerem
Perhaps go with Puro's solution first, it personally looks like the "best" / most efficient one to me
All up to you though, hope it works
No worries mate, I believe the problem is that my bot hasn't been verified which is why some dependencies weren't loading @hybrid ruin
So I'm just gonna give it a bit
Haha that doesn't have do to with anything as far as I know
Could you post your gradle file again, please?
Ah, the discord bot list dependency
THX
I'm at the pub atm but I'll get stuff posted when I'm back home
Ah, makes sense
How do I fix this, I literally dont have any other words
errno: -2,
code: 'ENOENT',
syscall: 'scandir',
path: './commands' }
/home/ubuntu/index.js:98
let jsfile = files.filter(f => f.split(".").pop() === "js")```
^
npm and node have just been sptting out errors errors errors
that arent on the host pc
that are*
but arent on mine
traceback
Do people even read errors these days 
im becoming numb to them
it didnt make sense on there
and npm has been killing me with errors
for 4 hours\
gg
If you are getting errors for 4 hours you really are great at googling
yeah I googled it and nothing came up
so i freaked out lol
btw it was a caps error
js is case sensitive
Okay so this is what I had at the time @hybrid ruin
https://cdn.discordapp.com/attachments/272764566411149314/605301076941602846/unknown.png
but I removed what I had as I was under the impression that what i did was wrong
Okay so
can obviously bring it back tho
I looked into the DBL api as I never used it before
And yes you indeed need a verified bot first before you can use the api
riiight, I thought so. Thank you so much for clarifying that
Any time
I was honestly blowing a fuse at this project cause it was just a simple case of downloading a library
XD
Happens to the best of us
Feel free to ping me if you need anything else. Would love to help out a fellow Java coder
It does, but at least I know I can wait a few days and know my bot will hopefully be verified
I hope so too
but thanks again, I'm glad I'm not the only java coder here but I'll try and avoid spamming your inbox lol
What does it do so far?
Ah it's okay, I don't mind being "spammed"
Not a lot of people seem to code in Java. Most people crawl to Js / Python
XD
it's basically just a nifty flag guessing game I worked on during discord's hackathon
Ohh
it was the first time making a bot so I definitely needed more than a week
Already looking great

pitched the idea to r/vexillology and gonna see if they'll take it onboard
^
aw thanks
the actual process of inputting each flag was a bit tedious
like it got to a point where I went over the class byte limit and had to completely restructure my program lol
Poor guy just wants to show some flags 

Don't even get me started on nepal's flag
that idea was a disaster from the beginning
https://cdn.discordapp.com/attachments/596178386859327498/602628844494651393/unknown.png
scrapped that the moment it was done
can someone help me making my bot work on multiple servers and not being retarded
i dont want it posting welcome messages in server1 if it was from server2
with what you want, that can be just by specifying the server id before hand
but if you want your bot to work on multiple servers in general, hashmaps are proper useful
ooo what are hashmaps
what language you working with again?
js
Eh
ah, then you would have a dictionary then
I don't think storing data of even 50 servers in a hashmap would be ideal, especially for this
for welcome messages yea, you're right
I just save it in a database, but I don't know how complicated Modo wants to make this
like super non complicated
its just welcome and leave messages
im thinking just serverid
Do you know the welcome message of both? You can easily hardcode this
Unless you have a way for server owners to change welcome channels and such
nah the welcome message is the same
the only issue is that server2 joins are posting inthe server1 channel and its annoying
Do you know the channel IDs?
yeah i did that but it still posts in that specific channel
with the joins and leaves of the other server
Well, show code perhaps
// when a user leaves the server, announce it
bot.on('guildMemberRemove', member => {
console.log('User has left the server!');
let byemsg = `@${member.user.username} has left the server, what a pussy.`;
bot.channels.get("563724381646487xxx").send(byemsg)
});```
Well, you're not checking which server it's from, and you're only sending it to 1 channel
yus
can't you just have bot.channels.get(event.getChanne()).send(....)
Check if the guild's ID is x1
- If it is:
Send welcome message in channel y1
- If it isn't (else if)
Check if server ID is x2
Send welcome message in channel y2
hehe, i can't write pseudo code okay
@granite trout that code can fail so much
what thana said is good
but if you ever deal with storing server data in the future, have a look at dictionaries
@amber cobalt dictionary is python, not js
I can read js better than I can write it so I have no clue on what to tell you
oh right, what's the js equivalent then?
objects maybe
your guess is good as mine
XD
man i should really have a look at js
js has maps and shit too
oh, then there we go
But you get the point. You really just wanna check which server it's coming from and send a welcome message to the that specific server's welcome channel according to the server ID
plenty of shit
const things = new Map();
things.set('bob', 'meme');
things.get('bob');
// => 'meme'
open bob show vagana
I love how Js sometimes looks so similar to Java, but then someone brings up const and shows the code after that and you just back off
mhm, that's where the stuff becomes illegible
I feel the same when people use lambda expressions in their java code
lol
those arrows just give me nightmares from C
Just be glad not every dev post their code on github
Saw someone who's here as well with just the messiest code. The more we went through the classes, the worse it got
my early code is pretty damn cursed
Hi there was a command to upload an image on a server glitch does anyone know you have it
Oh boy
I know there was a random gif floating round on discord that crashed everyone on mobile
I swear I just can't code if I can't format my code properly
Yeah, I even refused to skip one step of my bot because it was making my code so much messier
Basically someone recommended i should combine the step where i randomly generate a country and the step which reveals the first emojis
sounds better in hindsight but it didn't work as well, but more importantly it was messy af
and hopefully that issue was fixed, probably not gonna test if it did
when they leave the guildID is undefined 😦
so event.guild?
Yeah, and get the ID from there
i can't see that on the js docs and ive not heard/seen of event before
I'm not a Js coder but try event.guild.id?
might be
if bot.guilds.get(id) == serverID
I'm not a js dev so don't quote me on it
thats.. not how js if statements work
you guys shouldn't be trying to help if you don't know yourself
if im trying to post a message to a channel based on the channel name, does it work if the channel has emojis in it?
yeah you just need to provide the emojis in the name
ie. for #👍-votes it'd be channels.find((channel) => channel.name === '👍-votes');
JDA devs 
make larger
how 
upscale
i thought that was py for a sec just bc of ctx
lol
you could just edit the message instead of deleting then sending another one imo
on line 59, just call m.edit and remove m.delete
yes 
@sick cloud https://github.com/kyranet/canvasConstructor/blob/master/guides/Profile Card/ProfileCard.md
.displayAvatarURL returns a url with ?size=128
you have to use regex to change the 128 to whatever size in intervals of 64
On master you have options
TypeError: Cannot destructure property `reply` of 'undefined' or 'null'.
It's send me this when I run
k.eval let d = db.get(`prefix_${message.guild.id}`) message.channel.send(d)
But only is some guild
Why no one is any server know the answer
are you sure you're looking at the right line?
well idk
Lol
have you tried asking in plexi development?
your eval command is likely 🅱roke
Nope
d.js?
ye
I then tried this in my server it work fine
Util#splitMessage
oh
Even in this guild it work
Does my question don't have answer
its broken
How it work in this guild perfectly
Even in some guild it work
Only in some guild it give err
idk
(node:5595) UnhandledPromiseRejectionWarning: TypeError: Assignment to constant variable.
One more err
```let fetched = db.fetch(prefix_${message.guild.id});
if (fetched === null){prefix = 'k.'
}else{ prefix = fetched}
Prefix is a const?
What u mean
how can i add color to console.log (powershell console)
L
Is it even possible to overwrite the everyone role? role = discord.utils.get(ctx.author.guild.roles, name="everyone")
```let fetched = db.fetch(prefix_${message.guild.id});
if (fetched === null){prefix = 'k.'
}else{ prefix = fetched}```
(node:5595) UnhandledPromiseRejectionWarning: TypeError: Assignment to constant variable.
Still didnt work well @slender thistle
Err at }else{ prefix = fetched}
What do you even need it for
a lockdown command
What's your code looking like currently, Emil?
its not a good code but i just started
@commands.command(pass_context=True, name="lockdown")
async def lockdown(self, ctx):
role = discord.utils.get(ctx.author.guild.roles, name=ctx.guild.default_role)
try:
for channel in ctx.guild.text_channel:
await channel.set_permissions(role, overwrite=discord.PermissionOverwrite(send_messages = False))
for channel in ctx.guild.voice_channels:
await channel.set_permissions(role, overwrite=discord.PermissionOverwrite(speak = False))
await ctx.send('🔒 Channel locked down. Only moderators may speak.')
except:
success = False
else:
success = True```
Uhhhh
yea uhhh
Does default_role tell you anything
does what tell me?
What do you think ctx.guild.default_role is
have you seen what it even is
You said something about that being the everyone role
Thanks @slender thistle It works now
👌
Hello, I have a problem with my laptop. So this morning I decided to reinstall my pc (restore the factory) however, an error in full reinstallation occurs: We encountered an error when reinstalling your PC. However, no changes have been made.
I search the internet, but no help helps me solve my problems. How can I do it?
(For info I have a USB key to my reach but the problem is that my pc requires 8go more than I can not release)
is reinstalling your pc even a thing
reinstalling windows is
@earnest phoenix ok
I want to go back to factory, reset what @earnest phoenix
which os
i have windows 10 familly version @earnest phoenix
yeah
if that doesnt work, your drive is fucked and you need to do a clean install
which means you're required to have a copy of windows on a usb stick / cd drive
i have this mistake
is the copy pirated
isn't exactly
but u know
is it, or is it not
it's french
It seems that I have corrupted files.
And in the log file (C:\$SysReset\Logs\setupact.log), i have this
LogSession: Reopened a log session at [C:\$SysReset\Logs]
ResetResumeLog: Reopened session logs in [C:\$SysReset\Logs]
ResetReturnToOldOS: Started
ResetReturnToOldOS: Tracing failure event
ResetReturnToOldOS: Event traced successfully
ResetReturnToOldOS: Tracing Boot State file [C:\WINDOWS\bootstat.dat]
Attempt to get BsdSummarize Diagnostic Information for bootstat file: \??\C:\$SysReset\Logs\ReturnToOldOS\bootstat.dat
BsdSummarize Diagnostic Information: BootLogInitCount:241
BsdSummarize Diagnostic Information: BootLogOsLaunchCount:170
BsdSummarize Diagnostic Information: BootLogErrorCount:300
BsdSummarize Diagnostic Information: BootLogLastErrorEventCode:50
BsdSummarize Diagnostic Information: BootLogLastBootdiagErrorCode:0
BsdSummarize Diagnostic Information: HeaderPresent:1
BsdSummarize Diagnostic Information: BootId:330
BsdSummarize Diagnostic Information: LastBootSucceeded:1
BsdSummarize Diagnostic Information: FatalErrorCode:0
BsdSummarize Diagnostic Information: BootLogInitCount:0
Encrypt: Restoring original protection state
Encrypt: State file does not exist, assuming reset has not suspended protection on any volumes
ResetReturnToOldOS: Completed
@earnest phoenix
Is that the blue screen of death
module.exports.run = async (bot, message, args) => {
const embed = new Discord.RichEmbed()
.addField("Username:", message.author.username)
.addField("Avatar URL", message.author.avatarURL)
.setColor('#ff9bbd')
message.channel.send(embed)
}
module.exports.help = {
name: "avatar",
aliases: []
}```
Sends the Link of the Avatar, but not the Picture.
setImage
yes setImage(message.author.avatarURL)
Ok
I need commands for Moderation bots
@sterile laurel which language
All I need is command ideas
and I thought I was uninspired....
How could I make a purge thing? Right now I use message.channel.bulkDelete and that only deletes 1-10, is there a way I can purge more messages?
But if I do more than 10 the bot crashes
Example
If I do =clear 5 that works
But if I do =clear 11 or more it doesn't
show code
okay but Im not here in 2 hrs
Ok
just follow it from d.js docs
You’re probably not parsing the amount argument correctly
^
What you can do (psuedocode):
split at the first space, then whatever that is, split it again at the first space, and use the first argument
That's what I do for multiple args
hey guys mayne anyone can help me to add this ID 537047382752362512 in my server on discord ?
I don't know much about bots (practically nothing) , but i need to find this bot =p
args is (most likely) an array
Yeah, it always is afaik
You want to convert it to a string first and then replace whatever you'd like
Also, congrats on getting the bot verified, Jappy 
i mean someone can make args a string variable but 99.9% of people use arrays
thank you!! Got the message in the middle of work and was thrilled
args.join(' ') is likely what you want vic
Can anyone help me with bulkdelete
This is my code but it can only delete 1-10 messages
case 'clear':
if (!args[1]) return message.reply('Error please define a 2nd arg')
message.channel.bulkDelete(args[1]);
break;
I want it to delete more
Can anyone help?
in eris does <Client>.channelGuildMap include all channels, even possibly uncached ones? (i have no clue how caching works in eris)
if not, how could i fetch a channel?
Cyber28 you can use the <Client>.getRESTChannel method to fetch a channel.
of course if you have it enabled
Hello everyone!
I have a command to add roles to members and I have a small problem, how can I check the position of the role I want to give, with the highest position of the roles in my bot?
what lib?
I already have the role position check (but I have to specify it) and what I want is to check if a role is more or not higher than the role of my bot
I don't know if I explain myself well xD
This is my code but it can only delete 1-10 messages
case 'clear':
if (!args[1]) return message.reply('Error please define a 2nd arg')
message.channel.bulkDelete(args[1]);
break;
I want it to delete more
@sudden geyser is there any way without using rest mode?
I believe max is 100, but it can't delete stuff over 14 days old
I don't think so
There is a limit
Flaming don't you need to pass an integer, not a string?
sometimes discord just works with a string, weird or the lib does that
is it a way to fix so if a bot uses the unlock command to unlock all channels is it possible so it doesnt do it to channels that already has send_messages as false before using the lock command?

@sudden geyser actually, it seems to be working
the channel im getting hasnt been connected to any events yet it fetched it perfectly fine
Hi, i search one dev for support me with a personal little bot developing. i'm italian and my english so seriuosly bad but ok..
Okay so it's back to downloading the gradle @hybrid ruin 🙃
I'll be with you in a few minutes buddy
thanks man





