#development

1 messages ยท Page 472 of 1

ruby talon
knotty steeple
#

i dont think you know py

#

much

ruby talon
#

no.

#

I'm pretty new.

knotty steeple
#

@slender thistle pls say what is wrong with that

#

well i know some indenting is wrong

viscid falcon
#

Yeah, that doesn't look like any normal programming language syntax

slender thistle
#
  1. Inconsisent use of tabs and spaces, probably.
  2. You don't fucking do global var = 0 global var2 = 1.
#

Multiple lines exist. :^)

ruby talon
#

'k

#

xD

knotty steeple
#

what is global anyway

viscid falcon
#

Global var I think

#

I tried learning python before

slender thistle
viscid falcon
#

Gabe up

knotty steeple
#

its probably like global.something = "uh" in js

slender thistle
#

StackOverflow will help.

wide ruin
#
const Discord = require('discord.js')

module.exports.run = (client, message, args) => {
  const help = new Discord.RichEmbed()
           .setTitle("Help")
           .setDescription("commands:")
           .addField("[Joke \n Sends a random joke")
           .addField("[Help \n Shows this")
           .addField("[Ping \n Responds with pong")
           .addField("For people with the permission:")
           .addField("[Kick @user \n Kicks a user")
           .addField("[Ban @user \n Bans a user")
           .addField("[Role {role} {user} & [Delrole {role} {user} \n Gives/Removes a role from a user")
           .setColor(0x00ff00)
           .setFooter(`Help for ${message.author.tag}!`)
          message.channel.send(help)
  }

module.exports.help = {
  name: "help" 
}``` this is the help command,
#

but after every field, it says undefined

#

why?

bright spear
#

@wide ruin the format is title, description

#

You only put the title

knotty steeple
#

shit if thats how ur gonna make ur help command rip

frigid bone
#

addField takes at least 2 parameters by the way

#

for name and value

topaz fjord
#

^

wide ruin
#

So I need to add a description after title

bright spear
#

Yes

wide ruin
#

Wait no

frigid bone
#

and yeah you need a better way of listing your commands. Perhaps build an embed from important modules instead of hardcoding it

wide ruin
#

It's already on there

topaz fjord
#

.addField(title, desc)

wide ruin
#

So change \n for ,

topaz fjord
#

That's how it's supposed to be in addField

bright spear
#

@wide ruin end the string, put a comma, start a new string

#

Like "help", "this comamnd"

wide ruin
#

Ok

#

So \n becomes ", "

#

Thanks

thorn vault
#
  File "c:/Users/Mini David/Desktop/brute/bot.py", line 24
    @bot.command(pass_context=True)
                                  ^
IndentationError: unindent does not match any outer indentation level
PS C:\Users\Mini David>```
#

what do i do

frigid bone
#

That's one way of interpreting it, I guess hmmbutspinning

knotty steeple
#

indentation error

#

for some reason i cant understand anything else about that error

frigid bone
#

SO says your indentation might be inconsistent

#

e.g mixing tabs and spaces

knotty steeple
#

fix your indentation

#

@thorn vault

thorn vault
#

Done ๐Ÿ˜›

#
Collecting sys
  Could not find a version that satisfies the requirement sys (from versions: )
No matching distribution found for sys
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
PS C:\Users\Mini David>```
knotty steeple
#

im pretty sure to use sys you just import it

slender thistle
#

Isn't sys already installed...

knotty steeple
#

correct me if im wrong

slender thistle
#

You just import sys.

#

You don't install it.

thorn vault
#

ok

rich sail
#

why im muted in general

#

@radiant current xd

slender thistle
#

Wrong channel to ask.

knotty steeple
slender thistle
#

Because of the people who kept complaining about people from here hacking their bots.

earnest phoenix
#

oh well shit happens

latent heron
#

Maybe you shouldnt post your bot code with your token online

earnest phoenix
#

I joined from a link crewio

latent heron
#

Stop complaining and use common sense people

earnest phoenix
#

From crewio *

latent heron
#

Just delete the bot token on github

#

So simple

earnest phoenix
#

He's trying to frame Tonukku lmao

slender thistle
earnest phoenix
#

You can add it to gitignore

latent heron
#

I didnt start the convo??

earnest phoenix
#

when you push to git

#

the token

latent heron
#

Yeah use gitignore or just delete token from source...

warm fossil
#

Um... Why do I not have permission to send message in the general channel?

latent heron
#

If you are going to publish the code use common sense on whether or not it will be private

warm fossil
#

Ohhh

earnest phoenix
#

I don't have permission either

latent heron
#

Nobody but staff do

warm fossil
#

Isn't general channel supposed to be public

#

?

latent heron
#

Apparently some wannabe hacker is fucking with leaked bot tokens which people could quickly solve...

slender thistle
#

You cannot chat in #general because it was locked down due to many people coming just to complain about hacked bots.

latent heron
#

And people flamed the channel

warm fossil
#

Alright, alright, alright. You don't have to make me feel bad

#

How was I supposed to know

#

It was my first time creating a bot

slender thistle
latent heron
#

Hey shiv can you stop mini modding thx

slender thistle
#

Yeah sure np. :^)

wide ruin
#

In d.js can you say let message = client.message

rich sail
#

use my bor

knotty steeple
#

no @wide ruin

topaz fjord
#

the fuck

wide ruin
#

How can you?

topaz fjord
#

to get message u need the message event

thorn vault
#
Traceback (most recent call last):
  File "c:/Users/Mini David/Desktop/brute/bot.py", line 5, in <module>
    import chalk
ModuleNotFoundError: No module named 'chalk'
PS C:\Users\Mini David> python -m pip install -U chalk --user
Collecting chalk
  Could not find a version that satisfies the requirement chalk (from versions: )
No matching distribution found for chalk
PS C:\Users\Mini David>```
#

hmm

earnest phoenix
#

who here knows how i remove a command in discord.py (async)

slender thistle
#

bot.remove_command('command_name')

thorn vault
#
Traceback (most recent call last):
  File "c:/Users/Mini David/Desktop/brute/bot.py", line 5, in <module>
    import chalk
ModuleNotFoundError: No module named 'chalk'
PS C:\Users\Mini David> python -m pip install -U chalk --user
Collecting chalk
  Could not find a version that satisfies the requirement chalk (from versions: )
No matching distribution found for chalk
PS C:\Users\Mini David>```
#

ploz halp

#

xD

#

Idk

slender thistle
#

You don't have to spam that.

earnest phoenix
#

@slender thistle I tried that

knotty steeple
#

why do you need chalk and what does it do Thonk

slender thistle
#

Chalk allows you to print to your terminal in color. It also provides a simple logging handler and formatter for a more informative logging experience. Why print in black and white?

latent heron
#

Discord.py lets u do this but a bit different in variable context

thorn vault
#

so chalk isnt needed..

earnest phoenix
#

@slender thistle That didn't work

latent heron
#

message = ctx.author.content

earnest phoenix
#

hello

slender thistle
#

@earnest phoenix Looks like the thing isn't being called. :^)

earnest phoenix
#

what do you mean?

thorn vault
#

what does dbl do

wide ruin
#

d.js const Message = args.join(' '); this better?

slender thistle
#

Well, what command are you trying to remove, anyways?

latent heron
#

Noo

knotty steeple
#

help @slender thistle

thorn vault
#

What does dbl do

latent heron
#

Are you trolling

topaz fjord
#

no

slender thistle
#

@knotty steeple wut

earnest phoenix
#

please

#

verify

knotty steeple
#

he is trying to remove the help command

earnest phoenix
#

pls

latent heron
#

How tf is a constant var gonna work for messages

#

@earnest phoenix wait for staff to approve it

earnest phoenix
#

ok ๐Ÿ˜ฆ

#

no problem ๐Ÿ˜ƒ

topaz fjord
#
<Client>.on('message', msg => {
    // use msg for anything
})
``` @wide ruin thats how you get message
thorn vault
#

what does dbl do

topaz fjord
#

dbl is a bot list

#

gives exposure to your bot

thorn vault
#

wdym

slender thistle
#

bot.remove_command('help') right after declaring bot. It's easy to remove the in-built help command.

latent heron
#

Using message whitespace to get messages in JS ๐Ÿคข

thorn vault
#

@topaz fjord wdym

topaz fjord
#

it cant get more basic than what i said

thorn vault
#

It exposes ur bot?

topaz fjord
#

yes so people can invite it

knotty steeple
#

advertises ur bot

open basin
#

this pice of code dose not work why await client.change_presence(game=discord.Game(name=current_status)) await asyncio.sleep(5)

thorn vault
#

but people should be able to invite it already

slender thistle
#

It's a website where you list your bot so that more people could see it and decided whether or not to use it.

#

@open basin rewrite or async?

topaz fjord
#

piece of code does not work why

open basin
#

async

slender thistle
#

Why are you indenting asyncio.sleep thing?

#

Why do you need it in first place?

latent heron
#

Uhh

open basin
#

to loop statuses

latent heron
#

Yesy

#

No

open basin
#

of the bot

latent heron
#

You cant loop like that

#

Set up a for loop of the asyncio sleep

open basin
#

i have

latent heron
#

No you have not

slender thistle
#

for for asyncio.sleep?

#

Maybe a while True:? :^)

open basin
#

yes

latent heron
#

Idk

open basin
#

ok i will try

latent heron
#

For loop was most relevant in my head

slender thistle
#

Hold the fuck up.

thorn vault
#

no u

latent heron
#

Yikes

thorn vault
#

listen up

slender thistle
latent heron
#

.mp3

#

๐Ÿ˜ฑ

thorn vault
#

fite me broo

latent heron
#

Nou

thorn vault
#

XD

knotty steeple
thorn vault
#

samurai

knotty steeple
#

not trying to minimod

thorn vault
#

โค

slender thistle
latent heron
#

Dont fuck with stacks

#

He will fuck you up

earnest phoenix
#

lmao it's so easy to remove the command

#

i'm so stupid

slender thistle
#

Yep.

latent heron
#

Yesh

slender thistle
#

:v)

thorn vault
#

samurai

knotty steeple
#

what

earnest phoenix
#

;;help

latent heron
#

You need to remove help RIGHT after you define the bot variable

earnest phoenix
#

Yeah, I figured that out

thorn vault
#

ffpronounce dont fuck wit me, i have the god and anime on my side! AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

earnest phoenix
#

.

thorn vault
#

ffhelp

#

D:

knotty steeple
#

...

slender thistle
#

Bots don't reply outside of testing and bot-hell channels.

latent heron
#

Ok you can call a mod now

knotty steeple
#

im gonna let @hushed berry tell you where you are supposed to be

latent heron
#

Why nik

#

Nik just wanna enjoy life

knotty steeple
#

he is cool

latent heron
#

Y uu pingggg

#

Hes playing a game how could u

#

=[

earnest phoenix
#

hey @latent heron how would i make it so users can change the prefix for their server only and not global..?

thorn vault
#

ur rude

knotty steeple
#

well im gonna go this is pretty offtopic tbh

latent heron
#

Uhh

#

Well

#

You can create server files for the bot

#

So it opens the file in the code idk

earnest phoenix
#

how would i do that

latent heron
#

I never did it

earnest phoenix
#

shit ok

latent heron
#

But

knotty steeple
#

database

slender thistle
latent heron
#

I would do like a database or .txt

thorn vault
#

-_-

knotty steeple
#

txt would be bad if the bot is in 12k servers

thorn vault
#

fuck u

#

awh

knotty steeple
#

then it would have 12k text files mmLol

thorn vault
#

tts doesnt work ๐Ÿ˜ฆ

earnest phoenix
#

also, how do i find out how many server's it's in so i can put it in the status..?

latent heron
#

If command is prefix: get server name, open server name.txt, split content in file, get prefix, change to prefix

knotty steeple
#

len(bot.guilds)

latent heron
#

Idk about the global part tho

slender thistle
#

@queen sentinel 369145073989976075 (@thorn vault) shitposting in #development.

earnest phoenix
#

ok thanks samurai

knotty steeple
#

len() gets the length of something

latent heron
#

Hm

slender thistle
#

Length of a list or tuple.

latent heron
#

Dont you need to list the server guild firdt

slender thistle
#

or a string. :^)

latent heron
#

Before len?

knotty steeple
#

yes

#

also whats a tuple

latent heron
#

Tuple

#

Is err

earnest phoenix
hushed berry
#

like a list

slender thistle
latent heron
#

Idk but shiv is more intelligent than me

slender thistle
#

@earnest phoenix servers, not guilds.

latent heron
#

I dont wanna give false info

earnest phoenix
#

okay

knotty steeple
#

oh yea async

latent heron
#

Well servers is async, guilds is rewrite

knotty steeple
#

my bad

slender thistle
#

Just remember that servers is the only thing that exists in async. guilds aren't.

earnest phoenix
#

@ocean current

latent heron
#

Why is it guild tho

earnest phoenix
#

it's in 3 servers! ๐Ÿ˜„

latent heron
#

Servers makes more sense

slender thistle
#

Doesn't Discord API call them guilds?

earnest phoenix
#

so this and my main server, but someone else got whale ๐Ÿ˜„

latent heron
#

Ill go write a complaint to discord bout it then

slender thistle
#

I mean, you could play around with the source and call those servers.

#

Or do stuff like bot.servers = bot.guilds

earnest phoenix
#

my bot is hecking cool now

#

dab

latent heron
#

Gg

#

Now be careful to not abuse api

earnest phoenix
#

wdym abuse api?

latent heron
#

cough mass DM or message

earnest phoenix
#

i wont

#

lmao

latent heron
#

Is an example

earnest phoenix
#

*mass dm you say..? dblWink *

#

jk

#

lmao

latent heron
#

Dummies guide to getting banned on Discord

wide ruin
#

In d.js, for a submit command, can the bot DM me?

#

If so, how?

west raptor
#

I would recommend sending into a channel but you would need to find or get yourself and then (whatever you denified it as).send(whatever here)

wide ruin
#

So how would I find myself

gilded blaze
#

You could use client.fetchUser();

west raptor
#

^

wide ruin
#

So client.fetchUser(); would do what

#

I want to send it to me

gilded blaze
#

It returns a User object which you can use the send method on.

#

However keep in mind it returns a promise.

wide ruin
#

How would I get it to DM me?

#

Because it hasn't mentioned my name anywhere

gilded blaze
#

client.fetchUser("id").then(user => user.send());

west raptor
#

(user).send()

#

Or that

wide ruin
#

Can you get my Id please

#

I'm on mobile

west raptor
#

438733159748599813

wide ruin
#

Thanks

west raptor
#

Np

wide ruin
#

I would ask for token, but I like the server

#

And discord as a whole

#

So no

#

I won't ask

west raptor
#

Huh

knotty steeple
#

what

slender thistle
#

Token? What?

wide ruin
#

Selfbots need user tokens

knotty steeple
#

and?

wide ruin
#

client.fetchUser("438733159748599813".then(user => user.send("text here"));

#

Is that right?

west raptor
#

Yes

gilded blaze
#

No.

knotty steeple
#

no

west raptor
#

Oh

wide ruin
#

O

west raptor
#

Nvm

gilded blaze
#

fetchUser is its own function.

#

The .then is only because it returns a promise.

#

Which you need to wait for.

west raptor
#

I'm on mobile, hard to read

#
client.fetchUser("438733159748599813") .then(user => user.send("text here"));
#

Do that

earnest phoenix
#

I need help

#

help for what?

#

@bot.command(pass_context=True)
async def lock(ctx, channel: discord.Channel):
    if ctx.message.author.server_permissions.manage_channels:
        overwrite = discord.PermissionOverwrite()  
        overwrite.read_messages = True  
        overwrite.send_messages = False  
        await bot.edit_channel_permissions(message.channel, message.author, overwrite)
        embed= discord.Embed(title="Locked channel.", description="This channel was locked by {}.".format(ctx.message.author))

@bot.command(pass_context=True)
async def unlock(ctx, channel: discord.Channel):
    if ctx.message.author.server_permissions.manage_channels:
        overwrite = discord.PermissionOverwrite()  
        overwrite.read_messages = True  
        overwrite.send_messages = True  
        await bot.edit_channel_permissions(message.channel, message.author, overwrite)
        embed= discord.Embed(title="Unlocked channel.", description="This channel was unlocked by {}.".format(ctx.message.author))
#

"Channel is a missing argument"

#

hmmmm. sadly i can't help you :/

#

Thanks anyways :):

#

i use dsharp plus so sorry

#

;-;

open basin
#

Do you have a channel variable @earnest phoenix

earnest phoenix
#

No, I don't, how would I set one as the current channel?

#

@open basin

open basin
#

Make a variable

#

Called channel

earnest phoenix
#

alright, and then what..?

#

@open basin

open basin
#

And then define the channel you want it to be said in

earnest phoenix
#

but the thing is

#

is that i want it to be said in any channel

#

and for the bot to recognize the channel

#

and lock said channel

open basin
#

Oh

#

Sorry I can not help

earnest phoenix
#

Alright. Thank you anyways.

open basin
#

No problem

earnest phoenix
#
@bot.command(pass_context=True)
async def lock(ctx, channel: discord.Channel):
    if ctx.message.author.server_permissions.manage_channels:
        overwrite = discord.PermissionOverwrite()  
        overwrite.read_messages = True  
        overwrite.send_messages = False  
        await bot.edit_channel_permissions(message.channel, message.author, overwrite)
        embed= discord.Embed(title="Locked channel.", description="This channel was locked by {}.".format(ctx.message.author))

@bot.command(pass_context=True)
async def unlock(ctx, channel: discord.Channel):
    if ctx.message.author.server_permissions.manage_channels:
        overwrite = discord.PermissionOverwrite()  
        overwrite.read_messages = True  
        overwrite.send_messages = True  
        await bot.edit_channel_permissions(message.channel, message.author, overwrite)
        embed= discord.Embed(title="Unlocked channel.", description="This channel was unlocked by {}.".format(ctx.message.author))```
"channel is a missing argument"
ruby talon
earnest phoenix
#

is it obvious.. ๐Ÿ˜‚

ruby talon
#

Idk xD

#

I have been coding for only 1-2 weeks so..

#

XD

earnest phoenix
#

I just started yesterday

#

ยฏ_(ใƒ„)_/ยฏ

fiery canyon
#

oooh

#

whats this

earnest phoenix
fiery canyon
#

i know rewrite

earnest phoenix
#

damn, this is async

fiery canyon
#

did you try putting self before ctx.

#

or

earnest phoenix
#

let me check one sec

ruby talon
#

I do know that you forgot

await bot.say(embed=embed) 

I don't know anything else, sorryh.

fiery canyon
#

when youre doing channel

#

because that could be what is just simply causing it

earnest phoenix
#

oh, one sec, that might be it.

#

didn't work

#

wait

fiery canyon
#

how are you running the command then

earnest phoenix
#

wait

#

wait

#

wait

#

wait

#

now it's giving this

#

I'm just trying to edit permissions D:

#

(and lock a channel)

fiery canyon
#

is everyone defined

earnest phoenix
#

it's a normal role

#

is it not?

fiery canyon
#

where did you define it

earnest phoenix
#

nowhere

#

lmao

fiery canyon
#
everyone = list(r for r in ctx.guild.roles if r.id == ctx.guild.id)[0]```
#

this should work

earnest phoenix
#

"in" is an invalid syntax

#

lmfao python

fiery canyon
#

you didnt add the r

#

accidentaly put r for in

earnest phoenix
ruby talon
#

How to disable it that your bot responds to other bots?

earnest phoenix
#

change the prefixes

wide ruin
#

d.js message isn't defined?

fiery canyon
#

lemme find the code

earnest phoenix
#

what lib you use @ruby talon ?

fiery canyon
#

async

earnest phoenix
#

it should be done automatically

wide ruin
#

How isn't message defined? Pls help

ruby talon
earnest phoenix
#

hmmm

#

idk then

#

async or rewrite @ruby talon

#

ye

#

maybe that

fiery canyon
#
async def on_message(message):
    if message.author.bot:
        return
    await self.bot.process_commands(message)
    ```
ruby talon
#

I use async.

wide ruin
#

Can I have help please

fiery canyon
#

whats wrong

#

๐Ÿ˜ฆ

wide ruin
#

Message isn't defined

ruby talon
#

@fiery canyon ty.

fiery canyon
#

whats the code

#

is this in an event or in a command

earnest phoenix
#

so change the prefixes then, because it's getting called from when a bot uses a prefix, change a prefix to something semi-original such as ;- or something @ruby talon

wide ruin
#

But I have had no problems before with it

fiery canyon
#

if its in a command refer to ctx.message

#

put the on_message handle i put above

wide ruin
#

Can I invite you to the code?

fiery canyon
#

is it an event

#

or command

earnest phoenix
#

what lib u use?

#

^

wide ruin
#

d.js

fiery canyon
#

o h

earnest phoenix
#

ah ye you said that

fiery canyon
#

is it in on_message

earnest phoenix
#

rip nobody uses dsharp plush xD

#

oofi

fiery canyon
#
function on_message(message) {```
?
earnest phoenix
#

*plus

#

nope

fiery canyon
#

well

earnest phoenix
#

Damn.

fiery canyon
#

you should erm

#

learn basics

earnest phoenix
#

i know just a bit of python

fiery canyon
#

lemme find you some help

earnest phoenix
#

but basically nothing

fiery canyon
#

this will help

earnest phoenix
#

It seems so simple just to lock a channel

fiery canyon
#

oh thats rewrite

wide ruin
#

@fiery canyon

ruby talon
#

@earnest phoenix my bot has multiple prefixes to make it easier for users, I won't change them and @fiery canyon already gave me a good response, I'll look into it tomorrow.
Gn ya all.

fiery canyon
#

erm

#

you just called it not in an event

#

it should be in an on_message event

earnest phoenix
#

@wide ruin You're coding on your phone? Wait until you're on your computer to do it, much easier.

fiery canyon
#

^

#

also

#

you havent even supplied a bot token yet

#

so dont you think something is wrong

wide ruin
#

No

#

That's a separate file

fiery canyon
#

its not even running the bot

wide ruin
#

Its uses a command handler

#

Ik

fiery canyon
#

and nothing there

wide ruin
#

There is an error

fiery canyon
#

its not in an event

wide ruin
#

Can I just invite you

fiery canyon
#

why are you making discord.Client again

#

no

#

just learn how to use discord.js

knotty steeple
#

ok what is it

fiery canyon
#

he wants to be spoonfed

#

discord.js

wide ruin
#

No

knotty steeple
#

no like whats the problem

wide ruin
#

The code that i used has worked before

fiery canyon
#

he didnt put it in an on_message event or as a command

knotty steeple
#

discord.js message event is just message

fiery canyon
#

hes not declaring an event or command

knotty steeple
#

why are u defining args if you already have it in the run function

pale marsh
#

@earnest phoenix D#+ best lib

earnest phoenix
#

^^^^^^^

#

tru

viscid falcon
#

i making a music command in d.js and when it streams to the channel the audio is all choppy and laggy, how would i fix that?

earnest phoenix
#

get a better server

#

ยฏ_(ใƒ„)_/ยฏ

viscid falcon
#

i was gonna build a new one soon, is a raspberry pi 3 not good enough?

earnest phoenix
#

I don't think so

#

i am going to try

viscid falcon
#

lol ok, would an old 2 core i3 be better

earnest phoenix
#

using a 500 mb/s connection

#

probably it's not able to work 24/7

viscid falcon
#

you mean your internet connection or the i3

earnest phoenix
#

my wiki conncetion ye

#

annope

#

the i3

#

it can'r work 24/7

#

i guess

viscid falcon
#

rlly

#

wait it can or cant?

earnest phoenix
#

it can't

viscid falcon
#

y not

earnest phoenix
#

if it's a normal pc

viscid falcon
#

wells its some partss from an old one i had, if it was a dedicated server would it be good?

#

tghe new build

earnest phoenix
#

idk about that

#

i use a rasberry

viscid falcon
#

ima try the command on my main build and see if that fixes it

earnest phoenix
#

oki

rustic axle
#

Best option for cheap ass hosting is the Pi 3 B+

#

25$ not even

earnest phoenix
#

i ahev taht xD

#

end me

rustic axle
#

yeah then learn how the fuck to use linux

#

g

#

l

earnest phoenix
#

eckseedee

#

I'll use the rasb just for the voice probably

#

eckseedee

#

jk

upper ember
#

is discord ID an int or text value?

ruby dust
#

depends on lib

upper ember
#

discord.js

ruby dust
#

iirc it's text in d.js

upper ember
#

ffs that's why it keeps telling me it couldn't find the server in the database

#

thanks

brave wedge
#

one of my static files in apache has been cached and i need to update it but i cant figure out how to clean out the cache to change it

#

if anyone has any tips pls can you @ because i have my notifications muted. imma go fight with it some more

earnest phoenix
#

@brave wedge you mean it has been cached by the browser and you want to force the browser to update it?

brave wedge
#

no, its being cached on the server

#

i have my browser cache turned off to avoid this sort of stuff

#

oh wait does cloudflare cache stuff?

earnest phoenix
#

yes

#

there you have it, clear the cache or enable dev mode temporarily. if you want it permanently you can either do it via page rules (for specific stuff) or globally by cache settings

brave wedge
#

christ that was more painful than it had to be. thanks.

#

still not working though but i think this is on me. websockets and stuff, ill figure something out

earnest phoenix
#

how do I make this like ban perms or administrator
if (!msg.member.hasPermission('BAN_MEMBERS')) return msg.channel.send(`You don't have permission to run this command!\nMissing Permissions: \`BAN_MEMBERS\``)

#

node.js?

knotty steeple
#

what

#

make it check for ban perms or administrator?

fickle ibex
#

@earnest phoenix When you check perms, if someone has the admin perm, it will always be true for every permission node

earnest phoenix
#

๐Ÿค”

#
@bot.command(pass_context=True)
async def info(ctx, user: discord.Member):
    if discord.Member:
        embed = discord.Embed(title="User Info", description="The user's username is: **{}**\nThe user's status is **{}**".format(user.name,user.status), color=0x234D87)
        embed.set_thumbnail(url=user.avatar_url)
        await bot.say (embed=embed)
    else:
        embed = discord.Embed(title="Hmm", description=":thinking: I can't find that user...", color=0x234D87)
        await bot.say (embed=embed)```
#

@knotty steeple do you see any problems with this?

knotty steeple
#

no cuz i dont py

fickle ibex
#

py oof

#

JS is love uwu

inner jewel
#

bot.say

#

it won't know what channel to say

frigid bone
#

I'm not sure if color=0x234D87 is legal

inner jewel
#

that's just a hex literal

earnest phoenix
#

Natan what do you mean?

knotty steeple
#

@inner jewel but it works

earnest phoenix
#

It says it in the same channel.

inner jewel
#

idk then

frigid bone
#

ah

earnest phoenix
frigid bone
#

I need to do more Python :^)

inner jewel
#

plugin

knotty steeple
#

rich presence*

earnest phoenix
#

like i'm chilling in visual studio code but it doesnt show mine ๐Ÿ˜ฆ

inner jewel
#

you need to install a plugin

viscid falcon
#

for some reason this bit of code client.channels.get('473694816190988288').send('test') works on my eval command but not on the bot, any ideas?

knotty steeple
#

you need an extension

frigid bone
#

There's a plugin for VS Code too

earnest phoenix
#

how do i install it lmao

knotty steeple
#

just search discord

#

in the extensions tab

frigid bone
#

There's an extensions tab on left

knotty steeple
#

Discord Presence

#

yes get that one

earnest phoenix
#

got it

knotty steeple
#

vscode-discord is one i also have if i want to customise certain stuff

viscid falcon
#

for some reason this bit of code client.channels.get('473694816190988288').send('test') works on my eval command but not on the bot, any ideas?

frigid bone
#

@viscid falcon are you getting any error in particular?

knotty steeple
#

we already saw your message

inner jewel
#

no need to keep asking it

knotty steeple
#

no need to send again

#

oof natan

viscid falcon
#

yeah, cannot read property send of undefined

#

srry

frigid bone
#

Probably because client is an eval object

#

Can you show me the full code?

viscid falcon
#

sure, gonna take a minute since i cant copy paste

frigid bone
#

take a screenshot hmm

viscid falcon
#

cant, seperate computer

frigid bone
#

rip

viscid falcon
#
const Discord = require('discord.js');
const client = new Discord.Client();
module.exports = {
    name: 'bug',
    cooldown: 2,
    description: ''reports a bug',
    execute(message, args) {
        client.channels.get('heres my channel id').send('worked')
    },
};
frigid bone
#

You're not logging in?

fickle ibex
#

And itโ€™s: client.channels

viscid falcon
#

thats what i meant

#

srry typo

gilded blaze
#

Why are you instancing another client?

viscid falcon
#

and jokerus im using a command handler

#

what do u mean sei4or

sick cloud
#

well thats your issue

#

your making another client

#

that isn't logged in

#

has no commands or channels

viscid falcon
#

its worked for other commands

sick cloud
#

its a new bot literally

fickle ibex
#

You are creating a new instance

frigid bone
#

If you're going with a modular command design, take a look at discord.js-commando

viscid falcon
#

how would i not do that

frigid bone
#

Because you're doing it wrong

gilded blaze
#

message.client

sick cloud
#

ew

frigid bone
#

Won't work

viscid falcon
#

but then client wouldnt be defined

sick cloud
#

commando is fucking gross

viscid falcon
#

its a seperate file

frigid bone
#

Client not logged in = no channel cache

sick cloud
#

just pass it through

frigid bone
fickle ibex
#

Just module.export your real bot instance

gilded blaze
#

client is a property of the message object.

sick cloud
#

global.client = client even

fickle ibex
#

Ew

frigid bone
#

What's wrong with commando hmm

sick cloud
#

its commando

viscid falcon
#

so what would it be message.client.get...

gilded blaze
#

yes

viscid falcon
#

thanks!

frigid bone
#

Yes but that still won't work

gilded blaze
#

How will it not? That returns the client who received the message.

viscid falcon
#

but it just did

fickle ibex
#

If it doesnโ€™t work, just require your main instance and call an exported module of the discordjs bot instance

sick cloud
#

<message>.client.[whatever]

viscid falcon
#

you have a diffrent set up then i do jokerus

frigid bone
#

He instantiates a new client, and does not log in

viscid falcon
#

it doesnt mean me or u are wrong

sick cloud
#

works easily

frigid bone
#

That's not the issue

sick cloud
#

message always has a client

#

its built in

viscid falcon
#

go to #commands and do _bug, you will get no errors and i recieve the message

#

it works

frigid bone
#

actually

#

it will since you're passing a message object, my bad

#

But

const Discord = require('discord.js');
const client = new Discord.Client();
#

There's no need to create a new client here

viscid falcon
#

ik that now, it just thats how i used to do it

#

now imma go cuasae my dad brought home chinese food

frigid bone
#

I assumed you were using properties of the new client YuiShrug

viscid falcon
#

that literally all the code for that command

#

its just a bug reporting command

#

may add 1 or 2 more lines though

obtuse wind
#

Node.js ( Discord.js )

How would I make my bot join voice channels and play music?

viscid falcon
#

google is nice this time a year

gilded blaze
#

Get a Voicechannel (https://discord.js.org/#/docs/main/stable/class/VoiceChannel) and use the join method. To play music you have to download the mp3 and play that. There are libraries for this.

obtuse wind
#

Where would I get the mp3 file

viscid falcon
#

your computer

#

or a website

#

depends on which you wanna do

obtuse wind
#

^ If you don't want to help, then don't talk -.-

#

Simple as that.

viscid falcon
#

????

#

i was helping though

#

oh i thought you meant where you streamed it from

gilded blaze
#

Youtube is one of the most popular and has an api for it. (TOS allows it unlike spotify.)

viscid falcon
#

mb

obtuse wind
#

Alrighty, then

  1. Computers don't have mp3 files unless downloaded manually
  2. I don't trust websites.
viscid falcon
#
  1. you cant get one then
bright spear
#

then where will you get the music from...

#

if you "dont trust websites"

#

also u know discord is a website

obtuse wind
#

Depends if the website is shady

#

It could be virus

bright spear
#

you think youtube is shady???

viscid falcon
#

lol

obtuse wind
#

No

#

Other sites are shady

viscid falcon
#

so then get it from youtube

obtuse wind
#

Many sites are shady

smoky spire
#

You only have to trust YouTube

viscid falcon
#

is there a way to get an html element from a specific website, like if i wanted to get the pokedex entry from this website and send it to the user https://www.pokedex.org/#/pokemon/1

gilded blaze
#

You could scrape it and scan ids.

viscid falcon
#

how would i scape it?

frigid bone
#

Yeah, but most websites don't like it

gilded blaze
viscid falcon
#

thanks

frigid bone
#

You're using JS, right? Look into request and cheerio

#

if you want to scrape

#

oh well

viscid falcon
#

ill just use the api lol

frigid bone
#

Yeah api is the best option

viscid falcon
#

and is there a way to download discord.js docs, im going to be on a flight in the near future and i wouldnt mind having that handy

bright spear
#

if you download d.js itself, i think the docs are generated from the source

gilded blaze
#

It's totally possible and a simple google search could find you a tool.

hexed lark
#

why i cant get banned=

viscid falcon
#

?? can you be more clear?

hexed lark
#

no

#

i swear 40-50 times

#

for got banned

viscid falcon
#

is english not your native language? try asking to see if anyone speaks it

frigid bone
#

Off topic, and if you're trying to trigger auto ban mechanism of a bot by cussing, it won't work

viscid falcon
#

y

frigid bone
#

That was for nomnom remsniff

viscid falcon
#

if (message.content.includes('frick')) {
message.author.ban //forgot the ban method
}

hexed lark
#

ok

frigid bone
#

ban is a member method, not user

viscid falcon
#

message.member.ban

frigid bone
#

message.member.ban() is the correct usage

viscid falcon
#

but why wouldnt auto banning work for swearing

prime cliff
#

@viscid falcon pls no swear christian server

viscid falcon
#

srry

frigid bone
#

I don't think bots here have permissions to ban

viscid falcon
#

oh i thought u meant it wouldnt work in any servr

hexed lark
#

ok lets try again "fuck, shit, bastard" and let's try german "scheisse, fick" and turkish "siktir, orospu" and TA DAA no ban

#

magic

viscid falcon
#

then prob a collection and while loop

#

let me show u a similar thing ive been working on

hexed lark
#

ok

viscid falcon
#

this follows the same concept

var BugNames = ['bug', 'error', 'glitch']
   while(i--) {
    
        if (helpRequest.includes(BugNames[i])) {
            if (helpRequest.includes('report')) {
                console.log('success')
                message.channel.send('To report a bug use ;bug <bug> in any channel or server')
                return;
            }    
        }
}
#

you would prob only have 1 if statment

#

but auto banning for cussing is a bad idea

hexed lark
#

you are right

#

but only thing i now i can get banned if i swear to server owner

quartz kindle
#

please tell me you defined i somewhere before that

viscid falcon
#

oh i did

#

var i = BugNames.length

#

forgot to put that

quartz kindle
#

xD

sick cloud
#

and kinda detailed

bright spear
#

isnt that only for external sharding?

smoky spire
#

Internal sharding is still in early development

fiery canyon
#

hacked again

bright spear
#

@fiery canyon ur bot was "hacked"?

fiery canyon
#

no

#

the thing in general

idle mountain
#

yeep

gleaming glen
#

people are still asking

idle mountain
gleaming glen
#

and they dont understand english

#

so i sent a turkish one

idle mountain
#

Was the recently-deleted bot in Turkish?

fiery canyon
#

most probably

gleaming glen
#

yes it was

wide ruin
#

in d.js, how can you make the bot change from playing to watching, listening and streaming?

earnest phoenix
#

Are we allowed to use .css and html on detailed description or just html?

#

Anyone knows how to do this with YAGPDB? That after every message, it sends automatic response

#

I couldn't find their official server Sadness

#

Wait nvm found it BigFacepalm

half spear
#

I Wouldn't Really Know Where To Send This In The Server But I Recently Had My Discord Bot Rejected For A Reason I Have Now Fixed And I Was Wondering If I Can Re-Submit It On To discordbots.org I Have Re Submitted It And Hope It Doesnt Get Re-Declined Again

quartz kindle
#

yes, resubmit it and wait

thorn vault
#

Who develops py-js bots? dm me

earnest phoenix
#

py me

quartz kindle
#

py-js? like mixing both?

slender thistle
#

Probably someone who knows js and py

thorn vault
#

No not mixing both

#

Just one or the other

quartz kindle
#

well i develop in js

#

but not in python

thorn vault
#

then dm me ๐Ÿ˜„

#

@gilded plank bots @quartz kindle

gilded plankBOT
#
Tim#2373
Bots <:dblCertified:392249976639455232>

@oak sentinel dblCertified

thorn vault
#

-help

#

oof

quartz kindle
#

lel

slender thistle
thorn vault
#

I mean i succ at it

#

so

#

I succ at both languages

#

I don't learn from both online tutorials, so im looking for a human

earnest phoenix
#

(;

thorn vault
#

3 2 1

quartz kindle
#

i can help with js, but not with private lessons (unless there is $$)

thorn vault
#

drop it

#

.help

#

REEEEEEEEEEE

slender thistle
thorn vault
#

There is so many D:

quartz kindle
#

rip

slender thistle
#

Back at mini-modding ofc

half spear
#

Does Anyone Know How To Check For A Command Being Requested In A NSFW Channel Since I Have To Make My Urban Command NSFW

quartz kindle
#

lib?

half spear
quartz kindle
#

according to the docs its channel.is_nsfw()

#

but i dont use py, so idk

half spear
#

I Have Tried This But According To My Bot And To The Source Code Of Discord.py is_nsfw() Doesnt Exist In The Code

quartz kindle
#

which version of discord py?

half spear
#

0.16.12

quartz kindle
#

cant find anything in the docs

half spear
#

Thanks For Your Help But Ill Just Remove That Command From the Bot

quartz kindle
#

i think its not available in that version

half spear
#

Attempt 3 Of Submitting My Bot

quartz kindle
#

good luck

slender thistle
#

Yep. is_nsfw() doesn't exist in 0.16.x

brave wedge
#

ive got gunicorn, flask and nginx. something is redirecting to https://cards.jellywx.co.uk,cards.jellywx.co.uk/game?id=11 (rather than just https://cards.jellywx.co.uk). has anyone had this before?

foggy oak
#

Is it possible to multiple language bot?

brave wedge
#

when you say language what do you mean, programming or spoken

earnest phoenix
#

i guess they mean programming thinkEyes

quartz kindle
#

regardless of what they mean, both are possible

#

xd

brave wedge
#

yeah lol, just depends if its worth it

foggy oak
#

nope

#

speaking language

#

English, Turkish etc

#

Is there any tutorial for this? I can make different commands for each languages but its look so noobish xd

sick cloud
#

@foggy oak set per server and get cmd responses from a file

foggy oak
#

im thinking about using fs plugin

#

thx for idea, i think it'll work @sick cloud

night bridge
#

code from Discord web server~

sick cloud
#

np

#

@night bridge nice example off the djs docs

knotty steeple
#

made this to external or a function

#

what

night bridge
#

so like java?

function functionname(){
    // code state here...
}
sick cloud
#

what

knotty steeple
#

why dont u make a java bot GWqlabsNotLikeNoot

sick cloud
#

what are you even trying to do

night bridge
#

i use node.js 0-0

knotty steeple
#

so why did you say like java

night bridge
#

trying make is as function or external code

knotty steeple
#

im very confused

sick cloud
#

maybe freaking learn it

#

we aren't going to spoon-feed you

night bridge
#

i though node.js same as java

knotty steeple
#

no

#

they are different

night bridge
#

fine~

sick cloud
#

LMFAO

night bridge
#

sorry for your time

sick cloud
#

js = Java

open pine
#

@night bridge Can you speak turkish?

sick cloud
#

love it

night bridge
#

Nope. sorry >_<"

open pine
#

oh ok

thorn vault
#

i own a domain..

knotty steeple
#

ok

sick cloud
#

gg

quartz kindle
#

js / node.js = javascript (ECMAScript)
java = java

steel drum
#

@night bridge

#

id recommend storing commands in some sort of Object

#

then checking to see if there are any keys in said object

#

that match the inputted command

#

if so

#

run the associated value

#

smth like

#

let commands ={kek: function () {}}; if (msg.content == "/kek") return commands.kek();

#

this is a TERRIBLE example but this should give you a basic idea

earnest phoenix
#

or if(commands[commandname]) { commands[commandname].run() }

#

so u dont need a big if statement lmao

quartz kindle
#

i do ```commands = ["cmd1","cmd2","etc"];
if (commands.indexOf(msg.content) > -1) { eval(msg.content) }
function cmd1() {}
//etc

#

xD

steel drum
#

yea

#

well i usually load all the plguins from a directory

#

parse the msg (meaning break it up into 3 parts, trigger command and parameters)

earnest phoenix
#

How do I do serverjoin messages with an image

quartz kindle
#

which lib?

thorn vault
#
const client = new Discord.Client();
const token = ('lol not stealing today')

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('message', msg => {
  if (msg.content === 'ping') {
    msg.reply('Pong!');
  }
});

client.login('token');```
#

but

#
    at WebSocketConnection.client.ws.connection.once.event (C:\Users\Mini David\Desktop\brute\node_modules\discord.js\src\client\ClientManager.js:48:41)
    at Object.onceWrapper (events.js:273:13)
    at WebSocketConnection.emit (events.js:182:13)
    at WebSocketConnection.onClose (C:\Users\Mini David\Desktop\brute\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:390:10)
    at WebSocket.onClose (C:\Users\Mini David\Desktop\brute\node_modules\ws\lib\event-target.js:124:16)
    at WebSocket.emit (events.js:182:13)
    at _receiver.cleanup (C:\Users\Mini David\Desktop\brute\node_modules\ws\lib\websocket.js:220:12)
    at Receiver.cleanup (C:\Users\Mini David\Desktop\brute\node_modules\ws\lib\receiver.js:535:15)
    at WebSocket.finalize (C:\Users\Mini David\Desktop\brute\node_modules\ws\lib\websocket.js:206:20)
    at TLSSocket.emit (events.js:187:15)
(node:1696) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:1696) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
earnest phoenix
#

@quartz kindle currently using async

#

will be upgrading to rewrite on a new bot

quartz kindle
#

@thorn vault token = variable, 'token' = string

thorn vault
#

? so i dont put (boi no token)

#

I dont put ()

quartz kindle
#

you put token

#

without the ''

thorn vault
#

ok

earnest phoenix
quartz kindle
#

else you're giving it literally "token" as the token

thorn vault
#
PS C:\Users\Mini David\Desktop\brute> node bot.js
(node:3636) UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.
    at WebSocketConnection.client.ws.connection.once.event (C:\Users\Mini David\Desktop\brute\node_modules\discord.js\src\client\ClientManager.js:48:41)
    at Object.onceWrapper (events.js:273:13)
    at WebSocketConnection.emit (events.js:182:13)
    at WebSocketConnection.onClose (C:\Users\Mini David\Desktop\brute\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:390:10)
    at WebSocket.onClose (C:\Users\Mini David\Desktop\brute\node_modules\ws\lib\event-target.js:124:16)
    at WebSocket.emit (events.js:182:13)
    at _receiver.cleanup (C:\Users\Mini David\Desktop\brute\node_modules\ws\lib\websocket.js:220:12)
    at Receiver.cleanup (C:\Users\Mini David\Desktop\brute\node_modules\ws\lib\receiver.js:535:15)
    at WebSocket.finalize (C:\Users\Mini David\Desktop\brute\node_modules\ws\lib\websocket.js:206:20)
    at TLSSocket.emit (events.js:187:15)
(node:3636) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:3636) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
PS C:\Users\Mini David\Desktop\brute>
#

BUT WTH

quartz kindle
#

then your token is wrong

thorn vault
#

how..

#

I lit just c/[

earnest phoenix
#

you didnt add a catch with async in it

thorn vault
#

im on js

earnest phoenix
#

yeah, you can do async and catches on js

thorn vault
#

oh

earnest phoenix
#

catches make it so if the command fails its like "eh whatever"

thorn vault
#

How is my token wrong tho

#

ill send my code

earnest phoenix
#

and async lets you do like client.say("heck")

quartz kindle
#

it will still fail because the token is wrong, but it wont crash/exit the bot if you catch it

earnest phoenix
#

^

thorn vault
#
const Discord = require('discord.js');
const client = new Discord.Client();
const token = 'no honey'

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('message', msg => {
  if (msg.content === 'ping') {
    msg.reply('Pong!');
  }
});

client.login('token');```
earnest phoenix
#

thats what i meant but im too lazy

quartz kindle
#

i told you

#

client.login('token');

#

is wrong

thorn vault
#

how

earnest phoenix
#

^ i was just about to say that

quartz kindle
#

you're giving it literally the words token as the token

thorn vault
#

dont i take the ''

earnest phoenix
#

remove the quotes

#

and then it'll work

thorn vault
#

Logged in as Brute#3467!

quartz kindle
#

if you use "" or '', whatever you put inside it becomes literally that. it will not get the value from anywhere

earnest phoenix
#

kerpow

quartz kindle
#

for example

earnest phoenix
#

Tim he's got it xd

thorn vault
#

No, Tim is helping me

earnest phoenix
#

ight my bad

#

lmao

quartz kindle
#
var abc = "test"; //test
var abc2 = abc; //test
var abc3 = "abc" //abc
night bridge
#
if(tomute.highestRole.position >= msg.member.highestRole.position) return msg.channel.sendMessage("You cannot unmute a member who is higher role than you.");

i have this error even i follow the tutorials

 UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'position' of undefined
quartz kindle
#

that means "highestRole" is undefined/wrong

night bridge
#

ok i found the reason and its looks not good.
it read wrong one

#

lol

thorn vault
#

DM me if u can help me with a discord.js bot

knotty steeple
#

just say what you need ffs

thorn vault
#

no

#

someone to help me with a discord.js

#

bot

#

thats what i need

quartz kindle
#

dm means private lessons / private help which people are not willing to do for free

knotty steeple
#

and i have dms disabled

night bridge
#

how to check if user we tag is bot

sick cloud
#

look at the user property

ruby dust
#

if a bot doesn't have access to any channel, will it still receive member join/leave events?

sick cloud
#

@ruby dust i think so

night bridge
#

oops i forgot i can use that method

sick cloud
#

as long as the guild is cached

night bridge
#

anyway thanks for answer

knotty steeple
earnest phoenix
#

sryy i thought i posted it there

night bridge
#

how to make an async in function?

steel drum
#

huh

#

syntex is

frigid bone
#

async function func() {}

steel drum
#

async function name (){ }

#

when something returns a promise

frigid bone
#

oops I forgot the syntax

steel drum
#

u can catch that promise with the await word

#

so like say

night bridge
#

ok thanks i trying it now

steel drum
#

let blah = await someSortOfFunction();

#

or u can just use

#

await function();

earnest phoenix
#

how 2 make discord moderation bot pls explain

rustic axle
#

give token to me first thx

topaz fjord
#

Moderation Bots aren't that hard

#

Mainly ban, kick, mute, etc

steel drum
#

well

#

id probably

#

use regular expressions

pulsar patio
#

?help

#

wow

#

a lot of bots send dm messages

steel drum
#

their help commands probably contain alot of information

#

so its better to pm

earnest phoenix
#

how would i get the uptime of my bot in async py?

slender thistle
#

Main file:
Some datetime.datetime.now() var called uptime attached to Bot/Client instance right after declaring it

#

Then basically do datetime.datetime.now() - bot.uptime on command usage

#

And strftime the result

earnest phoenix
#
Ignoring exception in command mute
Traceback (most recent call last):
  File "C:\Users\Nero\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 50, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "bot.py", line 116, in mute
    await bot.add_roles(member, role)
  File "C:\Users\Nero\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 2915, in add_roles
    new_roles = utils._unique(role.id for role in itertools.chain(member.roles, roles))
  File "C:\Users\Nero\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\utils.py", line 232, in _unique
    return [x for x in iterable if not (x in seen or adder(x))]
  File "C:\Users\Nero\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\utils.py", line 232, in <listcomp>
    return [x for x in iterable if not (x in seen or adder(x))]
  File "C:\Users\Nero\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 2915, in <genexpr>
    new_roles = utils._unique(role.id for role in itertools.chain(member.roles, roles))
AttributeError: 'NoneType' object has no attribute 'id'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Nero\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
    yield from command.invoke(ctx)
  File "C:\Users\Nero\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 374, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\Nero\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 54, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'id'```
#
@bot.command(pass_context = True)
async def mute(ctx, member: discord.Member):
     if ctx.message.author.server_permissions.manage_roles:
        role = discord.utils.get(member.server.roles, name='Muted')
        await bot.add_roles(member, role)
        embed=discord.Embed(title="Success!", description="The user **{}** has been muted.".format(member), color=0x77B255)
        await bot.say(embed=embed)
     else:
        embed=discord.Embed(title="Oh no!", description=":no_entry: You don't have permissions to use this command...", color=0xe74c3c)
        await bot.say(embed=embed)
#

idk what's going wrong

#
@bot.event
async def on_server_join(server):
    embed = discord.Embed(title="Whalebot", description="Thanks for inviting me to your server!\n\nMy prefix is **;;**.\n\nTo see all available commands, type **;;helpme**!", color=0x234D87)
    general = discord.utils.find(lambda x: x.name == 'general',  server.channels)
    if general and general.permissions_for(server.me).send_messages:
        await bot.send_message(general, embed=embed)
        author = ctx.message.author
        await bot.create_role(author.server, name="Muted") 
        await bot.edit_role("Muted",send_messages = False)```
#

oh wait

#

its basically "cannot read id of null" from js but the py equavalent

#

so hard to figure out OMEGALUL

#

author = ctx.message.author

#

but it's not a ctx command

#

lmfao

steel drum
#

just wondering

#

are there any advantages for writting a discord bot in python

#

rather than nodejs

earnest phoenix
#

yes

#

not really tbh

steel drum
#

or is it purely a preference thing

earnest phoenix
#

you get to brag about using the less popular language

#

^

#

that's true

steel drum
#

...

#

doesnt everyone use python

gilded blaze
#

Yes, but not for Discord bots.

earnest phoenix
#

have u been on the internet lately? awaitwhat

steel drum
#

true

earnest phoenix
#

node js skyrocketing in popularity especially for web and realtime chat stuff

#

python not so much