#development
1 messages · Page 380 of 1
@earnest phoenix it can't find that emoji
Thanks everyone
change :thingy: to the ID of the emote
Or use the unicode symbol for it
\👌
\💩
You're \💩
dont tell me its a sa response
I think it is
if anyone here uses postgres ive got a question
right now the way i have my database laid out is i've got a single structure that starts/handles the database so that my models can use it
this is what one of my models looks like
const Sequelize = require('sequelize');
const Database = require('./../../structures/PostgreSQL.js');
const SettingsModel = Database.db.define('settings', {
guildID: Sequelize.STRING,
//blah blah more stuff after this and then i'd export this file
and i access this model by requiring it in a command/structure, however i've seen people use import (like this https://please.zbot.me/QCyEYgiQ.png ) and i was wondering if it would make any difference to switch over from requiring a bunch of models to just importing them all?
it doesn't actually its just another way of doing it what looks a bit cleaner afraik
@earnest phoenix You must put the emoji itself
And then save the file as unicode, if it is not in unicode
message.content.includes or message.content.indexOf, whichever you like
what's swears defined as
what's in the file, what kind of structure is it
then you're not doing it right
..? 🤔
you didn't use it at all
okay
IDs are uint64
not in js

npm i bigint64 :^)
Natan pls
discord py switched to ints in rewrite version
#IfYouComplainAboutSupportingFeaturesThenBlameJavaForNotBeAbleToOverLoadStuff
but you can?
Since when can you overload operators?
you can overload methods
it's still overloading
technically the java bytecode allows overloading with return types
int a(int b)
long a(int b)
But not operators for some reason
are different methods
because they learned from the abuse that became c++
<< for writing to streams
for reasing
Hey you could only take the good parts like C#
reading*
when used correctly it's a nice feature
but people often misuse it
and shit becomes hell
for eg, math related stuff operator overloading is useful
Same you dont need .addTo() .subtractFrom() etc.
because a + b is more readable than a.add(b)
yea
but when you have << writing instead of bit shifting
it makes sense why someone might not include it
Can you make custom events in node.js
"custom events"?
Yes
yeah
you can even just throw an object at that point with those args

What are you trying to call inside a function inside a function?

@earnest phoenix
okay
so what I'm doing is this:
function Lib() {
function getAccInfo(accid) {
// some code here
}
}
Js Objects?
wait a sec

@sand roost thank
ik
ok
let lib = {
getAccInfo: function(accid) {
// some code here
}
}
ok im going
@earnest phoenix that seems fine
I mean yeah you could do that
You could maybe look into classes too
depending on your level of understanding
Who?
Fire
let yes = () => {
return {
yes:()=>{
return false
}
}
}
but your case, uh with custom events look into EventEmitter
:banne:
yes
yes
🤦
@inner jewel BigInts are coming in newest V8 build 
JS snowflake lib when
👀
guys how to play my spotify music into bot
not storing them 
@granite grotto spotify doesn't allow playing directly from them
your best bet is using their API to get track names and searching those on soundcloud/youtube
@inner jewel thanks dude ❤
it sends every time someone upvotes/removes vote
oke
Were do I put the code in for the bot to work
do you know how to code
yes
were
like lets say, main.[your language extension]
beginner level classes

which language do you know?
python
ok
I don't think you even know the basic computer knowledge before getting into python...
i do
then why are you saying you know python yet you don't know where to put code or how to start a bot
i am new
how to turn pseudocode into python: rename file from pseudocode.txt to pseudocode.py
ok then
no, not even that, you would know that files don't open by themselves just by putting code in there, like you have to open it like any other file
but I am a programger
sigh
programger?
yes

lies
yes, he most likely isn't a "programger"
don't you see? he knows new level words that we don't know, of course he is the best programger!

I am
wtf is going on here
our fellow "programger" knows python, but doesn't know where to put the code to run a bot
¯_(ツ)_/¯
there you go
idk why, but to me this looks like a stolen image from the internet 🤔
Well I do not have any right now
why are you trying to pass android backup service as your own 
I am not
then why send image say its yours
Never said it was mine
this isn't to the channel's topic anymore
I no
wow he deleted picture
Using the messagesDeleteBulk event, how could I get a channel using that event?
discord.js that is
cant, I can do D.js
@brittle oyster I can't, sorry
Does this have any support for ruby?
Question: Can bots have gif avatars?
Reply: Thank you. But can't bots use animated emojis and use custom emojis as well? Those are Nitro perks, aren't they?
not gif avatars
ok access linked accounts
lmao
Yeah except that 😂
and discrim changing
CAN YOU GUYS HELP ME PLEASE
I CANNOT USE client.fetchUser!
@earnest phoenix May you be of any assisstence?
The problem is that the bot isn't here
so i can't show you o.O
Screenshots?
I guess
Also isn't client.fetchUser only for user accounts 🤔
even if it would be here, how would you show us? just a lot of bots will respond like always lol
Or you could join the testing server
...
Mine...
Lets just say its UNIQUE...
I am pretty sure no other bot runs like mine lol
wym?
if you're using discord.js then you can't
because
or maybe you can
idk
¯_(ツ)_/¯
I could show you in my server but i cannot invite ;-;
No
fetchUser
not profile
fetchUser can only be used in bot accounts
what are you trying to get?
But what do you want from it?
To get the user tag and the avatarURL(RIGHT NOW.. Will need it for more stuff later)
Wait
https://discord.js.org/#/docs/main/master/class/User?scrollTo=avatar and https://discord.js.org/#/docs/main/master/class/User?scrollTo=tag
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
What do you mean no lol?
I need to get the id'd user's avatar and tag
use that one aswell then
I need fetchUser to get users from outside the guild
you reminded me to imlplement a hackban for my bot
thanks
it's actually possible to get a user from outside of the guild in python, idk if it's possible in js tho
OK, NO NEED TO SHOUT, IM NOT INTO JS OK
client.fetchUser(id)
xd
fetchUser returns a promise
you need to add a .then or use await
Promises: Catching beginners in a crossfire of frustration since 2010
so two \ after eachother?
Possible to make a XP system, embeded with pic on a single page of .js?
was on a server that had this bot and was like wth lol
would dig to add something like it on mine
I made one but its lame just says level up and you can check your level
yes it is possible
I see that, but how?
Ive been looking everywhere for examples after seeing this, but an avatar inside a pic?
I can get a random pic and probably get that to work, but this blows my mind lol
This could add a pic on a pic with text?
awesome ty, i havent heard of this before so it never crossed my mind to look
Hi
i would like some info-advice-help on something
I want to request something from sites and get the output
https://lingojam.com/PirateSpeak
what should i begin to see to make it
I don't trust that domain
@earnest phoenix if they don't have an API, your best bet is GET'ing the output and then parsing it with something like cheerio
i asked in other channel too and they gave me this link
but how do i install
what is this $ npm install --save pirate-speak
Is your bot in nodejs
Anyone know any good twitch libs for js?
oh sorry
@earnest phoenix, npm i[nstall] --save pirate-speak installs the pirate-speak module from npm.
his bot is in python
i have another question
nvm
i will search a bit more
I want to make it so
guys gives a specific name
then the bot search all the users
and mention him
but it could give like "Dredd"
not full name
@solemn obsidian he trying to install node packages w/ py?
somebody told him to get npm package, but whoever told him to never knew his bot was in python
so now he thinks he wants the module from npm

ig you could use that module to write an english -> pirate converter in node and utilise it in your py bot
easier to just rewrite the 20 lines of actual code in python
ye
hmm
i took the dictionary
and made it work
but it took me so long 😄
can you help me with the other question?
there is a get info something
just a quick question, how long does it usually take to get the discord bot approved?
Depends on the queue length
from a few hours to a few days
and for a certification ?
I submitted on the other site first before this one, still waiting for the approval there, apparently bot's uptime is very important to them
(╯°□°)╯︵ ┻━┻
It’s not. They’re just lazy.
They’re literally just lazy
like I've been waiting for 9 days as of now
it takes month
any idea of the time needed to confirm or not a bot certification application ?
Depends. Oly does certifications
oh ok
what does certification even do?
Usually a week or so
I thought mods can also give a certification
Nope :/
I want to make it so
guys gives a specific name
then the bot search all the users
and mention him
but it could give like "Dredd"
not full name
which lib are you using
wut :D?
python
doesn't discord.utils.find do the trick?
it's in the api docs
I forgot what is discord.utils.get for, it may be either one
member = find(lambda m: m.name == name , channel.server.members)
and then ctx.member.mention ?
I'm assuming this is for async version?
@bot.command(pass_context=True)
async def command(ctx, name:str = ctx.message.author.mention):
member = find(lambda m: m.name == name , channel.server.members)
await bot.say(ctx.member.mention+ random.choice(list))
list is defined
will that work?
I would test that, but I'm on rewrite version
it says ctx is not defined
@ruby dust
Lol
yeah... I'm not on async, so idk how that is possibe
Does anybody know how to overwrite permissions on all channels in a guild? I've tried doing it like this js message.channel.overwritePermissions({ overwrites: [ { id: created.id, denied: ['SEND_MESSAGES'] }, ] }) but it says that it cannot read id of undefined (created) created is just an empty let that I filled with this js created = await message.guild.createRole({ data: { name: "Muted", } });
That's discord.js btw
anyone know how to limit eval() to just math
How do I make it play a specifc mp3 file in my channel?
where is the info in API
What lib?
python
Guys
?
Isn't Python supposed to be faster as a language because it can handle multithreading
compared to JS
¯_(ツ)_/¯
lmao
Assembler does it
because of it's very precise memory usage
yeah
ofc assembler
but binary can also be faster you know what I mean
I was speaking in terms of "moderns' and widely used languages
I'm actually planning on moving to C# or something, I'm tired of python as a language
idk why
is it worth it?

I would say it is
python is like for beginners lol
python is more of a scientist language
I've been playing with C# a lot before even knowing how to code
@old glade python isn't that faster because it has GIL (global interpreter lock)
what is this ?
so you can only have a single thread running python code at once
+1 reason to ditch python lol
node has a single thread too
also for recursive algorithms a lang with tail recusion might be better
and python/node do have multiple threads
but only one running code
others may be doing I/O
there's never a need for the best of the best language, just enough for everyone to be happy 😄
so it's still a benefit
I see what you mean
the problem is that I have no motivation to start over to learning the basic of a programming language
^
try other langs out and you will see when you feel confident while writing in one
well I also don't like the fact that python is case sensetive EVERYWHERE
thats how i got from C++ to C# actuall
isn't any lang case sensetive 
or what do you mean
yes?
with python it's case sensetive, a user must type just the way it was defined
wait thats not a python thing
it's how it works for me 
thats from your lib
if str.lower() or str.upper')
or framework
just if/elif/else
well I'm not doing that nonsense for sure lol
okay im not sure which lib/framework you use (i guess d.py with build in framework?) but thats not a language thing its because of your library/framework
normally it should lowercase all input and compare to lowercase commands so its case insensetive
prism
@bot.command(pass_context = True)
async def laugh(ctx):
'Performs his evil laugh.'
await bot.say("MWAH-HAH-HAH-HAAA!!!")
await bot.join_voice_channel(ctx.message.author.voice_channel)
voice.play(discord.FFmpegPCMAudio("\murray bot\cool.mp3"))
i need help wit hlast command
so it can play
the mp3 file
pass_context=True
iirc no spaces between is known as a more pythonic way of doing things
Why does this happend? I ran the command 1 time https://discordbots.tech/LOOCh9Aj.png
two processes running
my bot keeps on going offline about every 30 minutes, but nothing shows in the console and there is no error? 
I think it started happening after I added the Discord Bot List API into it, but I don't know
my first bot tripled mem usage after getting added to botlists

the other guild eats 10MB alone
probably more by now
Oof
So how can I still connect it the Discord Bot List API without it causing outages?
Any suggestions?
Make sure you coded it right
I just followed the example code on the API info section on the website
I set it to post the guild count to dbl every 30 minutes, that's all I did with it.
so what's going wrong
How do you use emojis through bots again? I forgot
Default emojis or user added ones


can anyone help me with mongoose
Can anyone help me(again)?
what do ya need help with
How to use .has()
In JS I'm guessing?
I'm guessing you're using discord.js so try searching in the docs
I want to check if someone has a permission
Yeah i already did
Its useless lol
i have no idea what a "bitfield" is so...
not useless, thats where I found out how to check perms so try checking again
...
10s of google https://en.wikipedia.org/wiki/Bit_field
A bit field is a data structure used in computer programming. It consists of a number of adjacent computer memory locations which have been allocated to hold a sequence of bits, stored so that any single bit or group of bits within the set can be...
so
Ok just show me how to check a member's perm using .has() i don't need that crap
I need to check it every message
we won't spoon feed you
i'd suggest you stop
Spoonfeeding is not good for the soul
and read the rules too
Ok
So
can you atleast show me what it actually works on
apparently not message.member
i ran it like a 100 times

Yeah ik
🤦 I AM ON THOSE PAGES
member.has("ADMINISTRATOR")

do you know how to use it though it a way that would check the permissions of a member
member.permissions.has
what endpoint are you trying to access
This is the command:
d.js right
I don't have much experience with fetchApplication, but isn't it exactly as the error says, a bot cannot access that endpoint 
Whats an endpoint?
;-;
Using d.js, how can I set uptime to show as DD:HH:MM:SS
but its not just for that
i use for other things
also natan
do u know some stuff about the html script tag
can someone help me with embed stuff, stuff that does this basically, I have it for the broken eval command I have but idk how to code it, any help will be appresiated
only with different stuff, not just a copy of that
rethinkDB or mongoDB
which 1 is better
@earnest phoenix What lib?
discord.js / node.js
@earnest phoenix
Okay! Same library! Let me get the code!
Do you have a prefix?
do you use Atom? if so this would get a lot easier
Yes
Ny.help
K
and it died wtf
Ny.ping
can bots not work here? ok
No
oh ok
K here's the code
The code for discord.js is:
if (command === 'botinfo') {
message.channel.send(message.channel.send({embed: {
color: blue,
author: {
name: client.user.username,
icon_url: client.user.avatarURL,
},
title: "Owner Status",
description: "Status for the bot's owner.",
fields: [{
name: `Server Count`,
value: `${client.guilds.size}`
},
{
name: `User Count`,
value: `${client.users.size}`
},
{
name: "PING",
value: `${message.createdTimestamp} ms`
}
],
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Hekapoo#4756"
}
}
}))
} else
You can edit text, name, value, title, description, and color
ok thank you so much
To your customs and your welcome
can anyone help me make one
Of what?
i am looking for someone to tach me how to make a bot
Sure, what lib?
can u pm me?
Yes
ok
hhhh my bot wont come online >^<
HAHA I DID IT!!!
1 SIMPLE FUCKING } SCREWED BY BOT WITH CREATING THOUSANDS OF ERRORS
^ coding in a nutshell
yes
@earnest phoenix 🎉
@earnest phoenix don't spoonfeed people
and what the fuck is this nested send() method
yes
how do I code a configurable bot prefix ?
.py
Okay, when I was using python, I got most of my info from this: https://docs.python.org/3/tutorial/index.html. It lays down the basics for .py
@old glade
!avatar @old glade
t!avatar @prime geyser
and there i intended to do the same 
except it'll be 2 hours*
Anyone Here Can Help Me With Checking Over My Discord.py Code
Need An Experienced Discord.py User To Check It Over tickYes

You should be able to check over it 
I've never used it @earnest phoenix so I wanted somebody to check
lmfao
Does anyone have a reference where I can find out when a command is issued, it will show in the console? I use Discord.jd
js
change your command handler to do that
okay, don't r/facepalm me, but still new to the bot business, what is that?
What am I doing wrong here?
function findType(type) {
switch(type){
case 0:
return "Basic";
break;
case 1:
return "Medium";
break;
case 2:
return "Advanced";
break;
case 3:
return "Very Experienced";
break;
default:
return "Basic";
break;
}
}
}
hmmm
@earnest phoenix why do u have an extra }
yes roight there m8
!avatar @storm leaf
Or sorry
ok
oof
Does forever npm package account for fatal errors in nodejs apps?
so I got embed working today, I am proud! just need to get color to work
this is for questions not for comments on your progress 
discord.js and a little bit of node.js sprinkled in there
richembed or messageembed
idk, I am very new to this
Hm
bot embeds are always rich
if you never modify it it's actually a good idea
no point in always creating a new one if it'll always have the same data
ok
how do I get my embed to show color in its message, as of the image below it has no color. how do I give it color?
pm me, mention me, whatever
I need help
.setColor(0x<hex colour code>)
for example, .setColor(0x4d94ff)
np
in your embed variable
yea I know, just clicked in my head
you're using a rich embed right?
yes
ok
well I tried,
message.delete();
message.author.send("Please do not say that!")
}``` Is this correct, its not working for me?
Please tag me if you know.
instead of if(message.content.indexOf("tester") >= 0), use if(message.content.includes("tester") @fresh shuttle
@jagged birch Now the message on the second row is underlined.
does your code look like this?
if(message.content.includes("tester") {
message.delete();
message.author.send("Please do not say that!")
}```
cause it should work..?
No, the I got rid of the top { by accident.
oh, well that's why it's not working.
Lol, yeah.
Welp if(message.content.includes("tester") **{** message.delete(); message.author.send("Please do not say that!") } The bolded curly brackets are underlined and everything in between them are whited out.
I just did and it still doesn't work. Do you know what could be wrong?
show error lmao
That still does not seem to work?
Please ping me if you know.
Now im confused af, its sending me the help command when i type the blocked word...
YES I HAVE COMPLETED MUSIC COMMANDS YAYAYAYAY
dafuq, send me the code @fresh shuttle
Hello how to shard my bot?
What language?
Why can't I change the h2 color on my bot page? Because on the dark theme, you can't see the h2's as they are white. I tried changing it to red: <h2 style="color:red;">Fun:</h2> and it doesn't work, tested on my own html page and it worked on there.
Mm, try !important
How'd you use it
<h2 style="color:red;" !important>Fun:</h2> @uncut slate
never really used !important in html before
I did, it just comes up with css shit
it's seriously not that hard to google
yeah i know
"The !important rule is used for overriding the previously assigned CSS declarations. But it is also possible to override itself"
look at how you use it syntax wise
how do you edit your bot page to incorporate custom CSS?
do you use a <style></style> and select parts of the bot page to edit?
yeah
For people that want the colors used by Discord and the HEX codes for them, here they are: https://dabbing-is.such-a-me.me/GAefmvwgh.png
You can also fond this here: https://discordapp.com/branding
How do I add a permission to my discord.py bot? Also, I am using async not that rewrite one.
@lethal sun /branding*
@frail kestrel ty for the notice
How to use payload_json on create messages endpoint?
use an actual wrapper
@wintry dune why do you want to shard
@topaz fjord I want to know how to do it. Maybe I might need one day.
For wut
Ive never made a search for a wb page on my bot, how would I do this?
https://us.tamrieltradecentre.com/pc/Trade/SearchResult?ItemID=&ItemNamePattern=
adding the search name to the end of this
//*[@id="body"]/table/tbody/tr[3]/td[2]/section/div/table/tbody/tr[1]```
`Item 1 ^`
```#body > table > tbody > tr.align-top > td.max-width > section > div > table > tbody > tr:nth-child(3)
//*[@id="body"]/table/tbody/tr[3]/td[2]/section/div/table/tbody/tr[3]```
`item 2 ^`
```#body > table > tbody > tr.align-top > td.max-width > section > div > table > tbody > tr:nth-child(5)
//*[@id="body"]/table/tbody/tr[3]/td[2]/section/div/table/tbody/tr[5]```
`item 3^`
```#body > table > tbody > tr.align-top > td.max-width > section > div > table > tbody > tr:nth-child(7)
//*[@id="body"]/table/tbody/tr[3]/td[2]/section/div/table/tbody/tr[7]```
`item 4 ^`
```#body > table > tbody > tr.align-top > td.max-width > section > div > table > tbody > tr:nth-child(7)
//*[@id="body"]/table/tbody/tr[3]/td[2]/section/div/table/tbody/tr[7]```
`item 5 ^`
How do I add this to a search for an item with this
https://us.tamrieltradecentre.com/pc/Trade/SearchResult?ItemID=&ItemNamePattern=
do I use the selector or the xpath?
Any help would be most awesome if someone has exp with this plz pm me!
... holy fak
those are the values im just not sure how to put it together
im guessing after the lack of responses this would be uber hard? lol
google "web page scrapping <YOUR LANG>"
so web page scrapping js
i hope you're using an xml parser for this
discord.js is a library
discord.js isn't a lang
what
@glossy sand parse it with regex
way ahead of you
thanks
@glossy sand best comment was "Is it possible to use RegEx to parse this answer?"
im not seeing anything usefull yet
to search and bring up the values anyways
as the items continually change
what you really should do is parse the page with an xml parser then traverse the tree the parser builds to get to whatever tag you're looking for
tl;dr find an xml parser and learn how to use it + basic xml knowledge
so an xml parser and learn how to use it, check and check. Example would be cool though if you have the knowledge.
that's all I was aiming for. just a basic example of a search that can bring up a changing value.
what exactly do you mean by "changing value"
what exactly are you doing lmao (im lost)
the items wont remain the same, they change as people buy or sell them ingame
if it was a set webpage i would ask for adive
ok well here's the issue
did you check if they have an actual api first?
I assume you mean the page updates in real-time?
well that won't do for your application
front end changes will break your code fyi
regex parsing html is a nightmare is a waste of time, if you can work a way around it, do it
the real-time page updates are likely done with client-side js
so you should keep an eye on those
and probably some websocket work
^
which is all performed in a browser but won't mean anything to your single http request
if the data is dinamically added it won't work either
scrapping just parses static results
HOWEVER:
sent in the text the server gives you
I figured the xml fields would stay the same right?
what you could do is reverse-engineer the webpage and figure out the websocket protocol they're using
they won't get updated
then simulate a client and connect to that websocket server
https://us.tamrieltradecentre.com/pc/Trade/SearchResult?ItemID=&ItemNamePattern=(type anthing here) Sword or shield what ever
those boxes shouldnt change
this page doesn't look like it updates in real-time
do you mean it updates every time you make a new request?
I dont think I am explaining this right lol
thats an example of of a changing value
you can test it in my bot and see that the scores change
so by "changing value" you mean the data you receive might change each time you make a request
im just trying to figure out how to do this ^ with a search
it doesn't change in real-time or anything
so basically you're asking how to keep the data on your bot up-to-date with whatever data the server is serving
Maybe I dont know how to explain it. Im not sure how to lol
ill try discord api
thanks for trying though
just a wild guess but to probably restart his bot
i wonder 
How do you measure the servers your bot's are one, I thought it was bot.servers.
js?
Yeah
Thanks, sorry I do not know my library... ;-;
np
Does anyone here know what does "rate limit abuse" mean... My bot was declined because of that and since English is not my first language idk what does it mean.
ratelimiting is going over the set amount of requests per day, hour, minutes, etc
ratelimit abuse is spamming an API causing ratelimiting quickly
or other forms of abuse
for a ratelimit
@high tinsel so in your bot's case it is that you spammed the Discord API too much, causing ratelimit abuse
Oh, I realize it now... If someone spammed that command than it would be a problem... Plus it posts messages too quickly. Thank you. I will fix it today and than resubmit that bot.
owo am i missing something or ..
semicolon at the end of .get(commandName)
can't do that when you are doing your boi ||
np
._. did i not address the commands file properly or something cause my commands aint working weirdly.
nani
🙇 sorry im quite new to programming so i may have made dumb mistakes.
what are you trying to do?
um for now is i have a command files where i can just insert new commands
uhuh
and in my main file which is the photo it seems like its not going there
i think
🤔
not at all
the paths are not connecting
yep
so ya saying that its not reading the commands directory?
i think so, i dont see any other reason it wont respond to my ping command
name: 'ping',
description: 'Ping!',
execute(message, args) {
message.channel.send('Pong.');
},
}; ```
well this stretch are the ones that fetches the commands
below it are just cooldowns for spams.
using const {prefix, token } = require('./config.jason) which will fetch the prefix and then if (!message.content.startsWith(prefix) || message.author.bot) return; will execute it
onwards
that will execute your command?
yeah
how
all your doing on that line is checking if the message begins with the prefix or not
and if the author is a bot
and if one of those cases are true you will return
nani?
😅 haha sorry. im bad at coding, still working on it
np
If you need multiple variables listed below each other, how do you do that?
Like
var 1
var 2
var 3
In Javascript
Or just some discord thing that does that...
what
i've even reinstalled node and everything but as soon as my script starts it stops
without an error
and it exits with error code 1```
@high tinsel ```js
let var0 = 0;
let var1 = 1;
let var2 = 2;
that's my npm error file
anyone?
So if I want them listed the command would be something like: message.channel.send(let var0 + let var1 + let var3);
@high tinsel give me an example of how you want the output to look like
oh
to send the value of each variable
you just go
let var0 = 0;
let var1 = 1;
let var2 = 2;
message.channel.send(`${var0}`); // => sends 0 to the channel the command message was sent in
message.channel.send(`${var0}, ${var1}, ${var2}`); // => sends all 3 of your variables to the channel the command message was sent in
No, I need those variables listed only one at a line...
I can't, it's for a fight command and the stats need to be listed below each other...
And if I list them in separate messages the bot will get denied for posting messages too quickly.
@high tinsel the use setTimeout
But it needs to be listed at the same time
._.
That makes no sense
if(message.content.includes("vs: ")){
var opponent = (message.content.replace("vs: ", ""));
var score = 0;
for (var i = 1; i < 4; i++) {
var yourattack = (Math.floor(Math.random() * 100));
var yourdefense = (Math.floor(Math.random() * 20));
var hisattack = (Math.floor(Math.random() * 100));
var hisdefense = (Math.floor(Math.random() * 20));
message.channel.send("Round " + i + ". Fight!");
message.channel.send("Your attack effectiveness is " + yourattack + ".");
message.channel.send("Your defense effectiveness is " + yourdefense + ".");
message.channel.send("His attack effectiveness is " + hisattack + ".");
message.channel.send("His defense effectiveness is " + hisdefense + ".");
var win = (yourattack - hisdefense) - (hisattack - yourdefense);
if (win > 0) {
message.channel.send("You win!____");
} else if (win < 0) {
message.channel.send(opponent + " wins!____");
score = score + 2;
} else {
message.channel.send("No one wins!____");
score = score + 1;
}
//mesage.channel.send();
}
if (score < 3) {
message.reply("You won!");
} else if (score > 3) {
message.reply("Your opponent won!");
} else {
message.reply("No one won!");
}
}
this is the originall code
And what's wrong with it
var
@restive silo no u
The amount of messages that it sends is too high so thy declined my bot because of that...
If they need to be bellow each other, cant you use \n?
Yeah
I try, but it did not work...
How did you do it
if(message.content.includes("test: ")){
var opponent = (message.content.replace("vs: ", ""));
var score = 0;
for (var i = 1; i < 4; i++) {
var yourattack = (Math.floor(Math.random() * 100));
var yourdefense = (Math.floor(Math.random() * 20));
var hisattack = (Math.floor(Math.random() * 100));
var hisdefense = (Math.floor(Math.random() * 20));
var var1 = ("Round " + i + ". Fight!");
var var2 = ("Your attack effectiveness is " + yourattack + ".");
var var3 = ("Your defense effectiveness is " + yourdefense + ".");
var var4 = ("His attack effectiveness is " + hisattack + ".");
var var5 = ("His defense effectiveness is " + hisdefense + ".");
var win = (yourattack - hisdefense) - (hisattack - yourdefense);
if (win > 0) {
var var6 = ("You win!__");
} else if (win < 0) {
var var6 = (opponent + " wins!__");
score = score + 2;
} else {
var var6 = ("No one wins!__");
score = score + 1;
}
mesage.channel.send(```"var1\nvar2\nvar3\nvar4\nvar5\nvar6"```);
}
if (score < 3) {
message.reply("You won!");
} else if (score > 3) {
message.reply("Your opponent won!");
} else {
message.reply("No one won!");
}
}






