#development
1 messages · Page 511 of 1
OOOOOOOOOOOW
@lament meteor i dont have a client and i didnt make a new client in a client and a client.
then open command prompt, type cd drag the file into the command prompt then do the node cmd
@earnest phoenix ur using a cmd handler right
ok thx
yes, but i didnt use client in the handler, i made a new one only for that command, it isnt using the client from the main file
because that command pings everyone
....
@lament meteor u dont understand how handlers work if u think what u think, my error is cannot read id of undefined so the id of something is undefined but what
I think he knows more than you know Callumok2004
the only id there is, is message.author.id so idk @earnest phoenix but just saying it isnt a good practice to make a new client in the cmd. just saying
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});
//the only thing with a object that has a .id
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)
//this will not cause the error
client.channels.get("501467078172082176").send("@everyone", { embed: announce })
message.delete();
client.login(process.env.TOKEN)
}```
If you make a new client, that client won't have any users or anything because those are populated on ready and you don't login with that client
So ready would never fire
that also might be the issue 🤷
could people not post a huge blob of code and say "why doesn't this work" that's not helpful to you or anyone else
@heady anvil i agree they should put the error msg with it at least
or what happens exactly
@smoky spire wrong, it had previously worked, even with a new client
Because you login in that file
but the issue is that he is getting .id of undefiend....
im moving to plexi
Good luck getting help there
and that the thing id is reading of is defined
if your problem is only the ID, then whatever you're getting in that message has no author
but that code has a lot of other problems lol
I have this code however I need to input more advance capacities in my bot
can someone assist please
@quartz kindle when people don't know how to read error msgs :/
u gave no details about what you are coding @quasi saddle
@quasi saddle what do you do?
asks for help and doesnt say what they need help with
ikr
Hi, I need to enable my BOT to be reactive to voice command
tfw someone tries way too hard to act very officially
learn from the query of different devises
lol merci
var Discord = require('discord.io'); var logger = require('winston'); var auth = require('./auth.json'); // Configure logger settings logger.remove(logger.transports.Console); logger.add(new logger.transports.Console, { colorize: true }); logger.level = 'debug'; // Initialize Discord Bot var bot = new Discord.Client({ token: auth.token, autorun: true }); bot.on('ready', function (evt) { logger.info('Connected'); logger.info('Logged in as: '); logger.info(bot.username + ' - (' + bot.id + ')'); }); bot.on('message', function (user, userID, channelID, message, evt) { // Our bot needs to know if it will execute a command // It will listen for messages that will start with ! if (message.substring(0, 1) == '!') { var args = message.substring(1).split(' '); var cmd = args[0]; args = args.splice(1); switch(cmd) { // !ping case 'ping': bot.sendMessage({ to: channelID, message: 'Pong!' }); break; //
on Padillo
Bon, déjà je pense pas trop pouvoir t'aider vu que c'est discord.js
Je code
- discord.py
- JDA
discord.js = javascript, non java
Ok oui
java cest different
Je viens de la dire
and please use code blocks
vous avez tout compris mon idee
utiliseur code blocks pls
ok
``` code here ```
ok
var Discord = require('discord.io'); var logger = require('winston'); var auth = require('./auth.json'); // Configure logger settings logger.remove(logger.transports.Console); logger.add(new logger.transports.Console, { colorize: true }); logger.level = 'debug'; // Initialize Discord Bot var bot = new Discord.Client({ token: auth.token, autorun: true }); bot.on('ready', function (evt) { logger.info('Connected'); logger.info('Logged in as: '); logger.info(bot.username + ' - (' + bot.id + ')'); }); bot.on('message', function (user, userID, channelID, message, evt) { // Our bot needs to know if it will execute a command // It will listen for messages that will start with ! if (message.substring(0, 1) == '!') { var args = message.substring(1).split(' '); var cmd = args[0]; args = args.splice(1); switch(cmd) { // !ping case 'ping': bot.sendMessage({ to: channelID, message: 'Pong!' }); break; //
one min
still unreadable
js beautifier
OUI
?
true
lmao
Everything is ignored
En gros y'a que ca dans ton code:
var Discord = require('discord.io'); var logger = require('winston'); var auth = require('./auth.json');
je travail avec le code de d,autre person donc il me faut nettoyer les leurs
here is the corrected code to the french guy
var Discord = require('discord.io');
var logger = require('winston');
var auth = require('./auth.json'); // Configure logger settings
logger.remove(logger.transports.Console);
logger.add(new logger.transports.Console, {
colorize: true
});
logger.level = 'debug'; // Initialize Discord Bot
var bot = new Discord.Client({
token: auth.token,
autorun: true
});
bot.on('ready', function(evt) {
logger.info('Connected');
logger.info('Logged in as: ');
logger.info(bot.username + ' - (' + bot.id + ')');
});
bot.on('message', function(user, userID, channelID, message, evt) { // Our bot needs to know if it will execute a command // It will listen for messages that will start with !
if (message.substring(0, 1) == '!') {
var args = message.substring(1).split(' ');
var cmd = args[0];
args = args.splice(1);
switch (cmd) { // !ping
case 'ping':
bot.sendMessage({
to: channelID,
message: 'Pong!'
});
break; //
}
}
});```
lmao
d.js or eris. if you are new i think you should use d.js
I never used discord.js so I can't help :/
he said it was a copy pasted code right?
yes

@quasi saddle your code has discord.io which is very old and not good
use discord.js instead
It's not his code
im making a rlly lightwieght discord module but wont have all endpoints
It's his friend code
I need to use discord to eanble the bot function so I can get it to work with Diaalog Flow and Adobe X Voice command
Halloween email me on oravibno@gmail.com
well, good luck. but still, start with discord.js or eris, if you want to use javascript
No one wants to email you
well guess I just kill thew community!!!
Lets say user returns true/false
if not user:
And
if user is false:
Work the same right? Python btw ^
it should yes
the difference is that user === false is strict, while !user is not, at least in js, idk about python
!user would work the same with false, 0 null, "", etc...
Yeah in python theres no ===
For example if u wanna do that you would do
if a == b and type(a) == type(b)
const newUrl = `${url}=forDiscord=${Date.now()}`
url queries work as follows: &name=value&name=value&name=value
& adds a new field, and = specifies the value
&forDiscord=?
your code is adding = twice, which is invalid
also, what does forDiscord do? it works perfectly without it
but not with it
even with the correct value
ah
try just &Date.time()
without the forDiscord
it should still bypass the cache
hi guys
i want to add the "upvote command"
but.. i don't know how to set up webhooks inside of a bot
i mean
i know only the channel webhooks
so if some1 can help me
i'm here
*sorry if I'm wrong speakin' english but i'm italian and italians can do it better e.e *
i have it because im a pokemon fan and umbreon is my favorite pokemon 
mh.. seems legit but let's stop chattin' here
Would anyone know that discordapp.com api link that has a giant list of servers with the server widget turned on?
the particular link all those bots with invite link usernames use to spam join discords
node.js isn't installing 
I open up the installer.. (I'm not on my main)
and I accept the agreement
and it crashes saying the volume D:\ isn't available
and I broke that usb a long time ago
Anthony, don't they do that by brute forcing the invite shortener site links?
re-install windows?? mate this computer will die @dusk thorn
@smoky spire thats one way
but they can also parse some sweet jsons from the discord api
@earnest phoenix i dont think so
@dusk thorn its not an issue within discord's API
never said it was an issue?
i mean
if it was in discord api
it would be an issue
iirc, discord said that the people were scraping it off of public server sites
Discord stated that?
What's the character limit for a ban/kick reason? (discord.js)
Does one exist in the first place?
in the app, you can set a reason up to 512 characters long
i tested something similar before, and it got truncated to 512
Good, big thank
np
Curious, is there a way to collect a bunch of messages in a row and then add them together?
Like with discord.js how would I actually receive those messages I guess
Alright yeah I got it working and I can receive them. But I am still confused on how I could get them in order and add them up to make one string
how would i sort by date lol
because the whole fetchMessages object is kind of confusing to me
lemme check the docs hang on
yeah it returns promise of collection of messages
and messages have a .createdAt property
so just use the .sort() method on collection
.sort((a, b) => a.createdAt - b.createdAt) i think
and then .reduce
and combine the message.content
is it possible for a bot to make a discord server?
cause uh i need a large amount of emojis and screw making this manualy but it works out to 60 emojis servers needed....
yes but only if its in lless than 10 servers
Bots can make servers as long as they are in under 10 total servers
so own less than 10?
thats a weird limit 
yeah it is
It can own maximum 10 servers if it is in no other servers than the ones it's created
ok so next question
whats the best way to make 60 emoji servers 😬
it's to prevent like spam creating servers than transfering ownership to someone and can keep spamming servers
i mean populating them is easy
just make an alt, make the alt create a bunch of servers
seperate servers?
and have bot join it
then store emojis there
bot doesnt hve to own server to add emojis
doesnt discord make you do phone auth if you make to many to fast or at least thats whats happened on my main acnt
probably
oh right then the joy of inviting bot to 60 servers
hf
k see ya next month
is there any better way of doing this someone can think of
making six bot accounts?
context i need lots of icons but discord is a derp and wont let you embed icons
so next best is emojis
make six bot accounts that make 10 servers then invite the main bot to each server? idk lol
oh right not a bad idea jsut fire up a bot to make servers and offload
but can a bot invite a bot to server
if a bot owns the server
No
heck
p r o b a b l y s o m e w a y
it can create invites
make another account and selfbot

does a human need to accept server transfer or could a bot jsut make servers shunt them off to user acnt then leave
i feel this action will set of flags as it is not even mentioning if it was user bot lol
(shhhskkssk)
bot make server to shunt off invites to user acount
that way user account doesnt get locked by discord for making to many servers 😛
but bot acnts dont get locked and demand you do phone auth
Yeah you're right, they just get locked
that's one way of putting it i guess
I've had one of my bots just outright stop working after spamming it
o o f
Just don't use 2fa
it still doesn't login
🤷
its not a matter of 2fa
by locked i mean on a user acnt if you make to many servers discord says yo you looked weird prove your human and until you do phone auth your account is locked
(if you dont own a phone then your fucked)
its human verification
i mean thats the only reason ive got 2fa on my acnt now cause exactly that happened...
with an account made less than 10minutes ago lol
I don't expect it to randomly pop up something that stops u?

it has already like i said ive had it happen on this account
Yeah actually nvrm it does pop up
it asks for a phone number to verify your a human and not just abusing servers
Why xd
and basiclly if you dont have a phone then you need to make an alt....
because discord usually doesn't like random spam botted accounts ? ? ?
They could just lower the max guilds owned then
like what why wouldnt they not want to stop them?
No one should have 100 guilds owned
<.<
guilds isnt the issue its the rate of which your spamming thats a bit un usual
And they're all legitimate and all server seperate purposes
that too
it's just the spamming
yeah and it's more than your proposed 10
listen it's just pointless to straight limit user accounts
if i make an account and 10minutes later i make 100 servers 1 server/second
doesnt that seem a little off to you...
meh
discord obviously watch for that stuff though
it does hence above
yeah that's what we're trying to figure out how to do it
using bot accounts
(i'd hope)
what r u even doing
they they lock your acount till you do phone auth and rip if no phone
That u need 60 emoji servers
i think they even have raised user ratelimits that no normal user can hit, therefore they have another way of detecting api abuse

since user ratelimits changed a bit ago afaik
its not api limits its just a thing pops up saying your a bit unusual
^^
not talking about those
stopping a legit user from creating servers to store emojis 
stopping userbot armies with verified phones 
discord™
👏
rip nitro
just ask dabbit like yo i need 60 servers for emojis whats the best way to not get banned
oof
theyre like twitter except not mainstream at all
@shy rose why do you need 60 servers
spacing out requests will reduce the likelyness
cause need 3k emojis
if I'm checking a member/user object for something specific, am I checking my own cache or constantly requesting discord with that information?
most likely a cache
^
otherwise you'd hit rate limit pretty fast
so I'm free to have an infinite loop with almost no intervals to constantly check members in a specific server?
yeah
sure but py is sync so youl freeze pretty fast
hmm, good point
anyone know how to use the FML api 
fml
maybe I will add an interval then
fuck my life API
yes
@shy rose why do you need 3k emotes
cause discord wont let you do inline icons so emoji are next best
seriously tho
whats unusual about needing 3000 emojis?
🙃
its basilly jsut a ton of image assets working on and you know there are kinda a lot...
best way imo would be if discord let you do inline favicon sized images
Perhaps you should reevaluate your options lol
@sick cloud wots fml
anyone know the rate limit for making emojis discord docs says its special and on per guild basis anyone know what that is thou?
or at least an est of it
.invites
What
Nickname stranger ;-;
What does that mean in my name? M Portuguese.
How do I get the server count on the site?
Like the DBL site
dbl api
And does anybody have the CSS classes for the site so I can customize it
Or I can just do inspect element but I'm lazy
i'm gonna ask again, does anyone know the api url for fmylife.com
no
how i get the number of users and guilds in one shard?
what library
How long are deleted emojis valid for as noticing once you delete them they still render in chat so like is there a fixed date or anything?
or is it jsut they are here but they can be deleted at anytime now
Probably forever
Hi, I'm pretty new to making Discord bots, and have only made them for my friends' server so I haven't really had to worry about security. Could someone explain to me how to ensure stuff like tokens aren't abused? Thanks
Just don't leak them..
Ok, so it's basically a non-issue unless you're stupid?
Just don't tell anyone your token and its fine
separate files
like a config.json or config.yml
you put your token and stuff in it
then you can require it whenever you need the stuff
ah ok. thanks
lol, I know I'm dumb.
How should I not do this? I mean I know about await and async but I feel like sometimes they actually doesn't work.
async/await or chain Promises properly
like
somethingPromise
.then(res => newPromise(res))
.then(() => newOne())
.catch(console.error)
``` looks way cleaner
async/await would also work
you don't need to open new functions for each then.
UserData.Init().then(QueueData.Init).then(SubscriptionData.Init).then(MalBindData.Init)
yeah maybe I should be using callbacks.
oh, why I didn't use it in the first place, tho.
or you could use async await
put it in an async function
await them all in order
and put them all in one try catch
ez clap
async await hell
ahhh
Why bot restarts automatically every hour?
tbh callbacks are messy as well
supposedly async/promises should make code much cleaner
and await only works in an async function
the main process is not in async
which might be why await doesnt work sometimes
async / await is the heaven and await always works in async functions 
@earnest phoenix Please don't randomly react to messages thanks.
await/async is easier 👀
@fluid basin async await can get messy too, and fast
still much readable than promise/callback hell
Take for example
await promise1();
await promise2();
await promise3();
await promise4();
await promise5();
That's an example of async await hell
if you need to do that many awaits you should probably have a function to do that
atleast its readable and much easier to manage if you have other statements in them
yeah its much more readable than .then over and over again
Really think so?
.then(callback)
.then(callback)
.then(callback)
.then(callback)
.catch(errorcallback)
k
but what about the fact that i can do
let var = await promise();
or
if (await promise() == "a value") {
}
?
it's just more convenient
let var 
lmao i just realised that
Also, you don't have error handling there
So essentially one glorified block
That you live by when using async await
Yeah...I really despise it
lol ok
I use call backs if I only have one promise in my code
At that point, it seems extra to use a try catch block
Why doesnt my bot show how many servers it is in on the website?
Since you get easy handling with .then and .catch
you need to post your server count to the dbl api, you can see how to do that on the documentation
I've some pb with heroku ...
They change their website since a while. So I can't find a button to add worker dyno, with node index.js... I host my bot (nodejs) with github and I deploy only via the website.
How could I add worker dyno ?
@junior bobcat you click the web npm start and edit it with the start script you want it to be and also enable it then on deploy, it’ll use that script
Or you could make a procfile ^^
@lament rock you can't edit a dyno on the website.
Well then you just create a start script in your package. Ez
but bots won't live longer in web dynos so worker must be present.
I don’t think it really matters since heroku shuts down the app if it doesn’t have web traffic
yeah. that is why you need a worker dyno. because web dyno will sleep when there is no web traffic.
it should work.
yes but no XD
turn off your web dyno. you can do it in the website or in the cli.
wait there is no worker dyno shown in your resources.
where did you put your procfile?
at the root, why ?
and also procfile doesn't have file extension.
are you using heroku cli or github? @junior bobcat
github
oh are you using auto deploy or are you sure you deployed your changes?
my auto deploy actually works. oh you use git hub. send me link?
its not that I want your source code but just checking If you setup some thing correctly.
yes np
I pushed...
why it is different from github.
idk
idk why
try using heroku cli
in your root folder
heroku login
heroku git:remote app-name
git push heroku master
by using heroku cli your source code can be close source too.
ok thanks
the app-name should be the name or your heroku app not the folder or github name
and don't forget to commit also.
before pushing.
What if I am doing the bot on my Phone?
then give up and get a pc
I have pc
The bot is made but I need to do the pc work once I get my personal computer back.
Why does my bot keep shutting down on glitch
i have it pinged
guys, it's my second time here, i want to add the "up-vote command" if you know what i mean, but.. i don't know how to add webhooks to a bot.
i don't know what i should tell you so.. i use discord.js if this is helpfull
sorry i'm italian, don't kill my english
guys please stop using glitch. its literally glitchy.
@vapid spoke just use the /check?userId
use a webhook. save votes to a db. check your db.
@vapid spoke A webhook is basically you host a web server (same thing that is used to run a website). the webserver is listening for requests. Discordbots.org will send a request to your server telling you when somebody votes and you can record it.
you can check in #topgg-api and read the channel topic for a link to the docs.
for discord.js, there is a library that suppots webhooks. so you should look at that.
yeah i know it
but
i mean
i should add a normal webhook in a channel
and put it in the code
and create a db (sqlite) with
bot
user
type
isWeekend
query?
"/check?userId" ? @earnest phoenix
@vapid spoke it's not a discord webhook
..?
You don't make a webhook in discord
You need to receive the requests with your webserver
The official lib can set it up for you
dblapi.js
DBL will just send a POST request with the data
Ok look
I use Python but it should be the same Logic
You're better off learning how http works
Just use the dblapi.js lib
mh
That's probably the easiest way
mh okay
so i should add that lib on my bot code
https://discordbots.org/api/bots/493045795445276682/check?userId={user.id}
You will see either Voted : 0 or Voted : 1
If Voted is 1, record it into the Database, and after 12 hours clear it
Else if Voted is 0 tell them they haven't voted
Same Logic I guess
https://discordbots.org/api/bots/493045795445276682/check?userId=358293206900670467
and so, this automatic see
:C
So I just facilitated my own shit
i think
Think?
i'm going to try with that lib first
Np
How do I set my bot's online status on the website? I'm using dbl = new DBL(env.DBLTOKEN, bot), but it says it's offline.
@shell blade it's not through the API, the bot just has to be in this server
@bright spear i'm so noob
i can't make the lib work
i mean
when some1 vote the bot
nothing happened
sorry i'm italian xd
@vapid spoke what's your code, also did you set the webhook info in your bot's edit page?
i think
yes
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
console.log(Webhook running at http://${hook.hostname}:${hook.port}${hook.path});
});
http://${hook.hostname}:${hook.port}${hook.path}
this is the url
right?
@bright spear
no its not that word for word 🤦
those are variables
it should console.log the full url
yeah
man
@bright spear
i know it
i'm not so stupid
i put the output in the edit page
change 0.0.0.0 to the ip or domain of the server
ooooooooooh
man
sure
i'm so stupid
why didn't I try this?
anyway
let's try
@bright spear when I click "test"
how can I see the result?
it should send a request to that url
and it should run whatever is in your "on vote" part
but actually i dont think glitch will work on port 5000
try changing the port to 3000 in your code and the edit page
do you also use express in your project?
use port 3000 and http://projectname.glitch.me/dblwebhook
a spooky error is with us
but i saw that error yet
but it doesn't want to go away
app.get("/", (request, response) => {
console.log(Date.now() + " Ping Received");
response.sendStatus(200);
});
app.listen(3000);
setInterval(() => {
http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 280000);
why if i put "3000" in webhookPort this script gives an error?
What's the error
When I have an event listener, like when someone joins a server. I wanted it to have a server greeting but my bot greeted them and had 20 messages
show code
bot.on('guildMemberAdd', member => {
const channel = member.guild.channels.find(ch => ch.name === 'welcome');
if (!channel) return;
channel.send(`Welcome to the server, ${member}`);
});
are you sure you don't have multiple processes running
I don't. Just hosting
It may be whatever I'm hosting it on
Only the event listeners do that
no other commands do that
that's not what I mean, like did you start the bot multiple times
without cancelling the old process
My computer that I use to run it is turned off and I use a hosting for it
what's the code around that
do what natan said
code around what?
the code around the event
I have the guildMemberAdd under that I have guildMemberRemove
send the code
the whole file
I don't have it I'm on my other computer and I also gtg
@topaz fjord oh ehm
the error is
'events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::3000
at Server.setupListenHandle [as _listen2] (net.js:1360:14)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at Function.listen (/rbd/pnpm-volume/36c952a9-269e-4a19-9078-b7c9ed1adc6c/node_modules/.registry.npmjs.org/express/4.16.4/node_modules/express/lib/application.js:618:24)
at Client.client.on (/app/server.js:36:7)
at emitNone (events.js:111:20)
at Client.emit (events.js:208:7)
at WebSocketConnection.triggerReady (/rbd/pnpm-volume/36c952a9-269e-4a19-9078-b7c9ed1adc6c/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:125:17)
at WebSocketConnection.checkIfReady (/rbd/pnpm-volume/36c952a9-269e-4a19-9078-b7c9ed1adc6c/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:141:61)
at GuildCreateHandler.handle (/rbd/pnpm-volume/36c952a9-269e-4a19-9078-b7c9ed1adc6c/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/websocket/packets/handlers/GuildCreate.js:13:31)
ohno
xd
some service is using port 3000
wait a sec
@topaz fjord yeah
wait
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});```
this
and
app.get("/", (request, response) => {
console.log(Date.now() + " Ping Received");
response.sendStatus(200);
});
app.listen(3000);
setInterval(() => {
http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 280000);```
this
you can't listen on port 3000 since the dbl webhook is using it
so..
how?
i mean
the second script
it is
idk how to say it
i'm italian
sorry
ok
It doesn’t
If you want to work with uptime
Go into the libraries source code and listen for /
..?
i use glitch
so uptime is required
without it the bot will go off
but if I use the second script
i can't use the first
Whats your problem
For some reason, every command that I run that uses an async def commandname isn't working. on_message is working though, and every other type of on_ blahblah is working fine. I noticed that earlier today and yesterday, all of the commands (including the ones where I set the command name) were sending out five times. Idk if this is a server glitch or something on my part lol
I schearching a code for a music bot
pls
@earnest phoenix you can always try the website
for bots
I'm making a DBL api wrapper
why is this not doing the markdown?
is markdown supported
¯_(ツ)_/¯
i have much go
DBL yes or no?
i have not sure
...
Okay, if u are not sure on which website u are
And don't have that knowledge
Why u try to make a bot
i have a bot in 800 server thank you very much
i can
Just say then...
but it should be common sense to know what website im on
it can't
if you cant process what discord we are in i have no hope
because you didn't even give us information on what website your on @marble elm
I already asked if it was DBL.
Indeed... I am just trying to help...
If u just answer
i CAN help
you just said it didn't work
its clearly on DBL why would i come here to ask about another website?
Because creating a bot isn't about DBL?
you didn't respond
How can i make < and > show in a paragraph?
`monospace`
Markdown is a lightweight markup language with plain text formatting syntax. It is designed so that it can be converted to HTML and many other formats using a tool by the same name. Markdown is often used to format readme files, for writing messages in online discussion forum...
Where u typed?
I mean, what's the complete text u use.
there
U already tried that monospace
because ur ` seems very weird, idk but it's like almost horizontal
wtf is happening
Nothing.
Well, I am helping someone who didn't want to answer the questions I needed to help him.
what site? idk
xD
@marble elm markdown won't work since your already using HTML
mh
very true
the website processes one or the other
That's why I wanted the text.
you use markdown or you use html
no
Yes.
it can only do one or the other
if you put a style tag then markdown it'll only use the style and not the markdown
In fact it does both, but my html doesn't affect my writing
But that's what I mean with it can be both
So it rlly depends on what html
Because I use style just for the background
whats the best way to avoid creating new listeners on a recursive function call

oh come on
why are you pinging web admins
because my bot is on applying
- probably a mute (you dont ping web admins for this shit)
- wrong channel
- be patient
- too bad if you bot is offline it will be declined
get a host
i know
then do it?
you dont have to ping
ok
look kid
how does it work
you better stop pinging all the mods kid
does it work even when the pc is offline?
shush kid
oldman
https://www.pickaweb.co.uk/vps/ VPS is ideal for web designers, agencies and companies who have outgrown a shared hosting account. A virtual private server i...
i just googled ok shut
fine sam
It's just a computer somewhere owned by a company that's always on
Btw @strange spear how did you make your bot
VM is probably a better option to do
Don't you just love it when you leave your token in your code on github, i'm so dumb
You could as try pm2 and nodemon, they will keep your bot for a bit longer than standard node.js if you make it in js
For beginners use nodemon, then try using pm2
techincally they dont "keep your bot longer", they just auto-restart it when it fails lul
I just put the key in another file and didn't add the file to the repo
Technically, but it's better than nothing
why would you use nodemon over pm2
i started by running node in a loop directly from the terminal lmao
nodemon is like running it normally
I just used a AWS server
i'm using gcloud rn
same
if your a student definitely look at the student package by github, Theres some great free hosting there
I'm a student but I don't think I have proof
Do you have a school email?
Let’s imagine I sharded my bot into 2 shards, will I still be able to send messages on a specific channel? will it work if the shard isn’t operating on the guild of the specific channel?
like 400
cool
i think you have to use broadcasteval to send functions between shards
yeah but for example, send message from shard2 to guild in shard1
i think i saw some stuff before about using broadcasteval to find a specific guild across all shards
^
That will all change soon though
once internal sharding gets released
internal sharding is p cool
eris already has it doesnt it?
I dont think so
Internal sharding treats all shards as one
is anyone elses shards spawning slowly
is it just v12 with cool shit
yes
G
guildWebhook.send({ embeds: [embed] });```
why is this erroring at `.send`
```16|youtube | (node:27327) UnhandledPromiseRejectionWarning: TypeError: Right-hand side of 'instanceof' is not an object```
I keep getting the error, Command raised an exception: TypeError: '<' not supported between instances of 'int' and 'str'. I cannot figure out wtf is wrong. My discord.py code is:
# Reading so I can add without adding 2 things to the JSON
with open("json/giveaway.json", "r") as file:
things = json.load(file);
# Generate a giveaway ID
givid = random.randint(100000, 999999);
# Create new key-value pairs
# Giveaway
# Check if the guild is there already
if ctx.guild.id in things["guild"]:
pass;
else:
things["guild"][ctx.guild.id] = {};
things["guild"][ctx.guild.id][givid] = {};
things["guild"][ctx.guild.id][givid]["msgid"] = ctx.message.id;
things["message"][ctx.message.id] = {};
things["message"][ctx.message.id]["giveawayid"] = givid;
things["message"][ctx.message.id]["users"] = [];
things["message"][ctx.message.id]["guild"] = ctx.guild.id;
things["message"][ctx.message.id]["creator"] = ctx.message.author.id;
# Writing to the file
with open("json/giveaway.json", "r+") as test:
# Pretty print please please please
json.dump(things, test, sort_keys = True, indent = 4);
Please don't judge for semicolons
@sick cloud why is it [embed]
webhooks take array of embeds
@sick cloud I have an issue with your nickname
@queen sentinel why do you
@topaz fjord webhooks only take an array of embeds apparently
because
hows this
@sick cloud I send mine as regular
how?
i sent it as embed: obj and embeds: [obj], both failed
they send the same error
@sick cloud I do it like this
// bot.js
this.guildWebhook = new WebhookClient(this.config.webguild, this.config.webtoken);
// guildCreate.js
this.client.guildWebhook.send({ embed });
okay
i make it like this
const { WebhookClient } = require('discord.js');
let webhook_url = 'url';
const guildWebhook = new WebhookClient(webhook_url.split('/').slice(5)[0], webhook_url.split('/').slice(5)[1]);|
Tony ignore everything I just said
ok
if you have guild logs you might run into an error
bc the guild might be on another shard
thats what I ran into
I use webhook
ye I recently switched to webhook aswell
👍
@sick cloud in master, embeds must be sent like this for webhooks this.client.guildWebhook.send('message here', { embeds: [embed] });
if you don't want message here to appear just put an empty string
ohhh ok
so i can do this?
guildWebhook.send("", { embeds: [{
title: `Shard #${client.shard.id}/${client.shard.count} has launched`,
fields: [
{ name: 'Servers', value: `${client.guilds.size}`, inline: true },
{ name: 'Users', value: `${client.guilds.map(g => g.memberCount).reduce((f, l) => f + l)}`, inline: true },
{ name: 'Channels', value: `${client.channels.size}`, inline: true }
]
}] });
yes
I need to restart mine to fix it but idk if people are listening to music
fuck
@topaz fjord same issue ..
*help
Quick question, where can I get my own token?
as in your user's token?
Open developer tools (ctrl+shift+i)
Go to network tab
click on some channel or server
click through the requests till you find one with an 'authorization' header in the request headers (I found one named 'science'), the value of that should be your token
not sure if that token at the bottom is the same woops lol, don't take a screenshot and send it to a server with hundreds of users
Okay! thankyou @tepid jasper
Actually, I have a lot of question rn. I'm super noob, is that ok if I ask a lot of questions here?
notices that the documentation link at https://discordbots.org/api/docs#pylib is broken, and the example at https://github.com/DiscordBotList/DBL-Python-Library is missing a bracket on line 26
A simple API wrapper for discordbots.org written in Python - DiscordBotList/DBL-Python-Library
is also a super noob, but doesn't see why that would be a problem
When a member joins a guild or leaves or when an event happens my bot says the message about 30 times
idk why that happens
https://hastebin.com/dakelacaju.js
This is the whole code
for my index.js
oh god this is hard to read

