#development
1 messages · Page 535 of 1
your bot is on your pc?
No
then no, it will work as long as your bot works
you have to put your bot's ip address, not your pcs
where is it hosted then?
The repl will be hosted with the following URLs:
https://REPL-NAME--USERNAME.repl.co
http://USERNAME.repl.co/REPL-NAME
http://REPL-NAME.USERNAME.repl.co```
Yea I have one of those links
so thats what you use instead of ip address
kay
Not working
We need a better explanation than that to help you. Please explain what isn't working, any errors, etc.
Hello. How can i make a proxy server for lightshot
I need html
i have domain
@earnest phoenix When I log the ready event of webhook:
mhm
Do I need to provide webhookServer?
you have webhook running at http://0.0.0.0:5000/dblwebhook
but if you want to run it on an existing server at an existing port then yes
so you need to set up your bot's edit page webhook URL to http://REPL-NAME.USERNAME.repl.co:5000/dblwebhook
Ok ty
Does the Test button vote the bot and unvote it?
dbl.webhook.on('vote', vote => {
let g = client.guilds.get(501396018395480065)
let c = g.channels.get(522420279352492049)
let u = client.users.get(vote.user)
let person;
if (u) {
person = u
} else {
person = 'User with ID ' + vote.user
}
c.send('${person} just voted!')
});``` This is not working when I press `Test` button
@quartz kindle
idk what the test button does
It tests webhook
if it doesnt work then either the url is wrong, or there is a firewall blocking it
you can try changing the port from 5000 to 8080 which is usually open by default
you can also setup a normal http server on port 5000 and try accessing it from your browser
just to make sure it works
that means the dbl token is wrong, usually happens on the post stats part, not in the webhook
Hello @quartz kindle
are you online?
what should i set the dbl edit page webhook
(its glitch)
its not working
if your webhook is listening on port 5000 then change it accordingly
like that? http://prntscr.com/lu2wby
that means 8080 is already assigned/reserved to some other process, so you cant use it
yes, like that
Should i set it the webhook token? http://prntscr.com/lu2wxw
you can set anything you want there, as long as its the same on your webhook password code
okay
Its Not Working
its not working
shit
const dbl = new DBL(settings.dbltoken , { webhookPort: 5000, webhookAuth: "Mert1234"});
is it true?
it should work, did you put Mert1234 on your bot's authorization? did you save it?
i checked glitch's website, and it seems they only allow connections through port 3000
which is bound as port 80, so you dont need to specify the port
so make port 3000 in your webhook code, and just do glitch.me/dblwebhook in your bot's edit page
Yeah mine doesn't have port and works fine
I really just use glitch as a translation from DBL to discord anyway
throw er; // Unhandled 'error' event
^
Error: listen EACCES 0.0.0.0:80
at Server.setupListenHandle [as _listen2] (net.js:1343:19)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at DBLWebhook._startWebhook (/rbd/pnpm-volume/bddb906b-1c32-4abe-b698-c698c3664c98/node_modules/.registry.npmjs.org/dblapi.js/2.3.0/node_modules/dblapi.js/src/webhook.js:45:18)
at new DBLWebhook (/rbd/pnpm-volume/bddb906b-1c32-4abe-b698-c698c3664c98/node_modules/.registry.npmjs.org/dblapi.js/2.3.0/node_modules/dblapi.js/src/webhook.js:27:12)
at new DBLAPI (/rbd/pnpm-volume/bddb906b-1c32-4abe-b698-c698c3664c98/node_modules/.registry.npmjs.org/dblapi.js/2.3.0/node_modules/dblapi.js/src/index.js:69:22)
at Object.<anonymous> (/app/Gamerbot.js:12:13)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)```
it gives that error
with port 3000?
3000 and 80
well, 80 yes, but 3000 should work
1 mins
const express = require('express');
const app = express();
app.get("/", (request, response) => {
console.log(Date.now() + " Ping tamamdır.");
process.exit(0)
response.sendStatus(200);
});
app.listen(process.env.PORT);
setInterval(() => {
http.get(`http://gamert.glitch.me/`);
}, 280000);```
they are overlaping
you already have a server running
so use the server you already have instead of creating a new one
check the webhooks docs, last example
okay
guys? can u made this in embedMessage
(im so stupid, and cant do this)
if(command === "ping") {
const m = await message.channel.send("Ping?");
m.edit(`Pong! Latency is ${m.createdTimestamp - message.createdTimestamp}ms. API Latency is ${Math.round(client.ping)}ms`);
}
without m.edit, just for knowing latency
what is the best way ti check if the user has a permission to use the bot
to not waste timr on algorithms
so i need help with discord bot list website
i told it to make the invite for me, and it gave this error
this is after i tried applying an invite manually and it said that i did not give any invite, when i had checked and definitely had
how do i make my ready.js file like twicth
const moment = require('moment');
const Discord = require('discord.js');
const ayarlar = require('../ayarlar.json');
var prefix = ayarlar.prefix;
module.exports = client => {
client.user.setGame("r!yardım | r!davet | Bagis icin RexSky#6133 | AnkSOFT.net");
console.log(`Giriş Yapıldı!`);
console.log(client.channels.size + ` Kanal - ` + client.guilds.size + ` Sunucu - ` + client.guilds.reduce((a, b) => a + b.memberCount, 0).toLocaleString() + ` Kullanıcı`);
}```
like twitch?
Now .d
it just looks stylish
I don't understand what you're asking
what do you mean by Like twitch
I have a file of my size and I am using this file as part of it. how do i make it twicth
wat
my point
@latent oasis I don't think so
Help pls !
We don't understand what you're requesting help for
@latent oasis you could make it edit in a differant server but that's very pointless I don't see why you don't want use edit
based on his code, i think he's asking how to change bot's presence
why didn't he say that though
"like twitch" -> playing/streaming
I'm so confused
shows code about game presence with only console.log in it
just add , {type: "STREAMING"} between the end bracket of setting the presence
@earnest phoenix
eyw
Thank you
if (text === message.isMentioned(bot.users.get('483052460903104513'))) {
let niv = bot.users.get("279749525009334273").tag
const embed = new Discord.RichEmbed()
.setColor("RANDOM")
.setDescription(`Hello! im Naknak Bot!
my prefix: \`${prefix}\`, my second prefix: \`@${bot.user.name}\`.
if you want me in your server type the command: \`${prefix}links\`(Invite me).
if you want get updates and more join to my server with the command: \`${prefix}links\`(Naknak Server).
if you want setup me type the command: \`${prefix}config\`.`)
.setFooter(`my creator: ${niv}`)
message.channel.send(embed);
}
why its not work?
no errors
in eval command it send
SyntaxError: Unexpected token <
message.isMentioned returns true or false
if text is a string, then if (text === message.isMentioned will never pass
also, isMentioned accepts an ID, so you can just do isMentioned("id") instead of bot.users.get
guys how can i convert a string whicu containts units to integer
for example 2m to 120
you could check to see if theres a m h d or s in that argument then convert that
but idk
yes i cam di that
i want to know if theres any premade solution
cause i do not like that sort of things
its kinda messy
idk have a look on https://npm.org
thats not it
oof
have a look on https://npmjs.com
@earnest phoenix
!
my bot isnt working ._.
whats the error?
have you logged the bot in with a valid token?
yes it was working a min ago
const botconfig = require("./botconfig.json");
const Discord = require("discord.js");
const bot = new Discord.Client({disableEveryone: true});
const client = new Discord.Client();
let prefix = botconfig.prefix;
let website = botconfig.website;
client.on("ready", async () => {
console.log(`${bot.user.username} is now online!`);
bot.user.setActivity(`${bot.guilds.size} Servers`, {type: 'WATCHING'});
});
client.on("message", async message => {
if(message.author.bot) return;
let prefix = botconfig.prefix;
let messageArray = message.content.split(" ");
let cmd = messageArray[0];
let args = messageArray;
let sender = message.author;
let icon = message.author.displayAvatarURL;
let boticon = bot.user.displayAvatarURL;
if(cmd === `${prefix}help`){
// Tell them to check DMs
let help_pub = new Discord.RichEmbed()
.setColor("#feca2e")
.setTitle("Check your messages! 📬");
message.channel.send(help_pub);
console.log(`I sent a new message to ${sender}!`);
// Send DM
let help_dm = new Discord.RichEmbed()
.setColor("#feca2e")
.setTitle("This bot was made by @Tehcno#0001, we are still doing some work on the bot. Please allow us to continue to work on the bot.");
message.author.send(help_dm);
};
if(cmd === `${prefix}update`) {
let reply = new Discord.RichEmbed()
.setColor("#feca2e")
.setTitle("Gimbo is now up to date! 🤖");
message.channel.send(reply);
bot.user.setActivity(`${bot.guilds.size} Servers`, {type: 'WATCHING'});
console.log(`I updatted my status!`);
}
if(cmd === `${prefix}icon`) {
let reply = new Discord.RichEmbed()
.setColor("#feca2e")
.setTitle("Heres your avatar image! 📷");
message.channel.send(reply);
message.channel.send({
file: message.author.displayAvatarURL + ".png" // Or replace with FileOptions object
});
console.log(`I sent ${sender} their profile icon!`);
}
});
bot.login(botconfig.token);
for const bot = new Discord.Client({disableEveryone: true}); you don't need disable or Discord.
you can just do const bot = new Client();
or const client
I'm probably missing something but I can't see why it won't work
censored:Gimbo censored$ node index.js
/Users/censored/Desktop/Gimbo/index.js:4
const bot = new Client()
^
ReferenceError: Client is not defined
at Object.<anonymous> (/Users/censored/Desktop/Gimbo/index.js:4:13)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
censored:Gimbo censored$ ```
French ?
English
use // ?
Yes
?
My prefix
// adds a note
Do you have lock and unlock command for my discord bot ?
@raven bronze ```js
const bot = new Discord.Client({disableEveryone: true});
const client = new Discord.Client();```
you register your events on client
but login on bot
they are two separate instances
you should have only one
Do you have lock and unlock command for my discord bot ?
same error
what does disableEveryone actually do?
(me) > node index.js
(serv) >
prevents the bot from sending @ everyone or @ here
You don't have lock command ?
that's lib specific
ok, well im gonna restart my computer and see if that help
guys it was working with the same code a min
@inner jewel Do you have lock and unlock command for my discord bot ?
instead of copy pasting like you did
ago
@velvet ruin what
I could just check all the messages the bot sends and see if it conains @everyone or @here and if it does just dont send
your commands are your code
no one is going to spoonfeed you
Send messages
You don't have code ?
code 4 what
nobody is going to spoonfeed
Do you have lock and unlock command for my discord bot ? @raven bronze
@velvet ruin stop asking for spoonfeeding and don't randomly ping
- Please dont tag me
- Also what will the command do?
What ? Reverso in french please
egg!translate fr 1. Please dont tag me
2. Also what will the command do?
French ?
- s'il vous plaît ne pas me taguer
- Aussi, que fera la commande?
Mais je voudrais le lock pour fermer le salon
my bot, just responds with " " when i do node index.js
Reverso in fr
i already pointed the error in your code
fixed code - same issue
also this channel is english only, don't try to speak french here @velvet ruin
#memes-and-media for other languages
hm
new error:
events.js:173
throw err; // Unhandled 'error' event
^
Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object])
at Client.emit (events.js:171:17)
at WebSocketConnection.onError (/Users/my-name-here/Desktop/Gimbo/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:374:17)
at WebSocket.onError (/Users/my-name-here/Desktop/Gimbo/node_modules/ws/lib/event-target.js:128:16)
at WebSocket.emit (events.js:182:13)
at _receiver.cleanup (/Users/my-name-here/Desktop/Gimbo/node_modules/ws/lib/websocket.js:211:14)
at Receiver.cleanup (/Users/my-name-here/Desktop/Gimbo/node_modules/ws/lib/receiver.js:557:13)
at WebSocket.finalize (/Users/my-name-here/Desktop/Gimbo/node_modules/ws/lib/websocket.js:206:20)
at TLSSocket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)```
//Code
});```
bot/client.on('error' => {
^^^^^^^
SyntaxError: Unexpected string
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:656:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)```
which one tho?
which ether you chose
client.on('error' => {
^^^^^^^
SyntaxError: Unexpected string
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:656:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)```
client.on('error', err => {
console.log("Oof I messed up... " + err)
});```
idk there must be something wrong with your bot is in online when you do node index.js

light theme is bad
Trying not to

you can do js embed.setImage(msg.author.avatarURL)
Client.deleteUSer("used light theme"(
what have you done
hold on
OHHHHH
"website" isnt definied in botconfig.yml
nvm not the issue :/
Issue:
pc = false
code = true
var = false
commands = false
consts = false
i dont know what i did but i think i fixed it
anyone know why my &setup command stopped working, it was working then people started reporting that it doesnt, i only allow myself and guild owners to do it i have this as a check and now it just shows this message even for me
if(message.author.id != message.guild.owner.id || "205440127361744897") return message.reply(`sorry, only the owner of ${message.guild.name} can setup this bot!`);
NodeJS btw
nvm it not working :/
it worked before but should i try taking it out?
As that would always return true
or like || message.author.id != "my id"
ok
something like this? if(message.author.id != message.guild.owner.id || message.author.id != "205440127361744897")
yes
kk lemme try that
And you should use !==
cheers
Instead of !=
welp im just gonna restore my backup code :/
@earnest phoenix I fixed it! don't know how though. $help now works 😃
Hello, tell me how to make a delay in the teams, it is necessary that the command be executed 1 time in 1 minute, for each user separately
when a user writes a message, the command is executed. it is necessary that the command be executed once per minute, not more often
then make users only type it every minute
this is not an option
I want to make a system of experience and levels, and it is necessary that the experience be charged for messages only once per minute
then do timing
when it happens, add a date to the users db record, and next time if the date compared is less than 1 minute dont do it
You can also look up tutorials on xp systems, a good one is from threebrow
OK
soo
i am trying to set up my Bots page so the box is grey and the text is white
but i get this
how do i fix
You might need to be more specific on where I am looking for
Yes
Have you worked with inline css before?
In the head tag do <style></style> to make an css inline block
im p sure u dont need <!DOCTYPE html> and all that stuff
Ok, you only need Background-color, color will not help you
Do you mean borders?
dont add body or head or any of the structuring
i want THAT BACKROUND black and the text white
also dont make dumb lies
Oh god green text on white background
wha dumb lies?
-_-
i am trying to change it
"the best moderation bot out there"
😭
dont
well its there
#ffffff is white
i can assure its not
Yes
ok
right click the page > inspect element
ok
read the css structure on the right side
Body is the whole thing, box is a section
and apply css to what is there
ok
you target the elements classes
So it's displaying the iframe in block style
for example body is everything. what is inside body? id=bots (#bots)
what is inside bots? class=container (.container)
so you go #bots .container .nextclass { your css here }
so i put my stuff in ther
you need to specify the classes until you reach the desired one
i think it's pretty self explanatory
a guild is a server
the description mentions to be valid on discordbots.org/servers
then if you follow that, the server page has an id
It said •Invalidate Server Format
Ohhhh
I’m smart
Alright, next question, how do I change the status from the library ‘other’
edit your bot
Mhm
Yeet
Did you check the docs?
doesnt help
and yeah no
it provides a basic user
User {
id: '296044953576931328',
bot: false,
username: 'ThatTonybo',
discriminator: '0001',
avatar: 'a_2afed7814983e81f57b7e23c0e8d776c',
lastMessageID: null,
lastMessageChannelID: null }
this
that doesn't sound right 
@sick cloud try user.presence
not sure if getter is included in your obj dump
most of the prop on class is a getter, which simply is a func that gets it from another collection
oh
/**
* The presence of this user
* @type {Presence}
* @readonly
*/
get presence() {
for (const guild of this.client.guilds.values()) {
if (guild.presences.has(this.id)) return guild.presences.get(this.id);
}
return new Presence(this.client, { user: { id: this.id } });
}
can someone help me
how do i do an or statment
if(cmd === `${prefix}sever` || `${prefix}info`) {
// stuff here
}```
@raven bronze Because you arnt actually checking if the command is {prefix}info, just checking a string (which will always return true)
you'd have to do something like
if (thing === thing || thing === thing){}```
ok
another question, how can split it into mutliple .js files
root
-> chat-commands
-> moderation.js
-> fun.js
-> etc.
-> webconnect-mysql.js
-> voice-commands
-> music-player.js
-> music-queue.js
-> music-web.js
-> music-link-mysql.js
module.exports
i mean like in my index.js, what do i put
require
index: ```js
var myfunction = require('function.js')
function.jsjs module.exports = function() { return "bla"; }
for example
var chat-commands = require('chat-commands/moderation.js')
@quartz kindle would that work ^
im still very confused
you cannot include multiple files just the way they are in js, unless you use eval
you need to prepare each file you want to include
to enable including and to specify what is going to be included
if you want to include a function from moderation.js in your index.js, you need to export the function in the first file, and require it in the second file
so i need to make a command-list.js file with all of the imports?
Some people with decent knowledge about sparkjava here?
I want to set up, that /api shows a site of a html-file I made.
I tried it with staticFile.location(""); and the file is called api.html. The issue now is, that I can't get it with /api but with /api.html which I really don't want.
Anyone here knows if it is possible, to remove the .html from the link and show the content of the html-file?
@ me pls
no, you just need to use module.exports in each file you want to include
show code @misty pawn
i dmed you
Spark.port(2000);
staticFiles.location("");
staticFiles.registerMimeType("", "text/html");
init();
Ignore the registerMimeType
from sparkjava.com?
yup
their docs show this
import static spark.Spark.*;
public class HelloWorld {
public static void main(String[] args) {
get("/hello", (req, res) -> "Hello World");
}
}```
its just a router, all routers work the same
thats weirdly familiar to express
if you want to receive requests at /api create a get("/api", etc
in the get function
then route it to your html file
something like java get("/api", (req,res) -> res.body(your html file))
then you should know lol
Not with staticFiles...
No clue what is wrong with my bot.
you cant rename static files, you need to route them
I have no clue where it's originating
or just rename the file itself and declare it as an html mime type
the file doesnt need to have .html to work like one
tried it, didn't work
hi
I have no clue where it
ook lemme see
is originating
That hi was fast 
For example, I'm using spark to serve static web pages as well, all of which are accessible at URLs like: http://my-ip:4567/web/html/home.html But I'd like to remap the following line to th...
Ok well you are trying to perform an operation when the bot doesnt have perms
like sending a message even
if someone triggers a command in a channel if cant speak in, itll error
Yes, but it happens right when I turn on the bot

Is it trying to do something in the message event?
158
Send me what your message event is
ok and
wdym message event
Does anyone have some discord.js knowledge? I need help

in a sec moose
Ight
@fierce owl never ask to ask (in any server), always just ask your question
Ok then
So basically I have made this dev hub thing on my discord, And a member will advertise their creation and if it is pretty cool, I will promote it. I want to use !promote (Message ID) and have it be sent to the specific promote channel.
I literally just copied and pasted it from my stackoverflow question
smh
oh
Where would the client.on(message normally be
shit
Ah what
lol
@bright spear what you say
kill it
then
show where the error starts
https://perfectly-balanced.as-all-things-should.be/i/jiac.png should see something like this iirc (this is a different lang error sorry)
it might not look exactly like that
-bots @earnest phoenix
@sour tide
huh
and keep multiplying
whats ur ready event
What's the problem?
Whatever it's, it's not being catched
send messages, add roles, etc
Check to make sure you spelt the permission right
What's the error?
@earnest phoenix what's your ready event
Check your cmd that your running the bot
Honestly it's such a vague error that node stack fails to capture correctly, judging from snekfetch being used, this is still djs v11 or stable
I need help
So basically I have made this dev hub thing on my discord, And a member will advertise their creation and if it is pretty cool, I will promote it. I want to use !promote (Message ID) and have it be sent to the specific promote channel.
This could be an internal lib issue that was addressed in v12/master. But I'd start by catching all the async actions in your project
How would one do that? The other dev did most of the work, I just added commands
a simple .catch will work
true
most djs actions are async or returns a promise
@vernal rivet thats from a module
snekfetch, already replaced in master with something else
Rip
@fierce owl that inquiry is vague
what
not enough info
This error usually means you spelt the permission wrong, or it does not have that permission allowed
What are you sending to that specific promote channel, are you just cloning the message id's content
give me a moment
Also something like promote !promote (Message ID) would probably require a channel argument with it
@vernal rivet Incorrect spelling would throw a different error; the errors means the bot doesnt have x permission
im cloning the content and putting it into an embed then sending it to a specifc channel (promote channel)
uhm
Maybe, but it would return the type of permission, like post
@fierce owl Depending what lib you are using
Actually it's incorrect permission. From what I am seeing it's a decrepited, since there's the decrepited warning
You want an example of something @keen drift
And it's a problem with not having a try and catch method
ello @west raptor
Catch will help locate promise rejections
yes but how would I add that to it
decrepited 
u mean deprecated?
Deprecation warning is perfectly fine
You get that deprecation warning if you are on a node version prior to promise rejection being fatal
There's not really a good way to locate the item that's causing the missing permission problem, welcome to nodejs
Yup
IDK if he is trying to overwrite permission, would it still give an error if he did it in the json formatting in the Js file?
He just says it happens on startup, I doubt it's any commands that's executed
Then would it be the problem of it unable to say something?
If it does, can the fact that the permission prevents it from saying something return that error?
@bright spear I don't think there's a release currently that makes it fatal
k
i'm going to predict v12 nodejs for fatal exit
@sour tide
Can you describe what it supposed to do?
kek, ban duh
yes
It bans the user from all the servers you have admin in
so it syncs your bans
through out your servers
@vernal rivet
Did the error started to happen when you added the command?
Ok so what does your ready method supposed to do?
Ok, it should be in the main bot file
ready
👏
It should be like ``bot.on('ready' async () ={
}``
k
Or it's client.on
you should fire whoever made that
Yes
let me pastebin it
Ok
hastebin.com isnt reliable anymore
but its usually down and u cant upload or see files
its up now
It's good for now
Not for me
hooly shit
So what is wrong with the start up
If it works, it works
fire whoever made this b0t
Yes
my eyes
Agreeable
wait
what
if(command === `${prefix}btext` || command === `${prefix}btext`)```
am i missing something or are both the same
also ew single file bot
Yeet
use
a
framework 
no its not
what is this then ```js
if(command === ${prefix}btext || command === ${prefix}btext) {
const what = args.join(' ')
const btext = what.replace(/[bg]/gi, ":b:")
message.channel.send(btext)
}```
Tell your Dev to get in here so fishy can throw down the hammer
and why are you telling urself to add ur own bot js console.log("Add your bot with this url: " + `https://discordapp.com/oauth2/authorize?client_id=${bot.user.id}&scope=bot&permissions=0` + "\n" + "\n")
he's in eu
lol
because @bright spear
I added that in there
cause it's handy
if anyone asks me
nice variables
thanks haha
If that's the case, then make a command for that link
I could do that
i was being sarcastic but ok
i'll give you $1 to delete that bot
Well If i did that
It's a lot easier than it looks, and having it send to your console won't help the person who wants it, you have to go to your console to grab it
I would need someone to remake it
Yes
Would you want to do it

Nope
exactly
when luca's troll repo actually has a higher quality code than this
someone merge this to luca
who is that in luca's pfp?
a kid in Oliy's basement
oh damn
fbi
so in that code
is there something i can put in there
to help find the problem
@west raptor how do I add .catch
- stop mentioning people
..
seriously?
deleted the message?
ghost pings are the worst
surrreee
wasnt me
please stop lying
haha take da joke
it's getting you nowhere
im having an issue with my promote command. It puts commas where there should be spaces when it sends the embed
if (message.content.startsWith('!promote')) { let args = message.content.split(" ") args.shift() let target = message.mentions.members.first(), id = args; const embed = ({embed: { color: 3447003, fields: [{ name: "**Promoted Server**", value: ${id} }, ], } }); message.client.channels.get("522572491969921026").send(embed) } })
and when i do !promote example message thing it sends example,message,thing
Someone help?
id = args;
yeah
try making it id = args.join(' ')
also use a real codeblock (```) pls
```js
code
```
@earnest phoenix This isn't the place to shitpost
lol
did you put the space between ' '
Well where’s it telling you to add it
So then why do you need to “add the catch thing”
So i want to try and narrow down what the error is
and I got a suggestion to add .catch
Oh well that doesn’t mean u need catch it means there’s something wrong with the code
The error is very vague
what is it
bot.on('ready', async() => {
var text = gamename
var values = {
servers: bot.guilds.size
}
var games = text.replace(/\{\{([^}]+)\}\}/g, function(i, match) {
return values[match]
});
var datetoday = new Date()
var days = datetoday.getDate()
var month = datetoday.getMonth() + 1
var year = datetoday.getFullYear()
var time1 = datetoday.getSeconds()
var time2 = datetoday.getHours()
var time3 = datetoday.getMinutes()
fs.writeFile('./botstart.txt', days + "." + month + "." + year + " \n" + time2 + ":" + time3 + ":" + time1, function(err) {
console.log("Logged in as " + bot.user.username + "#" + bot.user.discriminator + "\n" + "\n")
console.log("Server Count: " + bot.guilds.size + "\n" + "\n")
console.log("Prefix: " + settings.prefix + "\n" + "\n")
console.log("Add your bot with this url: " + `https://discordapp.com/oauth2/authorize?client_id=${bot.user.id}&scope=bot&permissions=0` + "\n" + "\n")
console.log("Created by Swift#2050")
bot.user.setPresence({ game: { name: games, type: 0 } });
bot.user.setStatus(settings.status)
const snek = require("snekfetch");
muscii(bot)
});
});```
Yes advaith, but the bot does that immidiately on startup
its from muscii?
and I got no clue what's happening
because nothing else is requiring discord
that could cause a missing permission error
i believe
i have no clue, the other dev did that.
then go talk to him when he wakes up
that's a problem with his code if you don't understand it we arent gonna walk you through a useless process
it'll still work for the time being though
its only a temporary error
it doesnt crash
right, but it floods the console
ok well if he doesnt know hes quite a bad djs developer
because im 15 and could tell you whats causing that if i saw the code
is there a way I can have it not send that error request to the console?
you're trying to send/delete/do something with discord that the bot doesnt have permissions for
Like stop the bot from logging those types of errors?
do a check for permissions and if the bot doesnt have the permissions required in message.guild then return;
it has all the permissions
@sour tide
yes
a fix would be to check permissions before doing discord api requests
how can I make it leave this server
what hashire said and what i said before make sure it has permissions each time
^
true
so manually leaving isn't a solution
it should be covered anyways
and leaving on no permissions would just make you lose guilds
Is there a way where I can not make it not send that error to the console?
instead of fixing it
so it doesn't flood
just on message event do
if(!message.guild.members.get(client.user.id).hasPermission("WHATEVER_PERMISSION_YOU_NEED")) return;
probably a better way of doing that
I didn't make this remember, nor do I know much about node.js in the first place
but this problem is about as stupid as that answer so thats what cha get
in the message event
if thats true thanks sm because ive needed a shortcut for kajillion years lol
alright
['uncaughtException', 'unhandledRejection'].forEach(err => {
process.on(err, function (reason) {
//console.log(`${err}: ${reason}`);
//process.exit(0);
})
})```
what file is the message event normally in
i was literally just lookin around for it before u said that i think im blind but yeah
hope that helps
Syntax dw about it
he just needs to prevent the error from happening in the first place
you should be addressing the issue not saying screw it let me just ignore it
hm
"Is there a way where I can not make it not send that error to the console?"
^
Syntax thats not his problem really
I have no clue how to handle it until the other dev comes online
he thinks it is
but he should be stopping the error from happening not just making the program ignore it
yes, but obviously he doesn't understand his code
add .catch to promises
I have no clue
where any
of this can be added
would it be in the main bot.js file?
wherever the client.on('message' event is
bot.on('message', message => {
if(message.author.bot) return;
if(message.channel.type === "dm") return;
let messageArray = message.content.split(" ");
let command = messageArray[0];
let args = messageArray.slice(1);
const mentionprefix = message.guild.member(botID).toString()
fs.readFile(`./blacklisted/${message.author.id}/black.txt`, function(err, data) {
if(data === "true") return;
if(err) {
if(message.content.startsWith(prefix)) {
var dir = `./usagelogs/${message.guild.id}`;
if (!fs.existsSync(dir)){
fs.mkdirSync(dir);
}
const fuck = new Date()
const nowdate = fuck.getDate()
const nowdate2 = fuck.getMonth() + 1
const nowdate3 = fuck.getFullYear()
const minute1 = fuck.getHours()
const minute2 = fuck.getMinutes()
const minute3 = fuck.getSeconds()
fs.appendFile(`./usagelogs/${message.guild.id}/logs.txt`, "\n" + nowdate + "." + nowdate2 + "." + nowdate3 + " " + minute1 + ":" + minute2 + ":" + minute3 + " " + message.author.id + " " + message.author.username + "#" + message.author.discriminator + ":: " + message.content, function(err) {
});
}```
it's bot not client
that's where I got confused
so can you take that, add the new thingy to it, then send it back so i can add it to the bot?
oh ok
at the very top just put if(!message.guild.me.hasPermission('MANAGE_MESSAGES')) return
alright
like underneath bot.on
yikes, ever heard of json?
and also the messageArray is useless because message gets outputted in an array
Zua he has no idea what his code actually is
yeah the other dev made it
keep in mind that will make the bot completely ignore any channels it doesn't have manage messages permission
I've only used python before
Alright
that's wack
I just made the bot public today
and for some reason it already has 30 guilds
so probably some kid tried the >>delmsg 2010291321 command
and didn't give the bot perms
and It just tried to pickup where it left off
thats quite a way to address your bot's users....
apparently d.js had a method of finding the source of those promise rejections
¯_(ツ)_/¯
(╯°□°)╯︵ ┻━┻
but why
thatd be so nice
"so here's the plan guys. the stack isnt displaying correctly, so we have to fix it!
Guy 1: Let's find out how we display it correctly
Guy 2: I agree with guy 1
Guy Idiot: Let's just get rid of it cuz like y not
Guy idiot it is! Guy 1 and Guy 2 you're fired."
Can anyone help me find a better prefix than $, because way to many bots use that one.
bash your head on your keyboard and pick whatever is first
holding shift helps too cause you get symbols
$
true you could make your bot only mentionable but tahts kinda toxic
how come when i tried to bash my head on my keyboard i got nothing but a hurting nose? has anyone else found that bug?
no you should report it
another dollar sign 
like ..$ or $> or $.. or >$ or maybe like $% even >$$
$$ is taken
!prefix '); drop table prefixes; --
[]{}#%^*+=_|~<>$€£·.,?!help
{}23{@3#memes-and-media
no that prefix is for dum heads
best prefix is



