#development
1 messages · Page 510 of 1
I don’t know why you would need to
If I did it would complain it needs to be async
And idk how to put that into an eval operation
just put it in a function thats async and call that function
so like
await shit
}
ejhsgbhuj()
i mean... does bulkDelete even return anything?
or does it need a callback/promise?
Welp, here are the js fellas
then even if you async/await it, it will still show as [object map]
yes
he needs to actually return something usable
I don’t understand object maps
@sonic glade you need to specify which channel
the channel is not being found
guildMemberAdd does not give you a "message" to work with
message isnt valid in guildMemberAdd
also sending the message every time a user joins the server
Yes, but I need you to send the message with the image in the channel that the user is watching
thats not possible
@earnest phoenix objects and maps are mostly the same thing, just with different capabilities. but you need to give discord a string
you cant know what channel they're looking at
you can filter throughout the channels to find one you can speak in and send one
^ but pls dont do that
^
or in some channel, but that is when someone enters the discord server
make welcome messages off by default and let server admins set a welcome channel if they want @sonic glade
^
you need to specify a channel, so let the guild owner chose which channel they want to receive those types of messages
Why when I do result.size/length does it always say undefined even when I define it?
what if you console.log(result)
I use pm2
Nothing logs
Not even startup messages
just use length
do not try size
It says undefined
On both
unrelated question
?
why do you have an unused variable called length
I was trying to define it
But it didn’t work
define what
length
i mean
all you would need to do is result.length
yes
result is none existant
what is you code for args
How do I fix it
didn't answer my question

let args = msg.content.split(' ').slice(2)
@earnest phoenix
hmm
It’s 2 because of the space in the prefix
So Alexa eval
slicing arrays uwu
well
try removing the await from the eval
no
its not that
yes
just check if its undefined
if it is, send undefined instead of checking length
await eval is not the problem

oh wait
Having fun showing the same thing?
thank you tom
👍
now i feel stupid
you don’t need eval
It’s an eval command
eval command


this guy read a comment on stackoverflow saying "never use eval" from some grumpy old cunt
and took it too literally 

eval commands makes you look even cooler when you release your bot token

.replacing bot token 
replacing multiple substrings too
^ 
.setTitle
if (output instanceof Promise || (Boolean(output) && typeof output.then === 'function' && typeof output.catch === 'function')) output = await output; amazing
you can use typeof
did not know it shows u a preview of the response https://media.turtle-bot.com/f/0WrLf.png
typeof args === 'number'
yes
wut
why are you asking me, its you code you should know where args is defined
Can I do
let args = thing here
typeof args === 'number'```
Or
```js
let args = thing here
if(args === typeof 'number' return *must be num message*```
I don’t understand how it works
if(typeof args === 'number') return *must be num message*
typeof (typeof 1) lmao
mdn is pretty informative
they even give examples
@quartz kindle it makes sense
¯_(ツ)_/¯
if(typeof args === 'number') return msg.channel.send("Hm... the 2nd value you gave is invalid... Problem:\nmust be a number")
yeah but why would anyone ever need that
example purposes
It doesn’t work
Oof
because you "args" is an array
pls ignore my message above as of natan is smarter than me
i'm pretty sure your args is a string array
coming from splitting the content
which means typeof args[N] for any N will be either string or undefined
anyone knows how to make coin and shop system?
maybe
why you ask
@lost scarab We're not going to tell you how to make a complete system, but we can give your resources to do so.
You'll need a database, for sure
this is not a development question
its a problem solving question
and u figure it out on ur own
var ttttturl = "";
fetch(url)
.then(res => res.json())
.then(json => {
var z = 0;
while (json.items[z].id.videoId == null) { z++; }
ttttturl += trueurl.concat(json.items[z].id.videoId) //"https://www.youtube.com/watch?v="
})
i know this seems like a pretty basic question but why is this not concentrating to the string?
is it because its in a function
or is it because im an idiot
promises are async
it is concatenating
but code below that will have already executed when concatenation happens
oh
no wonder why
do i async it?
or
You put your code inside of the callback
the promise is already asynchronous.
wait
you mean the .then(json => {})?
wait nvm
you did mean that
thanks
i need opinions on a database for saving things to a queuek thx
Can someone please send a script in here that can turn on a bot please?
<script>
console.log('Bot is On!')
</script>```
turn --on bot
But wouldn't you need the token?
What language are you using?
Who knows python?
If you simple come here asking for a complete script, don't expect to get anything other than memes
I'm only asking for a bot online script I have the other stuff.
"If you simple come here asking for a complete script, don't expect to get anything other than memes"
You didn't provide any details at all..
Ok
So
I am making a Music Bot and I keep running into errors if I can't get it online in Python language and I keep running into errors on making it go online can someone please help?
You need to provide details.
I'm not a mind reader.
import discord
TOKEN = 'XXXXXXXXXX'
client = discord.Client()
@client.event
async def on_message(message):
# we do not want the bot to reply to itself
if message.author == client.user:
return
if message.content.startswith('!hello'):
msg = 'Hello {0.author.mention}'.format(message)
await client.send_message(message.channel, msg)
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
client.run(TOKEN)```
You may want to provide the errros youre getting.
Here
Well that explains a lot: import aiohttp
also are you trying to code on your pone @earnest phoenix
Yeah.
It's so hard.
yeah
But I'm not giving up.
bbecause your coding on phone
why don't you code on a laptop
No internet
what
I dont know much about Python, but just importing the aiohttp module should work
I use Data
Mobile data lol
doesn't your data have a mobile hotspot
It so damn laggy
i mean
you could use the mobile hotspot to download a text editor like vsc and code from there
Coding on your phone is one of the biggest developer memes.
yes
I still like to try.
ok
I will not give up.
If you try, you are a meme

...
So your saying people who try making a bot are a meme
.
is it enmap good database for making a queue system
Who try making a bot on their phone
Many people
how many
I watched it on YT.
thats gross
don't even get me started on the people who run their bots on their phone
but still
Now that's even more of a meme
what lib
python
each lib should have a thing that gets ping
python async 3.6.5
im trying this
@client.command()
async def ping(ctx):
': Check your connection '
t1 = ctx.message.created_at
m = await ctx.send('**Pong!**')
time = (m.created_at - t1).total_seconds() * 1000
await m.edit(content='**Pong! Took: {}ms**'.format(int(time)))
await ctx.message.delete()```
but then im getting this error
Ignoring exception in command ping
Traceback (most recent call last):
File "C:\Users\Keagan\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "C:\Users\Keagan\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 367, in invoke
yield from self.prepare(ctx)
File "C:\Users\Keagan\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 345, in prepare
yield from self._parse_arguments(ctx)
File "C:\Users\Keagan\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 304, in _parse_arguments
transformed = yield from self.transform(ctx, param)
File "C:\Users\Keagan\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 212, in transform
raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param))
discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.```
Hello Developers. I got lil question. Is it possible to create Discord BOT, wchich will be able to reading, gathering and processing information of this website https://proclubshead.com/ ?
for ex. This https://proclubshead.com/19/club/pc-13982/ for whole team, and this https://proclubshead.com/19/club/pc-13982/player/6iJBOqa1-MGbOg1mQHua3g!!:51uin9bSSzfoXMzrY9EaQg!!/ as an ex. for each player of a team. cheers
Current division: 3 | Best campaign: Div 3, 14 pts | Wins-Draws-Losses: 74-22-62 | Stars: 4 | Stadium: Stamford Bridge | Region: Western Europe | Ranking points: 1540 | Skill points: 3223 | Seasons won: 6 | Cups won: 0 | Doubles won: 0
Its all about FIFA19 official Esport Virtual Pro Teams
I think cheerio is a good one for scraping
who?
Will be here any nice person who would help us with it and make first beta please?
pm me
if there is money involved, sure
Do bots get access to a user's connections?
@pale marsh only oauth2 does
Gotcha
you need the connections scope iirc also
Docs confused me a bit
However I remember a bot once that used your steam connection to get stats to a game before 
It was the bot on the payday 2 server
probably had oauth2 implemented
theres no way you can get connections other than that or unreliable external websites
I don't think so honestly. It never asked me for oauth or anything
weird
Ay, anyone here has a bot in golang 
@sick cloud Looks like you'll have to wait a little longer for dashboard
I'm planning to ship it with the rewrite (v2)
oof ok, waiting fun. also happy birthday
Making bots with phones is the best way to idk why you’re questioning making bots on mobile I mean the spelling mistakes your auto correct gives you is always the best when making a command that would break your bot if you messed it up
@earnest phoenix
I only edited that message 5 times

How can I fix my bot every like 30 minutes on the same VPS my bot errors and says Error: Socket something like disconnected how can I add an auto restart thing because even if I use PM2 it still crashes and I want to be able to certify my bot >:c
Try another free VPS to test if it's the VPS or the bot
If it makes that message again it means it's the bot the issue
It not, you have to talk to the VPS customer service
@earnest phoenix
@earnest phoenix are you memeing?
Auto correct vs. an actual JavaScript linter on a desktop
Yeah come back and tell me which one is better
@keen drift yagpdb is in golang
I'm thinking of rewriting as well
I'm in the middle of rewriting but I can't figure out how to make a command handler
nodejs
What must I do to my bot msg.react("1⃣") ?
I dont find how to copy the 1⃣ emoji, or find its id
does anyone know how I can create a pingable role in Discord.NET using c#?
btw ping me in the response just in case more people talk here before I come back from school since I am leaving right now
@late hill 👌
yes
{embed: { fields: [
{name: "name1", value: "value1", inline: true},
{name: "name2", value: "value2", inline: true},
{name: "name3", value: "value3", inline: false},
{name: "name4", value: "value4", inline: true}
]}}```
does this
Setting them all to true does this
🤷
I just want this
😩 😩
Is it against tos for a bot to send an invite to a server that is not owned by the bot owner?
I have a similar question which is in relation to ToS aswell
I am making a bot that will handle announcements by making an announcement role so people can opt in or out of announcements, it also DMs said people who opt in. Of course I wrote for the opt in command that by doing so they agree to DM announcements but I still wonder if it would be against ToS
I have an issue
My change able prefix isnt working
it says in command prompt that I spelt JSON Worng and I typed JASON
Lmfao
whats funny?
i hve ask can i?
I want to use Python to make my mp3 player run.
i can make mp3 file but i can't play it
youtube-dl, ffmpeg, or lavalink
Feel free to use either
okok thx
Shivaco WDYM?
Yes shivaco
@late hill you get your embed fixed?
Yeh
Ah ok
Ah ok
You could of just done JavaScript embed: {fields: [{ Name:"",value:"",inline;false },{ Name:"",value:"",inline;true }{ Name:"",value:"",inline;false }{ Name:"",value:"",inline;true }]}
lower case n for name
Do I need normal OAuth2 rather than Bot OAuth to POST text Meassages?
I can't see this in doc ,any link or answer is appreciated,thx.
btw,I 'm sure I granted SEND_MESSAGE Permission already.
if you want them side by side make them all inline.. 
yeh that's what i did
But with a thumbnail
Because I wanted 2 each line
It goes up to 3
If theres no thumbnail
Facepalming about something thats already taken care of 🤦
Use a transparent image
How even
imagine i want when a person with Member role types !ping it would say something but if person with Owner role typed !ping it would say other thing
like check what role the user has
What lib
wdym lib?
Just asking but if anybody knows:
How does Luca's starboard function work? I'm working on a starboard for my bot @halcyon bear and was wandering how to make it edit the starboard message if it has already been star'd. Like this:
Both is good anyways
js xd
idk
And since I know jack shit about js, can't help ya out, sorry
np
And for the starboard feature, you might wanna look at https://github.com/Rapptz/RoboDanny/blob/rewrite/cogs/stars.py
Could someone redirect me to a guide on how to send my bot's server count to a website?
Depending on your lib
Discord Js
@waxen quest #312614469819826177
anyone in here knows how to remove points when certain command is typed
using better-sqlite3 btw
I meant to my own website
That's a DB lib lmao
Nice 
https://ghostbin.com/paste/3mt8o Anyone know why this isnt working?
Any errors?
yo, can someone join my server then leave, I'm trying to test join and leave
KInda wrong channel but... sure, DM me the link
ok
Should I host my bot with Azure?
no
So I basically copied the code snippet from #312614469819826177 for the server count but I can't seem to figure out what to do with it, would someone mind helping me?
those are outdated iirc
They are?
refer to the api docs on the site
Azure 👀
what's a good service to host a bot with, I am wondering because I am not getting a server until Christmas.
ovh
I am looking for a free service to temporarily use.
You could try glitch.com
Am I able to make it so my PC runs node . 24/7 even when it is off?
No I don't think so
Ima leave my pc on at night when it is getting approved
I can't wait to get a server for Christmas
I’m using glitch until I need to get a vps
I'd rather use a physical server not a virtual one
Why?
Mainly because I am a business owner
My company is about to be incorporated
servers remind me of mainframes
Yes, just the feeling of owning one would be cool
Yeah
I watch Linus Tech Tips it think it would get annoying if they failed
Always need to keep a backup of a backup
Back in the 50s those were very common
just wondering, what's the real difference between
<@id> and <@!id>
it says on the wiki "user" and "user (nickname)"
but why does it matter
Not really, probably depends on your lib
there's no "nickname" if it's an id it makes no sense 🤔
idk whatever
i'll parse both
It renders the nickname either way
it probably got changed but the format stays idk why
it used to be like it
if the user has a nickname in the server, its mention shows up as <@!id> (in discord.js)
so you need to take that into consideration if you're matching/working on mentions
@gilded elm It's used for more internal things
but yes, you should obviously handle both
would ```javascript
.setFooter(author)
what is author
What can I do to make my commando bot look more professional in the commands dm
anyone know c#
how are people editing their bot page to have different attributes than the default one. Like having your status be a purple online status rather than a green one?
dbl page
have a picture?
css
how are they using it tho?
np
What are some approaches to sharding across machines 
@keen drift redis redis redis
@hushed berry elaborate pl s
What lang are you coding in?
Golang
Schildkröten sind Gott
What purpose does redis serve in a shard system
thats kinda easy tho
kubernetes?
oh
Will Discord gateway report back proper shard count on second machine?
like totalShardNeed - Machine1Shards
no
oh
nvm
You will have to work that way later, anyways
hm?
since large bots have to have a static shard count
h u h
n i k
I use 128 rn
how many guilds 
180k
makes sense
I'll probably bump it up later
so that I can run for a couple months without changing it
Yo guys, how would I delete a certain role?
I tried so many different things around .deleteasync
I code in C#
Nevermind
``if (MessageChannel.substring(0, 1)) == '?' {
var args = MessageChannel.substring(1).split('');
car cmd = args[0];
args = args.splice(1);
switch(cmd) {
// ?verify
case 'verify':
bot.SendMessage({
to: userID
message: 'Reply with you are now verifyed'
})
}
}``
It gives me errors what did I do wrong (JS)
if (MessageChannel.substring(0, 1)) == '?'isnt it suppose to be inside the if ( )- You forgot to add a
varto cmd message:is apparently invalid- can you not see the red underlines you silly goose xD
oops I said car not var
missing comma after the userID in sendmessage
oh thanks
can anyone help me with How can I see on what servers my bot was invited and I want also to appear on the website discordbots.org
?
Hey guys, this is the api I use to make my bot "https://discordapp.com/api/v6/guilds/439880012183896075/messages/search?" which return some chats from person. The problem is, There's an offset in searchbar, which only let me get the first page of the search result. While the rest of result can't be taken. is there any ways to take all the data from the search result?
why are u using the v6 gateway
is there something else?
anyone know a translation api
https://www.npmjs.com/package/google-translate-api suddenly has stopped working
use yandex translation api
link?
The API provides access to the Yandex online machine translation service.
I dont know any others
can anyone help me with How can I see on what servers my bot was invited and I want also to appear on the website discordbots.org
?
i need help guys
i get error 31
a device attached to the system is no functioning
import json
import aiohttp
uri = 'https://discordbots.org/api'
class dblapi:
def __init__(self, bot):
self.bot = bot
self.session = aiohttp.ClientSession()
def __unload(self):
self.bot.loop.create_task(self.session.close())
async def send(self):
dump = json.dumps({
'server_count': len(self.bot.servers)
})
head = {
'authorization': 'BOT_TOKEN',
'content-type' : 'application/json'
}
url = '{0}/bots/BOT_ID/stats'.format(uri)
async with self.session.post(url, data=dump, headers=head) as resp:
print('DBL: returned {0.status} for {1}'.format(resp, dump))
async def on_server_join(self, server):
await self.send()
async def on_server_remove(self, server):
await self.send()
async def on_ready(self):
await self.send()
def setup(bot):
bot.add_cog(dblapi(bot))```
Shoundn't this work?
Ping me if you guys have a solution
do you have an error with that? @earnest phoenix
@bitter sundial Ugh I just get a 401 Error.
Its the place I'm posting it I'm pretty sure.
What token are you putting
My bot token
I just didnt post it here
read my previous message @earnest phoenix
haha yes
@earnest phoenix
As i stated
I didnt paste it here because its a priv token
but you put "BOT_TOKEN" which makes me think you are using your discord bot token
discord bot list has a differnt token
just making sure you are using the right one
I know
👌
I mena like I already said it
But
whats the Api link?
Hi, anyone knows how to set up greeting-on-join with JDA?
Api Key Will be Found Website
Go your bot> edit> Get Api Token > Copy
paste in 'authorization': 'BOT_TOKEN',
@sick cloud Google changed how tokens for Google Translate are formatted, check google-translate-api's PRs, you might find a version that supports the new token formatting
copy and Paste 🤷
npm is a good site to use
can anyone help me with a discord.js problem with a rock papper scissors command. Please @ me so i can get the notification.
We can't know what you need help with if you don't tell us what's wrong
for some reason the bot isnt sending the embed.
show code
can i post a paste bin link
🔥 👉 
many problems in this code...
this one is funny ```js
if (message.toLowerCase() === ('rock' || 'papper' || 'scissors')) {
papper lmao
its comparing if message.tolowercade is equal to true
im dying
do [x,y,z].includes(message or some shit here)
for proper syntax
i took a look at the code and im having a hard time figuring out which one is the proper one, it seems like you have a lot of test commands within the same command
also google the diff between var const and let
yea i was trying to figure out where the problem was occuring
also image is empty in embed? so just remove that
ok
u should remake this command
i got headache reading code
lol
also, instead of send({ mrps }) try send({embed: mrps })
ok
yes rhat will make the embed send
but u should make the rest of the code not a clusterfuck before
answer tim 
y u do dis
lol ok thanks
lmao
i mean
u can do anything after the command
it dont jave to be rock paper or scissors
it will still work
so yikers
oh
ok thanks
also no need to check if they pick rock paper or scissors
nd then check each individually
ur checking twice
do what i said before with an array and use .includes
ok thanks 😃
👌

@long geode Don't spam emotes here
k
@frail harness i saw that, the recent issue made just said to change it to gtx from t and that worked
could someone help me understand a little bit better what @earnest phoenix meant by [x,y,z].includes in discord.js
ok
it basically sees if one or more provided values includes a provided one
ie.
['foo', 'bar'].includes('foo') // returns true
['foo', 'bar'].includes('kek') // returns false

if (input === 'rock' || input == 'scissors' || input == 'paper') {}

if (['rock','paper','scissors'].includes(input)) {}
oooh ok thanks 👍
no
thats not how it works nik
no because they will declare it at the top as const
it doesnt change
but otherwise probably yeah
[...].includes(...) will create a new array
anyone here own an api for bot devs that might have some stuff thats useful for fun-related bots? trying to see what i can add to my bot
Ive heard of this one called cleverbot.io its for ai messaging.
I dont know completly how it works but still.
i don't really like cleverbot, its so weird
yea i dont know much about it lol
i use cleverbot and just makes people hate your bot for slow responses/trying to make out
Me too, I've triyed to put a event when someone vote for the bot but it's don't work
what lang
If you're using javascript you can check out our lib for easy use
what's the best way of storing this in sql? https://zero-two.is-a-good-waifu.com/0581c0.png (notice the list)
either store the list as json string or create a table for lists indexed by some sort of id
am i doing something wrong here?
theres no way theres over 25 users with such a random discrim in 180~ users
It’s possible I think
statistically very improbable, i think
i tried loads of discrims tbh
I’m to dumb I think
whats your code
let discrim = 0000;
let users = [];
if (!args.length) discrim = msg.author.discriminator;
else {
if (isNaN(args[0]) || args[0].length != 4) return msg.channel.send(`That isn't a valid discrim.`);
discrim = args[0];
}
client.users.map(u => users.push(`${u.username}**#${u.discriminator}**`));
if (users.length > 25) return msg.channel.send(`There's over 25 users with that discrim, and I can't display the full list.`);
const embed = new client.util.embed()
.setTitle(`Users with the discrim #${discrim}`)
.setColor('#36393F')
.setDescription(users.map(u => u).join('\n'));
return msg.channel.send({ embed: embed });
ok so
let me get this straight
youre taking every single user that your bot knows
and adding it to an array
then if that array's length is more than 25 (the bot knows more than 25 people) it says that message
yeah
are you seeing the flaw yet
and even so the .users property of client
won't have duplicates
the problem is that a) i doubt you intended to show the list for that discrim for everybody that the bot knows and b) it doesn't filter the discrim at all
How would a config.js file work?
Would I put a const call token in it?
And make a const called token in index?
Why json? Is it because of the format?
Ey I have a question.
I’m pretty new to discord bots but not that new to programming, I’ve seen some bots be able to play games on discord servers and I was wondering if there’s any custom way you can make your game that is not embeds or texts?
Was planning on doing it with js
Not really
It’s a game only consisting of drawn blocks
So 2d
But it is drawn with the help of a library (p5)
then its impossible. maybe if you are jimmy neutron you can do it.
it may be possible with gifs, and realtime edits. but its api abuse.
Oh is it?
oh you can't edit files on discord.
you can only edit text.
so yeah still impossible.
Well rip
just make a game and publish here.
Lol
It was the game of life
i need help
Please enter at least 300 characters excluding special characters in your detailed description. Add your commands. Spaces or empty spaces are not counted.
I was thinking you input your animals or humans or whatever
And you just see as the world interacts with each other
I’ve already made it, was interested if I could pop it into discord chat
Guess not
@earnest phoenix what’s the problem?
i want add my bot to discord bots
but its want 300
Please enter at least 300 characters excluding special characters in your detailed description. Add your commands. Spaces or empty spaces are not counted.
And....?
It means write a 300 lettered bot description
Does anyone know how to get the online members and total member count through the API?
I'm using a PHP curl request
is blob down?
$authToken = $core->api->bot_token;
$url="https://discordapp.com/api/v6/guilds/402882533592662017/members";
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_HTTPHEADER => array('Authorization: Bot '.$authToken),
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_VERBOSE => 1,
CURLOPT_SSL_VERIFYPEER => 0,
));
$response = curl_exec($ch);
Does anyone know how to get more than one result?
No one knows??
@earnest phoenix its right in front of you
Limit?
It is not possible
is there an api that converts a b64 image to a url (need it for embed)
Due to spamming
And big data and stuff
@zenith oriole for url?
You just need to host it somewhere
I dont think discord accepts data urls for embeds
i know
what are you using it for then
ping packets send favicons in b64
so you need to turn a base64 image to a link for an embed
You're gonna have to upload it somewhere
imgur? idk
possibly
bootleg php script to the rescue
you code in php?
nah
it's just the language im used to server side
quick and dirty
but does the job well
ok another question, is this safe?
public static OnReady() {
return new Promise((resolve, reject) => {
setInterval(() => {
if (this.Initializing === false) {
resolve();
}
}, 1);
});
}
I'm curious about the resolve method there. that might be called multiple times because the interval is too low.
do you even understand what is setInterval?
and that number 1 there?
do you even code and thinking about thread safe or something like that?
and do you know what promise is?
Hey
hey, what's up?
revive it?
Yea, working on it
do you have respawn method?
Like the hoster fucked me up
you must make one
make a respawn method. it will respawn your bot when it died.
Yea, why not
@rapid citrus calling resolve multiple times is fine, it will ignore all subsequent calls.... but that interval is going to run every second forever and ever
hmm. thanks can I stop the interval?
yeah but i think there is a better way of doing this. lemme write it
Hell no
use a lib with autoreconnect 
I hate free shit
well actually id have to assume a bunch of stuff to write an actual example
but basically, create a promise and save it as a field on the object.
then in your OnReady() function, return that promise
when the thing is ready, fulfill the promise
after the promise is fulfilled, anything that awaits OnReady will immediately resolve
but to answer your question about stopping the interval anyway, you do something like
const timer = setInterval(() => code, 1);
to start it
and then
clearTimeout(timer);
to stop it
Restcord
clearInterval actually, not clearTimeout
🙄
It's not the only language i write
And PHP is one of the best langs out there
then use other lang.
.man you can make websites with different langs. nodejs is the best option.
Yeah ok i didnt ask for your looks on things
I asked how to get the membercount of a guild using discord's api
if you cant answer me that then why are you speaking to me
I work professionally as a backend web application developer and infrastructure designer at europe's leading erotic toy distribution company
Do you really think i dont know what i'm doing
I didn't ask for your personal preferences
I didn't ask where do you work.

what do you mean not hard?
@sinful lotus that's for his own good. who uses php btw?
then why did you asked?
yeah that's what I'm asking for. I'm not too expert with promises so I asked.
ya :DDD
@fossil oxide Can you tell me how you are fetching online membercounts?
Or membercounts in general
For Discord servers?
@fossil oxide Yeah
I'm trying to get it done without widgets through a bot token
what lib are u using
Restcord
to get member count you need a gateway connection
they're sent with GUILD_CREATE payloads
you could iterate the fetch members endpoint
but that's incredibly slow for large guilds
Hmm
@fossil oxide Can you let me know how you did it?
ew php
$total_members = [];
$at_time = 1000;
$max = 30;
$last_id = isset($last_id) ? $last_id : 0;
for($i = 0; $i < $max; $i++) {
$new_loop = $core->rc->bot->guild->listGuildMembers(['guild.id' => 402882533592662017, 'limit' => $at_time, 'after' => $last_id]);
foreach($new_loop as $loop) {
array_push($total_members, $loop->user->id);
}
$last_id = $total_members[count($total_members) - 1];
if (count($new_loop) < $at_time) {
$i = $max;
}
}
dump(count($total_members));
Incase anyone needs it
@earnest phoenix We're just getting them from the gateway like Natan described
@bitter sundial I see, thank you @inner jewel
What are some of the most important commands for a bot owner must have? Apart from eval and reload.
I don't understand what is the password for webhooks.
Can someone help me plz?
i'm using Javascript with library discord.js
Are you trying to connect DBL Vote or something?
@earnest phoenix
yep
I want to use it, but I don't know what is the webhooks password
So it don't work
I believe the webhook password is what you entered in the Authorization option of the DBL Bot Editing Page
uuhh?
Wait
You mean the webhookAuth and not the password?
here
Yeah, its what you put in the Authorization box on the bot edit page
Me?
Yeah
I never put something
Just put something random but secure
It doesnt have to be somthing specific, just spam your keyboard or something
Make it secure
Ok
And for the URL?
What is it?
What are you hosting your bot on?
on my computer for reworking
I'm not sure how to actually do this on a computer, I use Glitch.com for the Vote Announcements and use Skysilk VPS Services for my actual bot
So, im stuck here also 😂
bruh
But the first part I said is correct.
Just not sure bout the URL part
Yep the first part is correct, it's me i'm just dumb
If I put my ip address it's will work no?
I also believe you would need to Port Forward your IP and I think its what is meant to be put in the box
oof I can't port forward my ip
Your IP in the box with "https://your.ip.here/dblwebhook", but you need to port forward
mhh
I dont know how to port forward tbf, so I use glitch to get the vote updates and use skysilk to run my actual bot xD
I will test it
I think your know heroku
If I host my bot on heroku, it's will work?
I dont know, I never used Heroku, sorry.
bruh
I don't like it 😂
Just use Skysilk, they give you $10 free to use on their services.
oh
I think they already have IP's that are Forwarded, not too sure though
I never heard about this host
Ez
@earnest phoenix are you here?
with python, is there a way I can force 2 numbers to be visible, even if it's just 00
that sounds like a workaround, but I'm wondering if python even has a built-in way, like when you can do with decimal numbers you can just format the int with .2f, but this time with whole numbers
been googling that for 3 days is the reason why I'm asking
why wont this work
const discord = require('discord.js')
const {prefix, PREFIX, footer, owner, ownerID} = require('../../settings/config.json')
exports.run = async (message, args) => {
const client = new discord.Client({disableEveryone: false});
if (message.author.id !== ownerID) {
message.channel.send("You are not authorized to use this command.");
message.delete();
} return;
message.delete();
let announce = new discord.RichEmbed()
.setAuthor("Announcement From ")
.setTitle("Callumok2004")
.setDescription(args.join(" "))
.setFooter(footer)
client.channels.get("501467078172082176").send("@everyone", { embed: announce })
message.delete();
client.login(process.env.TOKEN)
}
Language = JavaScript
........ Not helpful ........
Because right after you check for owner id, you return out of the command. You probably wanted the return to be inside the if statement
So I tried to make a bot but when I used the terminal and typed node . it didnt work
@earnest phoenix cause u have a client and u made a new client in a client and a client. i presume u understand what i mean
@earnest phoenix show code or u dont have any code
const Discord = require('discord.js');
const bot = new Discord.Client();
bot.login('token');
i did
the path?
where would i drop the folder exactly?
u on mac or windows or linux
windows 10


js typeof



