#development
1 messages ยท Page 1315 of 1
user doesnt even seem to be a promise here
read what scopes are
pretty much I'm trying to get the user object of the user who reacted
hey
lol
you are reinit the object, with the exact value, as it did have before
so
and awaiting it for ???
im not good at coding
legit took the const outta there
i made this code a while ago and have been fixing everything
um
it's a mess
should just delete the line
i changed it to just await the user
make my bot online?
@waxen rover No, it needs code to run
the user isnt a promise tho
you have to make it
gl
this is such a mess of code
take a look at the link i sent gimmy, that will be some help in your journey
ok
i havent even hit the database part yet
hex
const collector = user.DMChannel.createMessageCollector(filter, { time: 600000});
How do I actually make a message collector in a user's DMs
because i know that isnt it
its the same as any other channel afaik
<User>.dmChannel.createMessageCollector(<filter>, <options>)```
oh wait was it just a caps issue?
I think so
so
i suggest taking a look into javascript. you can do python as well, but javascript uses discord.js as its library, which is what most people use, so it will benefit you more, if you use something that majority of people use to get help gimmy. but you can try other languages, and libraries, but discord.js and discord.py is your best options
it was
ok im gonna be here a lot for the next 30 mins or so trying to fix this disaster
docs are going to be your best friend
@waxen rover i'd totally recommend discord.js, I use it and lots of people are familiar with it
the docs are also pretty good
and theres plenty of tutorials and explainers to help get you started
i mean i would recommend discord.NET, but thats just me.
, but for beginners, javascript or python is going to be better than doing C#, Java, Rust, or Cpp
ok
MOVE_MEMBERS includes disconnecting right?
Js*
so
?
?
what is the question
script?
change the role perm
you have to do this in your program.
okay would anybody be willing to help me bug check a large chunk of code
having the bot overwrite the channel perms, and turn the permission to speak in the channel for the @ everyone role.
im suffering a lot right now and im not sure if im catching everything
collector.on('collect', m => {
global.schedulecollectedTime = m.content.first(); //This needs to be the content of the collected message
if(m.content === "cancel", "Cancel", "Cancel.") {
let cancelEmbed = new discord.MessageEmbed()
.setTitle("Cancelled.")
.setColor("#FF0000");
user.send(cancelEmbed)
console.log("User cancelled collector.");
return;
}
console.log(`Collected ${m.content}`);
collector.stop();
});```
This keeps spewing out
```Error: val is not a non-empty string or a valid number. val=undefined
at module.exports (C:\Users\Samst\Desktop\RemindMe\node_modules\ms\index.js:34:9)
at Client.<anonymous> (C:\Users\Samst\Desktop\RemindMe\core.js:43:22)
at processTicksAndRejections (internal/process/task_queues.js:97:5)```
can anyone help?
???
which is line 34?
thats not what it's pointing to that takes me into the module thats giving the error
pretty much the error is saying that what im putting into the function isn't a number
hello
show line 43 in core.js
let msTime = ms(global.collectedTime)
so global.collectedTime is returning undefined
so...
@waxen rover
i need to learn what type of code?
@waxen rover
to make it lock
@waxen rover
the server
@waxen rover
i understand the error
collector.on('collect', m => {
global.schedulecollectedTime = m.content.first();
if(m.content === "cancel", "Cancel", "Cancel.") {
let cancelEmbed = new discord.MessageEmbed()
.setTitle("Cancelled.")
.setColor("#FF0000");
user.send(cancelEmbed)
console.log("User cancelled collector.");
return;
}
console.log(`Collected ${m.content}`);
collector.stop();```
i need to get the content
of the collected message
but i dont know how to do that
m.content
i think you do not fully understand gimmy
m.content
@sonic lodge i had that
also, this condition isn't doing what you think: m.content === "cancel", "Cancel", "Cancel."
@waxen rover
@waxen rover
@waxen rover
@waxen rover
@gritty bolt @vernal rivet @blissful coral
oops
also yea, you should be use OR operator to do that
so...
@waxen rover
i need to learn what type of code?
@waxen rover
to make it lock
@waxen rover
the server
@waxen rover

help
it checks if m.content === "cancel", then it returns "Cancel."
javascript, the best code i've ever use 
alr
oh
||when someone calls javascript a code not a language||
fixed that
ah
@waxen rover ??
||when someone calls javascript a code
not a language||
@vernal rivet
but how do I fix getting the content of the collection?
Why are you spam pinging yourself and pinging me
i think he's a little confused
can any1 help me setup lavalink?
what are you using the global object for
this is what im working with
code is referring to the source code. language is what you are programming in. its also a pet peeves when people say coding than programming. its like yes both are correct, but professional it would be referred as programming.
i press moderaation and all it does is kick and ban
For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath
how do i do this?
its giving me an error
:milk_think: code is referring to the source code. language is what you are programming in. its also a pet peeves when people say coding than programming. its like yes both are correct, but professional it would be referred as programming.
@vernal rivet
what to do
idk man, i haven't worked much with lavalink. but kotlin is fun
???
aight
wut
Guide*
i dont need the code
first learn programming first, then read the docs.
alr
^please
Hence why you learn
ill read anyway
what do you mean with lock servers? make all channels read only?
can anyone help me get the content of the message I'm collecting
collector.on('collect', m => {
global.schedulecollectedTime = m.content
if(m.content === "cancel") {
let cancelEmbed = new discord.MessageEmbed()
.setTitle("Cancelled.")
.setColor("#FF0000");
user.send(cancelEmbed)
console.log("User cancelled collector.");
return;
}
console.log(`Collected ${m.content}`);
collector.stop();
});
let msTime = ms(global.collectedTime)```
i cant figure out what i've done wrong
so that answers the second question, which answers the first one tim
what does the console.log show?
is global.schedulecollectedTime a property or a function?
variable
what does the console.log show?
@quartz kindle it isn't showing anything actually
which is why im confused
oof
not even "Collected"?
nope
then there's something wrong with your collector filter
um
true === true? lmao
@waxen rover you need a code editor
@waxen rover a discord bot is a program you make by yourself and run in your computer
doesn't the d.js guides explain where
go download Visual Studio Code
you need development tools in your computer
or atom
you dont put code in the dev portal, the dev portal only gives you a bot account
or notepad ++ 
you need to create a program that logs in to this bot account
ok im gonna go try and get a better filter
and then listens to messages and executes commands
so this thing works
can you show your current filter?
F1 micro
how do you set up a custom email on a domain
or you can enable linux console, i forgot the settings name, but you can do the other way, and install vscode through there
chromebooks can be used for development, but its a bit tricky to install certain development tools due to compatibility
^^^
however as pointed out above, there are a few websites that offer you an all-in-one experience, they contain all the development tools you need built in and run the code for you
they have some limitations tho
glitch ๐คฎ
@sick cloud with cpanel/other or without anything
my mum wants to buy a domain and have an email
but she wants to pay as little as possible
postfix and roundcube is free
best option would be a dedicated email hosting service
they cost as little as $1-2/mo
self hosted is a pain to setup
if you use the email for work, dont self host
I mean on a VPS
you will have trouble with spam filters and shit because your machine is not in a verified-safe ip address and/or worse
can you suggest one then tim
zoho mail is pretty popular
Only 7?
What code did you use?
namecheap also offers email hosting, 10 bucks per year
client.once('ready', () => {
console.log('Ready!');
});
client.login('your-token-goes-here');
and put the tokeen
where it goes
what happended?
And that's everything you used?
You need to define client
oh
Client needs the djs lib required
@waxen rover where are you working atm? on glitch?
ah ok
so on the left side
there is a menu for packages
open it
and from the search bar, type discord.js
and install it
@waxen rover
you have to create a repl with node.js, if you didnt, go back and create a new one
oh ok
crap
what? @quartz kindle
just a message
when saying !ban
like tf
did i do sum wrong
thecode is like 20 charcters
bruh
Gimmy do you know how to program in Javascript?
not really
Do you know how to read errors?
um
Do you know to read and fix errors in Javascript?
not fix
and alittle read
im not very good at coding
i have gudes
*guides
in a few tabs
From what it looks like, you are just trying to make a command without a token or anything
you are just running into nothing
oh
and even then I do recommend you learning how to read/fix basic errors before learning to make discord bots
Hey guy's can u help my bot reach 100 server's
this is code i put
(message.content === '!ban') {
message.channel.send('No banning dummy.');
where do i put the token?
You need the client login stuff from before
That you had
I would really read the guide
yea
this?
F
yea but now renew it
thats the token
but dont post it in public because it is private info
does anyone know a good dummy filter for a collector
that actually works
i dont need a filter
message collector
just checking if the thing your collecting exists
how
m => m?
yeah
an example of what i have so far tell me whats wrong
lol
Nowojdwjodjwdosawd
whats wrong with it
i feel like you posted your real token with random letters at the begining
you should read the guide
because i think you misunderstand
you need this at minimum to get the bot to login
const Discord = require('discord.js');
const client = new Discord.Client();
client.once('ready', () => {
console.log('Ready!');
});
client.login('your-token-goes-here');
at the very minimum
the second one looks fake
it is
the second one looks real with the first few chars replaced with random chars
which is also unsafe
sadsdadasdckbuddy69
still able to figure out what it says
wtf
since edited messages are saved
the guide does end up going into config files so you can paste code without leaking tokens
on like the third page
so all this
and the token
inside
const Discord = require('discord.js');
const client = new Discord.Client();
client.once('ready', () => {
console.log('Ready!');
});
client.login('your-token-goes-here');
?
thats it?
yeah, thats the absolute minimum
the guide goes on in the next section to explain responding to messages
MTIxOTE5NDQ5OTk2NDYwMDMz.bG9s.aGFoYSBubw
yes, i really suggest reading the guide and the explinations for it
(message.content === '!ping') {
// send back "Pong." to the channel the message was sent in
message.channel.send('Pong.');
}
this
then what i want
right?
how?
the previous section explains a section of code your missing
oh
start the bot first?
nvm
my bot is up
your reaction
when i accedentally posted my toke
F
@solemn latch
lmfao
oof
@earnest phoenix posted a fake token up above, posted it anyway 
@solemn latch see what happens when you base64 decode that boye
we cant see what that link is for
oops

lmfao
why do you have such long invite links
^ much better for making links
whats your code look like?
everything except the client.login line please
๐
Can you at least not include racial slurs in censorship?
oop
anyone wanna play among us rn?
ptero 1.0 out yay
none of my friends r online rn :P
@earnest phoenix wrong channel
Nรฃo entendo vc
What permissions does a bot need to see when users join/leave/change channels??
Like voice channels?
Yeah
I think its the view channel perm
Should be view
Either that or the bot has administration enabled then it will allow it to bypass the channel perms
does anyone know what the name of the npm package for creating a progress bar?
is it string-toolkit?
It shouldn't be too hard to implement yourself though
hello help me please
explain your issue please
f
code : give money
@lone wyvern wdym,
??
db that stores money?
give money command
it probably wouldn't work anyway
^ lol
give money command
@lone wyvern we don't do spoonfeeding here
We can't give you code for you, but we can explain the logic behind something. You need to help us by helping yourself.
@lone wyvern You got to give money for the money give command

(for illegal reasons that was a joke)

@lone wyvern I'd love to walk to thou it
That's straight up spoon feeding
@blissful coral
Walking them thou it isnt
No
watch
Get args check perms store new money with
math
easy math
value + value
that's extremely vague
Who said it had to be good?
It's a channel for helping peeps ยฏ_(ใ)_/ยฏ
yo
sup
yea it took me a while to switch
you basically change everything
yes
and im not doing that
brain said. have 10 tokens
and switch
one person uses one, go to nezst
what
but that is cheating ish
so its in a cycle
tokens for what
im not doing that rn i got too drunk
Lavalink annoying af but better
bro what baoutn playing songs
it uses website scrapping
It gets the link
scraping is more of a double-edged sword
npm i yt-search
Imagine scraping 
no qouta
your on about fucking minecraft
I not sure if it scraps
on one hand a lot of devs only have that as their option, but on the other they may just block you. Anyway I don't think scraping has to do with this as they mentioned the youtube quota, which would mean they're using the official API
Kid?
makes my bot more unique\
wouldn't you just hit the quota again
bcs qouta doesn;t work like that
"Veiws" 
no becuase i get 10x the limit
10k x10
someonse work that out
1 trillion api
yea
doubt
1 trillion api?
1trill is alot
not enough api
pathetic
Just use yt-search
yeah 10x yoube api keys
or lavalink
BRO I DONT WANNA CHANGE MY CODE
i have servers
videos.forEach(function (v) {
const Embed = new Discord.MessageEmbed()
what the fuck is that @solemn leaf
videos.forEach(function (v) {
connection.play(ytdl(v.url, { filter: "audio" }))
});
bro if i sent you all my bot, can youn change it foir me
if you paid me
watch
deal lmao
But not gonna get bean
what is even going on with this discussion at this point
ill just get oyu nitro
๐คทโโ๏ธ
idk anymore
not the place to discuss this anyway
yeah different server
Ill ping you soemwhere else
general
pm if you wanna discuss this
mods will tell you not to talk about it there either
Yeah
lol
aki go general
they still will tell you to talk about it in pm's
discussing payment for stuff isnt really allowed here
you're saying your plan out loud
ez pz
probably a perfect idea
he said it fellas, im doing it
hold him responsible

be back in 10 ish when i cache all necessary queue streams
does anyone have any leads on how to begin coding a sticky command?
define a sticky command
ok so you use the command and it makes the bot send a message...but then I send a message after that...the bot auto deletes the message it sent and resends it...that way its like a sticky note at the bottom of the chat and is always the last message sent...it's mainly used for announcements or used as a temporary pinned message for channel rules
https://prnt.sc/uxfoar like this...if I would send a message...that embed is deleted and resent after my message
so you want a command that would fire and re-send its message to make sure its the most recent one?
yes exactly
js?
also I code in JS
d.js?
yep lol
as far as that goes, you will need 2 things
I've looked everywhere on github...npm.com...and google and can't find anything
I know you would have to fetch the old message ID, delete it...then resend it's contents
but I'm not the best at fetching and stuff like that
first, you'd need to store the message content somewhere
second, you'd need to listen to 'message' event and check if the message channel is in a channel you want it to be bottom most
to put it bluntly
map the new message + send it
on 'message' => if message channel = previous message { oldmessage.delete() message.channel.send(message) }
else => continue normal code
z
its better to store it rather than fetching it
ok I'll check that out
@fast trench i'll give you an example code, DO NOT COPY IT as it WONT WORK, this is the framework for your command
let map = new Map();
command => message.channel.send(embed); map.set(message.channel.id, embed);
bot.on(_'message' => {
if(map.has(message.channel.id)) {message.channel.send(map.get(message.channel.id))}
else {your normal code}
})
@fast trench
thats a REEEEEALLLLYYY mowed down, but it should give you a VERY BASIC idea of what to do
also remember that im biased in JS since im addicted to MAPS and FOR loops, there ARE better options, though i enjoy maps and for loops myself
you can use sets, arrays, or databases, it goes by preference
i enjoy maps due to their indexing nature
Does anybody know which intent discord.py requires
intents arent based on libs, its based on your code
I have literally been told so many different things
are you verified? which intents do you need? did you request priviledged intents? theres plenty of things to check on
its based on what YOU need
intents are the things discord sends you
first, is your bot verified?
I have been told so many times today that if I don't have it for discord.py the bot Will not work properly
if you require messages and guild changes, you can request to get jus tthose
And yes I am verified
I have not yet I don't even know what I need
it depeneds on what you want the api to give you, unless someone reviews your code thoghrougly , you should be the one to know that
are you using presence?
are you using member updates?
are you using voice updates?
you, as the owner of the bot, and as a developer, should know what your bot needs, as you are the one coding it
Which is the one that lets you see the users do not disturb online and idel
the intents you need is required based on YOUR needs(witch exemption from priviledged ones, whcih requires verification)
its like,
rather than:
GIMME EVERYTHING
you say:
Gimme A, B, C and E, i dont need anything else
intents is what you tell the api to provide to you rather than recieving everything
its based on what your code does and what you need
Where can I find what they are
thats why its so hard to give you a concrete answer
the dev page has them
what i CAN give you is a list of all intents so you see which ones you are using
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
Isn't guild_member one
like i said, its up to YOU which ones YOU ARE USING
I don't even know what any of these do
its highly optional, you could just leave them all blank, but its you'd have limited functionality
most imo are self explanitory
All I know is I have my commands don't work anymore
its based on what YOU use, the best person to say what you use, is, well, YOU
since you are the developer
what are those commands, what do they do.
what you could do as a patch to revert the changes is call all Non priviledged intents
How do you even unit test a Ping command lmao?
Me:
its a blunt way of saying 'gimme all you got' from the gateway
The main command that we're trying to get working is one that tells you what moderators are on and offline and it also gives you their status
iirc, thats privlaged info
that likely requires priviledged member update intents
which is guild presences
dont quote me on that though, i havent played with enough to know for certainty there isnt another available option to get a user status
if this is a small personal bot(which i think you said its verified so its probably not?)
You can still request all the mods info still afaik
It is verified and has over a thousand servers
or just get verified for the guild_presences
which i think the solution was to contact discord.
you likely need both GUILD_MEMBERS and GUILD_PRESENCES
just to be certain, request guild presences
request everything

and void as needed lmao
Yeah but I can't request it if I don't even know what it does and if I don't provide reasoning and code proving that I need it they won't give it to me
be a crackhead and just take everything
I'm trying but they won't
correct, you need to prove you need em'
give an example command that says you need that specific intent
I think the link explains it very well.
https://discord.com/developers/docs/topics/gateway#gateway-intents
So I have presences rn then I need to apply for
you said you want to show the status of members, in order to receive status updates, you need GUILD_PRESENCES, without it you dont receive any status from anyone
^^^^
remember when discord had a flag for more emojis in a server
Yes I know I need that one now
Tim likely knows a lot better than me in that regard, like i explained, i havent played enough with guild intents yet
Ok
no idea, havent had one for 6 years
6 years? damn
Lol
Tim is too smart for a gf, not many of them can keep up with his superior knowledge
I think I need to go through and see what commands don't work
LOL

it can be a bit hard to know if a command works just running it sometimes.
If you run a command in the test server, and the bot already cached everything from other sources, it still will work.
iirc presence data is sent with message events(tim correct me if im wrong) so if your the only mod, and cached it may work.
presence data is sent with presenceUpdate events only
yeet everything to the voind
i stand corrected
I dont think it being priv really helps
ever since i started coding i wondered about sketchy shit that could be done with datamining it, so i think its fair only verified and accountable bots have access to it
So if I have a command that deletes a channel I know that is an intent which one would it follow under presences or or the other one
i forgot how to spell privilaged privalaged privleged? idk im drunk aparently
I feel like to reliably delete channels without error you need the GUILDS intent
@outer niche intents are not about what you can or cannot do, intents are about what you receive
Discord itself isnt selling your data to third party apps, so shouldnt bots
since the channel could be deleted
Ooo ok
you wouldnt know
in order to receive messages, you needs GUILD_MESSAGES
So if the bot needs to receive a message it needs guild messages
one thing discord is, is that its transparent with users
though they get a lot of uncalled for shit they didnt do
got nothing but respect for em
discord bought by facebook when
So if I have something like what is the message you need to send to the developer is that guild message
isnt facebook potentially getting sued for being too big
and might have to break up the company(instagram and some other sites)
facebook is threatening to leave europe over new regulations (that forbid companies to sell data to the US)
lmao
dont abide by the laws? fuck off
So if I have a message that's coming from the guild I need guild messages
yes
yeah
So safe it's asking me for a message that would count
you should likely request both from what i understood tbh
theres only 2 priviledged intents as of now
Yeah but I'm trying to find one of my commands that needs the second one
guild MEMBER?
Yes I'm trying to find a command that would fit into that
wouldnt caching be a valid excuse or maybe voice commands?
do you have a welcome message? when a member joins
you'd need to listen to guild member updates for voice
No tim
you only need GUILD_MEMBERS if you use guildMemberAdd, guildMemberRemove or guildMemberUpdate
or if you use fetchAllMembers
What type of command would be used for guild member update
send a message when a user changes their username or nickname
send a message when a member role is added/removed
wouldnt my case apply for when a user change state over voice?
Well I have that
send a message when a user joins/leaves a guild
I have a command that will add roles to member
no not that
Oo
a command comes from a message
you dont send an auto message if someone changes their roles
True
tim, what about voice updates?
So it's stuff like audio messages
So stuff like voice updates and voice messages are what guild member uses
for voice you need GUILD_VOICESTATES
hmmm interesting,i assumed the way d.js handled it would be with members
since it brings new and old member states
should i normally ignore dm commands
voice states do include member data
yeah i just checked the type declaration for it

thats interestintg
i assume it'd come packed with member
as voice updates is partial of member status
@solemn latch when a guild adds/edits/removes an integration
I don't know if I need the second one because I don't think my bot uses any of that considering I don't even know what it is and can't figure it out lol
stuff related to oauth2, twitch, youtube, acounts, etc i believe
yeah
๐

i go sleep
Gn
gn lads

So if I'm gathering server info for a command do I need a intent For that?
Or user info
@opal plank ^
erwin
i dont remember the back of my head the intents for everything
I got nitro again
nice[
what do I make my pfp
#general though
@outer niche depends on how you do it, if you getting it directly from the API, none
like i said, you should only concern yourself with priviledged intents for now, unless you REEEALLLLY optimizing your code
which i assume you arent
I have just requested that one
no, like i said, its only related to priviliedged intents rn
you can request all other ones withoput a problem
priviledged means, only verified bots
so, you neeed to request them on verification if you need em'
I'm pretty sure my server info command needs it because it only says one for online members and the amount of members
Tim would be a much better person to tell you about that, im aware of my shortgivings, and intents is one of those
And he went to sleep
indeed, its probably best to wait for someoen with the same experience as him to get you an answer
Ok
thats a field im not too keen/comfortable with to give a definitive answer
i CAN give some general instructions, but im not gonna rule something that isnt part of my knowledge
The way I determined what intents I needed was by only enabling one i knew I needed.
Went through each command and checked if it worked, if it didn't I would find the intent by looking at the list and add it.
most of them are self explanitory
i just got everything and about to ask for intents
i got the clyde message about a month and a half ago
but i keep leaving guilds due to their inactivity
so i dip down below the 75 guilds often
im not interested in low count servers[
my bot is for streamers, if you have a bot hell, im not interested in it, sorry
do i have to put something here?
you dont have to, but youd be wise to
also
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000, autopost=True)
what about webhook_path, webhook_auth
website/path
path can remain default, you can change it if you dont like it
auth is the password
^
to make sure the request is coming from DBL and not some other website
you can just spam random letters and copy paste it over tbh
its one extra security measure
yeah, the same one in the webhook_auth as that box
how to i get the data who voted the bot
so i dont need to do anything?
it will send it to the listener as shown in the docs
import discord
import dbl
from discord.ext import commands, tasks
from dhooks import Webhook, Embed
import asyncio
import json
class TopGG(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.token = f"{self.bot.top_gg_token}"
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='my_password', webhook_port=5000, autopost=True)
@commands.Cog.listener()
async def on_guild_post(self):
print(f"Posted guild count: {len(self.bot.guilds)}")
@commands.Cog.listener()
async def on_dbl_vote(self, data):
print("Received a test upvote:", "\n", data, sep="")
def setup(bot):
bot.add_cog(TopGG(bot))
im testing it but nothing is posted via webhook
yup
if this is running at home youll need to port forward
let winner = m.reactions.cache.get('๐').users.cache.random()
TypeError: Cannot read property 'users' of undefined
why this hapen 
if its on a server it needs to be let past the firewall
currently im hosting it at home ill update on vps when it will be done with it
okay, then youll need to portforward it
windows has a firewall too if your on windows
so itll need to be let past that
port forwarding depends on your router
its diffrent for every single one
letting stuff past the windows firewall youll have to google, I havent ever done it tbh
so ill just leave it
will it work if i update on vps now?
or on vps also i have to do that?
so ill let it be 5000 only
5000 is perfectly fine.
https://top.gg/api/docs?#webhooks
in the data format section
Woo
hello
What is your main programming lang?
js
Ohok
I'm not sure, not a py dev tbh 
was hoping shiv would magically know someone has a question about his lib
I just want to make feel good and relaxed




