#development
1 messages · Page 598 of 1
What the
Okay, so.
It stopped responding to commands, But outputted no error message, and claimed it was still online??
restart it?
I also just changed the bots token to another one of my bots and stopped getting this error?
what the fuck lol
did you already try without dblapi?
chceck this:
bot.on("message", async message => {
@earnest phoenix
if its all okey
hey everyone,
i'm new to nodejs and need some help
i'm working on a react web app for a discord bot i made and i want to access data from the discord api
i've done the auth part and i have the token i need
now i need my react app to access that token, how can i do that ?
@amber gorge the react app should not call the api
but your web server
set up a web server in express or hapi.js
then from there call everything
yes i made one using express
so i fetch an endpoint on my web server ?
how do i store the token ?
create_task = asyncio.async
^
SyntaxError: invalid syntax
W, h, a, t. What did I do wrong wth xD???
import discord
from discord.ext import commands
import json
with open("./config.json", "r") as file:
config = json.load(file)
token = config['token']
prefix = config['prefix']
client = commands.Bot(command_prefix = prefix)
@client.event
async def on_ready():
print("Running")
client.run(token)
That traceback is a complete opposite of what we call 'helpful'
But I get it
You're using async with Python 3.7
@slender thistle so?
They're incompatible
shit
Either move to rewrite or downgrade your Python
ok nah im not downgrading my py
i removed this line async def on_ready() but it still gives me same error
though i dont use async
the library does
fk
difference?
async is old, rewrite has latest features that Discord provides
how to use the rewrite then?=
Rewrite also is more OOP-alike
pip3 install -U git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py[voice]
https://discordpy.readthedocs.io/en/rewrite/api.html
Rewrite is also not directly converted from async, you'll have to do some work to convert your code
hey if I just type "screen" in my terminal for AWS will that keep my bot running when I close the terminal
Heya! Just finished adding a whole tonne new commands to @granite stratus, Has anyone got some suggestions? I'm stuck on what to add now.
i dont get the purpose of the bot. cant people just click screenshare on their own 
thats some nice english
Wait what
database and data base in the very next sentence
MY DATABASE IS OUTDATED?!?
capital Please after a comma, lowercase Discord. out-dated is one word
were, not where
and what the heck does that message even mean
"you were running an outdated database".....? isnt it your db and why do you even need a db to serve links
@earnest phoenix
muted
its not wrong, the dialect is so advanced that we are all too stupid to understand its beauty smh
I have updated your database Tell me how you got my SSL keys? 
@mystic narwhal i want show member count, client.users.size is wrong
My bot @earnest phoenix
shh
I don't think cilent.users.size is correct tho it sounds like we're telling the height of a user.
"Height of a user"
hm
alrighty
🤔
welp, i gave you the answer you wanted, if you want to ignore me for no reason that's on you 
Some langs use .count though
I use bot.users.size for it to show member count
@mystic narwhal
${client.guilds.reduce((a, b) => a + b.memberCount, 0).toLocaleString()} this is correct
Showing correct member count
hey you did what i said 😩
Good job, now go enjoy your code
damn discord.js
be proud that you came up with it yourself and didn't need code samples to copy
I literally copy paste the codes in the internet
Ok
k
I made that changing status for my bot when i started to make it since then i never changed it
k
you arent guaranteed to have all users cached and your cache might not be on par with realtime updates, band aid is to request all members but then you are adding unnecessary heavy load to your app. youre also allocating more memory by calling size on each collection
tldr use the property provided by the api, not .size on the users collection
When you tag one in a message and when bot deletes the message, the tag appears, how can I fix it? @scarlet bane (Sorry, i translate.)
Like, when i tag @low bolt, bot deleting my message and says "Don't tag SedatTR". But tag appears again
The ssl was a joke. Like it was a l33t h4x0r and got into a db i own
@low bolt not sure what you mean but:
- if you are deleting too fast, discord has bug where message will not go away (usually only on mobile but maybe your problem)
- Deleting message with tag does not remove tag, only removes message. Only way to remove tag is to open channel
Okay, thanks
Ah. Dynamic how?
oh.
its not set in stone and its pretty much different on what the backend decides, hence why dynamic
I understand. I want to implent an auto translator and edit it in but i don't want to hit that limit.
if youre using a library chances are they already handle ratelimits for you
How does discord.py rewrite handle ratelmits?
sec i need to go over their docs
ALright.
okay so basically they handle ratelimits for you, the request will fail if you are ratelimited, im not sure if they queue it back up though like for example discord.net
I'll contact the server later...
ok
How do I make a redis server?
with skill, and by reading the billions of articles about it
@lusty dew again?
You didn't tell me last time
I did that
Using custom emojis for global bot, python
Just using the emojis ID is this possible?
probably
- Have the bot be in the same server as the emoji u want to use
- Send the emoji urself with a backslash at the start
- To send that emoji with the bot, copy what the emoji becomes should be something like <a:123413134234>
<:emojiname:emojiid>
^
Yep! Then that ID can be used spliced into the code where needed and it will be on all global servers where it's used?
yeap
yeah
Sweet! Just wanted to confirm!
unless they turned off "use external emojis"
Thanks guys!
Hi Guys! I'm coding discord.py and idk how I give Permissions to specific Users/Groups...
i only know discord.js sry can't help you
For example, I'm doing the kick command but I do not know how to do it, only owners, admins etc. can do it
Owners of the server the command is invoked in or bot ones?
But anyway, are you using rewrite or async
people with the permission Kick Members
Iirc there should be a @commands.has_permissions(your_perm=True) decorator
Unless you are doing your commands in on_message, that's when permissions_in or server_permissions come in handy
Ok
So should I remove the command or make it only work in nsfw chats?
And does text actually count as nsfw?
Because it only sends text not images
Tried, got burried
How would i detect if a member has admin/mod permissions for moderation
Like something like this?
return message.channel.send("You can't server kick members that has Admins/Mod permissions");
}```
message.member.hasPermissions(put permissions here)
wat
for d.js
damn hasPermissions is deprecated youre right
bitwise yay
but hasPermission is still there
yes
on master they use stores for everything so it would be member.permissions.has()
ye same
if I remove everything from github heroku can't understand
like you have to put bot infos
heroku git remote: -a "nameOfHerokuApp"
Or i am wrong with this cmd
wait
@earnest phoenix do you have what heroku requests no?
Procfile
requirements.txt
Yes
I have it
Create a new one
ok
Done
You did the instructions?
Wait
It tells to add app in pipleline
Should I do that
I created a pipeline
I understood nothing lol
Question - Role deletion
How would I delete a role. I know how to create one, but I need to know how to delete a role too.
Ping me when you answer, please
lib?
Thanks. Seems like I couldn't find it
I'm currently lost, and idk what to do and how to fix this problem... I'm trying to make a chat application using Python (3), but I somehow can't run the python program without getting an error, which is: https://hasteb.in/raw/unipacub
And this is my code: https://hasteb.in/wusufogi.py
handlet
Also, are you sure accept returns a tuple? And I doubt putting recv as well as accept are supposed to be in a while loop
I cant make it work i tryed many things. (Python)
what no thats not how it fucking works
though you can't create high quality commands with python
yes you can wtf
but python is really good for beginner's
and soooooo many hosts give free 24/7 python hosting
but im self hosting 😛
Yep heroku gives 24/7 hosting for python bots
But you have to give your bot infos on github
And if you do it your bot token is public
And you can't get your bot in discord bot list
ok
you have no idea what you are talking about
i fucking wonder why 
@proud pivot what is def on_error 
(almost) all discord libraries have 100% coverage for the discord api. you can do the same things with a discord.js bot that you can do with a discord.py bot
also one of the first things you see on the heroku website is the node.js logo and the python logo
and 5gb ram on heroku isnt free its 512mb
Should I use JavaScript or Python for my new bot
why not both
use haxe
veld we all know you are just trying to troll
@earnest phoenix you know private repos exist
use whatever you fucking prefer
I'm not
it started with sta something like that
yeah
ask @vague chasm i have said it to him several times
# i forgot i had to add this to my error handler
if str(type(err).__name__) == "Forbidden" and str(err) == "FORBIDDEN (status code: 403): Missing Permissions":
return
fucking
that if only i could code in py
discord
ok
python really isn't that hard
then why dont you just read the dms 
@trim saddle on_error() (https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.on_error)
the script isent workinng cus ineed it on discord.errors.ConnectionClosed ore websockets.exceptions.ConnectionClosed
yes that is very helpful
i have not disclosed that site to him too as i saw it on a yt vid and went to it
^
any1 well experienced in python and sockets?
also
sockets 
^ ?
@proud pivot switch to rewrite
i am 0.01% experienced in python any1 need my help?? for python
@proud pivot use asyncio.sleep
Not time.sleep
@trim saddle isinstance(error, discord.Forbidden)
idc
Make it look good you non-human being
Please take the argument in dm
Who was the one serious here 
@slender thistle no u i refuse to acknowledge the resources danny provided
websockets or pussy
websockets are 
Not that hard
I can give you the very beginning and from there you will start doing shit on your own
(Connecting isn't hard)
import websockets
websockets.get("gay")
import websockets as uwu
owo = uwu.connect(uwuss://discord.gg/)
print('daddy, it works!')
return
@slender thistle seems gay
Fits you
because im a furry? 
Yes
@slender thistle you forgot about the quotes for the url
r/wooooosh
I didn't miss the joke I just ruined it
@cursive gale hm
thats right
ty

yayy
no?
How do i stop setInterval loop
I only get https://wow.doge.asia/i/dcro.png even though I have it in the same json just a few lines above
Anyone know how I could fix that?
this.botlists? 
hello , i need help
ask away
js
or a command handeler??
if(message.content === ${prefix}rhem) {
message.channel.send("hello \n hey \n bey")
}
ok?
I think that isn't what they are talking about
d d
see edited
Still
hmm
Don't think that is what they are talking about
like random ??
@earnest phoenix Are you wanting your bot to listen for what users say then respond with a response?
you want it to send random message??
listen listen
hold on
👀
i want my bot stay online , 24/7 if error read, stay online.
you want it to respond with all 3 messages at once or it chooses a message to send?
such that.
@grim aspen
If member send $premium
message send such this photo
......
@cursive gale
hmm
you have db setup??
@earnest phoenix
and other things needed for db?
also wut db ya use (just curious)
Traceback (most recent call last):
File "C:\Users\Super\Documents\Programming\Python\ChatApp\chat.py", line 54, in <module>
server = Server()
File "C:\Users\Super\Documents\Programming\Python\ChatApp\chat.py", line 10, in __init__
self.sock.bind("0.0.0.0", 10000)
TypeError: bind() takes exactly one argument (2 given)
i see the problem but
idk how to fix this
whenever i anter another argument (my ip address) i get this error:
self.sock.connect((address, 10000)) TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
```
This isnt so useless right?
maybe you should start using the third param of addField 😃
what param?
.addField(first param, second param, third param)
First and second params is usually a string
While the third has to be a boolean
Just try, puttin True on your fields as a third param
@trail dagger mannen, gör så här på alla dina .addFields()
.addField("str", "str", true)
Och sen pröva o se hur de ser ut sen
Kmr va mycket bättre, imo
what
So, is there any way to stop setInterval loop?
@earnest phoenix Ye 
clearInterval()
i know
but i need to test one thing
i have js bot in a nice host
not free
but i need free to test
for (let cmd of Object.values(client.commands)) {
let conf = cmd.conf;
if (!conf) { continue }
if (conf.guildOnly && message.channel.type !== "text") {
return message.reply("That command is a Guild Only command!")
}
}
This works for if the commands are being used in dms and it is set to guild only
But if it is set to guild only and you try and use that command
it errors in the server
Fast and good text editor for scripting?
nano is best text editor
nonononono notepad is
@earnest phoenix Wym notepad ++ is
Visual Studio for C++
PyCharm for Python
Visual Studio Code for JavaScript
And Sublime Text 3 for everything
Java for bot development? Nice joke
Visual Studio Code can be used for almost any coding lang 
the biggest bot is java
hold up, wild idea incoming
hear me out
what if.. what if
we let people decide for themselves whatever the fuck they want to use for whatever
wild idea.. i know 

very nice joke indeed
V4Today at 19:07
Java for bot development? Nice joke```
you do realise that quite a few big bots are written in Java, right?
Most are JS or Python iirc
But most of the big ones are in Java.
Yea some of em
JukeBot and Groovy to name a few.
Mee6 isn't written in Java is it?
Python
rythm - java
mee6 - multiple
dyno - js
fredboat - java
tatsumaki - js
microservices i'm guessing
yeah
the more you know

hello everyone
what is the best way to store the discord acces token that you get from the oauth ?
a database
database I think.
Lol
Oh also if you didn't know

xD
so i fetch an endpoint on my server that gets the token from the db and then asks discord for data
is this how it should be ?
i'm looking for the best practise
i just use a google cloud function 
but yeah as long as you have a strong db password then you should be fine
and strong server password/ssh key auth
Hello I need some help. (discord.py) How can my bot edit its sent message? I now use
await client.edit_message("Test is good!")
but it's not working.
Error:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'channel'
any ideas?
i think that u forgot to specify the channel
and also what message you want to edit
thanks @amber gorge
np
btw this is the good one:
@client.command(pass_context=True)
async def edit(ctx):
msg = await client.say("This is a test!")
await asyncio.sleep(0.5)
await client.edit_message(msg, "Message")
if anyone needs it in the future...

hi,um,i'm traing to add again my bot but without a desc. with spam,but i can't bacuse it says that the invite server ID is invalid,What do i do??
🤔
Can you, just send me the discord.py document link
Helloooo?
Hey 👋🏼
Can you help me?
I did google
I literally said i searched for the discordpy docs but i couldnt find it
thanks for the link though
Np
Read the documentation you got a minute ago
k but i dont find anythign
Took me no more than 30 seconds to find it on a fucking phone
How can i find something idk what im supposed to look for? 🤔
This is my JS bot, i wanna do this in Python but idk how
I literally dont know how to use the docs for discordpy
i searched for client
then a bunch of texts comes up, nothing that has with client to do but paragrahs thats include the word client
But this is what i get
What no
...
No its the logged in user
ok
client.user.name gets the bots name, but how do i gett the tag?
in JS its user.tag but what is it in py?
client.user.name does not get the bots name
Oh
in py
I thought you meant in js
xD
Yeah i did
or smth
Well
you could do
wait
in python you can concatenate right?
Like add two strings together
iirc you can
yes
assuming client.user.name gets the name
without the discriminator
you could do
client.user.name + client.user.discriminator
or however you get the discriminator
it would be easier to do this:
botU = bot.user.name
botD = bot.user.discriminator
print("%s#%s", (botU, botD))
ya xD thanks man
I was just offering help
how to install the rewrite version?
Man if only there were resources that told you everything
Something like a documentation
inv?
hi,um,i'm traing to add again my bot but without a desc. with spam,but i can't bacuse it says that the invite server ID is invalid,What do i do?? x2
link?
;n;
i'm pretty sure spam is against the rules
yeah,i didn't know that and they delicated(? my bot ;n;
You don't talk spanish?
visible confusion
Good thing we ain't speaking spanish then
You are talking it rn.
you missed a message
what language do you mostly speak then
like your first language
spanish
:v
I TALK SPANISH BUT I DON'T TALK ENGLISH TNT
calm
👀
hekking caps >:v
Sorry for being confused
:v
what do you need help with again? try speaking spanish
nice token
what is your Send defined as?
Repl isnt private tho
if you're gonna do free at least do something that's private
accounts
"private"
do glitch
THATS NOT THE POINT
🤦
then clicc
on my screen it's not showing the full error
ok
it's a 400, which is odd to me
all he does is send a normal message
to a user tho
that would be 403 cause forbidden
exactlu
400 is when you legit did something inproperly
i mean, discord did just have a spasm a couple of mins ago
so try again now?
bc its doing stuff
that doesn't solve the issue
in the channel already
creeper what did you find?
i found a stack overflow answer
i'm afraid i would be spoonfeeding
still confused, a normal message returned a BAD REQUEST error
well then it's not the answer i have
well, i think discord is having muscle spasms
I mean, if my bot is fine then it's still you
its randomly not sending messages im sending
but anyway, I'm afraid I have to inform you that you are currently using the very outdated version of discord.py, which might possibly be the core of your issues
I can tell that by your code
wdym
hold the fuck up
I just realized
you are trying to send a message to yourself, aka bot to itself
oh
no wonder why a 400 code from a normal message
and it's description now also makes a lot of sense too

mistakes like this slide by me a lot as well
I end up staring at my code for hours until I find something odd
one time i forgot an eol, and stayed up til 4 to find the missing eol
but yeah, discord doesn't allow you to send a message to yourself
and I'm glad that it's not protected by a 403 error instead
:v
hi
i'm trying to fetch a server endpoint but
im getting cors issue
with Access-Control-Allow-Origin header
how to deal with it ?
@grim aspen what do you mean with "try speaking spanish"? and i need help with this:i'm traing to add again my bot but without a desc. with spam,but i can't bacuse it says that the invite server ID is invalid,What do i do??
what did u put in for the server id lol
@earnest phoenix if you are trying to the "verified server" you need to have a server added to DSL
i'd just leave it blank tbh
i got a server,i added in the discord server list,and it says that is invalid :'c
:v
How does publishing an npm package written in TypeScript work out?
how to use the refresh token to get a new access one ?
@amber gorge https://discordapp.com/developers/docs/topics/oauth2#authorization-code-grant-access-token-response
Integrate your service with Discord — whether it's a bot or a game or your whatever you wildest imagination can come up with.
const dbl = new DBL(process.env.API, { webhookPort: 3000, webhookAuth: 'password' }, client);Error:```app@:~ 23:10
$ node bot.js
events.js:167
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::3000
at Server.setupListenHandle [as _listen2] (net.js:1290:14)
at listenInCluster (net.js:1338:12)
at Server.listen (net.js:1425:7)
at DBLWebhook._startWebhook (/rbd/pnpm-volume/0b28cce5-8ed1-4100-8276-eb9a8aee3f33/node_modules/.registry.npmjs.org/dblapi.js/2.3.0/node_modules/dblapi.js/src/webhook.js:45:18)
at new DBLWebhook (/rbd/pnpm-volume/0b28cce5-8ed1-4100-8276-eb9a8aee3f33/node_modules/.registry.npmjs.org/dblapi.js/2.3.0/node_modules/dblapi.js/src/webhook.js:27:12)
at new DBLAPI (/rbd/pnpm-volume/0b28cce5-8ed1-4100-8276-eb9a8aee3f33/node_modules/.registry.npmjs.org/dblapi.js/2.3.0/node_modules/dblapi.js/src/index.js:69:22)
at Object.<anonymous> (/app/bot.js:11:13)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
Emitted 'error' event at:
at emitErrorNT (net.js:1317:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)```I'm trying to use glitch for my discord bot, but the dbl webhook keeps interfering. There is only one available port for glitch (3000) but that does not work?
have you tried reading the error before you cp'd it on here
ah nvm i got it
im blind
simple solution; dont use free hosting
Does glitch even give it's containers an ip?
Either way, either you have a program using port 3000 already, or someone else does
You almost definitely have two sessions of your bot running
👌
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module> start(fakepyfile,mainpyfile) File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start exec(open(mainpyfile).read(), __main__.__dict__) File "<string>", line 1, in <module> File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/__init__.py", line 20, in <module> from .client import Client, AppInfo, ChannelPermissions File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/client.py", line 38, in <module> from .state import ConnectionState File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/state.py", line 36, in <module> from . import utils, compat File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/compat.py", line 32 create_task = asyncio.async ^ SyntaxError: invalid syntax
[Program finished]```
I made a setnick command
but it says missing permission
but i am guild owner, and the bot has admin
You can't change the nickname of people above you afaik
like, role wise
@lime geode the error says exactly what your problem is. try reading it
thx boo
@scarlet bane I have read the text but I still do not understand what exactly is wrong...
create_task = asyncio.async ^ SyntaxError: invalid syntax
[Program finished]
But that is not in there
But if I add it, it certainly does not start
What happens if you try and get index zero of an empty array in js?
ie, [][0]
does it return undefined/error/something else?
Undefined
dbl.getVotes() return users who did not vote
;-;
half random
sometimes yes sometimes no
:v
yes
@dense current
Wait
Wait no I'm just an idiot
20 votes
I want to catch everyone
need all votes
but it returns random users
sometimes correct
sometimes incorrect
hm
s
i just invited you're bot to my server @dense current
ok
thats rare
@amber fractal no they cannot
@amber fractal 
smh
@amber fractal what do I do 
@dense current look at this
@amber fractal thanks.
I'm not sure I dont know why it wouldnt work
:v
I also speak spanish
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module> start(fakepyfile,mainpyfile) File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start exec(open(mainpyfile).read(), __main__.__dict__) File "<string>", line 8 create_task=asyncio.async ^ SyntaxError: invalid syntax [Program finished]```
•-•
2nd time you've posted this
Yeah
/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py
create_task=asyncio.async
^ SyntaxError: invalid syntax
if that doesn't help you
idk what will
if you don't own that file, or have never heard of it before
you can google it
which gets you here: https://stackoverflow.com/questions/51196568/create-task-asyncio-async-syntaxerror-invalid-syntax
This her is not possible:
create_task = getattr(asyncio, 'async')
Look at different answers.
Usually first answer is best
Also, a bot is not something you should be making if you have not programmed before
bots are complicated, if you cannot google a problem this simple and find an answer quickly, you clearly are not ready for the pain that is about to come
hey guys i keep getting Error: certificate is not yet valid
how long does it take?
i just switched hosts so that might be why
Probably
how long does it take usually ? 24 hours?
thanks
can someone enlighten me why this is resolving
even though i reject it
so it shouldnt fire .then
correct?
or is .then fired regardless
I just do my shit through a mobile app
Like commands
Propesterous boast yet alas
2019-04-05 23:35:08.275 WARN 8196 --- [ japp-1] lavalink.server.player.EventEmitter : Billie Eilish - Ocean Eyes (Official Music Video) got stuck! Threshold surpassed: 10000
2019-04-05 23:35:11.354 ERROR 8196 --- [ack-13-thread-1] c.s.d.l.t.p.LocalAudioTrackExecutor : Error in playback of viimfQi_pUw
com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Something broke when playing the track.
Does anyone know what this error means?
I am using lavalink btw
Ah mk
Is there a way
I can like
send a message in the discord chat
if that happens?
@lusty dew is that the python client?
Wait wut?
I am using discord.js
if that is what you are meaning
but I got it fixed
My bot was erroring
so it was "stuck"
LavaLink is not dependant on your bot
o I mean
No*
something was wrong with the play command and the queue system that I had made that made lavalink error
I can't really explain it well
@earnest phoenix if it doesnt load from a browser client/any other client then its discord proxy issue, otherwise its just your client and internet being gay
bot.commands.set(commandName, props);
^
TypeError: Cannot read property 'set' of undefined
How come
bot.commands doesn't exist
it does
it does
Code:
Command:
Nothing is working with the command, in my cmd it says stats.js is logged but whenever i run my command nothing gets executed
I tried commenting everything in the exports.run and just a console log
but nothing was logged either
there is a bug in the js file but idk what, help?
cmdFile - commandfile
what?
index.js line 30
ohh i see
simple mistake my b
xD
well
god
it still doesnt work..
ffs
@late hill help pls
You're cutting off the prefix twice?
I used this code so whenever use !goodnight it gives a goodnight message and a pic too
@bot.command()
async def goodnight():
await bot.say('Goodnight')
e = discord.Embed()
e.set_image(url="https://discordapp.com/assets/e4923594e694a21542a489471ecffa50.svg")
But it tells this
Traceback (most recent call last):
File "/data/data/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module> start(fakepyfile,mainpyfile) File "/data/data/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start exec(open(mainpyfile).read(), main.dict) File "<string>", line 28, in <module> NameError: name 'e' is not defined Unclosed client session client_session: <aiohttp.client.ClientSession object at 0xb5f0ccd0> [Program finished]
What the fuck is that formatting
Also, your e.set_image is not under command goodnight
I... just told you
spacing?
Indentation, it is
Yeah it tells indentation error now
what should I do
I wanna attach a image in !goodnight command
... Indent it?
Ok any1 available to help me?
Code:
let array = [ "Content1", "Content2", "Content3"];
let fAr = array.filter(); console.log(fAr);
let mAr = array.map(); console.log(mAr);
Error:
let fAr = array.filter(); console.log(fAr);
^
TypeError: undefined is not a function
How come? 😂
excuse me what
excuse me what
is filter() even a function?
yeah it is but you are doing it wrong
it takes a callback, thats why it says "undefined is not a function"
and you didnt provide it with a callback
so its undefined
Ok fixed it
The link you sent me helped me alot thanks @mossy vine
Though, there is something else I wanna do but idk how and what to use
sort by role position then map
//Variables
let mGame = member.user.presence.game;
let type = { 0: "Playing", 3: "Watching" }
//In my embed
.addField('Activity', `${type[mGame.type] || "Nothing"}(${mGame.type || ""}) ${mGame || ""}`, true)
I get this error:
.addField('Activity', `${type[mGame.type] || "Nothing"}(${mGame.type || ""}) ${mGame || ""}`, true)
^
TypeError: Cannot read property 'type' of null
How do i fix this?
Just type are not correctly define
first check if the user is playing a game in the first place
@earnest phoenix I am xD
and if the user is not
i want it to send "nothing" instead of erroring
can you send the code for it?
Quick question. How long does it take for discord bots to update the profile pic of the bot?
(usually)
there isnt really a middle ground there
it depends on your up speed, api latency and if the api servers are optimal and stable at the moment
No no... that's not what I meant
I meant for this server's website to update it as the old one is still cached
epic, it's been longer than that


