#development
1 messages · Page 729 of 1
good idea
k well once you can afford it
there are a lot of vps options out there
id definitely consider moving off of rpi especially if you anticipate a lot of guilds
i am only expecting a small amount of users at first
it's legit just a moderation fun and delivery bot
@valid frigate uhm
in kotlin is there a substantial difference between contains and containsKey when using both methods on a HashMap?
contains is finding if the value of the key exists
containsKey is finding if the key exists in the HashMap
iirc
yea
Help plz i am program my sofware but my h2 dont work every time its chrashing the program
could anyone help me with having my bot add reactions with discord.py? ive tried await message.add_reaction(pensive)
but got the error
await message.add_reaction(pensive)
NameError: name 'pensive' is not defined ```
😔 i dont know im looking to add this emoji
what is pensive?
\:emojiname:
Default ones dont have them
\:smile: --> \😄
Copy nmw his emote into your code
Unless you have a variable with the name 'pensive' that would never work
@summer torrent default emojis need the unicode counterpart
for py it's \u{code} iirc
or u'{code}'
thanks for the help! i ended up doing pensive = '\U0001F614' await message.add_reaction(pensive)
Couldn't you really just slap 😔 in it
anyone know anything about writing bots in multiple languages? not like code languages. We're trying to do something because our french users have requested a version of the bot in french. We don't really wanna have two separate bots.
Have an object with each language with responses
lang['en'].ping = 'ping'
lang['fr'].ping = 'ping in French'
Then the response just call that object with the language the user choose in a settings
@cunning oxide
Here's Johnny?
🐷
Please go to #memes-and-media
Yeah
Anywhere where you would normally have 'response' you can replace it with lang[serversettings.lang].response
@cunning oxide
....
if(command === "clyde") {
let url = "https://nekobot.xyz/imagegen/940ec9ee-97e1-4ccc-8d55-367af08123c4.png"
let settings = { method: "GET" }
fetch(url, settings)
.then(res => res.json())
.then((json) => {
message.channel.send(new Discord.RichEmbed()
.setTitle("Clyde")
.setImage(json.text)
.setColor(client.embedcolor)
);
})
}```
what about it
?
urls are buffers, not JSON
(node:4238) UnhandledPromiseRejectionWarning: FetchError: invalid json response body at https://nekobot.xyz/imagegen/940ec9ee-97e1-4ccc-8d55-367af08123c4.png reason: Unexpected token < in JSON at position 0
@earnest phoenix it's because the URL is a Buffer, not a JSON value
just do .setImage('https://nekobot.xyz/imagegen/940ec9ee-97e1-4ccc-8d55-367af08123c4.png')
just a quick question since i'm uneducated with discord.js; does it support TypeScript files
@wet forge yes
epic this is going to make my life so much easier
Bonjour je vien de crée mon dasbord et je ne trouve pas command le connecter a mon domaine un personne pourait me venir en aide
How to use shard? discord.js pls help me
What is bot luca
You need to go to bot list and then login to onorher site
go to discordapp.com and loggin in ur account
Hey o have a question for a glitch project can i tell my questiom in this channel?
hey is it possible to do that with glitch to see if a bot is online and if not the glitch project goes offline? and if the bot is again attached, will the project go on again?
so how i block bot if bot not have permision in channel to send message discord.js
How can I look at the use of memory of 5 shards individually
e.g
Shard 1 : 550 \ 12288MB
Shard 2 : 420 \ 12288MB
Shard 3 : 400 \ 12288MB
Shard 4 : 350 \ 12288MB
Shard 5 : 223 \ 12288MB
Bruh
use broadcastEval + process.memoryUsage()
is your bot approved?
yes
all bots are manually reviewed by the staff to make sure they work etc
True facts
sometimes there are hundreds of bots waiting
Yup so gay
@earnest phoenix broadcastEval does that
bot.shard.broadcastEval((process.memoryUsage([3]).heapUsed / 1024 / 1024).toFixed(2))
I want to see the use of 3.shard memory by doing so but it does not work @quartz kindle
I'm bored what are u guys using the group chat for anyways
No one is texting on there
@earnest phoenix you need to check which shard it is from inside the broadcastEval
broadcastEval("bot.shard.id === 3 ? process.memoryUsage() : null")```
but its much easier to just get the memory usage from all shards, then filter it
since the returned array is indexed by shard id
@quartz kindle
client typed instead of bot gives client is not defined error
I also want the memory use of 5 shards at the same time
(will be in the shardinfo command)
How do u leave these group chat thingys
so how i block bot if bot not have permision in channel to send message discord.js
Erensi, bot was probably just an example. Replace it for this
Zentai, get the permissions for your bot in the channel and see if it has SEND_MESSAGES. There's a permissionsFor method on the TextChannel instance
I use bot @sudden geyser
in broadcastEval, this is your instance of Client/bot
And what is shard? discord.js
Client = autoshardedbot(nessesary peramiters)
@client.event
aysnc def on_ready():
"Print statement here and prints fine"
However
The test bot does not come online
Yes I've told it to run token
TOKEN = "YuP"
client = AutoShardedBot(command_prefix=("~"), case_insensitive=False, shard_count=2, shard_ids=(1,2))
@client.event
async def on_ready():
print(f"[OK] - {client.user.name} ({client.user.id}) - (Status - Online)")
client.run(TOKEN)
How can i edit bot's embed description with fetchMessage?
Read the docs and I imagine use string formatting
Can u send link @spice trail?
go to the documentation site for your programming language
and string formatting is well string formatting
OoF
@earnest phoenix so just edit a message?
No embed message
js
do u want to edit after you send the message
I want to change the message description
not SİMPLE MESSAGE
embed description you mean
THE SAME EDIT COMMAND APPLIES
<Message>.edit({embed: {}})
just assign the embed to a var
OOOOF
you can't edit specific embed fields, you have to edit the whole embed
but yeah
it does
^^
also try not to spoonfeed and instead link to docs
How can I check the connection to the discord servers?
Sometimes my bot's connection would silently fail without error
Then client ready is called again after timeout period
it doesn't silently fail, you're just not handling your errors properly
client.on('error', console.error);
I have this but I don't really see anything on the console
ready is called whenever the bot establishes an entirely new connection to the gateway (aka when it can't resume or on startup)
How do we log a messages text and post it to another channel discord pizza style
is there a way to actively ping the server for connectivity check?
don't do that
With the permission ovs
listen for message created/received event -> check if the channel id of the message is the one you want -> get the channel to which you want to post the message -> send the received message's content @static nexus
kthnx
New bot me
i'm gonna have to boot up DBM and use it to research
idk why but my bot had been offline for like 12 hours without an error
Did you start it?
If laptop off, bot ofdf
I only see client ready called after 12 hours
there are tons of factors which could've caused a disconnect
api outage, internet outage, if using a free host something happened there probably, bad code, cpu overhead
shouldn't it throw client error anyway?
I already set client error to call console error
I've seen it working before - but not this time
well if it isnt doing anying its probably not crashing
listen for the disconnect event too
its more likley just getting stuck in a loop
and print out the code
^
it could've just been cloudflare doing a swoop
3
code
What is normal problem, when they are declining bots?
They should give a reason
long description filled with junk
Oh
Ty
anyway whats the code sobble
🙏 Please, don't decline my bot.
lemme go get it
import discord
import random
from discord.ext import commands
client=commands.Bot(command_prefix='sb!')
@client.event
async def on_ready():
print('Bot is ready!')
@client.event
async def on_message():
channel = message.channel
if message.content.startswith('sb!ping'):
await client.sendmessage(channel, 'You expected your ping but it was me, DIO! https://media.discordapp.net/attachments/645025686414819332/645251910806405132/tumblr_pmsciyLJ7X1v7ql19_1280.png?width=452&height=451')
if message.content.startswith('sb!echo'):
msg = message.content.split()
output = ''
for word in msg[1:]:
output += word
output += ' '
await client.send_message(channel, output)
if message.content.startswith('sb!server'):
await client.sendmessage(channel, "I heard you wanted to join the Sobble Squad. Well, here's the link.CSsj7Hy")
if message.content.startswith('sb!order'):
await client.sendmessage(channel, "There's nothing in here to order!")
client.run('bitch you thought')```
ignore the does
ik to fix that
the only error i get it
File "C:\Users\mouga\Documents\Document1.py", line 1, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
you actually installed discord to path?
Are you sure you are using the same env vars
Aaaa
i need help thinking of a better var name for "value_value" and suit_value
what do the variables do
if it's the value and suit of a card then you could just call it value and suit?
no need to add value at the end of it
or maybe change the suit_value to suit_id if you identify the suit with it
i use the _value to sort the cards
Is it smart to create a table for each Guild, to make the leaderboard for points easier?
because even though "ace" represent 1, it doesnt have the "value" of one and being less than "two"
large ass bots like mee6 do that all the time
so making seperate tables for each guild is fine, since iirc hundreds of thousands of tables can work fine
Nice, thanks.
np
Cache
when the others see the page new form
have u posted the amount of servers your bot has?
I have tried to get my bot verified now twice and got declined. No reason why? First time ok, Description I spammed. but second time I did everything I should?
@lament meteor Command or on the site
on the site
no.
@wooden moss https://top.gg/api/docs and #topgg-api
@blissful scaffold Thank you very much!
Your bot doesn't have a (working) help command or obvious point of entry. Please make sure your bot has a help command or has an explanation in the bot description.
that means I just need to code a !help command? and then it should be good?
Im also really slow when im using my phone
because you need that to get the number of servers your bot is in on the top.gg list
your bot needs to tell the DBL bot list how many server it is in
You do that with the top.gg api
I am looking for a bot in discord to manage players looking for a division or team. Can anyone help me?
how many days takes to approve your bot?
Week+
How I setup dns setting of a domain for vps
oh heck
aproximately a week
Luca will DM you when your bot is approved or declined
Oh ok
Did you get a DM?
Any one here who can help me
Ik
@celest spear tf I was gonna bid but I dont have that much money lol
Whos can help me?
Ok now youre just killing me xd
how can join server discord?
xD
@barren moss in #mod-logs only the bot is mentioned when its declined, you will have to search for your bot name or id
Lucas can't dm à people with close dm
yeah, luca should also have DM'd you when you added your bot to the list
If you didn't receive that DM then you probably also wont get a DM when you bot is checked
Discord.py
How to use .send() for more than 6 arguements?
show the command which you are getting an error from
if message.content.startswith("sborder"):
channel = client.get_channel(645025686414819332)
await channel.send("We've got an order! Here's the info!", "Order
information", message.content, "Orderer", message.author)```
You need to make a rich embed
yes
yes
Better to name it bot
commands.Bot
I mean you can call it a_gay so it would be a_gay.command()
discord.Client
As its not a "client"
yeet
It makes sense if you name .Client client and commands.Bot bot
How do we get another server's invite
That is against TOS if I remember correctly
TextChannel.create_invite / VoiceChannel.create_invite to make one, or Guild.invites
peter i mean i will add a disclaimer
Yeah it could be considered backdooring into servers
Lemme explain
Someone adds bot
Thanks for adding me! For your information, every time the command sborder is done, a server invite which is one use is given to the Sobble Cafe server.
Someone does sborder
i got their name and the order's information
but not the invite
invite = await bot.create_invite
channel = client.get_channel(645025686414819332)
embed = discord.Embed(title="New Order:", description=message.info, color=0x00ff00)
embed.add_field(name="Orderer:", value=message.author, inline=False)
embed.add_field(name="Server ordered in:", value=invite, inline=False)
await send.channel(embed=embed)```
my attempt
Still should use ext.commands
this is rewrite
yes
can i get assistance
rewrite doesnt exist technically
Rewrite has became the new discord.py
JUST TELL ME WHAT'S WRONG
on what
@static nexus Please go easy on the caps. I would read all the pins in this channel and see all of the etiquette and other links about how to ask the right questions.
bot.create_invite() ?
ctx.channel.create_event with autosharded bot and commands.Bot
is it me or their question genuinely doesn't make sense
lemme try
@earnest phoenix it could go either way honestly
Can we not spoonfeed code also
kk
I mean how do we get one server's invite and post it onto another
The XY problem is asking about your attempted solution rather than your actual problem. This leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help.
User wants to do X.
User doesn't know how to do X, but thinks they can fumble their way to a solution if they can just manage to do Y.
User doesn't know how to do Y either.
User asks for help with Y.
Others try to help user with Y, but are confused because Y seems like a strange problem to want to solve.
After much interaction and wasted time, it finally becomes clear that the user really wants help with X, and that Y wasn't even a suitable solution for X.
So you want you to get the servers invite when someone does the command?
Yes
Also if you are making a food bot, I highly recommend to generate an invite when you order the food. Not when you join the server @static nexus
you would need to get the guild object
or controller or whatever
idk how it works in py
but then generate an invite
or ask for one to be provided when the command is run
im stupid if its js
no its py
ye its py
@restive furnace create_event?
Yeah create_event doesnt exist
i got the fetch invite
I have a global economy bot (your balance is the same on all servers)
I want to list the top users (highest balance) within 1 specific server
The database links user id's to balance
How to tackle this?
The main issue with all solutions I can think of is that I would need to know all id's of the members in the server which requires fetching all those members..?
i dont understand where is the issue
Servers with 100k members for example
make a dictionary
I don't think I should just fetch all those?
have the key be the userID
what about it
have the dict key be userID and balance be the value
From what I saw on eris docs I can only fetch 1k at a time
So that alone would be 100 api calls
Unless I'm retarded
not all 100k members are going to be in your database
Yeh
and why
just only start logging the members if they use the bot
ok look
do you want to mention the member?
take member x
I can't know if member x uses the bot without checking their data
which means i need the id of member x
what
no
just query your database
only get the ID of user if the bot is mentioned
Just query the database so like
You mean go through all entries in there and check if they are in that server?
Discord.PY is there a way to check if a message's content has a specific item in it like discord.gg? also can you answer this question: How do you get a server's invite and post the invite into another server?
There's nearly 100k users in the database
why
@static nexus hes
👀
Basic in operator
yes*
its called the in text
i tried notin
are you putting every single member despite them not using your bot in the dn
also create_invite returns an Invite object
No
db*
thansk
My bot grows fast
if you dont know how to use basic python like using in why try make a bot
also databases are made to withstand heavy queries
otherwise people wouldn't move from json ""databases""
i do
also whos joining the discord server your bot logs the invite for anyway?
but why log the invite
when someone orders the food
i remember tackling that issue by first downloading all members in the guild, which might be an issue with d.js because the lib is shit @late hill
so the staff can enter the server and deliver the food
that is quite dangerous m8 ngl
oh
i never see the value in food order bots but people dont seem to mind so idfk @spice trail
would downloading all members make a big difference resource wise
That's what I want to do
because """reasons"""
big guild? yes
if you have a good machine and use a good library it won't be a problem though
so you want the bot, to create an invite
send it to your staff
so ur staff can join the server?
i had a 2.5k guild bot on a 1gb ram vps which withstood downloading all members on huge guilds like DBL, DAPI and Dbots
using discord.net
@spice trail

your explination explained it
that is quite alot of effort for a bot which i take is your first time doing anything d.py related? <-- Sobble
try it and see 🤷♂️
that isnt gonna be a food bot dou xD no offence, find a original idea that ur passionate about which you can do well and within reason
i'm passionate about racing
if you want to learn programming use things that will push your knowledge and teacher better programming
keep the bot simple at start though
Food,Moderation,Fun .
how many large bots do you know that do a little bit of everything?
exactly thats cuz its ALOT of work not only to make it useful and workable
I just want my meth(od)
communism is a great example how monolithic design never works
do one thing well instead of serveral bad
@earnest phoenix oops my bot is monolithic 
oopa
ree
okay sobble what is your issue then?
i just want a way to get, when the command is run, a server invite to be sent to another server
when will my bot be approved?
like we told you before. use your discordpy docs to generate an invite, then send that invite to a specific channel
-checkmybot @supple saffron
@supple saffron
Bots added to the site are ordered by a queue based on the time they submitted their bot. Website Moderators check bots according to the queue and cannot check your bot just because you requested it. In addition, queue length is confidential and we cannot tell you your position in queue, either.
As the FAQ: How long is Approval? states, your bot may take up to a week or more until it is checked. There is no set time how long bot approval will take; there is a queue and you're not the first nor are you the last.
Please be patient.
thx
https://discordpy.readthedocs.io/en/latest/api.html#invite @static nexus it takes 1 min and reading
How to get votes?
i just don't know the exact bit. is it guild_invite?
cry
I mean api request votes
hard
that's the only question i have
oh
@chrome verge #topgg-api
go to #topgg-api
Ok ty
so do we do this
how do we specifiy what parts of classes we use
yes
lets call it MyClass
If you dont know basic python, you really shouldnt make a bot
class MyClass():
my stuff here```
oh yeah
now
so
how would we specify to the program to look in that class
and to get a specific part
MyClass(specific part):
no
thats a subrutine
thats saying
this subrutine
passes stuff
think of it like a file path yh
oooh
def function():
MyClass
return(mysubroutine, stuff)
what the hell is this
@patent prism pls be nice smh
read the etiquette rules ;n; in the pins
notice anything about this in the docs?
IK NOW
Too used to dpy help
sobble easy on the caps please
guild.fetch_invite()
We just turn people away instantly if they dont know basic stuff
thats understandable
there we go
🙂
also was my guild.fetch_invite() thing correct
possibly
youre along the right lines
its just testing now to see what it returns when you call it
oop
an i oop
qui
u huh
I just need to find how to make the invite into an actual invite
it's just showing<function invite at 0x000002719CD3EE18>
once again i say read le docs to find out
I have this,
but
this happens
can i have the bit of code i was supposed to put in there
also channel is a defined channel
@static nexus Yo! This is your last warning about excessive caps.
Please don't abuse it anymore or there will be consequences
bruh
i legit sent u a ss of the docs
did you not read it
there is a VERY clear part of it that says the corutine of invite()
How to change the bot status to
you cant
U can i have seen some bots like that
no its just the profile pic
no its not lol
i added .url
still being dumb
import discord
import asyncio
from discord.ext import commands
client = discord.Client()
channel = client.get_channel(645259977304571935)
bot = commands.Bot(command_prefix='sb')
async def invite():
invite = create_invite.url(reason=None)
if message.content.startswith('sborder'):
channel = client.get_channel(645259977304571935)
embed = discord.Embed(title="New Order!", description=message.content, color=0x00ff00)
embed.add_field(name="Order Maker", value=message.author, inline=False)
embed.add_field(name="Invite", value=invite, inline=False)
await channel.send(embed=embed)```
this is not full code
discord doesn't do any checks for setting presence type
just a part of it
so yes bots can have mobile indicators
^^^
huh
But how?
so it exists but is completely undocumented
your lib probably doesn't support setting it though
Discord.js
yea d.js doesnt
its a presence update like any other
just looked through the docs
have you tried putting the Url within the subrutine
it's not a specific url
i want the url of the server the command is used in to be generated
# Invite management
def create_invite(self, channel_id, **options):
r = Route('POST', '/channels/{channel_id}/invites', channel_id=channel_id)
payload = {
'max_age': options.get('max_age', 0),
'max_uses': options.get('max_uses', 0),
'temporary': options.get('temporary', False),
'unique': options.get('unique', True)
}
return self.request(r, json=payload)```
okay
just gonna leave the code from the discord module here
def get_invite(self, invite_id):
return self.request(Route('GET', '/invite/{invite_id}', invite_id=invite_id))
def invites_from(self, guild_id):
return self.request(Route('GET', '/guilds/{guild_id}/invites', guild_id=guild_id))
def invites_from_channel(self, channel_id):
return self.request(Route('GET', '/channels/{channel_id}/invites', channel_id=channel_id))
def accept_invite(self, invite_id):
return self.request(Route('POST', '/invite/{invite_id}', invite_id=invite_id))
def delete_invite(self, invite_id):
return self.request(Route('DELETE', '/invite/{invite_id}', invite_id=invite_id))```
should it be a function or just a line of code
rest of the other subrutines
Should it be a function or line of code
well im not saying copy the code
i know
just answer my bloody question
doing Class.XYZ() specifies the subroutine or class to use
also
im not gonna spoon feed you
you want to learn how to make a bot you gotta know how class, subrtuines and docs work
right sobble
gonna give u another hint, have you told it where to send the linK?
show me the code
invite = create_invite
you havent told it:
where to link to
how many times it can be used
any other options
etc..
create_invite(self, channel_id, **options)
its a subroutine, you gotta pass stuff into it mate
create_invite(self, channel_id, **options)
what is before the invite part
your not just calling in a subrutine remember
its a coroutine within a class
so what we gotta do to tell it where to look?
thanks @spice trail thanks @spice trail
i did it
my dumb ass just caused a name overlap
now let's try
server = invite.create_invite(self, channel_id, **options)
channel = client.get_channel(645259977304571935)
embed = discord.Embed(title="New Order!", description=message.content, color=0x00ff00)
embed.add_field(name="Order Maker", value=message.author, inline=False)
embed.add_field(name="Invite", value=server, inline=False)
await channel.send(embed=embed)```
it is all correct
but
NameError: name 'invite' is not defined```
also u missed the point of the whole discord.create_invite
or maybe client.create_invite
oh it's discord.create_invite
invite.discord.create_invite
hint: bot = commands.Bot(command_prefix='sb')
oh
hint 2: client = discord.Client()
@bot.command
because there are moderation commands too
I'm running node and am using guild.id in client.on("guildMemberAdd", async (member, guild) => { but id is returning as undefined. Any ideas?
they both can do the same thing just fyi sobble
and use client
cuz youve said client is the main class for discord.py yh?
yes
so client.create_invite(Parse parameters)
i would pay u if i had money
@wooden lance has it got a guild? might need to see more code
and dw about it sobble
we will teach you slowly
AttributeError: 'Client' object has no attribute 'create_invite'```
What library @wooden lance
@wooden lance try member.guild.id in your code
yes
o
InviteLink = await client.create_invite(Maybe a channel id and options go here)
wait imma try discord.create
I'm gonna try that
he says reading the docs again
im using pycharm and it says only discord. exists
thats cuz its the main class for the module
whats the code u got rn?
for the invite?
so imma do discord.invite.create_invite
NO
no .invite.
not needed
thats saying
using the class discord
look in the subroutine invite
do the subrutine create_invite
server = await discord.client..create_invite(self, channel_id, **options)
channel = discord.get_channel(645259977304571935)
embed = discord.Embed(title="New Order!", description=message.content, color=0x00ff00)
embed.add_field(name="Order Maker", value=message.author, inline=False)
embed.add_field(name="Invite", value=server, inline=False)
await channel.send(embed=embed)```
that's my code
Now I just need to wait for someone to join a server.
^
,client.
done
done
done
Channel ID legit means give it the ID
oh
Aye it worked. Thank you!
InviteLink = await client.create_invite(destination = <GuildID>, xkcd = True)
try somthing like that
but u gotta give it the ID
now that might involve using the .get_guild() function
no
well actually yes
channel = client.get_channel(645259977304571935) ✅
well no,but actually yes
i read the message wrong
the channelID and telling it to send the message to the selected channel is fine
so in theory it should work once i've fixed all that
AttributeError: module 'discord' has no attribute 'create_invite'```
no
do client
instead of discord
also
not channel
channel bad
u need the guildID
channel is just for sending the embed
annnd
it has no attribute called create_invite
maybe i should change the create_invite to another knd
try put it in a subrutine called invite
ok
wait guild id of the guild the invites from or my guild
so im gonna have to do get.guildid()
give me one min cuz i gotta test it on my test bot
anyone know how exactly to play a mp3 file?
no use me helping u if i dont have an example piece to double check
did it work
hmmm
how do i get Rbxodia V2
so hmm
hot do i get Rbxodia V2
idk
-wrongserver @earnest phoenix
@earnest phoenix
This server is NOT the support server for ANY bot. You need to click on the "Support Server" button on the bot's page, not the "Join Discord" button at the top of DBL.
do mod applications exist or something
every now and then they open them
oh cool
@static nexus to be a mod on this server you have to be active, mature, helpful, and preferably 18 years old or older
@loud salmon arent most mods under 18
@mossy vine like maybe 3 of them are under 18
huh
Anyone know if you can make qsort start from a specific index? or specifically ignore index 0
remove it from the array/selection?
-auctions @frozen cedar
@frozen cedar
What are auctions? What is #bids for? Click here to find out
How to block if bot cant send message it will make bot crash discord.js
Check the channel permissions for your bot (ex: <Channel>.permissionsFor) and see if it has send messages. If it doesn't, do nothing
is there a way to have an embed detect if a reaction is clicked forever (i know you can do it on a timeout, but i dont want it to be on a time out)
once i get this working, my bot should be pretty much done
I don't know what library you use, with my Java lib I can listen for reaction events and then check if the reaction is done to a message that the bot follows
probably not for long since your cache would have to be massive
also hes not using java
you dont need to cache messages to receive reaction events
djs
Discord.js v11 does not have the ability to emit events if the respective structures it needs to emit with are incomplete and does not auto-fetch the missing information. This behaviour has been changed in version 12 of the library. It introduces partial structures which enable us to emit incomplete structures and complete them with a single fetch call. This feature is not available on version 11.x if you want to listen for reactions on old messages please use version 12 of the library
https://discordjs.guide/popular-topics/reactions.html#listening-for-reactions-on-old-messages
looks like it isnt possible with discord.js v11
oof. okay
if you really need it then you can switch to v12, but i think that version isn't stable yet
wdym v12 is epice
I just go from what the discord.js documentation says
Personally I have never used it and I dont know much about JS in general
the documentation says v11.5 is stable and v12 is master
For some reason the website link for one of my bots links to a top.gg 404 page
In the editor its fine
Public it's borked
not sure why this is the case
Does anyone know how to fetch a user's highest role? (js)
Member#highestRole I believe?
Lemme check
@wooden lance
Thanks! I keep on getting lost in the docs. They are too large.
There is the search feature
waiiit...wot
@blissful scaffold it's approved

ah wait, i hadnt tried the link, it works 😄
I'll login in a few and double check @unreal oxide
Started getting reports about the website link not working and im not sure why
thats gonna make my life easier
@west raptor thanks
Edit the bot page and check if the website url starts with http(s)://
ohhh
it should redirect fine now
Thanks Dream
np
now the site works
const songInfo = await ytdl.getInfo(`${url}`);
const song = {
title: songInfo.title,
url: songInfo.video_url,
author: songInfo.author
};
console.log(songInfo)
var connection = await voiceChannel.join();
const dispatcher = connection.playStream(ytdl(song.url))
message.channel.send(new Discord.RichEmbed()
.setTitle("Now Playing")
.setDescription(`${song.title}\n By: ${song.author}`)
.setColor(client.embedcolor)
)
}```
What's the result of song.author when printed
[object Object]
what is in the object?
printed to the console
My guess would be it's something like song.author.name but to be sure you have to print it to the console
works ty
you just used my guess without checking? xD
I'm having issues with this bit of code:
let authorRole = message.member.highestRole;
let targetRole = bUser.highestRole;
let roleprotection = new Discord.RichEmbed()
.setTitle(`Role protection`)
.setColor(`#ff1900`)
.setDescription(`That user has a higher role or the same role as you so I can't let you do that.`)
.setFooter(`Replying to ${message.author.tag}`);
if(authorRole.position < targetRole.position) return message.channel.send(roleprotection); //Line 75 by the way.
if(authorRole.id === targetRole.id) return message.channel.send(roleprotection);
...and I'm getting this error:
(node:2429) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'position' of undefined
at finish (/root/DiscordBotApp/commands/ban.js:75:39)
at Object.module.exports.run (/root/DiscordBotApp/commands/ban.js:35:7)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2429) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2429) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Any ideas? (JS)
holy shit that's long
@wooden lance maybe targetRole is undefined
Is it a user or a guild member
a guild member
but I use let bUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0])); to get bUser
then bUser is undefined?
shouldn't be
proper way to do it is message.guild.member(/*first check*/) || message.guild.member(/* second check*/)
Does Guild#member even exist
it worked before I changed some stuff
Actually
It does
Just looked
Guessing it's new
okay, bUser.member doesn't work. I don't know why I thought it would.
typescript also exists
I'm aware
i don't know why i learnt javascript
if you were about to say that
types in JavaScript
pog championship
bro, only thing that does that is flow made by Facebook
o finish(client, message, args, bReason, bUser); on async function finish(client, message, args, bUser, bReason){ aaaaaaaaa
i hate javascript
aye works lol
Don't we all hate Javascript
i wish i learnt python first
That's why we grow up and use rust /s
you know how when you link a yt video it has like that embed
how would i go about making one of those for my site
meta tags
Which ones?
He didn't said it's an error
hoi noob danish here again
client.getScore = client.sql.prepare("SELECT * FROM scores WHERE user = ? AND guild = ?");
client.setScore = client.sql.prepare("INSERT OR REPLACE INTO scores (id, user, guild, points, level) VALUES (@id, @user, @guild, @points, @level);");```
How do I make both of these statement accesible to all others files?
Can someone help me? Every time I type something my bot responds :(



