#development
1 messages · Page 1094 of 1
C# has some interesting things like Interfaces and abstractions though
Delegates, funcs, actions and other lamba/linq
Which are seen less in some other languages
funny thing is i started to learn GO and py a little bit but never got into it bcs my bots are written in Js. (also had some issues with getting a GO enviroment running for development)
If you want to see how similar JS and C# bots are, here's the tutorial I watched for a C# bot with discord.net:
https://www.youtube.com/watch?v=e2iaRVf4sho
Today you can learn how to make a simple Discord bot using the Discord.Net library/C#.
Project GitHub: https://github.com/Inspectiver/TutorialBot
Discord.Net Github URL: https://github.com/discord-net/Discord.Net
Discord Developers: https://discordapp.com/developers/applicati...
time to learn C#
Ye
So writing a privacy policy kind of thing for a bot is necessary or Optional?
will be required
is not that i need to throw it in my brain together with extensive kowlede in G-Code, Docker, K8s, Linux Stuff, Windows Stuff, Networking Stuff, Useless Stuff and the languages i know
Which langs do you know?
Oh got it
well know lua and js. some Py and Go. Then English, German and some Dutch
@gilded plank bots 180112943612952577
also G-Code is some sort of Programing but on a way lower level and completly different usecase
I know js, frontend stuff (HTML and CSS) and C, and I wanna learn the other 2 C langs and py
Go for C#
ohh right forgot that i learned some HTML and CSS
Eyyyy
Also ejs it counts as a separate lang because of the file ext jajajajajajajajajajajajajajaja
Knowing C# means you also know Java for the most part
oops
I've heard that yeah
@gilded plank bots @west quarry
I can't see I'm on mobile ajajaj
I can't see and I'm on PC lol
Eyyyyyyyyyyyyy
any suggestions on what net core version? would go for 3.1 then
guys
I literally only downloaded VS to use C# lmao
how can i press the middle mouse button in python
Um
Keycode
@west quarry @earnest phoenix keep bot commands in testing channels please
i copied someones code that uses selenium and chrome extension so i have the somethingsomething.click
i can click but i don't know which makes the middle mouse button click
That's one way lol
i want to open something in new tab
Selenium probably has that ability
"I copied someones code"

No
lol
You are very not right
@west quarry @earnest phoenix keep bot commands in testing channels please
ok sorry
@faint prism what should i google to see the click etc. commands
Don't google
the only time I don't write my own is when I'm learning someone elses library for the first time
You gotta feeeeeel the code
lol i only know begginer level c++ rn
so im bodging in the meantime
will learn python js c++ thoroughly tho
https://pythonhosted.org/pynput/mouse.html @ashen shard
thank you auger
Learn from the examples, but write your own code.
im not sure which channel to ask this in but is heruko free?
Yeah
oki ty
sorry my bad starman
@faint prism profile_btn.click() is this usage correct?
yourSeleniumDriverInstance.click() would probably be a left-click is my guess
yes
I'm sure there is a mm btn click function somewhere in the docs
Are you using the pylib I sent or selenium?
well the program i downloaded was originally using selenium, i just wanted to make a few adjustements
so selenium
but can't i use both?
I'm familiar w/ selenium but not the lib I sent.
Selenium is a webclient driver. So most of your interactions in a chrome tab should be handled with it alone
so what do you recommend to turn profile_btn.click() into profile_btn.3rdbuttonclick()
Define the 3rdButtonClick() as the third button click code
So if selenium doesn't contain a middle mouse click, the docs say you can create your own via ActionChains
https://selenium-python.readthedocs.io/api.html#module-selenium.webdriver.common.action_chains
So maybe something like: ActionChains(driver).key_down(Keys.MIDDLEMOUSE) Idk if that's a valid entry in the Keys enum though, just a guess
@silver fiber
@slim robin 😳
Why are you using selenium though. Is it for a bot?
If so, I recommend adding options.add_argument('headless') so a window doesn't pop up every time
outras linguas em #memes-and-media
tenha modos
That's kinda rude
(thx dice)
@lyric mountain Ok, mais quem é você ?
@faint prism it is for a bot
kkkkk lmao
(np KuuHaKu)
@silver fiber
alor


se saia verme
Gettem erwin
😳
Omg
se tu nao for pro #memes-and-media vai tomar ban
vai que tem staff br aqui
👀
Lmao
20 upvotes 🥳
Gggg
I think that falls under mini-moding
It does seem to not follow rules 1, 3, 6 though
*pings atmod* he's not speaking English
Bruh wtf is this chat today?
Other languages
Ads
Random shitposts
like what the heck?
.catch()
throw
I know js, frontend stuff (HTML and CSS) and C, and I wanna learn the other 2 C langs and py
theres basically C & C++, but yeah C# is included.
Knowing C# means you also know Java for the most part
you dont need to
It's an added bonus
h
Top.gg is best
it got my bot added into 40+ servers
In 2.5 days
It's now in 115+
Where should I host my bot? Currently self hosting in a VM.
Dm me
there are some good VPS hosts
any vps should be good enough
just dont get a Free one they suck
I mean, SSH and SFTP is all I need
Dm me because nobody loves me and i need friends 😔
How would I go about actually reading the current discord js version ?
I mean, SSH and SFTP is all I need
@faint prism tl;dr: get a vps
Check your package.json
ok ok, lol
yeah that would be the easiest way I guess
was trying to make an info command with ping etc
Any recommendations is my real question
I like galaxygate
contabo is cheap 'n good imho
Not aws?
DO is expensive af
not really
Where can i host my express.js server?
Vps
DigitalOcean Gang
🤔
i know other that are more expensive
DO: $5/mo
Okay coolio
contabo, ovh, galaxygate, google compute engine, amazon aws, vultr, etc...
ramnode, vpsdime, scaleway
@pure lion i recommend using LOC
i dont like ovh. Had a Root server there a few years ago and the Firewall was annoying
upcloud, digital ocean
yeah
if ur code is efficient, u should be able to host ur bot & dashboard there until its like in 150 - 200 servers no problem
Oh I have a bot host already
LOC?
lol i guess i can run up to 1k Guilds with my current host
oh
But I can't find the IP lmao
ohh right you got the Docker Container
Got a link for LOC?
well yeah, superbrain. LOC is free.
Yeah 
DM me
free Hardware has always a Downside
Dm me because nobody loves me and i need friends 😔
@pure lion
I am your :)
im not tryna advertise or anything, their website is down
What is this LOC
yeah
actually i know a host who offered a VPS for 1€/Month when they rebranded themself
a code related community, augur
leauge of Oregon Cities?
lac and loc ma'am
Maybe I'll just buy a cheap server to host myself lol
yo those aint cheap
I've hosted before, power consumption was really the only thing
then feel free
if you have 1-2k$ spare buying a used Server is a valid thing
And I'm thinking a raspb pi 4
then just rent into a datacenter with it
super underpowered though
if you have the money for it, why not
raspberry pi is interesting
im paying $3 a month for my vps lol
galaxygate looked pretty good tbh
just in different parts of the world
i guess my ecosystem is way to large for a bot of my size. like i have 3 Dedicated database Servers 1 Dedicated management server and 1 Production Server
im curious what would happen to the sharded connections
how big is ur bot?
im trying to fit as much as i can on my vps
200 Guilds
because i dont wanna pay more
how much storage do u use, tim?
@lusty quest do you use a server cluster?
well ur biggest bot not u lul
the Database is running MongoDB in a Replicaset
arial, roboto, etc. are good for websites
i'd just use localhost on ur db so it doesnt take space away from the mongodb thing
cOmIc SaNs
instead its using ur vps' stuff
Good call
it was using around 1gb because of user generated images, but i reworked it to store only the generation instructions
now the database is like 15mb
nice
That's a solid optimization lol
tf
roboto is sexy af
@lyric mountain YES
15mb storage??
btw, remember to specify more than one font
use roboto or arial then
I think you can add a fallback option
Trebuchet MS is best font
Consolas is
comic sans :^)
roboto ugly periodt
roboto is so overused in design and apps i get sick of seeing it
new times roman scares me
sunglasses is nice
Is it possible to get vote updates without webhooks?
to reward users on voting
well, yeah, but it's not the font's fault
sunglasses is nice
@digital ibex that's roboto bold
Heem yes, there's an endpoint to check if a user has voted.
oh
but I recommend using webhooks if you want it instant
all of those are roboto
use webhooks for this
@sudden geyser like when a user vote, he gets rewarded
not in realtime, you will have to check for votes periodically
if I use webhook, where do I get the webhook pass?
with the webhooks you get a call that contains the userid of the user that voted
if I use webhook, where do I get the webhook pass?
@earnest phoenix you set it to whatever u like
you could use the word "cat"
or dog
webhook pass is a random string you generate
oh
that pass is returned to u in the http request
thx
how do i check if a member is messageble in discord.js
so you know that the request is coming from dbl
try and send a DM if it fails catch it
messageable?
message.author.send(content).catch(err => {
Message.channel.send('could not send this message')
console.error()
}
message.author.send(content).catch(err => {
Message.channel.send('could not send this message')
console.error()
}
better
ye
How do you send your discord msg in a block like that
```lang
code
```
```language
code here```
Oh snap
how do i make it so that way if it catches it, it sends that msg, but not the other one?
(my code btw)
Replace what the catch does
wym
Instead of just logging, call another function
lemme see if I understood: you want the code to break if it catches an exception?
that "sends that msg, but not the other one"
use .then
can i have some context i woke up maybe 10 minutes ago
@karmic compass console.error() ????
logging
how2avoiderrorswhencatchingthem101
.catch(() =>{}) there we go no more errors
try { Thing(); }
catch {Log("I don't want this. Take it back!"); throw;}
im tryna basically do this (just as cosmetic for context)
message.channel.send('woops')
} else {
(do this)
}```
try
{
if (what = thehell)
{
throw SpecificException;
}
}
catch (SpecificException)
{
}
if i put in the catch "break" would it not send the next msg?
so .catch(err => { message.channel.send(':mailbox_closed: This user does not have their mailbox open!') console.error() return }) would techincally work then?
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});```
here vote.user is id right? or the mention of the user?
You have some small sizing issues sometimes
🤷
I dont think a single word can wrap
Nope
Guessing you have a left margin that's a minimum size
Below a certain screen size it can be removed and just center
Other than that looks great
Login system isn't complete, but im sure you know that
The text element can resize to a minimum based on view port
@faint prism thx for recommending C#. its pretty easy to understand even if you used js before like the basic syntax is pretty similar.
helo
js is ass mmLol
any idea how i can move the make the divs be in the middle?
thats what it is now
im using css grid btw
margin: 0 auto
kk
i think
@lusty quest
No problem, if you haven't seen the ML.NET yet. You'll need Visual Studio and it actually scaffolds out a ML project for you based on the training data ready to go
do you have a wrapper div for it
I'm trying to make my bot react with a custom emoji from my bots support server, That reacts on other guilds, How would I make my bot do that
library of bytes that = emoji?
before i get into ML i write a bot with C# so i can learn it more
Sure
same way you would in the guild the command is ran in @still merlin
but guild = clinet.guilds.get('guild id')
and yeah @valid frigate
it doesnt change with margin: 0 auto :/
im using css grid
still
this iw what i've got now: css display: grid; margin: 0 auto; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 100px; grid-gap: 10px; margin-left: 13%; margin-top: 4%;
oh ok
doesnt change anything :/
~~ yeah ik i've got margin and margin ~~
no buli
true
o ok
the order you place them matters afaik
it does
i was saying "yeah" it was being overridden by the bottom 2
KuuHaKu is saying that order does matter
it was at the bottom tho
wait, no
try using flexbox
i fixed it by
and i'd not recommend using absolute units for margins and stuff
removing the margin: 0 auto;
.b-container {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-auto-rows: 100px;
grid-gap: 10px;
margin-top: 30px;
}```
and i'd not recommend using absolute units for margins and stuff
else you might get something like discord
lmao
even if i just want a little bit?
depends, do you want it to always be 10px away from the top, independent of screen size?
if you want it to adapt to screen size, use flexible units
oh
😘
what??
oh
so basically 10% of screen's height
remember that % is based on the current parent, while vh/vw is based on the actual screen
oh
the other flexible units
vmax and vmin are exceptionally useful when you need to take the max/min value between screen's width and height
Some CSS help required... how can I change the src of an image through CSS? I found this:
https://css-tricks.com/replace-the-image-in-an-img-with-css/
But trying it didn't work on my bot page. I want to replace my bot's image on the bot page with one that's transparent in some places (so it works well with DBL's night theme)
I tried ```html
<style>
div.bot-img img {
display: block;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: url(NEW_IMAGE_URL) no-repeat !important;
}
</style>
they are working for me
whelp
Discord has disconnected me on the desktop client today like 2 times already
and I mean connection drop, not a logout
i go to applications
and then it works for some reason
no idea what just happened there
Does anyone know how i filter users that has a specific value on true from MongoDB? JS
Small hiccups on Discord's side probably
ty
nvm
i keep getting a ilegal break statement in my code 😔
switch (args[0]) {
case "poll":
if (message.content.startsWith(prefix)) {
if (message.author.bot) return;
const pollMsg = args.slice(2).join(" ");
if (!pollMsg) return
message.channel.send("**error** you can't create a blank poll!")
let pollEmbed = new Discord.MessageEmbed()
.setTitle("New Poll @everyone")
.setColor("#ff7f27")
.setDescription(`${pollMsg} \n Be sure to vote!`)
.addField("Reactions", "👍 Yes \n ➖ Not sure \n 👎 No ")
.setFooter(`Poll created by ${message.author.tag}`);
message.channel.send(pollEmbed).then(messageReaction => {
messageReaction.react("👍");
messageReaction.react("➖");
messageReaction.react("👎")
message.delete()
break;
does anyone know how I can stop this from happening
thats not a switch statement
oh i never saw the top bit
i believe thats happening because of the returns u've got
change the returns to break
i think
What returns to break it- I'm a bit confused
is it not because breaking in the wrong spot?
outside any if statements
change return for break
What return though?
Sorry bit confused you want me to change my return too "break;"
i dont see why returns are the problem 🤔
return just means stop doing whatevers going on
and i've never had it when using return, so no idea
break stops the code from running whats underneath too
Exactly what I want to do
no idea then, im just suggesting it because its worked for me without getting that error 
not using break
but in my switch statements
break, afaik, can only be used in loops and switch cases
Wherever I put the break its still giving me ilegal break statement
yeah my bad 😓
I went back and looked at some other code and I fixed it, Sorry for the waste of time
is this rust
py
there are lots of sleep methods just this one is inbuilt so that is cool
and yeah, async
yo thats crazy
would be quite bad having to wait for somone elses command in another server to resolve before your one started ahahhaha
que
what problems are you encountering
does anyone know how I can run my bot 24/7 for free? Heroku recently changed their policy...
you cannot
from dapi:
How can this be
Is there honestly no where that you can run a bot 24/7 for free
I mean that's insanity
it costs money to maintain a vps
if everyone offered free hosting they would be immediately out of business
it's insanity that people dont want to pay for something for you?
do you let people remotely access your pc?
VPS is basically a computer that stays up 24/7... maintenance isn't easy and there's good reason it costs money
@ruby elbow there is , you could use an online ide
I am not sure if that is against the tos
Ok, I'll look into it
someone has to pay for the resources spent, it isn't insanity, it's called "you're a cheapskater"
It is insane, because having a free plan is a good business model, and 2 major services have been doing it for years up until this past month. Right when I decide to make a bot
those services aren't major in the slightest LMFAO what are you talking about
major services are aws, google cloud and azure
yeah, but they aint free
he is talking about free stuff
google cloud is not free
it is cheap
they have free trials
tho
They're partly free
because people pay
still doesnt deminish the defenition of major
xD
in summary, it's not insane; it's necessary
who cares about the definition @ruby elbow so which 2 services were you talking about?
which 2 major services?
@midnight blaze heroku and glitch
btw Pang dm me about the IDE I have a question
inb4 it's repl and his token is leaked
repl has a horrible reputation though
so did glitch and heroku for bots
rep for what
Glitch worked perfectly 24/7 for free for years
no it didn't
for me it did
glitch is horrible anyway for serious bots, because it only will handle small projects, unless you pay for it
depends. Is it your code?
My friend had a bot in over 500 servers and it used glitch
it was online 24/7
for free
or were you writing it at 3 am
my old code
Probably because you didn't document it // use comments
¯_(ツ)_/¯
Use comments to describe complicated stuff or what something may mean if it doesn't make sense at glance
it was online 24/7
@ruby elbow glitch breaks like every week until they banned pinging
it does not matter in how many servers the bot is in it, but I am talking about the possibilites a bot can reach. If you use canvas/collections and other stuff, your bot is going to eat a lot of CPU
doesnt the more servers that the bots in run more ram
@ruby elbow glitch breaks like every week until they banned pinging
@celest schooner It didn't for me
yes, ofc
Pang dm me
i highly doubt that bot stayed up 24/7 "for years"
but I am not talking about that, I am talking about bots that get complicated and need more cpu
Of course there was downtime, but nothing significant
w/o considering the numbers of guilds
which IDEs were you talking about before
you were misusing their services anyways, heroku and glitch were never and aren't meant for discord bots but rather for small apps and websites. because of so many people misusing and abusing with pingers, they had to take action and start banning such behaviour
Yeah, ik
yea but glitch embraced discord bots until they broke glitch
How else do you expect broke small time devs to do anything
get a temporary side job
I'm 15 years old mate
ok
old enough to be employed
its 3 dollars per month
Not old enough to have a job
^
ive worked my ass off in retail at 15 and 16 but ok
Even if some places would hire me, I don't have time
All the money I make I invest
I've been watching the NYSE since 13
you can also freelance so there's no excuse
I live in Italy at the moment, with little Italian so yes there are excuses
i didnt ask
well you can do online freelancing
You don't know the first thing about me or my situation so don't tell me there aren't excuses
you can freelance online ...
...yes you can
You want to hear why I can't?
freelancing became a thing online
I made money but my parents dont let me spend it lolo
oh yikes
my parents let me spend my money however i want at this point
i rarely ask for their financial support anymore
that's what I thought, so don't tell me what should be able to do if you don't know what my situation is
i said what i said, point blank periodt
cut it out
...but you did ask
I didn't.
all of you
did you not read what the mod said
I asked. You gave an answer that was so far from what is possible in my situation. Then you say you don't care.
If you want to continue this in DMs go ahead, but don't be a prick and try and get the last word in
mute away
@earnest phoenix
;-;
@earnest phoenix I finally managed to program it.
Is there some special way to rename files so that Git sees the updated file name or am I miserably fucking it up without realization? 🤔
They didn't, actually
git add doesn't seem to do anything noticeable
git status doesn't show any changes, at least
!play the box
-botcommands @trim flax
@trim flax
Hey! Bots aren't given permissions to send responses in this channel. Please use #commands or #265156322012561408 to run commands. In addition, bots with commonly used prefixes cannot read or send messages in any channel. This is done to prevent spam and bot abuse.
It took hours for me to figure it out lmao
hey shiv, is there anyway to git add . automatically whenever you commit.
@earnest phoenix Instead of it being a command it is now automatic.
I found it easier that way.
client.on('guildMemberUpdate', update =>
@crystal socket The only thing I can think of is a bash script 
sounds good
there are some nice tools like git kraken
Suit yourself
you always want to git add . when you commit?
is there any way that I could make my userinfo command alot more efficient?
I have to fetch all members to make it work
Do you cache guild members?
-
If the user passes a mention or text that looks like a user ID, look in the cache to see if you can get it. If not, try parsing the mention to get the user ID (or use the user ID you already got), then send a request to Discord asking for the guild member by ID (there should be a method for it).
-
Look in the cache to see if you can find the user by name/tag/nickname/however you want it to. I wouldn't try fetching all members to search by name and instead rely on the cache.
Really, it's up to you to decide how to implement it. I'd avoid sending a request directly.
all id's are cached right?
no
hm
Are VPS and VPS Hosting the same?
So can I build a Web using ordinary VPS?
technically, a vps is the thing, and vps hosting is the company who sells the thing
but its basically the same thing
you can do anything with a vps
its like having a second computer
except that its not physically near you, you have to access it remotely
So, how to configure the VPS IP to an URL like http://this.is.my.ip/
Probably at namecheap
So regarding my issue with files not being updated, it's fixed... somehow
Self solving issues
I re-cloned the whole thing and renamed stuff
how i can use the npm yt-search?
read the docs
Point the domain at the vps ip
@solemn latch ok lemme try
You have to buy domains
@solemn latch I already have at namecheap
Just create an a record pointing to the ip.
If you want www to work aswell, you can add an a record for that aswell
I run my webserver off my pi lmao

Just don't hack me
:D


why song.title say undefined?
let videos;
yts(args.join(' '), function (err, r) {
if (err) return;
videos = r.videos[0];
})
let song = {
title: videos.title,
url: videos.url,
time: videos.timestamp
}
@earnest phoenix are you running that async? it's trying to define song before the yts function could return
^
Does anyone knows how i remove EVERY reaction from a message
message.reactions.removeAll() for djs12 or message.clearReactions() for djs11
Are VPS and VPS Hosting the same?
@solid falcon
Oh boy, I get to use my favorite similes:
One is like porn, and the other is like PornHub
Im working on my website bot dashboard and im tryna implement markdown support to the changelog editor how would I do that?
use a library that does it for you or a whole load of regex and/or string manipulation
What library is that?
youd have to find it, theres bound to be one
I dont know what to search
"Markdown Parser HTML"
idk where to ask it but how do I do this reaction thing (its not a discord bot)
it says its a bot tho
It’s a webhook
Webhook
with reaction?
ye
how do I do that
I don’t think webhook can use reaction
I used it before but i dont recall
You had to send raw payload with token
Iirc
They can
Its just undocumented bits of the api
I dont think that was all though
Iai
so it turns out digitalocean has a $50 credit for github students
so i applied
and today i got in
and then i realized that you need to create an account to apply the code, and you need a credit card for that

fuck
why even have a credit for students when ur gonna require that
lots do that. take aws for example
75% of the github students users don't have a credit card or a paypal account with $5
i thought you just need an aws educate account
¯_(ツ)_/¯
under 18?
16 year old here
oh wait
im stupid

i did not see "debit"
but yeah my parents dont trust me with a debit card
credit cards and debit cards are interchangeable
where do u live where they give u debit cards at 15 or 16?
uh
isnt that like
you can get them at 14
a bit too early
🤔
not where i live
gosh no, you can drive, you can handle spending your own money
15 to 16 is 14?
🤔
you can get them at 14
well, you can drive a tractor on the road at 13 technically, so yeah
i guess
14 aswell
tf...
wtf
when ur 16, u've got to be someone who has a full license when ur driving until ur 18
18+ u can drive
actually where i am
england isnt even that bad
germany has dumb crazy driving laws from what ive heard
4+ years of permit min, some like 30x my states driving permit time for adults
wat
Does anyone have a good idea about how to sync a database between two python scripts in real time without using too much read writes to the disk. Because currently it's writing at least once a second and I think i can just commit before a read happens but I don't know how I would go about that
Reduce disk usage
One is for my webserver one is for the bot
what does the web server display that needs all data from the bot?
wouldn't you just write any relevant data to a db or cache
and have an API to access that?
Well I guess those are the things I'm asking for with this question
I suggest you cache your data somewhere in memory
with a tool like redis
if it's high-write
otherwise just write it to db
and then have an API access wherever you store that data upon request from the frontend
I have a small API script thing that has all the db stuff in it already so I'll look into the redis thing. It's a shame that the database tool can't have a memory database shared between processes otherwise it would be an easy thing to fix
where does it say the requirements for getting your bot approved
oh
well i look like a clown for not reading that channel dont i 🤡
also, generally speaking your bot should be up nearly 24/7
and #mod-logs helps for seeing the most common reasons bots get denied
ah i see
my bot is normally up but i have to take it down on my VPS when im editing the code
i get scared every time i do that because what if they're reviewing my bot
😔
Anyone know why this error shows up
DiscordAPIError: Missing Permissions at RequestHandler.execute (/home/runner/FP-Bot/node_modules/discord.js/src/rest/RequestHandler.js:170:25) at processTicksAndRejections (internal/process/task_queues.js:97:5) { method: 'post', path: '/channels/689969083705196564/messages', code: 50013, httpStatus: 403 }
it has send messages perms on the channel
clearly not.
it does
That will only show up if you dont have message send perms to the channel with the id 689969083705196564
well it did
I double checked
both its role and itself had the send message perm on that channel
It also has read perms?
mhm
idk any other reason that error would happen ¯_(ツ)_/¯
(╯°□°)╯︵ ┻━┻
Even tried to give itself a bot role and did the perms with the channel and same error ¯_(ツ)_/¯
hi how do u make my bot open 7/24 open
host it on a good vps
would I run in to problems using "s/" and "s " (s with a space after it) as prefixes for my bot commands?
what lang?
I mean usage problems, like maybe that conflicts with too many others
but I'm writing in Java
s/ and s isn't that much used
maybe just use 1
but i mean the most common prefixes are ! and / so you should be fine
I personally like the one with the /, but it's easier to say "s " on my phone
alright, thank you
yeah i think s/ is nicer. gl on bot approval!
Hlw anyone else
Hlw
why is this command not working for me? [link removed]
the bot is wokring okay but the command gives a error
regen your token
and what's your error?
also tf is this https://oliy.is-just-a.dev/3cbknc_5290.png
it's og tags
Wouldn't this work just fine.... lmao
if someBoolean and anotherBoolean:
Wait that's the same bool
Also, you just posted your token @crystal socket
You had better revoke that ASAP before someone else uses it
yw
Could someone help me solve this? Not really good with ReferrenceErrors. 😄
in order to get a message, you need to have a message event.
you also need to login
Hello. My problem is that When the bot does not have permissions to chat in a channel, he gives an error. It doesnt effect anything or shut the bot down. but it annoys the hell out of me.
How else am I supposed to catch the error and just make it go away?
you can check if the bot has permission to send messages in channels before sending them
Well he does
just not that one channel
it isnt a global permission. it is one set by the channels
I tried the check permissions thing. it didnt help at al
if (channel.guild.me.permissionsIn(channel).has(['SEND_MESSAGES', 'VIEW_CHANNEL'])) return
this code returns if you dont have send or view channel perms
! will invert it
you put it in the middle of an if else block
That's correct, just you don't need the else { after that
also its not something you can just directly import.
channel wont be defined, message.channel will.
And the last }
Yes, the ! makes it so that if it doesnt have permissions. then it returns. else it runs command
right?
In theory yes, but you don't need that else {
How do I create a Message Event for the trigger word?
And the last }
return means stop 🤔
Awesome
So that's the correct thing to do to avoid the error
It works
but euhm
it also stops it from editing the database.
Fixed it
this is what I did
yes
Not with og, I think it uses the pages theme
Not positive on that
I know that you can though
client.on("message", message =>{
if (message.author.bot) return;
if (message.content === `${prefix}img`) {
message.channel.send("**Ok, Wait..**").then(message => message.delete({timeout: 5000}))
message.channel.send(attatchment)
how to make it delete ok wait
then send the img
Omg
In matter of 6 hours
My bot got added in almost 100 guilds
Wow
It's now in 199
Without bidding
@earnest phoenix ```js
await message.channel.send(attatchment);
bot.on("ready", () =>
bot.setActivity(`with ${bot.users.cache.size} members in ${bot.guilds.cache.size} servers`)
)```
this is not working
idk why
its bot.user.setActivity
@delicate shore sorry for ping but:
bot.on("ready", () => {
bot.user.setActivity(`with ${bot.users.cache.size} members in ${bot.guilds.cache.size} servers`, { type:'PLAYING' })
})
hopefully this should work?
can anyone help me out real quick?
i want to prevent this from happening:
it should just say the second one, but it says both of them for some reason
my code btw
mailMan.send is probably async
i have client.on('message', function(message) {
how do i prevent it from saying the lower one + top one
i was told return would work
You'd have to await mailMan.send or .then()
Return does work, but its returning after the second send because promises.
would:
sdfjksldfkjslfjsldkjf
}))
sjfslkdjflksljlksfkl
``` work?
or what do i put in the .then ?
@solemn latch (read two messages above pls im depsperatr)
.then(m => {
}).catch(err => {
});
@delicate shore sorry for ping but:
bot.on("ready", () => { bot.user.setActivity(`with ${bot.users.cache.size} members in ${bot.guilds.cache.size} servers`, { type:'PLAYING' }) })hopefully this should work?
@karmic compass thanks but i did with another way and it worked
alr
@solemn latch still does it, this is what i put. any final suggestions? (sorry for ping so much, you're epic)
use return
okay my current issue
is that
the HP inside the collector
is not being read as the same HP outside
which is why its being set to NaN
How can I work around this?
my brain is large
moyai
send ur code
Then runs after doing something
So you want your confirmation message in then
return message.channel.send
The problem is returning in a promise doesn't work until the promise is resolved @digital ibex
Which his confirmation message was being sent before the promise resolved
ay, it finally works, ty for the helpers
wait
that was amazing grammar
alr cya
👋
I tried setting up a slowmode command where i wanted to detect whether the arg given was an integer or not. Why doesn't this seem to be working? It's not detecting it as a non-integer when i type a word as the slow time
if(Number.isInteger(slowtime)) return message.reply('Please provide a valid duration.')
anyone know what permissions are needed to create integrations?
Hi, does anyone used Google Classroom API?





