#development
1 messages · Page 776 of 1
google has one that does google assistant in voice channels so you can go 'ok google'
I used the google API for text to speech
i could integrate their voice recog api
the issue is when multiple users speakj
shit gets jumbled hard
so you are sitting there sorting packets and keeping them in order
checking if the pcm is valid
converting to something that google likes
i have 32gb on my dedicated server, mostly unused, ive worked out i can get about 22000 guilds on that before i need to look into an upgrade or start to cluster it, thats if a certain percentage make use of scripting, and a lesser percentage vote, so they double their allowances
so far out of 900 servers or so most of them dont use scripting, scripting uptake is about 10% of the servers
is spork your bot?
yup
it started out as a chat bot, but i want to build a scripting community around it
so that people can contribute extension scripts to it, without having to worry about hosting their own bot
but you can do a lot with it without scripting
like you can teach it an embed by pasting json into the chat
Are you not worried about someone using nasty JavaScript
at the developer level the bot is C++ and fully modular, i can load new features without restarting... took me 2 months to get that stable though
nah, ive got it locked down quite tight
Can I try
please do!
Yay
i'd love to find out what you find
If I can do anything
if you do think youve broken it please let me know, i'll find a way to credit you for the find or something
Lmk if you ever need a hand because this sounds dope
Do you have a way for users to share their plugins
Or what we you want to call their ecritps
that would be a cool idea ^^
i might need a hand as it grows, i need people who are willing to make scripts for it to kickstart the community around it
I'll make some
and eventually may need people to extend the C++ side
Ugh
but i'd have to be more strict with that if i did
becuase whatever code i allow into there via a pull request could cause all kinds of grief, need to be proper code review on the C++
But yeah having a way for users to share shit
Even if you just throw up a quick bootstrap site would be dope
Ooo
then when youre happy with them you can quickly dump them onto codebottle.io (instructions on the wiki)
then they show up in the downloader
so others can go 'that sounds cool i'll add that in my channels'
Oh this is fucking cool
This is actually insane
Jealous I did not think of this
Extremely good job man
also see here: https://github.com/brainboxdotcc/sporks/wiki/Programming-Reference for programming reference
thanks 🙂 i hope you'll help with it
if youre really interested i can invite you to my discord... its a quiet place, but hopefully it'll grow
im making a command that uses settimeout for a specific amount of time before preforming an action, so far I have
message.channel.send("💡 Working...").then((message)=> {
let days = args[1].substr(0, args[1].indexOf('h'))
let hours = args[1].substr(days.length, args[1].indexOf("m"))
let minutes = args[1].substr(hours.length)```
Is this the right way to do this if the command would go sort of like this?
>commandhere 2d23h23m
when i get my public eval command i'll be encouraging users to break it aha
public eval command 🤔
eval (bot.token)
Lol
Anyone here know how https://discordapp.com/developers/docs/resources/guild#add-guild-member works? I'm trying to make my alt join my guild through oauth but keep getting this error.
Traceback (most recent call last):
File "/home/geek/Fire/api.py", line 297, in getOauthInfo
await self.bot.http.request(route, json={"access_token":access_token, "roles":["670811591893188618"]})
File "/home/geek/.local/lib/python3.7/site-packages/discord/http.py", line 216, in request
raise Forbidden(r, data)
discord.errors.Forbidden: 403 FORBIDDEN (error code: 50025): Invalid OAuth2 access token```
You have an invalid OAuth token
you need a proper OAuth token with the guild.join scope
One message removed from a suspended account.
I do have a valid token with the guilds.join scope though
Yes, I do. I have guilds.join in the scopes in the oauth url and in the scope field when actually retrieving the access token. My bot also has the correct permissions in the guild in question
just because you think it's correct doesn't mean it is 😩
you dont have a valid token
yes I can read what it says but it's incorrect. I have the correct scope, the token is valid, the bot has the permissions it needs.
When requesting /oauth2/token this is the data that's sent
{ 'client_id': 'client_id', 'client_secret': 'client_secret', 'grant_type': 'authorization_code',
'code': code, 'redirect_uri': 'redirect_uri', 'scope': 'identify email guilds guilds.join'
}``` and the same scopes are provided in the scope parameter of the oauth url. The access token works for requesting `/users/@me` so the token itself is valid
Nevermind, someone else was able to tell me the issue
definitely made a mistake when asking for help here
Then you didnt need to come back here to say that ¯_(ツ)_/¯
https://oliy.is-just-a.dev/8z1off_2704.png also right in the docs
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
How do I make top 10 leaderboard using MongoDB and discord.js? I tried using this to get the first person’s level but it says cannot find level of undefined.
let lb = await db.collection("users").find({$sort: {level: -1}});
message.channel.send(`${lb[0].level}`);
{level: -1}```
@frank dust don't use the internal system.
wdym?
self.bot.http.request
what's wrong with that?
You shouldnt be using bot.http. Make your own aiohttp.clientsession instead
ok
Any tips on making a website for your bot?
@earnest phoenix maybe try find({}).sort({ level: -1 }).toArray()
find returns a cursor
thanks
How can I find out when a Client got Created? I'm using D.js
Uhh, use the ready event I guess?
Not entirely sure if that's what you mean
like message.author.createdAt() but for the Client
<Client>.user.createdAt
client.on('guildMemberAdd', async member => {
const canvas = Canvas.createCanvas(700, 250);
const ctx = canvas.getContext('2d');
const background = await Canvas.loadImage('./wallpaper.jpg');
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
ctx.strokeStyle = '#74037b';
ctx.strokeRect(0, 0, canvas.width, canvas.height);
ctx.font = '60px sans-serif';
ctx.fillStyle = '#ffffff';
ctx.fillText(member.displayName, canvas.width / 2.5, canvas.height / 1.8);
ctx.beginPath();
ctx.arc(125, 125, 100, 0, Math.PI * 2, true);
ctx.closePath();
ctx.clip();
const avatar = await Canvas.loadImage(member.user.displayAvatarURL);
ctx.drawImage(avatar, 25, 25, 200, 200);
const attachment = new Discord.Attachment(canvas.toBuffer(), 'welcome-image.png');
message.channel.send(`Welcome to the server, ${member}!`, attachment);
});
```Whats wrong? I don´t know. The bot do nothing
you cant use message in a non message event unless you use it as a variable
instead of message.channel.send get a channel from your bot to send to
@fluid sapphire
you should also learn to debug
for 2 days my bot can't run stable because i can't start it when I tried to start it says shard 0's client took to long to become ready.
yesterday i was able to start but today i have restarted it and it gave same error
you might have something wrong in your code, possibly an infinite loop or a long blocking process
but till last 2 days it worked without error
is your token right (might be dumb, but check)
Yeah it's right im sure
like yesterday it works now
but I don't know if it will work tomorrow
[{id: 0, value: 10},{id: 3, value: 30},{id: 3, value: 100}]
``` How do I get the index number of the object with the ID of 3 which should be "2" using a function?
filter or find?
That's if you're using JS.
// Find
<Array>.find(obj => obj.id === 2);
// Filter
<Array>.filter(elem => elem.id === 2);
or .findIndex() if you want only the index
there is no "values" in the code
i did.. its on the next line
Ye, just looks nicer like this
now for your problem, look at the stack trace
show the full stack trace, with all lines and all information
and also which version of discord.js are you using?
@snow urchin why you had
Discord and discord for the same base module...
a lot of those modules are not needed
vultr or galaxygate?
I'm personally going galaxy gate now
galaxygate @earnest phoenix
they're pretty cheap and service is great
also discord server support >> *
Anyone able to help me make a simple request function ( to request a web file ( http://ip/:port/info.jason ), and make it - if it gets a response a variable is set to true ( online ) but if no response its set to false ( offline )
FYI - its for a discord bot to see if a game server is online or not.
whatttt languagee
@sage bobcat to answer your question: This would be helpful https://www.digitalocean.com/community/tutorials/understanding-classes-in-javascript
its still functions
its just a wrapper around functions
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
I have this class in my code, I named it VoteManager.
Constructor contains the properties of your class, which can be accessed inside or outside the scope of that class.
it has methods, which is basically functions of that class.
One message removed from a suspended account.
no because you didnt put the constructor right
One message removed from a suspended account.
if you extend a class, and you want to put custom properties inheriting the props of the original class
you need to use super() inside constructor() {}
One message removed from a suspended account.
if you dont need to add anything on constructor,
class Owo extends baseOwO {
owo() {
console.log("OwO")
}
}
also still wrong
One message removed from a suspended account.
One message removed from a suspended account.
what the hell
If you extend a class, its still like the normal class.
Except it has super() inside the constructor, which contains the parameters of the original class you extend
One message removed from a suspended account.
basically if I extend a class that accepts one parameter, and I have extra parameter on my extended class
One message removed from a suspended account.
yes of the class you extended
while the class that extends from it can have its own parrameters, or use it also to pass the parameters bla bla your choice.
One message removed from a suspended account.
super = constructor of the base class
there ^
One message removed from a suspended account.
constructor of the extended class = base class + new class
or your extended class params only if you decided to put the params of the base class directly to super
but usually its like what Tim said above
hey guys i have a question
i want to make a command for fun to check if someone is gay. just for fun
i use this command right now: if (message.content == "!disco is gay") {
But if i type in chat: !disco is person gay I don't get a response.
Someone know how i can fix it? I already searched on the internet but nothing is working
It's Discord.js btw
imagine using ==
also
are you tryinh to tun !disco is person gay
or !disco is gay
the first one, i want the message includes !disco is gay, but if i type !disco is person gay, i also get a response. Of course replace "person" with another words
your probably gonna need to use regex to parse that
cannot i replace message.content to something else?
well yes but what would be the point
just get the person as an argument
not as part of the command
just build a proper command handler 🙃
^
not what?
i don't even know what proper, prase and regex is
hello folks
Does discordjs not have a command handler?
Ah
Discordpy does, released not too long after the rewrite
it's the reason why so many d.js bots are shit and often break when handling commands
yeah
so? i still use it
its a problem of logic, no need for whatever, just think about it logically
message.content === whatever means the message content must match EXACTLY that, not a letter more nor less
on the other hand, you can use built in functions such as .startsWith() to check if the message starts with a given content, but not care if you have any extra content in it afterwards
so you can use it like if(message.content.startsWith("!disco is gay")) and then get the person afterwards (you need to use the command like this !disco is gay person)
if you really want to use it like this !disco is person gay then its more complicated, because you need a more complex matching approach
for exameple if(message.content.startsWith("!disco is person") && message.content.endsWith("gay"))
but keep in mind that this will make the command fire for any message that starts and ends like that, regardless of the middle content
for example !disco is person iEfçuwefoh ouhfqohep qiepiqwep iqwjpei jqpwiejpqiwje pqiwgay
hmm
so then you need another line to check if the content supplied, regardless if in the middle or at the end, is a valid person
then i replace the command so i only need to use message.content.startsWith
and a rich embed message
i know how i can fix it now
Is doing a command handler that hard ?
I already fixed it in another much easier way
making a simple command handler isn't that hard
Is there a reason why my bot is not sending heartbeats?

BTW thanks for the .startsWith
I was doing this:
if(message.content.substring(0, Settings.CommandPrefix.length) != Settings.CommandPrefix){return;} // Check for prefix.
My prefix check is also case insensitive, so it doesn't matter if you write it with capital letters or not
@near ether you've got blocking code
i'm having trouble with an error:
DiscordAPIError: Missing Permissions
is popping up when my bot tries to delete a message
what permissions does a bot need to do that?
"manage messages"
nice, thanks! my link had that permission but i think i accidentally turned it off in the role permissions
you should always check for required permissions in code before executing the action
basically the bot just deletes the user's command to keep the channel from flooding, so it only deletes the message with the command
What's wrong with deleting the command itself?
you're stacking another request on top of the requests the actual command does
and i dont know for others but i personally get annoyed when my cmd invocation gets deleted automatically
is this man tryna raid or something
@modern sable
tonkku faster
Say i have multiple nodejs containers, each container has an id and a sharding manger. Each containers sharding manager only starts one shard with the given id, thus each container is running one shard.
Is the sharding manager even necessary? Cant i just only start the bot and assign the correct guilds with the given shard id in an easy way, without using the sharding manager in between?
the bot is ttrpg related, leaving the command in the channel just kinda takes ya out of it
You can connect to the gateway using just 1 specific shard
So if the library you use supports that, you won't need the sharding manager
How would I make a bot exacly work
Becuase i created code in node.js
how do I like make my bot see the code
or do I need to write something to do with my bot
you'll need to get your bot token and add it to your code
and then run the code itself
i cant rlly help u more than that cuz im a python boii
This needs to be pinned
i'm saving this
do you have any tips for making a moderation bot?
I mean they could be wanting to make one for a private server, I've done that, but I don't know whether they intend to publicize it, I'm assuming they do
anyone uses Python here?
How can i automaticly delete Bot usage?
like when somebody writes !help, and after the output the !help gets deleted.
check the docs for the delete method
its <message object>.delete()
fuck discord
message.delete([timeout]);
time out is in milliseconds
put 0 or just do .delete() for instant delete
rip tim
Discord is heading out 
@earnest phoenix
yes
So I'll explain it to you
Ok I appreciate it bro
fair
spoonfeeding lol pogchamp
// If Statement Begin
// First we check the channel type
if (msg.channel.type === 'dm') return // return stops the code here as it forces the function to return a value and stop running any further
How if statements work:
if (condition) {
// Do stuff
}
@manic terrace
this is a good example of how you should go about giving people code
@earnest phoenix ^ Example + explaination
@manic terrace like that?
about 2 weeks bro
when the mods verify it
@regal saddle Bot approval can take up to 1-2 weeks. It can take longer than this so please be patient. If you have any further concerns please feel free to DM a moderator
should work btw lukas, try it
@delicate zephyr Thanks for your help I will try to make it work;)
why got i tag?
oh oof
luke pinged the wrong person
I didnt asked for that lul
@earnest phoenix Bot approval can take up to 1-2 weeks. It can take longer than this so please be patient. If you have any further concerns please feel free to DM a moderator
because I shift click the persons name
and Chat moved up
I'm noob xd
no prob doe bud
;-;
in the mean time make sure your bot works and is online most of the time
else it will be rejected
And check modlog for declines to check if ur bot does the Same that u can fix it that u'll get approved
what about autorole, mine does not work in python 😦
Does anyone know if there is any restriction to logging in to two different clients with the same api token at the same time
your bot will just trigger at both code
So there’s no restrictions that you know of in terms of discord api rules
Pls beg
@sinful belfry don't abuse it, for example too many requests will result in your token being revoked a new one bring made, repeat offenses will get your account banned from api tokens
Ok so the only restriction I really need to worry about is the amount of requests that are made by both clients in total?
Basically, yeah. Why would you need two connections though?
@sinful belfry there is a limit into how many times you can connect in a time frame
@modest maple that comes under the requests I stated
if your sharded dont do it because you'll almost instantly get blocked out
one shard per 4 seconds is the rate limit iirc
Ah ok thank you.
Sharding is needed at times, discord has docs about it. I'll get a link. But why do you need two connections?

the limit is 1000 logins per day
doesnt matter from where you login
i often login from my computer while my bot is running in a vps
Basically my bot has a music command but whenever another command is carried out, the music stutters badly. It’s hosted on glitch and has limited memory. I was thinking of separating the music processes so they are not affected.
yes you can do that
you will still get the issue most likley
and yes ^ most likely
music bots take up more ram than other bots so just moving it isnt gonna make much diffrence
and cpu for decoding/transcoding audio streams
Well I mean like moving it to a completely new project.
well, it will help in his particular situation
Oh so music bots on glitch just aren’t great?
he said his music only stutters when another command is used concurently, so yeah, it will help for a bit
maybe
but once multiple music commands start running, its gonna crap itself again
glitch is good enough for small/light bots
but not good enough for music bots
but feel free to try it
I will look into some other ways of resolving this then.
Yeah I will check it out and see what happens.
I use glitch
I keep coming across a glitch in glitch, "discord.js; "3" wont work for me
because you need to await stuff
i have
no you havent
im retarted i guess
delete needs awaiting
@regal saddle you need to await almost anything you do with the discordpy library as it's all async

almost entirely async
Hey ハーリ-さん (CF8) thanks so much for telling me what to do
like that?
@still merlin what do you mean with that? post your code
@regal saddle in the message.delete as well
bruh.
we did tell you
python kinda weird
I ment like how to get my bot to work
you need to await a promise
like with a token lol
I'm using node.js
It's not. Either you await it or you have issues with blocking code
Umi Bot will be in the working soon I'm exited to see what I can do
well i mean you have to await futures
Seeing as discordpy has loads of networking, you'd end up disconnecting from the api almost instantly
@still merlin we cant help you if we dont know what the problem is. post your code, show us what you tried
Uh lol I have no problem I was helped
@eternal adder you say it has loads of networking but it is essentially a wrapper for just alot of post and get requests
not exactly loads of networking
Post and get requests are networking @modest maple
thats not really loads
what exactly happens if you dont await an async function in python? does it not execute at all?
it'll throw an error
oh bruh im very dodo its await message.delte() im very very dumb rn
because the code will expect it to return instantly
what if you want to run concurrent async functions?
Await makes the particular function wait, not the rest of the bot
because like
await just tells the code to ignore it for a bit and wait for the promise
in javascript, if you dont use await, it wont stop the function from working, it will still work, just your code will not wait for its return
asyncio is very strict in what you can and cannot do
so if you want to run it and do something else in the mean time you have to explicitly create a task
if everything is async you can run thousands of tasks concurrently on a single thread if done well
await just tells the code to ignore it for a bit and wait for the promise
ah i understand, thx mate
hey bois is there any website that gives like a general list of capabilities that every bot should have?
there is no such list
damn
In my case, if someone wants me to do it, I'll try
thanks
like
if you wanted to run multiple things concurrently you can do
loop.create_task(func1())
loop.create_task(func2())
loop.create_task(func3())
loop.create_task(func4())
loop.create_task(func5())
loop.create_task(func6())
loop.create_task(func7())
and that will run the 7 functions concurrently in the same thread
Would you know how to make the bot send a file in file mode?
and how would you wait for all of them to complete?
message.delete() works thx tim and the other wierd name.
hey bois is there any website that gives like a general list of capabilities that every bot should have?
Too many bots have the same features so you should rather focus on something unique if you want to make a public bot
Imagine not reading content inside parentheses
yea i have my own features
if you want to wait for somthing to complete you can use asyncio.wait_for(function, checks=xyz, timeout=n)
but like i was just thinking in general
and that will pause the code but not block the other tasks while you wait for one thing to come back
@modest maple i mean, awaiting for a list of concurrent async tasks to complete
oh the task loops do that automatically
ah cool
you can use .gather() to get any results from any corutines
or if its a one task you could do loop.run_until_complete()
like, in javascript i would do let a = asyncFunction1(); let b = asyncFunction2(); let results = await Promise.all([a,b])
just curious about how python would handle something similar
you can use all sorts of things
you can get it to return any values it has mid way through a task or wait until its full complete or just keep looping that task over and over and just keep receiving the futures
has pretty much everything on running tasks concurrently ^^
message.delete([timeout]); is timeout in secs or milliesecs?
you dont pass timeout there?
yeah timeout = numbers like 1 or 2
yeaj
Since like 1.2.x
yeah*
Though isn't kwarg delay
it is
Yeah because it is is totally the same as isn't, thank you keyboard
xD
i read it like isnt it ...? dw
ive been slowly making a new command handler and cog system
Why not use the provided command handler?
because it doesnt do very well with process handling and thread handling
/ it doesnt really do it at all
Interesting
i think .gather is what i was looking for
yh
Petition to make "pythonic" an official synonym for "weird"
str_len
7
Unexpected T_PAAMAYIM_NEKUDOTAYIM
disable code grant in your discord developer settings
Disable this
this page is pure gold http://phpsadness.com/
i knew php was bad, but never though it was this bad lmao
Anyone tried to read
emotes from messages ?
is it a custom emoji?
Yes.
Client should read custom emojis within the client or guild.
But someone did it, he managed to read emoji id's outside the client.
I mainly want to use it to display the full res .png
I know I can get the ID from a MessageReaction object.
Thus you'ld react with the emote to the bot's message, then the bot would reply with the full res link.
^ That's the only way around I suppose, but I was just wondering if anyone tried to read the id from a message object.
@valid holly you can literally make an url from the id
You get emoji
Via regex or what ever means
Then use some string minipulation and bingo
I was thinking the same, strip the characters but the emoji.
the id comes in the message
^
hol up
fek
I can't do it on mobile
XD
lmao
moderns problems require modern solutions
anyway, thats what your bot sees, so just get that number and build the url
🤝
Shite, I need to read that too and make the exact URL.
https://cdn.discordapp.com/emojis/ID.format
regex?
all file types work
you just chose whichever you want
you can also set a specific size, from 16 to 128 (in multiples of 16)
128 is the max for emojis
🤝 @quartz kindle @warm marsh
smol
the jpg version is horrendous
Why'd I get mentioned?
I don't really use JPEG format in anything
As it uses different compression from PNG
Unless processing photography, everything else that's graphic I mainly use PNG
i use jpg for everything that doesnt use transparency
and doesnt require pixel-perfect compression
for everything else there is quantized/indexed png-8
tiff > png > jpg
lul
Tiff is only rlly useful for uncompressed image renders
bmp > all
basically yeah; tiff is best for uncompressed images with an attached ICC
``` ```@bot.event
async def on_member_join(member):
channel = bot.get_channel(591627450853621771)
await channel.send("Welcome to the server {}. Glad to have you!".format(member.mention))
role = discord.utils.get(member.guild.roles, id="@<@&591626978050834487>")
await member.add_roles(member, role)```
that ain't no snowflake sir
read the error
🤮
should it be just id="NUMBER"?
@outer niche keep only sknowflake 591626978050834487
ooooooo oof
Prolly he tried getting the ID manually and copied everything
tbh if python allowed @<@&> I'd be worried
Just toss everything into the script hoping it holds up 
speaking of which, discord's recent update with the <!id> made my bot stop working
because my mentions were all wrong
lmao
what did they change? removed the !?
still did not worck
What's the log ?
discord.errors.NotFound: 404 NOT FOUND (error code: 10011): Unknown Role @bot.event async def on_member_join(member): channel = bot.get_channel(591627450853621771) await channel.send("Welcome to the server {}. Glad to have you!".format(member.mention)) role = discord.utils.get(member.guild.roles, id="591626978050834487") await member.add_roles(member, role)
it should be await member.add_roles(roles, reason=somereason, atomic=true/false)
not add_roles(member,role)
(anyone have a good source on how to handle promise catching? i am kind of lost on where to put them?)
try{
} catch {
}
try {
await promise()
} catch(e) {
}
or
promise().then().catch()```
if you use await, it will behave as sync code, and exceptions will be caught by try/catch
else, use .catch()
NameError: name 'roles' is not defined await member.add_roles(roles, reason=somereason, atomic=true/false)
bruh........
dont copy and paste without reading...
thankees
I don't think most bot devs don't know how to read docs
await member.add_roles(role, atomic=true)
async def on_member_join(member):
channel = bot.get_channel(591627450853621771)
await channel.send("Welcome to the server {}. Glad to have you!".format(member.mention))
await member.add_roles(role, atomic=true)
role = discord.utils.get(member.guild.roles, id="591626978050834487")
await member.add_roles(roles, reason=somereason, atomic=true/false)
``` so this

how get wavelink
what
Omg this channel is aids
how get wave link
sometimes, yes it is
I'm really sorry for the people who read it and try to help
Hi
hello
again how do i install wavelink
ok
hey GREEN NAMED PEOPLE How get WAVELINK
he means lavalink
you need a lavalink server
how get that
i mean liike i need wavelink i use python
You just do pip install wavelink iirc
you still need a lavalink server
to connect to Lavalink
And yes you do still need a lava link server
And depending on size will probably want a decent knowledge of network to config ipv6
i have ipv4
yes ik
it sucks
ipv4 and wireless connection *Me going crazy: ahahahahajha
naaah I'm out 
hey green named people here is a new thing. i gave my bot the MANAGE_MESSAGES permission, but when it deletes a message i catch an error that says DiscordAPIError: Missing Permissions in the log.
the good news is that i guess i set my catch up right, cause it worked
@manic terrace The message is self explanatory.
Collecting wavelink
Downloading wavelink-0.3.5-py3-none-any.whl (20 kB)
ERROR: Could not find a version that satisfies the requirement iirc (from versions: none)
ERROR: No matching distribution found for iirc
help
Collecting wavelink
Downloading wavelink-0.3.5-py3-none-any.whl (20 kB)
ERROR: Could not find a version that satisfies the requirement iirc (from versions: none)
ERROR: No matching distribution found for iirc
Does anyone know any code for the bot to have as an accountant? my idea is that if someone buys my vip, if he says! vip @user to tell him how many days he has left, you would help me a lot with your help.
we're not spoon-feeding / giving code
We don't spoonfeed here sorry
🥄
Collecting wavelink
Downloading wavelink-0.3.5-py3-none-any.whl (20 kB)
ERROR: Could not find a version that satisfies the requirement iirc (from versions: none)
ERROR: No matching distribution found for iirc
what does this mean
3.8?
is there a way to pipe a live audio stream to a dispatcher?
Use somthing like ydl or lavalink for streaming audio @lean palm
k
again
latest
@fallow mango can you actually check cuz it makes alot or difference
The EXACT version
oh 3.7
Welp that rules out one possibility
Version is okay
Don't go to 3.8 cuz it fucks more stuff up
then why not able to installs???
What command did you use to install it again?
i used the command my freind told me
and
Collecting wavelink
Downloading wavelink-0.3.5-py3-none-any.whl (20 kB)
ERROR: Could not find a version that satisfies the requirement iirc (from versions: none)
ERROR: No matching distribution found for iirc
bam errors
What command did you use
No point saying
The one my friend told me
Cuz that doesn't help
pip install wavelink iirc
pip install wavelink
@fallow mango https://pypi.org/project/wavelink/
k thx
Scroll down you'll find an example.
Ngl I never thought I'd have the day where I quickly download wavelink on my phone to test somthing xD
XD
That doesn't rlly effect much
The basic setup is stil the same in terms of connecting and make a LL server in initialisation
Stop spamming
First off
Second off
Read the actual code
You don't need to know how cogs work to understand where it's creating the server and making the connections
i dont see anything about lavalink server
i neeed a vps now dont i
No?
i understand nothing
You need to run another process
That doesn't constitute requiring a vps
I think you might wanna take a raincheck on making a music bot and get more comfortable with python OOP
Cuz it's really not the most advanced thing in the world to setup
Errr
😦
Python doesn't have a ton to do with the ll server
Wavelink allows you to create the LL nodes
It is just calling functions from classes
I'd strongly recommend switching to using cogs and if you're not using rewrite, switch to that
You have to use cogs, it makes some stuff simpler but can limit more complex stuff
But then again he's not rlly doing complex stuff
You don't have to use cogs
And cogs can do everything you can do without
Um, any tips to reduce memory?
wdym
Cache less things
check what memory-intensive work you're doing and see if you can make it better
don't use d.js
eris gang
any other lib than d.js gang
yes
why is eris more memory saving than djs?
Can anyone point me in the right direction for making a ticket system in discord.py
?
because Eris doesn't cache as much
you'll have to do a lot of heavy modification to get less memory in discord.js
is it possible to reduce chaching in d.js? because switching to eris is kinda hard
uh
@outer niche imagine the ticket system in your native language, apply logic and common sense
bruh
How can i check if my bot can send messages to a user?
So i can avoid getting "DiscordAPIError: Cannot send messages to this user"?
(discordjs)
check if the bot has the SEND_MESSAGES permission
Are all discord users' ids 18 chars long?
okay thx
@viral spade try doing it in a try/catch block
No
@earnest phoenix SEND_MESSAGES is permission owned by a GuildMember
He is trying to send a message to an User
as in dm? nvm
Best way to do it is to send the message to the user then() catch() the Promise Rejection
Yes its owned by a guild member but you can check if the bot has that permission
At least in djs
Idk about other things
Read the docs
why would you check permissions in a private channel
if(!message.channel.permissionsFor(client.user).has('SEND_MESSAGES')) return;
``` I just did this for an earlier proj
DMChannels are messages between 2 users
Users don’t have permissions
Permissions are only relative to guild channels and members
Oh he wants to know if the bot can send messages to a USER, I'm as dumb as rock
._. Sorry about that
ho can i make this red
@tiny tinsel can't seem to get it to work
@outer niche
Because It is syntax highlight ermm.
what
It is shell highlight.
hi
-hi hi hi
Make sure there is no whitespaces after diff.
-We believe in you```
-yaaaaaaayyyyyyyyy
@outer niche Anyways you could check https://highlightjs.org/static/demo/
That's what Discord use for syntax highlight.
# Test
- Hey
@tiny tinsel i can not fined how to get blue
markdown
what
# Hey
oooo what about
- Hey
But just check highlight.js you have all available languages because that's what Discord use.
that website is cunfusing
Yeah except I don't know how to like read any of that stuff in there
You don't have to. Just check the highlights.
I have no idea what is I highlight in there and what is not
whats it called in javascript when you want your bot to do something if it has permission and then do the next thing, OR skip the first thing and still do the second if it doesn't have permission
like basically i want the bot to:
listen for the command -> check to see if it has permission to delete the member's command, and do it if it can -> do the command. but if the bot does not have permission to delete the member command, i still want it to execute
right now the bot listens for the command, and attempts to delete it. if it cannot delete, it catches the error and tells the log, then executes the command. i'd like for it to skip trying to delete if it cant
when I want the bot to delete a message I just do message.delete().catch(() => null) because this will catch the error and continue execution even if the bot wasn't able to delete the message 
and it doesn't clog the log with the error stack?
cause that's also fine.
if (message.content === `${prefix}two stats`) {
message.delete([0]).catch(err => {
console.log('Two Stats Bot could not delete a command!\n' + err.stack);
});
message.channel.send(`\`${message.author.username}\` ${grammar.flatten('#statSentence#')}`);
}
here's the full command, to maybe help make sense
if you don't want it to output a stack then you don't need to add the console.log('Two Stats Bot could not delete a command!\n' + err.stack); part. You can just do .catch(() => null) to have it silently fail.
Also you don't need that [0] because delete takes an object of options. { timeout: number, reason: string } (on master)
it takes just a number on stable for timeout
giving it the null is a fine solution, thanks! curious though, if i wanted to learn how to do something like if (...) then (...) else if (...) OR (...) what would i google?
shit that's confusing even to me
and i wrote it
this is what I like to reference when I need to look for usage on a nodejs method https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else
i'll take a looksie, thanks again for your help!
because top.gg staff are also humans that cant keep up with the amount you guys submit to us
or they are busy watching anime who knows
https://hasteb.in/nopuxofa.js
My bot is not adding the successrole at line 47 idk why
Hello everyone! Could you tell me whether it is possible to make hyperlinks in messages in the bot? Suppose there is a special word in the message whose meaning not everyone can understand. If you click on it to receive an explanation or at least send a command to the bot to show a new message with an explanation.
Ohh indeed, cool. Thx)
or webhooks
@twilit rapids and webhooks lol
He literly said that he wants the hyperlinks in his bot. Not a webhook...
@twilit rapids but w bhooke
Im having a issue with some code, I want to make the bot use some yaml like
Credits -
Gmawolfgames - Founder
Jon - lead dev
*person* - artist
it thinks its a command for something else
there should be an spawn evernt
I don't know much about this. How should I write something?
hey i am trying to make a application command so when a user types .order it says See DMs and then asks them questions in dms then after they answer all the questions it sends both questions and answers to a specified channel can anyone help?
d.js and i need help with the message await @quartz kindle
anyone here using python rewrite? cause i need some help
I'll do what I can to help @plucky belfry
sure
i have a problem making a kick command with permissions
im not using cogs or anything
Okay. I strongly suggest using cogs as it'll make management much easier, along with the range of decorators it opens up such as permission checks.
i dont understand cogs thats why i dont use them
the kick command i made worked only once
and then it stopped working
even after restarting the bot
Otherwise, as far as I'm aware, you'll need to manually check permissions. E.g create a function that you pass a user and permission name to, and it'll return true if the user has said permission.
What stopped working about it? It'll print any errors
the thing is
i think my errors are disabled or sum
cause i made this checks thing
which will like rewrite a error message
so now no error messages comes if there is a problem
i searched google and tried its tutorial but i cant find the solution
there is one solution to make a whole new role and if they have that role they are able to use the kick or ban command
but i dont want to do that
My discord broke and stopped sending messages, hmm
also
Have you got a try/except block?
nope
and do you know atom?
it doesnt work even if i tried to open it
so i downloaded sublime as a replacement
I know of it, but don't personally use it.
it just doesnt work all of a sudden
I use vsc myself, I can't really give support with other ides
One second
well i will leave my bot in 1.4.1 beta for sum time.
btw my entire script is messy
Eg I have moderation in one file, memes in another, so on
It doesn't take too long, copy/paste and a little indent changes
my bot has at least 50 feautures
wait wat?
copy and paste thats it?
i thought they use a different types of terms or sum
Most of your code can stay exactly the same
I definitely suggest swapping to cogs. There's some examples out there that show how, the gist of it is creating classes containing your commands, and in the main file it's a case of bot.load_extension("cog name")
since my bot is able to do many basic things, should i add an economy system?
i always had troubles with cogs
it usually never worked when i went to more advanced commands
and i have a lack of knowledge of cogs which makes it hard for me to troubleshoot the problem
Hey all I need a help me coding how to do it I am beginner and want to learn it can anyone help me
Where
take courses
Ok thnx sir
watch the rewrite series
It's up to you if you add an economy system, for that you'll need a database though in order to store things (don't do what I've done) @plucky belfry
Sorry discord broke again
the new series starting from 2018
dont start with bot development if youre new to coding
^
If you really want to learn to code, take a real course
Could be an online course
Could even be free
Why would you take a look at 2018 tutorials for a maintained library
@eternal adder do i have to buy these databases... also currently my bot is running on my pc, therefore not 24/7... so should i invest in a server?
You won't have much of a need for bot development tutorials if you understand the language you're using
You should, yes. And no, you can use existing libraries to store/run everything in one place @plucky belfry
Are you in the discordpy discord?
no
They'd be far more helpful than here. Want an invite, or?
Would using a localised map for storing private variables be a performance issue or resource hog? JavaScript.
// SomeFile.js
module.exports = (function() {
let private = new WeakMap();
class SomeClass {
constructor(data) {
this.prop1 = data.prop1;
private.set(this, { prop2: data.prop2 });
}
}
return SomeClass;
})();
why declare a class inside a function?
So I can use a WeakMap for private variables.
doing:
// ...
let c = new SomeClass({ prop1: 1, prop2: 2 });
c.prop1 // 1
c.prop2 // undefined / salt
if you're using modern js, you can make private variables using #
Is there a way to state what version I'm using?
As when I googled around before I saw that but I tried it and got an error.
are you using node.js?
private fields were added in node 12 afaik
as for your original question, it wont be a problem, unless you are creating thousands of instances
Nah, It's only used once.
because each instance is re-declaring the class
It's how I've currently got my Client extension class setup.
Private fields are declared inside the constructor instead of anywhere in the class like other languages?
they are declared outside of the constructor
class Rectangle {
#height = 0;
#width;
constructor(height, width) {
this.#height = height;
this.#width = width;
}
}```
Yeah. I with they used a keyword.
https://top.gg/bot/647860115239731220 Why does the image appear so large?
<img src="https://user-images.githubusercontent.com/44723767/69565051-70d8ae80-0fb4-11ea-9b57-ba4813f05807.png"
height="125" alt="Akira">
```The height doesn't affect the image at all
try with "125px" or another unit, might be your problem
didn't seem to work
i cant see the page because your bot is not approved yet
but if you put that img in a blank page, it works properly, and the height is 125
so there is css in that page that is interfering with it
Well I don't really have control over that
Ill try
css overrides inline attributes
you can also inline style attributes in the tag itself
style="height:125px"
hello, is there any code so that a user can only write a command a number of times per day?
It's called a cool down
How can I learn users on all non-bot servers. nodejs
What?
@quartz hill can you explain a bit more about what you are trying to do?
My eng very bad :D
I will take the member size on all servers. but no bot only users
You can get the the count of all members and take away the bot count
let msize = 0;
await client.guilds.forEach((guild) => {
msize += guild.members.filter(member =>!member.user.bot).size;});
I wrote this, but I think it's counting the same user again. If it's on a different server.
my bot is not approve yet


