#development
1 messages · Page 1345 of 1
because this is an extremely low maintenance webhook server. I'm only receiving updates from one endpoint and that too not very often.
are you running the bot locally?
no it's hosted on heroku
that's why I was thinking of using ngrok
not sure if that's a good idea though
problem is I don't have any money to be spending on hosting
and heroku is extremely reputable and popular
their only downside is they limit usage, but that's not an issue for me since I never exceed their dynos
i'm not sure the purpose of ngrok? why not just run an express.js web service on the same heroku app?
heroku is against bots
though i'm not really totally familiar with either ngrok or heroku
because I'm trying to do everything in python
repl.it exists
repl.it is the only good host i can find that is suitable for bots
ngrok runs a local server on your computer and essentially makes that server public to the world
heroku and glitch and shit beaned my projects
you can use heroku if you want but you'll regret it later
is there a code for python
where i can restart a bot
using commands
I mean isn't it easy to switch over
I have been using heroku for around 2 years without an issue thus far
please check the pins at least
I read through them
if you can keep the ngrok tunnel active the whole time without the host address changing ever then i guess it could work
everytime the address changes couldn't I make an api call to dbl to tell them it's changed?
or is there no way to set the address through the api
I just realized I haven't even brushed my teeth instead I'm sitting here teaching someone why heroku sucks
I'm sorry man but you still haven't given me a valid reason why heroku sucks
the 4 reasons mentioned in the pin don't apply to me
heroku supports all python libraries, it rarely has downtime, I don't have any concerns with them stealing code, and the specs they provide for free are good enough to host my bot on a month to month basis
i don't think there's a way to change your webhook URL via API tbh
@fiery sierra sorry about that, so do you know if I can make calls to change the webhook server address?
oh damn okay
that's done in the page where you edit your bot, so unless you can dig into that request and emulate it (assuming that isn't against top.gg ToS) idk how you'd go about it
yeah I understand
so is there really no free webhook server hosting?
maybe I'll take you up on that aws plan then
why not just host a sub-process <python library name> server in your bot code and have that listen for stuff
i do that on repl.it
yes
the give you two free subdomains
a remotely accessable REPL (read evaluate process loop stuff) to access and a bash shell which only people with access to the repl can use
when i say REPL in caps it means the actual read evaluate process loop stuff
got it
but repl is a testing environment so don't expect it to be that fucking awesome
the free plan is good enough for my stuff tho I'm looking to buy hacker plan soon
they have a lot of tutorials on their repl talk sitr
for hosting bots
not sure if they have for top.gg
but i might be able to explain
the two subdomains are <repl name without dots>.<user name withour dots>.repl.co and <repl name without dots>--<user name withour dots>.repl.co
Start a Flask server on your python app and have it listen for requests to the environment variable PORT
Now on your bot/server page add any of the subdomains
I'm sorry but how is repl better than heroku?
the free plan is good enough for my stuff tho I'm looking to buy hacker plan soon
@earnest phoenix btw you can get the hacker plan for free with GitHub student
okay thank you sm for that information
I have it rn
I'll try it out rn
My school is not on GitHub 
yeah I also have GitHub student
You can get private repls with hacker
My school is not on GitHub :CS_AlphabetF:
@earnest phoenix neither is mine, you can still get it
Nobody can see your code
You just need to send a pic of your ID
i don't need GitHub student rn
It's free, you might as well get it
Also you just said you were planning on buying hacker
buying
Yes, and I'm saying you don't have to do that
By all means, go ahead and pay for it then
ok
I'm sorry but how is repl better than heroku?
@hollow sedge it's not specifically better since it's more of a testing environment (as code said), but it has capable of a lot more in terms of supported languages
Not sure about specs though
Yeah I was thinking more in terms of specs
I love repl as a testing environment though
It is awesome 
i only use repl as an IDE and a free host
I see
I have my VPS for that which is paid by an admin in our team 
I wouldn't really use it as an IDE but u do u
I keep repl for testing
I wouldn't really use it as an IDE but u do u
@hollow sedge it is meant to be an IDE...

is there any way to get a massage id from a specific channel ? at discord py
What I meant was I'd rather use VS Code but that's long term development anyway
is there any way to get a massage id from a specific channel ? at discord py
@low swanctx.message.id
nah didnt work
Can you share your code
yes a moment please
i want to take the message id from diferent channel to log it in a diferent channel
😛
On what?
xD
For the latest message?
yes
K
i should use fetch ?
use await channel.history(limit=1).flatten()
This will get the last message of the channel
As a list tho so you'll probably need to add [0]
Also this probably isn't the best way
Nvm
Do message = await channel.fetch_message( channel.last_message_id)
Either one will probably work
Not sure about the last one
np
Okay
Two advices all wrong
@low swan Do you want to fetch a message with a specific ID in a specific channel?
basically the idea is that users sends a photo and i want to delete the photo and reupload it as embed
Err
Well here's the thing
I really want to ask this, why would even want that in the first place
i khnow its hard
You'd have to cache the image manually
And I mean the image data itself
Not as far as I know
They have failed to work multiple times for me after deletion
i try to make it thouth to download an image it self
and reupload it to a secret channel
no, they will be immediately removed and up to cloudflare cache to decide when to expire the link (if you accessed it before it was deleted)
Logs channel?
Why not use a database and store the image URL there?
it will work ?
uh why even use a database lol
because the image will be deleted
- get the link of the image attachment
- download the attachment to memory
- send the attachment to discord as an embed
and them i tryed to get the image url from the secret channel
Actually, true, could just fetch message instead
Makes sense
i dont thint that will work because you delete the image
If you cache the image data, no
huh
Can't you cache for this?
just download and reupload the image smh
i made it like that
i download the icon local i delete the user message and i upload the image in a channel that users dont have perms
then send it to the correct channel
not the same channel
here is the full code
python is just await/async
i want the image url in embed and i want to retrieve the url from the sensed image in the secret channel
also my english are bad
this
I'd rather have
f"Sum: 5 + 5 = {5 + 5}"
than
"Sum: 5 + 5 = {}".format(5 + 5)
It depends tbh
s = f"{string.ascii_letters[random.randint(0, len(string.ascii_letters)-1)]}{string.ascii_letters[random.randint(0, len(string.ascii_letters)-1)]}{string.ascii_letters[random.randint(0, len(string.ascii_letters)-1)]}"```

lmao
that goes for me 
yes
Hey, can anyone help me change my vote and invite button colors on top.gg? I honestly don't know css
here's what i currently have:
<style>
.titleandvote{
color:#2B0548;
}
</style>
@restive furnace link is wrong the 2 should be to
@earnest elm wait did you just steal the code of popular bots and combine them into one?!
Galaxy combines MEE6, Dankmemer, Dyno, and more
wait i didnt do that description
it was this
wat
hm
steal
thats a bold word
i have been working on this bot for about a year
Can you have CSS borders with rounded corners?
of course
there's nothing on MDN about rounded corners
it's just border-radius





hey does anyone have good command ideas?
@slender thistle -ideas
-ideas @sly marten
@sly marten
Find something that you would like in a bot, and has also not been done before. Try and come up with a list of things you are interested in, and think up ways you could make the task easier with a discord bot. Eg. I like fishing -> I'm in a fishing discord group -> I'll make a bot that has fishing data and gives fishing advice. or I like a certain cartoon/anime/tv show. -> Why not make a bot that reminds me when new episodes are released and their watch dates? Once you have a fair amount of concepts down, try and look for those bots on bot listing sites like this one. If you cant find a bot that does what you laid out before as a bot concept, then feel free to write it! Who knows? Maybe a lot of people would like what you create...
ty
alright it's time to make a fishing bot ty luca for the -ideas
How can I make a bot like epic rpg
How can I make a bot like epic rpg
@toxic pilot you code it
How?
we can help with making the bot but the battling and RPG stuff you figure it out
How could I make the presence like refresh to make the server count change, since whenever the bot joins a new server, the counter does not change. It is propably pretty simple I am just wondering how to make it :)
client.once('ready', () => {
client.user.setPresence({ activity: { name: `${client.guilds.cache.size} Servers`, type: 'WATCHING'}, status: 'idle'});
});```
thanks I will check it out :)
Make sure to save a var1 with guilds.length and var2 = 0
On every GUILD_CREATED event var1++
GUILD_DELETED var1- -
Create a timer and compare var1 with var2.
If they are different first set var2 = var1;
and update the current presence info, watching var2 server
If(var1 == var2 || var1 == 0) return;
That’s it
Start the timer in the ready event
what is the difference between int++ and ++int and int-- and --int
hey guys
could somebody help me with my error:
console.log(name, + "\n" + raid.gym_name, + "\n" + raid.lat, + "\n" + raid.lng)
let start = raid.raid_start.splice(4);
let end = raid.raid_end.splice(4);
let spawn = raid.raid_spawn.splice(4)
const embed1 = new Discord.MessageEmbed()
.setColor('#0099ff')
.setTitle('Pokehub Raid Notifier')
.setDescription("Pokemon name: " + name + "\n" + "Raid Level: " + raid.level + "\n" + "Raid Start time: " + start + "\n" + "Raid End Time: " + end + "\n" + "Raid Spawn Time: " + spawn)
.addField(raid.gym_name, raid.lat + raid.lng)
.setThumbnail('https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQ2hDLbaXZ41SB4HUikZSG1ZK4wIf9OvgT9hw&usqp=CAU')
.setTimestamp()
.setFooter('Command created for Pokehub!');
``` raid.raid-start.splice is not a function
Let’s explain it differently @earnest phoenix
a = 5; b = ++a; // b = 6, a = 6```
Using pre- or post decrements on one var is basically the same even if I never seen somebody using pre decrement in this case
@boreal iron decrement = -value, increment = +value
How can I make rpg bot?
I dont know how
You need to code your own bot
You will need knowledge of a coding language of your choice for making bots, python and JavaScript for example
I’ve had good luck with mongodb but yes you can choose your own
Can u give me some example code?
No.
See the docs
Where
You need to code it yourself, read the docs of the language you are using etc
Dude you need to look into it yourself, if we spoon feed you everything you won’t get anywhere with a bot. If it’s your first time coding I wouldn’t recommend starting with a bot.
Even if it’s a dumb bot that shouts at you when you say fortnite etc
Just something to get used to the language
How to find a message by its ID in d.js?
Even if it’s a dumb bot that shouts at you when you say fortnite etc
Ahahahahahahaha
Even if it’s a dumb bot that shouts at you when you say fortnite etc
thats a great idea actually
I’ll get on it
woah you sent 4 msges at the same time
Stop
you can use bulkDelete
like
should be in the docs
Well you will need to ensure the bot has perms to manage messages, you can add a check for it too if you wish, you might also want to check if the user running the command has a certain permission most likely manage messages, then you will need to have an argument that allows a user to type for example -purge (amount to purge). Then you use bulk delete to delete the amount of messages using the arguments the user put in
ok
yeah and the permissions of course
dont want everyone to delete messages
Yeh haha
i mean i forgot that at first oops
Or maybe troll bot!
🙂
const fetched = await message.channel.messages.fetch({ limit: deleteCount });
^^^^^
SyntaxError: await is only valid in async function
at wrapSafe (internal/modules/cjs/loader.js:931:16)
at Module._compile (internal/modules/cjs/loader.js:979:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47```
Pls help
if (!message.member.roles.cache.some(r => ["Amun-Ra 🌞", "Osiris 🔨", "Horus 🛠"].includes(r.name)))
return message.reply("Sorry, you don't have permissions to use this! Please Make Sure you have either a role named **Moderator, Administrator or Owner**.");
const deleteCount = parseInt(args[0], 10);
if (!deleteCount || deleteCount < 1 || deleteCount > 100)
return message.reply("Please provide a number between 1 and 100 for the number of messages to be deleted.");
const fetched = await message.channel.messages.fetch({ limit: deleteCount });
message.channel.bulkDelete(fetched)
.catch(error => message.reply(`Couldn't delete messages because of: **${error}**`));
message.channel.send("**Purged**")
}```
my code
@viscid gale ohk
where i mention async?
but basically (async=()=>{ASYNC-CODE-HERE})()
by seeing how it is
ok
put everything in the ifstatement with the async block
like if(commandWhatever){ (async=()=>{stuff})() }
Put it into the event maybe
message.mentions.channel.first()
``` why foes not this work?
or are they something similar
@earnest phoenix so like client.on('message', async message => {})
any idea?
If I remember correctly
yes
const target = message.mentions.channels.first() || message.channel;
if(target.members.size >= 36 ){
It can not get the size from channel mention @earnest phoenix
wait doesnt members.size only work for voice channels or am i stupid
it works for channel xD
Hey does anyone know how to make a bot be online automatically without having to do it manually?
Host it?
Ty
And does anyone here know why my firebase query returns undefined but when i run it for a second time it works?
Thats a bit annoying
I'm not sure cause I don't know firebase but maybe something isn't cached?
Or it took too long to execute so the log goes first, then it gets cached and when u do it again it returns that
could be yeah
i tried to delay it a bit so it has time to get it but still doesnt work
its only when you do it for the first time or after something changed
if something changes you have to run it again to get the actual result
client.commands.get('vote').execute(message, args); gives me the error (node:9492) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'execute' of undefined
it worked before i npm i express'd
hi
who can help me with this error https://pastebin.com/sg2HKE9W
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
client.commands.get('vote').execute(message, args);gives me the error(node:9492) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'execute' of undefined
@tired gate justvoteexist inclient.commands?
yep
via js module.exports = { name: 'vote', description: "sends the link to vote for the bot!", execute(message, args) {
@lost stone what are doing, calling an API?
That error might be that the json is empty or you arent calling/using it right
yep
@tired gate The error says it does not exists in the collection
hey guys
i am trying to get the amount of invites someone has by using this code:
if (message.content === '!check') {
var userId = message.mentions.members.first();
var userInvites = message.guild.fetchInvites().then(invites => invites.find(invite => invite.inviter.id === userId));
var useAmount = userInvites.uses;
if (useAmount === undefined) {
message.channel.send("<@" + message.author.id + ">" + ` has 0 invites`);
}
else {
message.channel.send("<@" + message.author.id + ">" + ` has ${useAmount} invites`);
}
}```
the !selfcheck works
why doesn't this function work?
it straight up does nothing.
if(message.content.startsWith("c!invite")) {
let invite = new Discord.RichEmbed()
.setColor("RANDOM")
.setAuthor(message.author.username, message.author.displayAvatarURL)
.setThumbnail(message.author.avatarURL)
.setTitle("Click Me")
.setURL(`https://discordapp.com/oauth2/authorize?client_id=${client.user.id}&scope=bot&permissions=8`);///link bot
message.channel.sendEmbed(invite);
}
});
client.login("");//////
});
can someone help me why this gives me a error
@weak crag what's te error
it doesnt work

send the error
don't ping me please.
soz
Well you have to run it ofc 
i did
also
what the fuck why is your color RANDOM
have you defined it with math.random?
yes
debug it
an send a ss of your console.
also try logging it
console.log(invite)
also you are using message.content.Startswith wrong.
look at the docs @weak crag
@weak crag i think u need to use message.author.displayAvatarURL() and not message.author.displayAvatarURL only
@coarse dragon it would give an error in the sonsole
i tried it and it didnt work i tried everything can u guys send me a code and i put in idk if mine is wrong or something
console
@weak crag no we are not going to spoonfeed.
i already gave you the answer.
you are using message.content.StartsWith wrong
use message.content instead
ok a sec
i use glitch is that a problem ? @eternal osprey its like vs but its a website
idk never used glitch
try it on vs
i think that they use different debuggers (i have no clue tbh
so it might be
could somebody help me with my problem?
if (message.content === '!check') {
var userId = message.mentions.members.first();
var userInvites = message.guild.fetchInvites().then(invites => invites.find(invite => invite.inviter.id === userId));
var useAmount = userInvites.uses;
if (useAmount === undefined) {
message.channel.send("<@" + message.author.id + ">" + ` has 0 invites`);
}
else {
message.channel.send("<@" + message.author.id + ">" + ` has ${useAmount} invites`);
}
}``` it is not displaying anything.
tried logging it etc.
- Member is not user
- You are not getting the id of user
userId could be a GuildMember? and you need to add .id to get the id. add a check to make sure it exists first or make it the author as a fallback. don't compare the inviter id with a member object
on the bottom, you used message.author.id instead of userId.id
message.content === '!check' results false when you type: "!check [tag]", cuz message.content gives: "!check @ebon kelp"
Try: message.content.startsWith("!check")
flaze stop spooning 
yeah i tried making it but it wouldn't work.
but !check <@id> would automatically convert
to a valid user.
does google analytics eat your resources
@solemn leaf only way i know to do this
`${member} has ${useAmount}...`
why do textarea tags have max-height set to their height by default
why would we know
why would we know
@solemn leaf because you guys are cool
you're cool

could express be interfering with the error im having?
client.commands.get('vote').execute(message, args); gives me the error (node:9492) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'execute' of undefined
since i changed nothing, stopped working after installing express
it can't be
there is no command vote
there is xD
i changed absolutely nothing to the code and it worked fine before
module.exports = {
name: 'vote',
description: "sends the link to vote for the bot!",
execute(message, args) {```
should i add a preview command to my webhook generator?
hi
im new to better sqlite
and
case 'start':
let table = sql.prepare("SELECT count(*) FROM sqlite_master WHERE type='table' AND name = 'info';").get();
if (!table['count(*)'])
{
sql.prepare("CREATE TABLE info (id TEXT PRIMARY KEY, username TEXT, bal INTEGER)").run();
sql.prepare("CREATE UNIQUE INDEX idx_info_id ON info (id);").run();
sql.pragma("synchronous = 1");
sql.pragma("journal_mode = wal");
bot.getInfo = sql.prepare("SELECT * FROM info WHERE username = ?");
bot.setInfo = sql.prepare("INSERT OR REPLACE INTO info (id, username, bal) VALUES (@id, @username, @bal);");
infoL = { id: message.author.id, username: message.author.username, bal: 0 }
}
else {
message.reply("test")
}
break;
here
And we dont care
We wouldn't care if your new
Apperently not
it sends test cuz it says the table already exists
not you im just saying in general
Bcs you cant do it
with what
is it a db
ye
you didn't really specify the problem
then use a real db
it is a real db lmao
wdymm
yea it is lol
ok so it sends test cuz it says the table exists
even tho i didnt create it.. i think
cuz only the start cmd creates it
so im confused here
thats my problem
oof ok
sqlite
I could help you with a quick-db
Failed to login: Error [TOKEN_INVALID]: An invalid token was provided.
um
@split hazel addons
my bot is working in another project but in this it says Failed to login: Error [TOKEN_INVALID]: An invalid token was provided.
oh nice this might work https://speedy.is-a-qt.dev/media/1603543878068/Code_oCOnYII6CY.png
lol
much better
does visual studio code have proper ejs support?
@split hazel it has support for egirls too iirc
. bruh
i have a question , there is 2 config js and json, and in both i have to put the token how can i say to connect config.json token?
wait
i have a question , there is 2 config js and json, and in both i have to put the token how can i say to connect config.js token?
@lost stone can you explain your question better?
You have a js config file?
i can't understand anything
yes and json
config.js 

COde we understand all he is the one not understanding
COde we understand all he is the one not understanding
say in?
say in
bruh
what
@solemn leaf
BRO
this one json
LOL
thonk
WHY ARE YOU SENDING YOUR BOT TOKEN
are you fucking telling me you split it up into multiple strings
nvm bye no one understandin mee
you should reset your tokens "uncrackable" or not
two mods are typing I'm scared
they're saying they only sent non-essential parts of the token
IM 89% a mod
You wish
-bots noembed
PGamerX#7851's bots:
@outer marsh @steady ridge
get out
I added a multiple prefixes feature to my bot, but when I add a prefix that has more than 1 character, my bot doesnt respond to it. Heres what I used in my main bot.
if(!prefixPara) {
const standardPrefix = new prefixData({
_id: message.guild.id,
prefix: ["<"]
})
standardPrefix.save()
} else {
const prefixes = prefixPara.prefix;
for(const prefix of prefixes) {
// my code
}```
Idk whats wrong
idk
seems like
its a shit way to do it
and in theory you only need 2 lines of code
Artist : Devil & Akash choudhary
Lyrics : Devil & Akash Choudhary (own verses)
Mix and master: Devil
Prod. By : Matt Elvn
Video By : 360 productions (Yuvraj)
Lets connect together on Instagram :
Devil: https://instagram.com/devil_music_?igshid=19szmyutcdn68
Special thanks...
if(command === "3d" || command === "flanger" || command === "gate" || command === "haas" || command === "karaoke" || command === "reverse"){
let premiumorno = db.get(`PREMIUM_${msg.author.id}`)
let serverpre = db.get(`SERVERWOW_${msg.guild.id}`)
if(premiumorno !== "yes" || serverpre !== "yes") return msg.reply(`Woah there this is a premium command! which means you need to become a patreon to use it :) **But You can still try out - ${PREFIX}bassboost,${PREFIX}echo,${PREFIX}nightcore,${PREFIX}vaporwave without being a patreon** If you are a patreon then kindly run ${PREFIX}givepremium command`)
Server is added as a premium guild as you can see then why does it says not allowed
&&
@earnest phoenix The && and || Operators in JavaScript. If applied to boolean values, the && operator only returns true when both of its operands are true (and false in all other cases), while the || operator only returns false when both of its operands are false (and true in all other cases).May 25, 2016
I don't want both to be true
I want it to see if any one of those are true
app.post('/dblwebhook', async (req, res) => {
console.log("test")
})
is premiumorno whether the user has premium
is
premiumornowhether the user has premium
@sonic lodge yes
so if your user does have premium, but the server he's using the command in does not, your error will trigger
@lost stone bro do not send here your token,i did it once and then my bot sent everywhere some random nudes lmao
Wait we cannot use 1?
so if your user does have premium, but the server he's using the command in does not, your error will trigger
@sonic lodge why?
I am using ||
isn't it if one of them is true
if(premiumorno !== "yes" || serverpre !== "yes")
if (user doesn't have premium OR server doesn't have premium)
yeah
let's say user has premium, but server does not. we get
if (false or true)
so the error triggers
lol that too
command === "3d" || command === "flanger" || command === "gate" || command === "haas" || command === "karaoke" || command === "reverse"
ok
that also work
db.set(`SERVERWOW_${msg.guild.id}`,`yes`)
@delicate shore
And I get vakue of SERVERWOW_${msg.guild.id}
and check if it returns yes
@earnest phoenix I do it like this in other cmd but they don't work
what happend
why do i have this emote
does someone know ,where can i find all multiple guilds,like message.guild.channels.cache.size?
@earnest phoenix I do it like this in other cmd but they don't work
@delicate shore
I meant in other they work
but not in dis
stop pingin me
Sorry
does someone know any website,where i can find all multiple guilds like message.guild.channels.cache.size?
why should a website tell you that
a website does not have access to your bot
hello guys
hello guys
@toxic jolt bye
it does not matter,if it has or does not have,i want only know multiple guilds
your question makes no sense to me
const request = require('request');
const options = {
url: `https://cortexai.xyz/AI/Chatbot/Cortex`,
headers: {
'key': '3)w74xo+Dew/)s0bTFxaASF24gdd&24$2>3',
'soru': 'anan nasıl' // "ı" is special character.
}
};
request(options, (err, res, body) => {
let parsedJson = JSON.parse(body)
console.log(parsedJson)
})``` i have a this error
i how to fix special character errors
Code913,on Discord Js i found only basic guilds where you need only 3 parts = message.guild.id,but i did not find there guilds of more parts,like message.guild.channels.cache.size,where i can find these multiple guilds?
discordjs guide does not tell you everything
some stuff you need to figure out on your own
bro am i blind?
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'10',
'11',
'12',
'13',
'14',
'15',
'16',
'17',
'18',
'19',
'20',
'21',
'22',
'23',
'24',
'25',
'26',
'27',
'28',
'29',
'30',
'31',
'32',
'33',
'34',
'35',
'36',
'37',
'38',
'39',
'40',
'41',
'42',
'43',
'44',
'45',
'46',
'47',
'48',
'49',
'50',
'51',
'52',
'53',
'54',
'55',
'56',
'57',
'58',
'59',
'60',
'61',
'62',
'63',
'64',
'65',
'66',
'67',
'68',
'69',
'70',
'71',
'72',
'73',
'74',
'75',
'76',
'77',
'78',
'79',
'80',
'81',
'82',
'83',
'84',
'85',
'86',
'87',
'88',
'89',
'90',
'91',
'92',
'93',
'94',
'95',
'96',
'97',
'98',
'99',
'100',
there is 1 missing
i looked 22 times
cant find it
wtf are you doing
there's no missing number
theres 100
and it ended in 314
there is 1 missing
@tardy hornet
'96',
'97',
'98',
'99',
'100' // delete this ","```
and it ended in line 313
the trailing , doesn't matter in arrays
Why you ping me
Because they replied to you
Didnt ask about you being 12 and in 80 servera
I'm attempting rubber duck debugging
Gl
||
||
my bot is not a music bot but why it says api
The reason is
Which means you don't have permission to do something on Discord
Such as banning a member
Intents reqired now?
i am the ownership
Intents reqired now?
@solemn leaf for what?
@lost stone does the bot have permissioms? no you
i am the ownership
@lost stone they're talking about server member role permissions
Robot the API says otherwise. Are you able to reproduce what you did to get that error
yes
mot*
not*
is it just me or people don't know that the edit button exists
he have full perms
he have full perms
@lost stone even administrators have restrictions
they can't edit some stuff of people with roles above them
accessableby: "Administrators"
can you send the code?
You need to debug your error via reproducing. Just because you think it has permission to do something does not mean it really has permission to do something.
module.exports = {
config: {
name: "setwelcomechannel",
category: "moderation",
aliases: ["enablewelcomechannel", "swc", "ewc", 'sw', 'ew'],
description: "Sets A Channel Where The Bot Can Welcome Users!",
usage: "[channel mention | channel ID | channel name]",
accessableby: "Administrators"
},
run: async (bot, message, args) => {
if (!message.member.hasPermission("ADMINISTRATOR"))
return message.channel.send(
"**You Do Not Have The Required Permissions! - [ADMINISTRATOR]**"
);
```
the bottom of the code
what's the problem
missing permissions
also there is ``` } catch (e) {
return message.channel.send("Error - Missing Permissions Or Channel Is Not A Text Channel!");
}
}
};
he have administrator perm
Can you share the whole command via hastebin
ok hastebin crashed
Then try https://hasteb.in
@lost stone are you checking if the member AND the bot has permission to do smth?

How do me get someone's vote and the results of the vote can be used for certain cmd that the bot requires?

You may be looking for https://top.gg/api/docs#votes
With the code you shared, it could only be coming from <Channel>.send(...) (includes when trying to send to a channel specified by the author). The stacktrace produced from the screenshot does not detail where it's coming from either. Are you sure the error is originating from the code you shared.
added some tab stuff to this: https://discord-webhook.code913.repl.co/
what do you guys think of it
nice
why the fuck do the buttons just disappear

@ionic dawn imagine laughing at me literally at the same time when i finally fixed it

@quick dune You don't have NPM installed, you can install it by installing nodejs as it comes pre-installed iirc
I see
Lmao
I have node.js installed now
then re do the npm i dblapi.js
why are you in the nodejs repl?
do it in a normal command prompt
like go to your folder click the address thing at the top, type cmd hit enter then type it
click and then type cmd then do the npm i dblapi.js
how can you make vanity urls using node.js? e.g domain.com/users/kax
you need a domain?
nah i have a domain, just wondering how to make like vanitys
so like with discord you can have /dbl
you make a new html page?
yeah but making it automatic, like people can make their own vanitys
ok
how do i remove an attribute from an element in D3?
@vocal sluice basically tryna assign a vanity url to an express site
yeah but making it automatic, like people can make their own vanitys
@queen crescent just generate a new HTML page to that route and the page just redirects people to the correct invites
now just go to https://top.gg/api/docs and do what ever you got to do
okay
does anyone know a good api for trivia?
I’m trying to make a trivia command, and trying to make it pull random questions
Anyone have experience with React routing?
does anyone know a good api for trivia?
@normal sage I think @green kestrel has an API for trivia bot
Anyone have experience with React routing?
@stoic hull https://dontasktoask.com
help await is only valid in async function
alright, I willl check it out!
Lol.
@earnest phoenix you're passing async as a parameter and NOT making the function async
put async after the =
i add the code js await is only valid in async function
Well im trying to get my dashboard up, made with react and hosted with apache, but when i AUTH with discord, it redirects to the server selector page and instantly redirects back to the landing page, anyone know how to fix this issue?
var black = await Blacklisted(message.author.id);
if(black) return message.channel.send("Personas en el ForceNo tienen permitido mis comandos.");
```*
@earnest phoenix re read my message
how do i put that?

literally just put the async keyword before the function declaration
exports.run = exports.run = async (client, message, args) => {?
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
@earnest phoenix
An async function is a function declared with the async keyword. Async functions are instances of the AsyncFunction constructor, and the await keyword is permitted within them. The async and await keywords enable asynchronous, promise-based behavior to be written in a cleaner ...
@normal sage I think @green kestrel has an API for trivia bot
@earnest phoenix I don't share access to triviabot API but there's an open one you can use which is at https://opentdb.com
message.guild.members.cache.get(results[0].user)
``` is returning undefined when in my database, results[0].user is my ID
I am in the guild
<!DOCTYPE html>
<html>
<body>
<body style="background-color:rgba(0, 255, 21, 0.096);"></body>
<h1 style="font-family:courier;">NKBot!</h1>
<p style="font-family:Century Gothic;">[BOT STILL IN EARLY DEVELOPMENT]</p>
<p style="font-family:Century Gothic;">[ADDING THIS BOT TO YOUR SERVER WILL ONLY RESULT TO SUPPORT TO THE CREATOR]</p>
<p style="font-family:Century Gothic;">[SOME COMMANDS ARE UNAVAILABLE]</p>
<p style="font-family:Century Gothic;">Want a multi-function bot in your server?</p>
<p style="font-family:Century Gothic;">Want a bot that will give you many types of random commands?</p>
<p style="font-family:Century Gothic;">Then add NKBot to your server! Not only do you get early development bot perks, but you also support the creator!</p>
<p style="font-family:Century Gothic;">Invite NKBot to your server and use nk;help for commands</p>
<a href="[link]>NKBot Support Server</a>
<a href="[link]">Invite NKBot</a>
</script>
</body>
</html>
someone a little help with this?
How do I call a file that is close to the index for a handler?
Use CSS and don’t assign the same style to each element.
Does it actually connect to the game?
I can't locate my bots folder, Despite it being in [name]'s stuff.
I'm trying to install ffmpeg for my radio command
just "cd" per folder.
@sly marten If u open the " u also have to close it
I'm in the right folder, sort of
My folder is called "Spiderbot command handler" and I'm in the folder that holds it
I think I fixed the issue, My sister must've moved the folder by accident :/
cd "The folder with spaces"
or use backticks
my way easier
cd Dont\ Use\ Spaces\ In\ Folder\ Names
those are hot
@fluid basin Does that actually connect to an among us game?
Does anyone know how to center an image horizontally to the right? for example:
flex box
@stoic hull yes it does, but its buggy rn
Thats cool, whats the package name? Might try to turn it into a discord bot.
I'm interested too lol
Whoops
I'm interested too lol
@restive furnace among-js
But for me it only joins with a private server.
i don't think so kognise is willi123yao's github
@restive furnace
ok but still i don't think that
or then its possible, but I always thought that his github is https://github.com/willi123yao
and i still dont have the tag
@tardy hornet you don't get it anymore
They removed it due to presumably applying with their bots just to get the badge
The Developers who had their Bot verified have the Early Developer Badge now
aka the verified Developer badge is no longer obtainable
I tried flexboxes, they appear to align images to the far right now
I'm getting a 'connection.play' is not a function error while making a radio command, can someone help please?
module.exports = {
name: 'radio',
description: 'radio',
execute(client, message, args) {
const broadcast = client.voice.createBroadcast();
const dispatcher = broadcast.play('https://radio.dual.pw/stream.mp3');
if (!message.guild) return;
if (message.member.voice.channel) {
const connection = message.member.voice.channel.join();
connection.play(broadcast).then(
message => { (message.channel.send('Playing the <https://dual.pw> radio!')); },
);
if (!message.member.voiceChannel) return message.channel.send('**error** You need to be in a voice channel to play the radio');
}
},
};```
I checked the docs and something similar to what im doing
const dispatcher = connection.play('/home/discord/audio.mp3');```
connection is a promise as the .join() method returns one.
Alright, thanks.
Is there a alternative I can use?
alternative
what?
"damn it i have to open my car door to enter it, is there an alternative?"
Unless the Bot User is being informed that the bot creates a invite
But still a privacy breach
well im in all the servers my bot is in
but it would be cool to try that so im asking
Alright, thanks.
Is there a alternative I can use?
@still merlin your alternative is to fix the problem.
If your value is wrapped around a promise, you need to get the result of it. Either through async/await or .then
Read this guide for more information on using promises, as it's something you'll use throughout JS: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises
YEET
lol
I tried awaiting it, and my bot joined the voice channel but its logged a weird error
(what);ABORT=true;EXITSTATUS=1;throw"abort("+what+"). Build with -s ASSERTIONS=1 for more info."}Module["abort"]=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}Module["noExitRuntime"]=true;run();
abort(TypeError: connection.play is not a function). Build with -s ASSERTIONS=1 for more info.
(Use `node --trace-uncaught ...` to show where the exception was thrown)```
ok this following question is logically difficult(for me at least)
now i tried a 1 kyu problem(don't ask me y xD) and i chose the chess challenge
https://www.codewars.com/kata/5985ea20695be6079e000003
below shows an example of what my code gives, then what was an expected outcome
the problem im facing is that although i can successfully place down queens that do not check each other, i cannot place ENOUGH safe queens in the board
Q.....
..Q...
....Q.
.Q....
...Q..
......
..Q...
Q.....
.....Q
...Q..
.Q....
to the chess dudes out here, any advice?
thanks in advanced
you can put a queen in the bottom right position in your first example
guild.leveling = {
"enable": false, "rewards": {
"enable": false, "roles": []
}, "blacklist": [], "levelUp": {
"channelId": "", "enable": false, "text": ""
}
}
leveling: {
"enable": Boolean, "rewards": {
"enable": Boolean, "roles": [{
"level": Number, "roleId": Number
}]
}, "blacklist": [String], "levelUp": {
"channelId": String, "enable": Boolean, "text": String
}
}
help me
it is not saving those "enable"
hm is BAN_MEMBERS a valid permission, my bot keeps saying it doesnt have permissions but it has?
KICK_MEMBERS works
Am I able to apply for a spot in the top.gg website even if my bot isn't 100% ready yet?
also how will I know when they're trying to review it because I don't want my bot to be offline when that's happening otherwise it would be quite annoying
i mean my but is also still WIP but most features work and its online 24/7
i usually keep it online, do stuff and test it with another bot and then i update which takes like 20 seconds
yeah the features I have on my bot work well but it's just I haven't yet added all my features
I actually have some really nice plans
hm is BAN_MEMBERS a valid permission, my bot keeps saying it doesnt have permissions but it has?
figured that out btw typed banable instead of bannable
yeah the features I have on my bot work well but it's just I haven't yet added all my features
@rugged cobalt Well you can add them whil its on top.gg
i dont think thats a problem
exactly
so then I have some time to get an online database
i have a lot of really nice features but seeing that they take multiple weeks anyway i just decided to make them a bit more fancy
mine was just intended to be on a friends server but they told me to put it on top.gg and make everything look fancy
im still planning to add more aswell
yeah same
mine is kinda based around currency but it's not really like any of the other currency bots
yeah i thought about adding a few currency based minigames aswell
I just need to plan it out
yeah
@viscid gale Well i created a function to solve that problem in JavaScript 
@viscid gale Well i created a function to solve that problem in JavaScript :OMEGALUL:
@earnest phoenix thank uuuu
i'll see how much it works
What do y'all use for hosting?
VPS from retracted host
what does that mean
Say no more
A virtual private server (VPS) is a virtual machine sold as a service by an Internet hosting service. The virtual dedicated server (VDS) also has a similar meaning.
A VPS runs its own copy of an operating system (OS), and customers may have superuser-level access to that opera...
Don't wanna advertise the host
the vps is private, the host is legally not allowed to inspect the files on it
Can anyone help me with status? I am trying to use the code below but for some reason I don't think the time intervals work and also sometimes when it shows one it'll show the next for like a split second and go back. I can't seem to crack it for the life of me?```function testbotstatus(client) {
setInterval(() => {
client.user.setActivity('$help | Test')
}, 1000);
setInterval(() => {
client.user.setActivity('$help | test 2')
}, 2000);
}
@signal lantern 1000 2000 are in milliseconds, so every 1 and 2 seconds you're setting the status to be different
Discord doesn't like spamming of the api
is there a standard time? Because itll sit on the first for a little while before switching
well in terms of minimum time, you can do like minutes at a time, I think people would like it if the status didn't change too fast.
You have to think of each setInterval as it's own timer, so like the top one is boinking every second, while the second one is boinking every 2 seconds
If you wanted to rotate between each status message, you might want to structure it a bit differently.
Yeah I was hoping to get it to rotate, thank you for the info I will try to rework how I am doing it
@signal lantern Yeah, take a look at the answer in this stack overflow to see if you can apply a similar structure to your program, https://stackoverflow.com/questions/7439519/setinterval-to-loop-through-array-in-javascript/7440323
oooo thanks, ill see what I can do! 🙂
how can i add 2 prefixes (bc on phone u automatically get a capital at the begining)
Are you talking about your own bot that you're programming?
yes
Well, currently, you should check for if the message begins with whatever prefix, maybe you can check if the prefix starts with the first prefix OR the second prefix
Or, in your case, since the formatting gets messed up, you can format it so that the prefix check for the same letter, regardless of capitals
so like i did here but then with capital and non-capital
Or, in your case, since the formatting gets messed up, you can format it so that the prefix check for the same letter, regardless of capitals
@tame kestrel how?
how can i add 2 prefixes (bc on phone u automatically get a capital at the begining)
@quiet arch you can test the message's lower case version with the prefix
so like i did here but then with capital and non-capital
@quiet arch What language?
js
anyone knows how to fetch more than 100 messages in a channel ?
Do you use something.startsWith(prefix)?
anyone knows how to fetch more than 100 messages in a channel ?
@river thistle what language
so like i did here but then with capital and non-capital
@quiet arch so something like this, you can use the || operator, also known as the OR operator
msg.content == 'pepe' || msg.content == 'uwu'
If either side is "true" then it outputs as true
bc if i do const prefix = pepe in my case i cant do const prefix = ('pepe', 'Pepe')
anyone knows how to fetch more than 100 messages in a channel ?
@river thistle https://stackoverflow.com/questions/55153125/fetch-more-than-100-messages
@quiet arch take a closer look at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR to learn about the OR operator a bit more, you can use these to do compound boolean expressions, basically meaning you can check multiple things at a time, or check for multiple things
Yes! Let me know if you have any questions or concerns, I want you to be able to learn it so that you can apply it to other things in the future
sure i will take my time to read it but one more question bout the prefix
What's up
if ure in const can u do like more then one output or however u call it ex: const prefix = 'pepe', 'peepo'
why i get this error when i execute the "play command"?
So, const is just another way of creating a variable. When you use const it usually means that you can not change the variable after.
In terms of lists, you can use arrays/tuples like this: const name = [ 'one', 'two' ]
They come with their own benefits like being able to sort and all that. I don't think you can use them how I think you want to use them though.
like you can't do msg.content === name
yes
yes
@quiet arch depends on how you implement it, try deleting the !msg.content.startsWith(prefix) and creating your own logic for filtering out message that start with either of your prefixes
a variable can only be assign to one value
oh ok
if you want to have your prefix to have multiply values, then you would need to make a string array
wait, i am just repeating what safe said
oopies
but if i make like 2x const 1, will be prefix_1 and 2, prefix_2 and then in my code prefix1|| prefix2 + command
not needed
an array would be more efficient
arrays are more efficient
u have an article about array bc i dont know what it does
so array is let
Yes, an array is better, but I'm trying to have aka start from the ground up, and understand what really is going on when they check for multiple prefixes
no
hmm
let is just another variable declaration like const
oh
let means it's mutable, or changeable after, const means you shouldn't change it later on
^^^^^
oh
array is []











