#development
1 messages · Page 771 of 1
Hey guys i deployed my discord bot on heroku and it's working partially (it does what it's supposed to do while appearing offline but that is another issue), and yeah i checked the heroku logs --tail and noticed I got the Heroku "H14" Error which seems to be related to me having no web dynos running, which brings me to the following questions:
Why am I getting this error? Discord bots aren't web apps right? Why would I get a H14 Error that causes my bot to behave weirdly and even seemingly crash?
I might be completely oblivious and dumb and am overseeing sth utterly obvious here, but if someone could help me out that'd be awesome 
we dont support heroku here, sry. you will need to contact heroku support
ah aight yeah i thought maybe someone else used that service as well
const Discord = require('discord.js')
const client = new Discord.Client();
var Weather = require('weather');
module.exports.run = async (bot, message, args) => {
let code = args.join(" ")
const appID = ""
const appCode = ""
const weather = new Weather({
appID,
appCode
});
weather.now('Brisbane, Australia').then(results => {
message.channel.send(`The weather is ${results}`)
});
}
module.exports.help = {
name:"weather"
}```
Cannot read property 'location' of undefined
I dont know where .locationis
ping me
results might be an object
oh wait it probably means that results is undefined, console.log it
Are you sure the error's coming from that snippet of code
If you are, it may be an issue with the library or API it's using.
whats the stack trace?
it looks like a missing error handling in the library
the error is probably from here return resolve(data.body.observations.location[0].observation[0]);
the api might be outdated, or returning something unexpected
maybe ask the author (@ thatTonybo)
someone knows anything about shards in js? 
yes
@gray pagoda #commands #265156322012561408
@tiny tinsel you coding a bot on C#?
@gray pagoda Yep.
@tiny tinsel Skill, Repect++
🤔
I mean.. doesn't mean I have more skills than someone that uses Javascript.
ehh, depends
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
It is a suggestion, exactly.
One message removed from a suspended account.
You are saying that I said It is a need.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
should is a suggestion, need is a command
I'm gonna stop the conversation here, thanks.
One message removed from a suspended account.
suggestion
One message removed from a suspended account.
One message removed from a suspended account.
for bot rules - if you have a bot that has a deticated channel for a certain command and doesn't work in anyother channel does it still need a prefix
One message removed from a suspended account.
Should does not sound like a suggestion to me
bruuhh
One message removed from a suspended account.
"hey you should clean your room" implies a friendly suggestion that the room is messy and needs to be cleaned but not this very instant, it implies that there'll be a consequence
"you need to clean your room" is a command that says that you need to do it asap because of x reason
yall need to go back to sixth grade and re-learn modals
The only place where my bot does not need a prefix is in private messages, there is accepts commands with and without a prefix
One message removed from a suspended account.
ok
One message removed from a suspended account.
One message removed from a suspended account.
It ain't enough important to start a debate about it in #development.
One message removed from a suspended account.
@gray pagoda I'm gonna clarify, you don't have to embed your message. It was an suggestion.
Ye ik
:p
If you have anymore you can DM me them
If u wanma try I sent you invite link on DM
Good I will add it to my Discord.
What can be the cause to a image embed sometimes being in the embed. Sometimes It is outside..?
what do you mean
One message removed from a suspended account.
@tiny tinsel, are you possibly uploading it as an attachment?
https://ghostbin.co/paste/jvdnc
having some troubles with openweatherapi
Confused. Do you mean the attachment is sometimes inside an embed, but, sometimes, it's an attachment?
when you're sending an attachment you need to reference it in the embed via the attachment protocol
attachment://filename.ext where the filename.ext is the filename and extension of the file you sent
@sudden geyser Sometimes It is inside the embed. Sometimes It sends it outside the embed.
@earnest phoenix That's what I do.
if it is outside the embed you're using the wrong filename and/or extension
helps
https://ghostbin.co/paste/jvdnc
having some troubles with openweatherapi
smartJSON.temp = jsonObj.main.temp;
^
TypeError: Cannot read property 'temp' of undefined
@empty owl log jsonObj
ok
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'wavelink' ```@bot.command()
async def play(ctx, *, query: str):
tracks = await bot.wavelink.get_tracks(f'ytsearch:{query}')
if not tracks:
return await ctx.send('Could not find any songs with that query.')
player = bot.wavelink.get_player(ctx.guild.id)
if not player.is_connected:
await ctx.invoke(join)
await ctx.send(f'Added {str(tracks[0])} to the queue.')
await player.play(tracks[0])
```
what
your bot object has no wavlink attr
how
i get this error when i start my bot (node:2477) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 guildCreate listeners added. Use emitter.setMaxListeners() to increase limit , and if I make something happen when guildCreate is triggered ( client.on("guildCreate", guild => { console.log("I joined a server!"); });), this happens
when it joins one server
i have made sure of that
it happens when there are no listeners in the code
and if there are
i think it is either a node.js thing or a linux thing as it happens with every bot i run
@earnest phoenix @sudden geyser It was caused by spaces in images name. I forgot to reply.
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'wavelink' how can i fix this
i am doing git remote add origin https://github.com/aakash194/alpharemake.git
fatal: remote origin already exists.
getting this error
@sudden forge
Can an await-like operation be performed on a synchronous function?
nodejs
I will use broadcasteval. But after I send it to all shards, I will continue processing.
you can use .then(() => {})
.catch(() => null) 
thx so much
@earnest phoenix That means that you already have a remote named origin
@outer niche ```py
if not hasattr(bot, 'wavelink'):
self.bot.wavelink = wavelink.Client(self.bot)
me straight up copying something from examplle
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'wavelink'how can i fix this
What might that code snippet do, I wonder...
I've already fixed all that
So what's the current problem
Installing and setting up lava link to work with wave link
WaveLink requires Python 3.6+
Ik
It never said anything about installing Lavalink
From what I have been told your supposed to lava link because of wave wink is a library from lava wink
Link
No no no no
Wave link is the lava link wrapper
You shouldn't / can't get lava link in its raw form for python
Because this is the error I keep on getting
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 2333)```
I would advise you step back from bot making for a while and learn about reading docs and the basic of Python
Because all of these issues are the cause of you not reading up on stuff and just diving in
It was true about you trying to use ffmeg
And it is true with wave link
That's what the wavelength people told me to do
If you understood the basics you would know what that error is
And you would know some potential fixes to try and trouble shoot
Like literally there support server that's what I asked him about that ever and they told me I needed to download lavalink.jar
Us, the python discord and the d.py server should not be your first go to when you encounter and error that could be fixed by reading the docs
Troubleshooting is a major skill you need to learn when program and it wouldn't kill you to learn iy
I tried to read the documents and then when I cannot find it I literally asked there support server that's the directions they gave me and did not respond again
We're still talking python basics here
Well that's not what I'm talking about
5 seconds and a search
First thing that comes up
Go and learn the basics of python and how to read docs and trouble shoot because the amount of simple errors you get asking us to fix is depressing
I've been staring at this page for 2 hours I cannot find it
I still get the same exact error even with that code on the website
BECAUSE YOU NEED TO CONFIG IT BECAUSE COPY AND PASTING ISNT GOING TO SOLVE YOUR ISSUE
if you cannot read docs I cannot recommend you make a bot
Especially when using a more complex (and I say this bigging it up) wrapper like wave link that uses some of asyncio's neeter functions
wym???? i watched yt vid if works there!!

when you wanna copy an example but it said ```py
CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'get_tracks'
the ctrl key felt that
@zealous veldt so how i remove remote access and do another one
git remote remove origin iirc
done
and after i again use the command
getting this error
error: src refspec master does not match any. error: failed to push some refs to 'https://github.com/aakash194/alpharemake.git'
@modest maple Would you happen to know the cause of my issue here lmao
I've got a bot variable but my cog is seeing it as None 
Is it global or class var or what
bot.wavelink = wavelink.Client etc
under the same class in a function tracks = await self.bot.wavelink.get_tracks(f'ytsearch:{query}') returned an error but now it's yelling at me with the same error as here https://discordapp.com/channels/264445053596991498/272764566411149314/668726549255684106 so I'm troubleshooting that rn
Only thing I can think of is variable scope
which shouldn't be an issue because it's all under the same object
Yh
Altho if it was self wouldn't It have to be self.bot.wavelink = ...
Only time I've ever had this sort of issues with the same class was because I had seperate processes going seeing two different objects
Yeah it would, I just shortened that
was that a question or a statement?
yes
What language is "best" for making an API?
I know the basics in a handful of different languages. Lua, Java, C#, JavaScript and a few others.
JS
There is no best language for making an API
I know that it's pretty simple to make one with JS, but you should be able to make "best" APIs with other languages
you probably should choose where you are best, and spread off of that
^
Okay, I've done it with JS in the past but js doesn't seem too secure.
What do you mean by secure
You can make your API "secure" by making user tokens
and adding ratelimits
but again, it depends what you mean by "secure"
You are welcome ig
@modest maple yeah bro thanks i added the queue command and combined it with play
SAX
im currently adding my first proper voting reward to my bot. previously, the reward was that you'd just get a role if you were on the official server. now im planning to give something more significant, a doubling of ram and cpu time allowance for the scripting system
does anyone else here have a reward in their bot for voting (as opposed to just outright vote locking) and does it get people to vote?
That's pretty smart. Getting a boost for voting.
yeah so its something anyone can use, but voters get to use it 'better'
Yeah I hate when bots just lock stuff behind voting.
ive also set it up so that there are 7 sites you can vote on for the same privilege, so you can rotate your votes
on the downside it will mean the votes are spread thinner rather than all being here at top.gg but on the other side its nicer for users
the boost lasts 24 hours, but some sites only let you vote once per 24 hours, others once per 12, but people gotta sleep, ya know?
i thought if i put that in and allow voting in many places, people whove overslept and missed their voting window can vote elsewhere that time, and not lose their access to the feature
That's a great @green kestrel idea
i also set it up so that it boosts all servers you own
rather than 'i just boosted, i gotta pick one'
lol, thanks @flat pelican you like it?
I don't see how technically you'll set it up, but yeah, it's original
its already set up
basically, every site that supports proper voting webhooks has a webhook back to my site, and they all send a row to the same table with a time, date, and origin url
the bot looks for an entry in that table, which it was already using to assign voter roles
if theres an entry dated within the last 24 hours, the limits are boosted for all servers that snowflake id is owner id for
if theres not, you dont get it
i then have a separate table that gives a voting url for each of the origin sites, so that i can produce a pretty list of "want to vote on this site? go directly here"
im hoping it gets more of an uptake on the scripting stuff
lol
i think top.gg will directly benefit from it
because it will drive traffic to them in terms of voting
Kann mir jmd kurz helfen? Pls meldet euch mal Privat! Geht um den Bot code! Finde da den Fehler net..
are you still stuck on the missing closing something
Anyone know if an Orm framework won't delete a row because it isn't being given a unique column ID
Depends on the framework
Alchemy
@warm marsh This channel is english only
No german here
@warm marsh ur German?
A german wouldn't speak german badly 😛
German best Language 😉
Also the hardest
Laughs in English
language wars taken to another level
This is some nice development discussion
we gotta discuss what language our bots should use
Laughs in ancient egyption hyroglyphs
!help
@weak parrot I think you like that
@weak parrot ya yeet
-hekp
Thanks
Good evening, how can I do so that when I mention my bot, it looks like the prefix?
Yes or @lethal mauveplay nanana
Like that
token: '',
prefix: 'n!',
youtube: '', // Youtube data api V3
url: 'https://discord.gg/', // URL de votre serveur,
color: '#7289d9',
emotes: {
music: ":music:",
repeat: ":repeat:",
notes: ":notes:",
sound: ":sound:",
error: ":error:",
check: ":succes:"
}
};```
It's my options.js
in i stock my prefix
try it in an array
brain died
why
Just i want, the bot is mention it does like the prefix
i dont understand developement
yes
if you coded the part where you check for the prefix
it shouldn't be that hard to edit it so that it'll check for the prefix or a mention
mentions look like <@userid> or <@!userid>
How can i get the current date and let a timer on the console count down how many days are still there till next month?
what language
count down, you mean like printing the time left every x seconds?
or just print the time left once and exit the program?
ur tern tim
tern lmao
.
no dotpost @gentle cradle
This is development, skull
I don't know if this is the right place to ask this, but I'm running out ideas so maybe y'all can help me out. I'm a mod at this server and we use couch bot for channel promotion, some users although they have the twitch account linked with their profile and have streamer mode on, don't get the auto self promoting message. We have a role for the streamers who want to get promoted and that's how we usually trigger the messages. We requested them to unlink and link the accounts again, removed the role and added it again but they're still not getting the auto promotion.
Any ideas to try and fix this? I'm sorry if it's not the right place to do it
And thank you in advance for any assistance
/ ty anyway
One message removed from a suspended account.
What's that?
Because you can override avatars and names on each request
In the channel settings, you can add webhooks
You then simply post to the webhook
using the webhook url
Ok ty
How can I remove this spaces? trim() didn't work
content.replace('\n', ' ').replace(' ', '') ftw
well yes
but no
probably want to keep some of the new lines
should be able to get a regex that'll match only on the additional newlines that you don't want
content.replace('\n\n', '\n')
Turn every 2 new lines into 1 new line
replaceAll or whatever it's called in that language ^^
not a thing
would have to use a regex
You could just loop it but like, that's probably not as efficient as the regex would be
yeh
he didn't specify
but i've seen him ask or help people here using js
So I'd assume
regex worked. thanks 👍
epic
also I am using JS
Index.js
Console.prototype.Log = async function(input) {
return console.log(input)
}```
Testing/server.js
```const Console = require ("../index.js")
Console.Log("Hello")```
Ik it's a dumb Module. But somehow I get the error that `Console.Log("Hello") is not a Function` as Error. How would I fix it?
It's a Test Module
but now I ask how I can fix that fuccin error
nvm
anyways can u help
You need to make a new instance to access the .Log property.
Heyo, I got a question.
How would you do like that every time you hover over an item that has the class title it will add a - to the text, with this example HTML code.
(Using JS and no onover.)
<h2 class="title">MyContent1</h2>
<!-- HTML content here -->
<h2>Important note.</h2>
<h2 class="title">MyContent2</h2>
<!-- HTML content here -->
why do you not want to use onhover
Just wondering if there is another way to let the script do it auto. ^^
Smth wrong with trying to learn new stuff? 
Oh
nvm, found the way I was looking for with addEventListener.
Ty tho. ^^
i have this code:
vc = message.guild.voice_client
player = await vc.create_ytdl_player(stripped)
player.start()z```
But it says `AttributeError: 'VoiceClient' object has no attribute 'create_ytdl_player'`
'stripped' stores the URL.
Any Ideas?
You are trying to use a discord module to call a different module's functuon
Function*
@sudden geyser wait what?
prototypes are like classes, there is the class object and the class instance
you create an instance by using the keyword "new"
somevar = new Class()
then somevar becomes an instance of the class, and can access its prototype
also, if you wanted to do Console.log like you normally would (console.log), you'd need to remove the prototype.
Why does discord sometimes return "INTERNAL SERVER ERROR" when DELETEing, PUTting reactions
when discord is having a moment and the bot cant get the connection time todo it
This code is correct?
@bot.command()
async def connect(ctx):
channel = ctx.author.voice.channel
await channel.connect()
@bot.command()
async def disconnect(ctx):
await ctx.voice_client.disconnect
Why not tias
Let them suffer the consequences of their own creations
they just not reading docs
I have read the docs, I have tried several times but nothing that concludes a good result
😐
because ur trying to pull a voice channel out of a user object out of thin air
out of fucking no where dude
ctx.message.author.voice
It's just for me
@bot.command()
async def connect(ctx):
channel = ctx.message.author.voice.VoiceChannel
await channel.connect()
Are you handling cases where the command is executed in DMs
well then how do u expect it to get the user's voice channe;
is this considered discord api abuse?
https://discordapp.com/channels/264445053596991498/265156322012561408/668940227813048346
nah it can't do @ everyone
Can it do @here :^)
nope if it detects either of those it will just say 'no'
well then gj ig?
Solid
do u see any other harmful uses of this command or would u say it is ok?
just an annoying pointless command but no
Spamming non-ToS-compliant content :^)
I followed your advice, I don't know if I should use Voice Channel or VoiceState or both
voice_state_instance.channel to get VoiceChannel
Ok
VoiceChannel is the object/structure type
.channel is how you access it
VoiceState is the object/structure type
.voice is how you access it
its all in the docs
In theory I don't need VoiceState
in theory you get the voice channel the user is in from VoiceState
Ah
It's sad that my bot needs to send voice data before it can receive voice data 😦
But it's complicated since when you say things in English I don't understand the same thing in French 😐
I'm pretty happy
@bot.command()
async def connect(ctx):
channel = ctx.message.author.voice.VoiceState.VoiceChannel
await channel.connect()
I built and entire webscraper to scrape 1200 pages in under 5 mins
you were closer before, now you made it worse

gj
scraping 1200 pages in 5 minutes sounds like DOSing 😛
i think he made the scrapper in 5 mins
not that it scraps all pages in 5 mins
at least thats what i understood
lmao
Wonders of languages
ah yeah, i guess you are right
selenium?
Many many selenium drivers yes
lmao rip
cant you just use an http module and a dom parser? or you need to go through ajax requests?
Selenium is just faster overall and more reliable
@bot.command()
async def connect(ctx):
channel = ctx.message.author.VoiceState.voice.VoiceChannel
await channel.connect()
still wrong
i told you before
VoiceState is the object type
you access it with .voice
Sounds like basic Python problems rather than miscommunication
same as Member being an object type, and you access it by using .author
I change
yo can somebody help me debug my code? the commands output more than 1 response
2 instances
are you using multiple event listeners?
^
are you the guy that had 11 active event listeners yesterday or earlier today?
no
...
delete thtat
BOT TOKEN LEAK
Reset your token at least
exposed his toke?
token giving out is BAD!
Calm down you all
ok
oh noooo
time to reset your bot token
yep
try closing all bot instances and rerun one bot instance, just to make sure
Can you do that if you are coding in sublime text editor?
Im using the build function in sublime text editoir
is it a good idea to run ubuntu on a raspberry pi
editor**
ah
dev to dev when making a bot just edit the code and run it using like a bat file
oh ok
Cancel Build
well I mean your gonna change your token anyways
ok so stop the build and then put it into a .bat file then run the bat file?
but thats also something to do
i changed the token
ok.
and whats the best text editing tool? Or is that just personal preference?
Preferences tbh
whatever suits your purpose and current skills
Sublime is light compared to PyCharm, Visual Studio Code and etc
Traceback (most recent call last):
File "bot.py", line 1, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
i have discord.py installed
lol
its fine
just fixed it
time to learn js
Downloads Node.js, GIT, All the sockets
sockets?
Does anyone know the minimum time for presence updates on bots (online, idle, dnd, etc)
i think the rate limit was 5 per 60 seconds, but im not sure
you should be safe with once per minute
Most libs have it set to 5 times per 60 secs
Discord docs say 5 times per 20
But go with lib limit and keep it safe
2v2 boxfight?
Alright, thanks
what command do y'all what me to make next?
kk
@sturdy depot what command do YOU want to make?
inb4 nsfw command
ill try any
I (usually) don't judge people for their commands
k
but sometimes
make a math command that always outputs 42
no
/math 2+2
42
i already made a CORRECT math command
with eval?
make a math command that is correct with easy math, but is a little off with more difficult math so people don't notice it immediately
@quartz kindle
yeah but where's the fun?
make something unique, ngl everything generic has been done 10000 times when it comes to bot development
try to make a game or something
my suggestion
ASCII FPS Bot
lmfao
0.1 FPS
also i generally discourage "multi-purpose" bots
usually for those bots people go to something like dyno, mee6, or some other popular bot
make something and make it it's main thing
I always think it's weird when people ask how they can implement the Fun tag
And that they try to add as many tags as possible
yeah
But I guess that isn't really a #development discussion xD
true
Less = More
mhm esp. when it's the most focused on thing
many mp bots lack quality and rather go for quanity
im often guilty of it too, actually
The only reason to make a multipurpose bot is if you get a private bot for your own server.
Those bots are usually aimed at what YOU need and not what many other servers need
yeah
one of my bots is so simple, it doesnt even have any code to see how many servers its in, so i have no idea
probably not many lmao
I have one private bot for my MMO guild that has everything in it that we need/want.
And then when I thought one of the functions of the bot was kinda unique I made a public bot with only that function
yo anyone down to make a bot together? (preferably a music bot)
no thx
this isn't the place to recruit
sad
nah, there are already enough music bots
what you say: make a bot together
what i see: make a bot for me
Lol
sorry =P
its fine
I mean that does happen Tim so I wouldn't blame ya
Tech, if it is your first bot then I would advice you to make something easy, then once you know how to make bots and once you know the programming language you can try making a music bot
or if you already know how to make bots then probably have an idea how to make a music bot
yo can you get a custom status for your account??
bot account? no you can't
oof
discord doesnt allow it
you dont need a custom status to make a game
I have seen bots that can play text games, like hangman
i mean like ill see people with custom status
people can have a custom status, bot can not
I hope they will add it for bots some time so we dont have to put Playing: in front of our help commands 😛
exactly
@client.command()
async def commands(ctx):
await ctx.send('`rr! ban, rr! unban, rr! purge, rr! kick, rr! 8ball, rr! ping, rr! tictaktoe, rr! prefix')
anyone --\
know how to make a better list?
@client.command()
async def commands(ctx):
await ctx.send('`rr! ban, rr! unban, rr! purge, rr! kick, rr! 8ball, rr! ping, rr! tictaktoe, rr! prefix')
save a variable as your prefix so you don't have to rewrite it every time
i mean a highlighted list.
There isn't really a way to highlight messages, but an embed message usually makes it look nicer
How get embed message? (If you couldnt tell i have a white neame)
Im not a JS dev, so I can't tell you how to do it
im also not a python dev xD
Java
ooooooof
rtfd
i see the fd
A small example for you
An embed with "foo" as a title and "bar" as a description
embed = discord.Embed(title = "foo", description = "bar")
# second way to do the same
embed = discord.Embed()
embed.title = "foo"
embed.description = "bar"```
is that py?
kk
One message removed from a suspended account.
anyone know why doing
Image.open(data)
``` returns this
normally it doesn't try to make the data the name
Are you trying to put the DATA of a png image in the file name?
Maybe try to open a file with the file name instead of with the data 😛
no, normally i read the bytes of the image and open the image through PIL with that.
and it has always worked fine
likely
i do the exact same thing for my bot's api stuff.
i get the image bytes and write it to a image
and it works fine
but no raspbian has to be special
yeah its likely a new thing, Image.frombytes is new
^
also i hate that raspberry pi likes to combine old versions of the same file
its annoying
what do you mean with combine old versions of the same file?
i have no idea, it just does
functions i define aren't current even though I have restarted
Hi...
Im kinda new to bot development only been doing it for a month or 2 now
And i need help making embed Messages!
I use java script
Discord.js
And im using Visual Studio Code
To code my bot
you can read this https://discord.js.org/#/docs/main/stable/examples/embed
and if you want to add some more elements than described in that example, try looking at RichEmbeds' documentation
I dont understand that very well
you know how to create a normal message?
Yes
An embed is the same, except you use a RichEmbed
Ok let me see if i can switch them
So my code is pretty much the same from Discord.js Docs what would i have to change in that Event to make it an embed?
I have been watching Anson but none of his tutorials help me
I don't mean to be rude but you should seriously learn JavaScript beforehand
Doing stuff like this isnt for beginners
Well i mean i can take by business else where if needed...
I asked for one thing to get help with and you act like i know nothing about Java Script...
If you say so.. you're not going to get anywhere without knowing the basics
I code websites April
This isn't a website
backend JS is different from frontend JS
Nodejs is completely different from vanilla in some cases
I asked for a bit of help with Embeds and i fell as people are starting to become a little disrespectful...
I'm recommending you what should be in your best interest
Corrupt Portable Network Graphic gave you the link to the official example, that should be enough to discover how to add an embed ^^
None of us are out here to be disrespectful but we're also not gonna spoon-feed you and tell you how to do everything
How wud i go about blacklisting a disvord on python
check the id of the discord server you are executing a command for and if that id is blacklisted then don't execute the command
That is not what i mean like i do not want a welcome message to came hear how can i fix it
when you try to send a welcome message first check the id of the server and stop sending the message if the server is blacklisted
Oml u do not get what i am trying to say thar is no command
i am not talking about a command
you want to send a welcome message for new people?
Yes
when you want to send that message, first check the server id
when there is a new user you also know what server that user joined
and you simply check the id of the server that the new user joined
U are not giting it
Re-explain it better then please 😩
then ask your question again and make us understand it
Okay so when I am making a welcome message I want it to go into every server except this one and I do not want to have to go check something every time someone joins somewhere to see if it is this server
Ok so my apologies from a little while ago...
Here is my issue
I type all the codeing stuff for the embed then it has issues it tells me things are unexpected
I did exactly what you all told me to do
check on what line the error happens and see what is wrong there
It happens to everyline is the problem
Don't just copy and paste examples.
Read the example and understand what the example does.
After that you add it the way you want it to your own code
Im not copy and pasting
and you understand the code example?
Yes
then at the place where you first send the normal text message you are now first creating a new RichEmbed and then you are sending that embed instead of the text?
I am very new to coding and am trying to learn. I am trying to go off of the guide in the faq channel but I am stumped can some one help me?
Wassup
Well Im stuck on the part where I am trying to make a folder and set up the npm through the CLI
npm init
oh I'm dumb
NodeJS
also you can expedite npm setup by doing npm init -y
if you literally could care less about the config or whatever
async def search(ctx, *,query):
lol = '+'.join(query)
await ctx.send(f"https://www.youtube.com/results?search_query={lol}")``` how can i make it not do all the +
lol = '+'.join(query)
``` what do you think this does
i mean ya but it is like puting spaces
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
see thar = is a space and u i not wnt that
don't add the pluses
Sorry.
i gpt it
hooray
@quartz kindle I basically only forgot module.exports = new Console ;-;
Why does it take to update my bot, it still comes out as 5 servers in 42 votes, but in reality they are +300 servers and 45 votes
The test votes are not sent either
is there a way to make my bots ping normal, sometimes if i run ping command its like 1600 ping but if i do it again its 168
why is that
and is there a way to reduce my bots ping
@peak ivy do you have a test bot that is on 5 servers and also sends data to DBL?
yes, I had it, but today I changed the tokens, I even regenerated it
@earnest phoenix better internet
anyone know if discord.py rewrite version has removed the HelpFormatter or not? cuz im getting an attribute error that Bot has no attribute formatter
@bot.command()
async def connect(ctx):
channel = ctx.message.author.VoiceState.voice.VoiceChannel
await channel.connect()
still wrong lol
@dull terrace
message = Message Object;
message.author = Member Object;
author.voice = VoiceState Object;
voice.channel = VoiceChannel Object;
channel.connect() = join voice channel```
Is this still the yt dl co'nect thingie ?
nice, my module loader is fixed 😄
now i can reload bot functions without having to restart it at last 😄
Y do people use their @bot.command as @bot.command its very confusing? THAT'S why i do @client.command
because preference
makes sense
async def kick(ctx, member : discord.Member, *, reason=None):
await member.kick(reason=reason)```
seem efficient?
and with the info i just gave you.... Any command ideas?
@dull terrace how do you highlight your code?
like what command do you use to highlight your code
@bot.command()
async def connect(ctx):
channel = ctx.message.author.VoiceState.voice.VoiceChannel
await channel.connect()
@dull terrace
@client.command()
async def kick(ctx, member : discord.Member, *, reason=None):
await member.kick(reason=reason)```
oh their we go
@dull terrace nvm
how
did you do your prefix?
as i can see
we both code in Python 19 or some version using the Rewrite Version of Async
@dull terrace ^^
AttributeError: 'Member' object has no attribute 'VoiceState'``` @dull terrace
channel = ctx.message.author.VoiceState.voice.VoiceChannel
AttributeError: 'Member' object has no attribute 'VoiceState' ```
@dull terrace those are my errors when i build the bot with that command.
im going to dm you
his code is wrong, and we were trying to show him how to do it
i tried
you copied his wrong code, thats why you're getting errors lol
he probably saw those errors in his console as well, but he is having trouble understanding how Class properties and OOP works in general
and how to read documentation
the documentation has all the things u need to know
exactly
but if you dont have a basic understanding of the language, you're gonna have a hard time understanding the docs
i have been working for a week on this code and it no work, and i dont know why and nobody gave me a helpful answer can you help me?
const Discord = require('discord.js')
const Client = new Discord.Client()
client.on("ready", async ready => {
consloe.log("i am ready")
})
client.on("message" async message => {
if(msg.content === "ping") {
message.channel.send("pong")
})
client.login(token)
code is case sensitive
if you define it with a capital C, you need to use it everywhere with a capital C
also you misspelled this
also missing a comma here
also msg is undefined
it should be message
@cursive kiln i swear ur gotta be a troll
probably just a beginner
@client.command()
async def commands(ctx):
await ctx.send('rr! ban rr! unban rr! purge rr! kick rr! 8ball rr! ping rr! tictactoe rr! prefix')
is there a problem with this code
yuck static help command
@mossy vine any better way to make a list
Hey folks, i'm making a fun little discord bot
But i am struggling a bit here
I want the bot to count every time someone have said "uwu" in the server
But i can't seem to figure out how the "fetchMessages" work
anyone that can help out?
Or is there another way to have a bot look through all the old messages of the server?
any better way to make a command list?
@client.command()
async def commands(ctx):
await ctx.send('``rr! ban, rr! unban, rr! purge, rr! kick, rr! 8ball, rr! ping, rr! tictactoe, rr! prefix``')```
Help
"message.channel.messages.fetch(toString())"
i have no idea where to start
are you using discord.js v12?
yes this is v12
also, fetching messages only allows you to get 100 messages at a time
its very impractical to try to fetch all messages in a server lol, given that there might be hundreds of thousands or even millions
Have they allowed for bots to search for specifics yet?
I read that it is possible but undocumented, so not really allowed to use
nope, bots cannot use the search end point
Gotcha
if we ignore the "tostring" part of that screenshot 
What could i do to atleast make it look through those 100 messages at a time?
have you checked the documentation?
@client.command()
async def commands(ctx):
await ctx.send('rr! ban, rr! unban, rr! purge, rr! kick, rr! 8ball, rr! ping, rr! tictactoe, rr! prefix')
Any better way to make a command list
which library
which library do you use
@client.command()
async def connect(ctx):
await ctx.message.author.voice.channel.connect(timeout=60.0, reconnect=True)
@earnest phoenix it kinda does since discord.net and dsharpplus have different implementations for sending embeds
@dull terrace what's wrong?
😅
well, if you read the docs
I read the doc
it would be SendMessageAsync iirc
create a new instance of EmbedBuilder, add whatever to it and call Build on it, it returns an Embed object you can pass to the embed argument in SendMessageAsync
do you have a question regarding discord.py
See #topgg-api
Can someone help me with this?
Error: https://i.imgur.com/4qDZKIS.png
Code Causing Error:
def setup(bot):
is there anything below/inside the defined function
Where r u putting that tho
It worked before i added something to a command.
Go to line 92
Its at the bottom.
And send code
def setup(bot):
bot.add_cog(utility(bot))
I don't see the problem.
It's like that with every other cog.
Just this one decided to break.
it could be different line, send him whole code, ex. in dms
Its line 92.
or just use a site like https://hastebin.com
w/out ur tokens etc. and errors could be caused by different lines even tho it saying so
ill use pastebin lol
ew
Lmao
still has syntax highlighting
When you get shown a non tracker paste site and go with pastebin instead
and ads
i have PRO.
imagine paying to paste text
Ikr
Because he do any want to send the paste here because people will 'leach of his code' https://pastebin.com/71XJvQ58
lol
Ima send the link anyway
/root/alphaold/handlers/events/disconnect.js:7
.setAuthor(client.user.username, client.user.displayAvatarURL)
^
TypeError: Cannot read property 'username' of null
at module.exports.<anonymous> (/root/alphaold/handlers/events/disconnect.js:7:30)
at module.exports.emit (events.js:321:20)
at WebSocketConnection.onClose (/root/alphaold/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:400:19)
at WebSocket.onClose (/root/alphaold/node_modules/ws/lib/event-target.js:124:16)
at WebSocket.emit (events.js:321:20)
at WebSocket.emitClose (/root/alphaold/node_modules/ws/lib/websocket.js:191:10)
at TLSSocket.socketOnClose (/root/alphaold/node_modules/ws/lib/websocket.js:850:15)
at TLSSocket.emit (events.js:333:22)
at net.js:668:12
at TCP.done (_tls_wrap.js:557:7)```
help me out in this error
wait.
client.user.username?
wouldnt client.user.user not work?
i dont know js so
im just guessing here
or client.user.name?
Well have a guess seeing that client is different from the bot object
hm?
I'll have to look when I'm on my pc in 10 mins or so
its correct client.user.username
@earnest phoenix the client has likely not logged in yet
are you calling it before its ready
l o l
you can't access the data before it's downloaded
let me do it
and it isn't going to be downloaded unless you log in with an actual token
@minor kelp what cog was it not loading?
Utility.
You're saying load this cog: proceeds to send a UN initialised class
Only think I can think of
How is it uninitialized?
¯_(ツ)_/¯
You're still on your phone.
Yep
This is what loads the cog technically
class utility(commands.Cog, name="utility"):
def __init__(self, bot):
self.bot = bot
and in literally any other cog
thats how it looks
and it works
One message removed from a suspended account.
thats what cogs do
3|index | at Object.exports.fetch (/root/alphaold/node_modules/discord.js/src/client/voice/opus/OpusEngineList.js:27:9)
3|index | at AudioPlayer.playUnknownStream (/root/alphaold/node_modules/discord.js/src/client/voice/player/AudioPlayer.js:96:37)
3|index | at VoiceConnection.playStream (/root/alphaold/node_modules/discord.js/src/client/voice/VoiceConnection.js:478:24)
3|index | at module.exports.playQueue (/root/alphaold/struct/player/Queue.js:84:45)
3|index | at processTicksAndRejections (internal/process/task_queues.js:97:5)```
getting this error wjen i play music in my bot just say ``preparing lava link``
One message removed from a suspended account.
You can see that.
One message removed from a suspended account.
One message removed from a suspended account.
But harder to get working
One message removed from a suspended account.
Depending on sustem
my music doesnt work either lol
One message removed from a suspended account.
One message removed from a suspended account.
Discord.js used node opus or opusscript
i really wanna know what has bricked my cog ;-;
One message removed from a suspended account.
Delete cog and try again?
One message removed from a suspended account.
its one line causing it
One message removed from a suspended account.
i dont see an error with that line
its the same line for every cog
just this one broke
Just rewrite the line
One message removed from a suspended account.
One message removed from a suspended account.
2020-01-21T15:46:26.679564016Z app[worker.1]: [JDA MainWS-ReadThread] WARN net.dv8tion.jda.core.handle.GuildSetupController - Accumulating suspicious amounts of cached events during guild setup, something might be wrong. Cached: 13000 GuildId: [redacted]
2020-01-21T15:46:39.531749642Z app[worker.1]: [JDA MainWS-ReadThread] WARN net.dv8tion.jda.core.handle.GuildSetupController - Accumulating suspicious amounts of cached events during guild setup, something might be wrong. Cached: 14000 GuildId: [redacted]
wtf is happening?
it's eating my memory and im getting java.lang.OutOfMemoryError
it's never happened before
i mean memory issues and errors are normal for java
^
pretty sure its not normal for the bot to get 14000 cached guild events immediately after starting
find whats causing it to do that
check if there's any library updates
log says warning is from net.dv8tion.jda.core.handle.GuildSetupController but im looking at the source and nothing in that class logs this
i have install opus but stoll same error
is it loaded?
???
One message removed from a suspended account.
:(
One message removed from a suspended account.
i hope
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using needle for node-pre-gyp https download
[@discordjs/opus] Success: "/root/alphaold/node_modules/@discordjs/opus/prebuild/node-v79-linux-x64/opus.node" is installed via remote
npm WARN discord.js@11.5.1 requires a peer of @discordjs/uws@^10.149.0 but none is installed. You must install peer dependencies yourself.
npm WARN wandering-filament@0.1.0 No repository field.
+ @discordjs/opus@0.1.0
updated 1 package and audited 310 packages in 5.753s
1 package is looking for funding
run `npm fund` for details
found 0 vulnerabilities```
getting this



