#development
1 messages · Page 681 of 1
library
just use the ping command?
Wont work, gateway.discord.gg wont accept it
pinging the gateway domain =/= getting the latency during the websocket connection
What do all the titles in the “bots library” mean?
titles?
That's wrappers for Discord API
libraries/modules to interact with Discord API through code
And there are different ones for different languages
Oh so- uh then if I’m making an English bot for a game on discord I would use?
programming languages are meant by "languages"
How would I save a time stamp after something is done?
Like if I’m making a daily cmd how would I save the time stamp after the money has been added
simply save the current unix timestamp in a database?
Hm. Okay.
😂
how can i create an instant invitation with a bot
One message removed from a suspended account.
js
d.js?
yes
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
documentation is here: https://discord.js.org/
I'm on phone rn so I can't really remember off the top of my head
anyways now that I'm finally fucking updating my api I'll consider going to rewrite..
Idk
Hey I need help making a bypass for my bot that will allow me to change the prefix of my bot in a server regardless of my perms
just check if the message author's id matches your id
if it does, skip permission checks
what that means is if the author's id matches myid return out of the method
anyone here who can help me to create a bot for my server which can auto create a new voice channel whenever someone join the original vc please?
what library
reply me please
reply: what library, i will give you the docs
i dont think they even know how to code
i am new and dont have any experience in this \
pseudo code:
bot listener:
if a user has joined a voice channel:
create a new one
pls tell me from the starting
just use an existing bot
Documentations for popular libraries
Javascript
discord.js: https://discord.js.org/#/docs/main/stable/
discord.js master: https://discord.js.org/#/docs/main/master/
Eris: https://abal.moe/Eris/docs
Python
discord.py: https://discordpy.readthedocs.io/en/latest/
discord.py async: https://discordpy.readthedocs.io/en/async/
Java
JDA: https://ci.dv8tion.net/job/JDA/javadoc/index.html
Discord4J: https://javadoc.jitpack.io/com/discord4j/discord4j/build/3.0.8/javadoc/index.html
.NET
Discord.Net stable: https://discord.foxbot.me/stable/
Discord.Net latest: https://discord.foxbot.me/latest/
DSharpPlus: https://dsharpplus.emzi0767.com
DSharpPlus Nightly: https://dsharpplus.github.io
Go
DiscordGo: https://godoc.org/github.com/bwmarrin/discordgo
Disgord: Not yet released according to github repo
Rust
Serenity: https://docs.rs/serenity/0.8.0/serenity/
If any of these are wrong or not updated to the current version of a library please DM or ping me. Also feel free to ping or DM me if you would like a library added to the list.
@mossy vine cant even find this kind of bot if you know pls suggest
fixed
are you just gonna plug your fiverr now lmao
I just spent like 20 minutes getting all of those and formatting them lmao
@mossy vine nope. That would be advertising
how can i get a invite from a server with my bot
Check d.js docs
I don't understand anything and I can't find anything
it's my server i'm doing a test
doubt he's on master
shit
One message removed from a suspended account.
I already saw it but I don't understand
Oh it's the same I believe
ye
it is
One message removed from a suspended account.
@earnest phoenix fetch the first channel the bot has access to and create an invite with that channel
One message removed from a suspended account.
how i check if is an username already being used?
ScorpionToday at 10:35 PM
how i check if is an username already being used?
can you elaborate
im trying to make an rpg bot, then myself select a nickname example Bob if other person selects the name Bob return message You can't choose that nickname
@earnest phoenix
@sob
One message removed from a suspended account.
One message removed from a suspended account.
get the guild members and filter them by nickname, then check if the filtered array is empty or if there are users with the nickname already @rugged bramble
im using canvas constructor i used .addRect() is there a way to make .addRect like png? so see through
like kinda see through the background instead of the block
like transparancy
you mean transparent colors, or a rectangle with borders only?
rectangle
so i can see the background
so example i create a rectangle color grey and the background was pink . i can see through the grey ans see little bit of pink
and*
setColor("rgba(255,255,255,1)") // 0-255 red, 0-255 green, 0-255 blue, 0-1 opacity/transparency
setColor("#ffffffff") // 00-ff red, 00-ff green, 00-ff blue, 00-ff opacity/transparency
what did you use?
setColor("rgba(255,255,255,1)") // 0-255 red, 0-255 green, 0-255 blue, 0-1 opacity/transparency
i didnt tell you to copy paste it
i showed you how it works, you have to set it yourself
the first three parameters are the color level, where 0 is nothing, and 255 is the max
const db = require('quick.db');
exports.run = (client, message, args, func) => {
let prefix = db.fetch(`prefix_${message.guild.id}`)
if(args[0] === "sıfırla") {
if(!prefix) {
message.channel.send(` | Sunucunuzda herhangi bir ayarlı prefix bulunmamakta.`)
return
}
db.delete(`prefix_${message.guild.id}`)
message.channel.send(" | Prefix başarıyla sıfırlandı. Mevcut prefix `.`")
return
}
if (!args[0])
return message.channel.send(" | Önce istediğin prefix'i belirtmelisin.\n" +" | Doğru kullanım: `prefix <prefix>`")
db.set(`prefix_${message.guild.id}`, args[0])
message.channel.send(` | Prefix başarıyla \`${args[0]}\` olarak ayarlandı, sıfırlamak istersen \`${args[0]}prefix sıfırla\` komutunu kullanabilirsin.`)
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: 3,
kategori: "Prefix Komutu"
};
exports.help = {
name: 'prefix',
description: 'Sunucunuza özel prefix ayarlar.',
usage: 'prefix <prefix | sıfırla>'
};```
first is red, second is green, third is blue
where is wrong dude
the 4th parameter is the opacity
it goes from 0 to 1
0 being totally transparent/invisible
1 being totaly opaque
if you want 50% transparency for example, set the 4th parameter to 0.5
@tight forum what is the problem?

how do you check for prefixes? show your command handler
so, do I have to do "module.exports.run"?
show your command handler
i have just prefix.js
show the .on("message") part
you mean this part ?
db.set(`prefix_${message.guild.id}`, args[0])
message.channel.send(` | Prefix başarıyla \`${args[0]}\` olarak ayarlandı, sıfırlamak istersen \`${args[0]}prefix sıfırla\` komutunu kullanabilirsin.`)
no, i mean your main file
bot.js or index.js or idk
also, i dont see any db.fetch on quick.db's website
they have db.set and db.get
i think in my version, "db.fetch" is available
ok, then show your main file
my bot.js file does not contain anything with prefix but i can send the file if you want
your bot.js contains the check for prefix.
for example, if message starts with prefix
Maybe his message.js file (If they are using a command/event handler)
i have only prefix.js file related to prefix
should i write something else to bot.js?
Then where are you checking that a message is actually a command of your bot

you have a fixed prefix
loaded from the botconfig file
your bot always checks for this prefix, it never checks a prefix from quick.db
no, you have to add a prefix from quick.db
bot.on("message", message => {
if(message.author.bot) return;
if(message.channel.type === "dm") return;
let messageArray = message.content.split(" ");
let cmd = messageArray[0];
let args = messageArray.slice(1);
let prefix = db.get(`prefix_${message.guild.id}`);
if(!prefix) {
prefix = botconfig.prefix;
}
// use prefix here instead of botconfig.prefix
});```
for example, when writing an event in bot.js ```js
let prefix = require('quick.db').fetch(prefix_${message.guild.id})
do i have to write something like that?
oh you already wrote.
tysm
for example, how do I define the ban command for prefix to work?
or do i need to make a definition?
all your commands need to check the prefix from the db
iif prefix doesnt exist in db, then load prefix from config file
really thank you so much, you are very patient
👍
Is there a program for easy editing a sqlite file?
Ok
guys the codes Tim gave me were fine. but now my commands don't work as if there were no prefixes
I'm a bot developer, can i get a role as for that?
well im just a developer in general
Alright
@tight forum
let p = new db.table("PREFIXES)
let prefix = p.fetch(`${message.guild.id`)
if(!prefix || prefix === null || prefix === undefined){
p.set(`${message.guild.id}`, '<prefix>')
prefix = <prefix>;```
Sorry if anything is incorrect as I did that on a crappy phone
you only need the first one
or just do
let prefix = p.fetch(message.guild.id) || '!';
Yeah
inport discord from discord.ext.commands import commands,has_permissions, MissingPermissions import json with open('reports.json', encoding='utf-8') as f: try: report = json.load(f) except ValueError: report = {} report['users'] = [] client = discord.ext.commands.Bot(command_prefix = '?') @client.command(pass_context = True) @has_permissions(manage_roles=True, ban_members=True) async def warn(ctx,user:discord.User,*reason:str): if not reason: await client.say("Please provide a reason") return reason = ' '.join(reason) for current_user in report['users']: if current_user['name'] == user.name: current_user['reasons'].append(reason) break else: report['users'].append({ 'name':user.name, 'reasons': [reason,] }) with open('reports.json','w+') as f: json.dump(report,f) @client.command(pass_context = True) async def warnings(ctx,user:discord.User): for current_user in report['users']: if user.name == current_user['name']: await client.say(f"{user.name} has been reported {len(current_user['reasons'])} times : {','.join(current_user['reasons'])}") break else: await client.say(f"{user.name} has never been reported") @warn.error async def kick_error(error, ctx): if isinstance(error, MissingPermissions): text = "Sorry {}, you do not have permissions to do that!".format(ctx.message.author) await client.send_message(ctx.message.channel, text) client.run("BOT_TOKEN")
Does something like this even work anymore
why the FUCK is that one line
i meant i could work but it hurts my eyes
D.js commando
I want to make sure that some commands are only run if some certain conditions are met (not permissions). I tried adding an inhibitor for the purpose but it didn't run for any of the commands or even any message in general. Is there some other way to make sure that the command is only run if the condition is met other than putting the condition in the command's run method as I need to do the same for multiple commands.
What’s the specific condition
we need more information (Code "without token" , screenshot of the error in the console)
@opaque eagle the condition is if the channel where the command is used is in a specific channel whose id is there in the array that I've stored in my database
I’d just suggest extending the Command class
The error come from here
Show where you defined message
@opaque eagle how do you suggest I do it by extending the command class?
That's how I'm defining my commands for now
Do you suggest I define another abstract class where I perform the test before running the command
Yeah
And use my class to create the commands?
But I want similar conditions to be applicable for the normal messages as well
what is that event called for edited messages?
kk
Work with oldMessage, newMessage
Ok
Any way to make the bot send a message to a random channel in the guildCreate event?
@earnest phoenix i will try it, ty
@tall arrow read the docs for your lib
Does anyone know what CSS I need to define to change the appearance of the report, vote, and join support server buttons?
anyone know how to get a user id who reacts inside collect event after that user reacts?
j.on('collect', (r) => {
})
are you using the d.js ReactionCollector?
@restive night ^ also what version? 11.5 or 12
already solved, thanks for response btw
I use the v12 d.js but this does not work but I do not know why:
message.guild.channels.forEach (async (channel, id) => {
channel.overwritePermissions ({
permissionOverwrites: [
{
id: tmute.id,
deny: ["SEND_MESSAGES"],
}
]
reason: 'Mute.'
});
}); ```
Knowing that it puts me no mistake in the console
@earnest phoenix well uh doesn't overwritePermissions delete all other perms
you might wanna use this
ok
Could not find node null, using 10
what does that mean
Why i have this error : `
(node:14) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'delete' of undefined
at message.guild.channels.forEach (/home/container/commands/admin/unmute.js:11:58)
at Map.forEach (<anonymous>)
at Object.module.exports.run (/home/container/commands/admin/unmute.js:10:26)
at Client.client.on.message (/home/container/theking.js:225:33)
at Client.emit (events.js:203:15)
at MessageCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:391:31)
at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:418:22)
at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:274:10)```
Code : ```js
message.guild.channels.forEach(async (channel, id) => {
await channel.permissionOverwrites.get(utilisateur.id).delete()
});```
How is utilisateur defined? @earnest phoenix
Why was you bot rejected? @pseudo parcel
Reboot command must be restricted to you and you only
ok
How annoying would it be if user x in a server can’t use your bot because the owner of server y chose to reboot your bot
const { MessageEmbed } = require ("discord.js");
module.exports.run = async (client, message, args) => {
if(!message.guild.me.hasPermission("MANAGE_MESSAGES")) return ("**:x: Je n'ai pas la permission de unmute des membres !**")
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("**:x: Vous n'avez pas la permission d'effectuer cette commande.**");
let utilisateur = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
if(!utilisateur) return message.channel.send("**:x: Veuillez mentionner un utilisateur.**");
try {
message.guild.channels.forEach((channel, id) => {
await channel.permissionOverwrites.get(utilisateur.id).delete()
});
} catch(e){
message.channel.send("**:x: Je n'ai pas la permission de gérer les permissions.**")
}
message.channel.send(`**:white_check_mark: L'utilisateur ${utilisateur} à été unmute avec succès.**`)
utilisateur.send(`**:tada: Vous avez été unmute dans le serveur ${message.guild.name}**`).catch(err => {
if(err) {
console.log("Impossible de DM")
}
})
let logs = message.guild.channels.find(c => c.name == "theking-logs")
if(!logs) {
console.log("pas le salon logs")
}
var logse = new MessageEmbed()
.setColor(`#7CFC00`)
.setTitle("[UNMUTE] Utilisateur unmute !")
.addField("Modérateur :", `${message.author}`)
.addField("Utilisateur unmute :", `${utilisateur} avec l'identifiant ${utilisateur.id}`)
try{
logs.send(logse)
} catch(e) {
console.log("Impossible de send")
}
}
module.exports.help = {
name:"unmute"
} ```@opaque eagle
beacause is a loop
no?
Maybe they have no overwrites?
You’re making an unmute command?
Discord bots generally mute users by adding and removing a “Muted” role, not by manually changing permission levels for each channel
Your implementation is very spammy and Discord API abuse-y.
I don’t approve of API abuse, maybe someone else can help you with that.
Could you tell me how to do it every 7 seconds?@opaque eagle
@earnest phoenix simply make a timer
ok
Could not find node null, using 10
what does that mean
@earnest phoenix
moderators please test my bot
They will test when they have the time
592630332201893889
Wait for a week upon submission before complaining
@stray garnet you are hosting on Glitch right, that's why you see that
wrong channel
and pls dont annoy everyone because your one of 20000 bots isn't approved yet
-bots @tight heath
@earnest phoenix using a user instead of a role doesn't change a thing really
with misconfigured perms
you're better off just creating a role on first use of mute
wt hell
and saving the id of that
@versed thorn
and on each consecutive mute you just assign the role
oh
macc pls this is development
sorry,Sir
@stray garnet
@wet void so what does that mean
that means
that you don't need to worry at all
it's just telling you, that you didn't tell it which version of node.js to use
so it automatically uses the latest stable version, being 10.
Read the post man .-.
-bots @grave pilot
dw
const Embed = new Discord.RichEmbed()
.setAuthor("Edited Message")
.setDescription(`Original Message:\n${oldMessage}\n\nNew Message:\n${newMessage}`)
let edit = JSON.parse(fs.readFileSync("./logss.json", "utf8"));
if(!edit[message.guild.id]){
return message.channel.send(`
An Server Admin must set the Log Channel with !setlogs <ChannelName>.
`)
}
let log = edit[message.guild.id].log
let logc = message.guild.channels.find(r => r.name === log);
if(!log) return message.channel.send(`
Error 404!
`)
message.delete();
logc.send(Embed);
})```
Why it dont sends it when i edit an Message? And yes #log does exist
you cant just do oldMessage, newMessage, message to recieve a message object as well lmao
@mossy vine so?
unless you are emitting it yourself and passing that 3rd param. it doesn't exist
Why? @earnest phoenix
For bots command
Ooo ok
else
.
it's very specific, i doubt such bot exists
why does it need to be a separate message for each line?
@quartz kindle Just for the effect
the problem is that is terribly innefficient for both discord and for your bot
sending a poem line by line will take more time and much more resources, because you need to respect rate limits
ie: you cant send more than 5 messages every 5 seconds
for starters
and repeatedly sending as much messages as possible for a long period of time might lead to account ban
I mean you could get a poem api and make it write to a txt then send to a person every hour or some shit
Oh okay
its plausible if you make it wait a second or two before sending the next line
but even so, you'd have to make the bot yourself, as it probably doesnt exist
@quartz kindle That's how I intended it like that, sending a message like every few seconds. Just as much as it would take to read a line out loud which would be about 5 seconds
you'll have to make it yourself or hire someone to do it for you
or you might come across a person who's willing to do it for free
Okay then I guess I'm gonna read in the API
and try to tinker something myself. Thanks four your help 👍
good luck 👍
hello guys, one of my friends on another discord suggested, so I joined this one.
I am looking for getting a bot made for one of games that I play.
Would anyone be able to help?
I am willing to pay
which bot should i use for moderation in my support server
dbl hardrequest @quick kayak
You seem to have asked for a very specific bot/feature. You likely won't find it on the site if you haven't searched already... What you can do is talk to Oliy#0330 to get access to #434058442764714002 and find a developer willing to do the job. Be sure you provide enough details like payment options, if you are going to selfhost it or not, how fast you want it done, etc.
Isn’t #434058442764714002 supposed to be for like really official corporate company type bots
Not freelance work like what they’re asking for
@opaque eagle nah, its just that none of the people requesting bots are formal enough or pressure oliy enough
and most of them not willing to pay
LOL
I just wanted to ask if people use bots such as Dyno or Mee6 for moderation or do they make their own :/
I mean some people uses their own
I make my own lol
I made my own. For the basics you only need a few lines of code.
I guess i can make a specific one for my use
Along the lines of if(message.body.contains(“https://”)){ message.delete } not exact code but an example
I usually add a group check condition to it as well. Like && message.member.roles.some(r => [“Administrator”].includes(r.name))
That way you can exclude some roles from using urls/discord invites.
Hmmm
[“Administrator”].includes(r.name) can be just r.name === "Administrator"
Really? 🤔 I guess so, never thought of it that way.
That would get messy with more then one role though. Have to have multiple conditions, right?
You can use switch statements :/
That is true, or amend the original code, [“Administrator”,”Moderator”]
or check if member has admin/mod permissions, instead of going through their roles
a switch statement would be the worst option there
you'd go from js roles.some(r => ["a", "b"].includes(r.name));tojs roles.some(r => { switch(r.name) { case "a": case "b": return true; default: return false; } });
module.exports.run = async (client, message, args) => {
let msg = await message.channel.send("**✅ Génération...**");
let mentionedUser = message.mentions.users.first() || message.author;
let avatarembed = new MessageEmbed()
.setImage(mentionedUser.displayAvatarURL())
.setColor("#FFFFFF")
.setTitle(`Avatar de ${mentionedUser.username}`)
.setFooter("Demandé par " + message.author.tag)
.setDescription("[Cliquez ici si l'image ne s'affiche pas.]("+mentionedUser.displayAvatarURL+")");
message.channel.send(avatarembed)
msg.delete();
}
module.exports.help = {
name: "avatar"
}```
Why do I see her above the picture?
I use d.js v12
because it's a method not a property
Would anyone happen to know why in Express.JS when I include a partial the CSS doesn't come along? It only happens in this one file, every other ejs file I include a partial in it works, just not this one. <%- include partial/navbar.ejs %>
try <% instead of <%-
How can I get random responses from an array of strings?
I tried:
const responses = [’array of strings']
const reps = Math.floor(Math.random() * responses.length)
Or would I have to do
const responses = [’array of strings']
const reps = responses[Math.floor(Math.random() * responses.length)]
What I did for mine Like are you trying to make an 8ball command for something?
No work command with random responses
I got it
Example const work =[“Jobs”, “....”, “.....”];
const work = math.floor(math.random() * work.length);
That wouldn’t work
Because it returns a number iirc
Well I’m not finished with it
- 2 variables with the same name
- you probably meant
work[ math.floor(math.random() * work.length)]
const array = [’array of strings’]
const random = array[Math.floor(Math.random() * array.length))]
You could but it’d cause problems and possibly errors
Yeha
Especially when using const
Since you can’t give a variable a new value when using const
If(message.author.id !== ”yourID”){
//error message
}else{
//code here
}
But what if not return
Wdym?
But just check if the person using the command ID matches yours.
Ok
If it doesn’t send an error message, if it does proceed with the command
Then use setPresence
And just the status option
I don’t think you can make a bot appear offline can ya?
I tried it and it just remains online so idk
Yes
you can, but I think if you switch to offline, your bot won't read messages, but I'm not sure
Hmm
just try it
Cause my bot @unborn mulch is on dnd
But its in his code
(bot)client.user.setactivity(
client.user.setPresence({status: 'offline’})
...
What?
i use client.user.setstatus(‘dnd’);
https://github.com/discordjs/discord.js/blob/stable/src/structures/ClientUser.js#L264
its using the same thing
Wait I did that wrong I think
Oh wait no nvm
Reading the docs wrong kek
Yea didn’t work
@onyx summit
Kek
tell Discord not me
By coding it
cough I suggest Lavalink but ytdl-core is good for beginners
Would this be a good way of organizing things in EJS? https://vinniehat.is-inside.me/Qgdq0R2y.png
from /dashboard you have /servers
Usually they just have pages or views and then /index.ejs, dashboard.ejs, etc. But then for stuff like ^ above, I would have to do /dashboard-servers.ejs and egh
I need help! My bot lost its ability to display a custom status(DND in my case) and activity
@earnest phoenix u using activity or game?
@earnest phoenix It's fixed now 😕
okey
ok this is probs a dumb mistake of mine, but how would I upload a .png to a github repo using pygithub

I tried uploading a blank file then editing it, but that, well didn't end well.
And if I try uploading the image file, it will give that. It doesnt allow a sha to be supplied.
can someone tell me how to make the kick command
in which library
Before you try to kick someone, make sure they are kickable
On that page there is an example of how to set the bots status.
thank you
can someone tell me how to make a bot send an image without a link of an image?
oh okay
rm: cannot remove 'node_modules/': Is a directory
what
have to use <code>rm -rf</code
you need to specifically set the r flag (recursive)
well it doesn't error but the folder stays
Do ‘’’ ls -l ‘’’
Ugh. I’ll never learn markup. Lol
ls -l
See if you own it or even have Perms to delete it.
oh ok i just had to refresh to show changes
How can I make a fail rate? Like they have a 25% chance to fail or succeed
follow percentage logic
generate a random value between 0 and 100, you'll get your rate and then you can decide which value is fail or success, eg if the value is 25 or under (25%), return a fail
So basically make use of Math.random?
i have no idea what that is, but it sounds like the right thing, so yes
Okay
Thanks
I was just thinking about that but I wasn’t sure how it’d help
Thanks for pointing it out :)
okay so im making a discord.js bot and i am trying to make a footer for my help command that says the user and the time (ex: the wire#2204•Today at 8:53 PM)
but when i try to do it it just puts my user id
<@209410953035513856>•Today at 8:53 PM
Thanks
what's the most reliable way to generate a random number in c++
i legit looked on so and cant find any solid answer
Im a big fan of DigitalOcean
heroku doesnt count
and do is pretty good
if you get someones referral code you get like 10 months free lmao
probably because you've got low usage
then it doesn't count
Sobheroku goes downhill fast with data then?
yes
it doesn't perform well during concurrency
nor like
more than 10 commands in 30 seconds
its not really meant for bots at all
that too
Hm
heroku's meant for web hosting
sure, you can fit a square peg into a round hole if the square peg is small enough
I just found it to be super easy with nodejs
but you'll run into issues sooner or later
just host it on an actual server
not only you will have less problems
you will also learn linux as you go helping you in future incase your bot grows
- you can host a lot of other side apps that you can experiment with
You can also have it as your personal vpn if you like / need those
Eww learning
you are not fit to be a developer if you dont want to learn 
Lol I'm about to take in a year's worth of job learning
I'm just scared of extra projects for the momebt
I totally agree though
Learning separates those who should from those who cant
I have side jobs since Im not yet in college and I maintain my bot on top of that while learning more about things
why not aquire such knowledge now and accelerate in it later rather than learn it later and not stand out
I was going down the path of career programming 2hen I found a dream job
or just dont be a developer if you dont like reading, effort and patience
Now it's a hobby
I love creating things but ive lost my flame for reaching out and learning it
ATC keeps you pretty busy learning shit 
Honestly every programming avenue (learning a system) is the career
It becomes second nature
most likely
i do understand people lose passion for coding, it just means it's not at their best of interests
There is no such thing as a career programmer that knows 1 language in 1 compiler for 1 application
Actually maybe with a good contract...
I love coding but the coders basic tasks are sometimes difficult
Professionals would call it basica of the job
Git code for example
don't get me wrong here, the field of programming jobs is oversaturated (e.g software eng.), but it's oversaturated with underqualified people who have most likely lied on their resume or are being screwed around by the parent company
which if you have enough experience in that field, you already stand out
Yeah that's the scary part
Cs majors that should have been janitors
People with no initiative to learn and be creative
this tbh
You see it all over the web
Long maintenance, terrible input checks
Visual basic forms
I haven't been able to view my work schedule for 2 weeks
Because the federal contract is a traveling circus
How would I make a command for my bot that will clear all of his past responses
all of them?
there's not really a way without api abuse
Damn
Is ytdl decent for beginning
Uhh
you'd have to keep spamming the endpoint until you got all of the messages in the channel then filter out your bot's messages and then delete all of those
And that's just one channel
Save bot's messages in cache? 
How?
not reliable enough
True
if the process has been restarted the cache is lost
an efficient but rather unproductive way would be to ban the bot then unban it and invite it back in
nevermind, even that has a limit
maximum of 7 days history deletion
Hmmm
Is there evaluation command?
I have mainframe that will delete the last message sent by my bot but its only the last message
is client.ping the API ping?
if d.js then ws
Erm
guyz
hellow
I still haven't fixed my prefix, can you help me?
commands don't work as if there were no prefixes
https://hastebin.com/cinexonuyo.js bot.js prefix event
https://hastebin.com/oyutejotij.js prefix.js
where is wrong ?
you're not running any command
let prefix = getyourprefixhere;
// check for prefix+command and run command here```
I didn't want to bother you any more
do i have to write this in bot.js?
or prefix.js
in bot.js
What is the problem?
Dms dont have permissions, so permlevel doesnt work
A reboot command should be locked for owber only
Do you have a pernission level for owner?
Yes, but did you make one for you?
Like, to check for owner, you have to check if message.author.id === your id
You can make a permlevel that checks that
Where do you check for permlevels?
You copied the code from someone else?
Same as copying
Anyway, i already told you how to check for owner, now you have to figure it out
Then try it
Make it 5 and ask someone to try reboot it
then you need to check how the permlevel checking works
find the file where the checks are done
or simply just make your own owner check
I cant put background on my bot page html's.
colour or pic ?
picture
what did you try?
body {
background-image: url('link')
}
hmm
do you have a css file ?
no
ready code
it does work for me
okey.
which version of discord.js are you on?
defaultChannel is deprecated in stable and removed in master
Depending on which version you are on, send isn’t really a function or what Tim said
defaultChannel still exists in 11.4.2 but it should not be used, because it refers to the general channel of a guild, and that channel can be removed
if a guild deletes its general channel, defaultChannel will not work
wouldn't it be .channel then?
no
if you want to send a message when a user joins, you have to configure a specific channel based on what the guild wants
so you need to setup a database to save configuration and the guild owners need to set which channel they want to receive those messages on
restricting it by owner id
then your permission system isnt working
how about just debugging and logging your code?
easier to test than making alt accounts
7 24
On the guildbanadd event how do I retrieve who banned that user to post a message in a certain room?
you need audit log permissions and retrieve it from there
Hey tim!
I made some changes with help
thats code https://hastebin.com/lobewubeka.cs
has this error ```js
Uncaught Promise Error:
TypeError: Cannot read property 'length' of undefined
ld.prefix
but there is one more problem, now no commands are working
not just prefix cmd
Instead of writing all that extra code, why not just do: js const prefix = await bot.prefixes.get(message.guild.id) || botconfig.prefix;
Just use the or operator lmao
I tried, but will that solve my problem?
If you tried it, you'd know if it solves your problem or not.
That's just a style thing, since a lot of your code there is redundant... the real problem I think is that botconfig.prefix is undefined.
this time i got this
Uncaught Promise Error:
TypeError: Assignment to constant variable.
with this code https://hastebin.com/edeyitabar.cs
@opaque eagle
Remove those other lines you had
What I sent was supposed to replace all thisjs let prefix = botconfig.prefix; const data = await bot.prefixes.get(message.guild.id); if (data === null) { prefix = botconfig.prefix; } else { prefix = data; }
Even if there's a problem with the db, the var falls back to botconfig.prefix
The problem is likely that botconfig.prefix is undefined
Not really how I have my perm levels set up but tbh the most foolproof solution I can give you is writing the check in the command itself... when the reboot command is run, js if (message.author.id === "YOUR ID") return;
In your command
Yes
Right after js exports.run = (client, message, args) => {
Yes that should work fine.
let prefix = client.prefixes.has(message.guild.id);
i saw but
oh w8
uhm not worked
it says client.prefixes.has is not a function ok
but I didn't define it as function
Then don't call it like a function
Can someone help me? I was writing my own MessageCollector when I ran into some issues.
CODE: https://gist.github.com/SinistreCyborg/fb633e4c103ef1f15d5d392c4165c168
ERROR: https://imgur.com/a/oxa7D9Q (disabled imgur embed b/c there are two images in the link but Discord only shows one)

lol
show code
full file
not just one segment of it
hide your token if it's in there
then send it lol
w8
this is for settings the prefix?
Show your main file lol, that doesn't show where client.prefixes was defined
yup
lemme send u command handler part
No
oh ok
or show the part where client.prefixes is defined
whatever
freaking prefix i've been trying for two hours
hey don't use those words
don't worry
freaking more convenient
What are you trying to do with your prefix?
let cooldown = 30000
db.fetch(`lastCooldown_${message.author.id}`).then(i => {
if (i!== null && cooldown - (Date.now() - i) > 0) {
let timeObj = ms(cooldown - (Date.now() - i));
return message.channel.send(`Cooldown! Please wait a few minutes`) .then(message => {
message.delete(8000);
})
how do i make it say after 5min
THISCMD is now available when cooldown expires
huh?
so when a user uses !daily
for example : the cooldown sets 24H then after 24h the bot pings the user saying daily command is avaialble
you have setTimeout()
i dont like setTimeout
cause if i restart bot
the whole thing colapes
why i want to use a db
for this
then store the unix time when the command is available
Store a unix timestamp in a db
Then Date.now() - 155551889091910
hm
That's a random number but
You can define one with Date.now() and then store it
return message.channel.send(`Daily ccommand avaialble`)
})```
nono
Not really
that will check once
IF you want to to routinely check use setinterval
when the command is triggered, if the user isn't cooldowned, store the unix time + 86 400 000 in the db then put a setTimeout. when the timeout ends, you remove the cooldown and remove that unix time from the DB
and if the bot restarts, add a setInterval to the index.js where you check if there are cooldowns and remove them if the unix time + 86 400 000 is > than the current time (Date.now())
@earnest phoenix
hm
I do this for my mute command
@opaque eagle are you still having the problem you have? I think it might be because you call the listener like this.client.on("messageCreate", this.listener); and the this value is different
hmm... what would i do to fix it?
maybe try this.client.on("messageCreate", (msg) => this.listener(msg))
Thanks
I did this to fix it js this.client.on("messageCreate", this.listener.bind(this));
nice
I know this might be a silly question, but how do I go about catching mentions like @ everyone or @ here before they ping people?
you can't
revoke role's permissions to mention everyone if you don't want it to ping people
Okay. Makes sense.
I could however catch it with my regular word filter, delete it, and log it.
Yea, better to just let server owners that use my bot figure it out.
One message removed from a suspended account.
ok
libdiscord
c isnt cpp
oh didnt read that properly lol
I got pinged?
libcord also isn't production ready
@hushed berry go heck yourself
i've heard groovy can play spotify playlists?
yes 
do you have a regex for playlist links/uris i could use?
really?
is it just accepting the playlist id?
do you really need a regex for it at all
i mean
regex is the standard way to do it
@trim saddle
no
I just parse the URL
so if it's a proper playlist url it should get parsed correctly and play?
i mean i could easily try that
also uh..
it's hard playing spotify playlists considering the playlist GET has a constantly changing form of authorization
its not that hard
its just standard oauth stuff 🤔
just when you make a request
check if expired
if yes, refresh creds
then execute request
ez ala pz
@trim saddle You could put all urls in a list then make the play command repeat check the list until none is left
idfk
How to I mention an emoji. I know that sounds crazy but how do you do it with the id instead of
:name:
?
I never said it didn't work at all.
I asked a question and received irrelevant answers.
thats the only way you can do it?
Nope.
I've seen the other way before, Requires both the name and ID and it's almost like a mention.
yes
you get the format by putting a backslash infront of the emoji
-> \:dbladmin: -> !dblAdmin
maybe you could try having a certain database @trim saddle, like storing the user's input somewhere in a file with the links, have it in a certain order depending on that input, and playing it in that order in and what nikki said
maybe
Anyone know a way to get what IP a player is playing on (Forge 1.8.0 with java)
Are you allowed to ask questions like that here?
I don't think so
@west spoke Need it for a forge mod.
Ah
@west spoke Mind giving me a doc page or smth? Can only find 1.8+ docs
ah ok
hmmm k
@unique nimbus Can only find 1.12-1.13 docs 😦 https://please.dont-hack.me/8khe8okj3hm7v.png
oof
Not really a dev question; but does anyone know of any good bot hosts for .NET core bots? Been trying IBM's services, but it's been nearly 2 weeks and my bot still can't run on their systems --'
basically anything that can run .net core
Was kinda asking for suggestions based on past experiences, I already had that much figured out :p
do you have an idea @loud salmon on how to solve this problem? 😄
Hello, i have a problem
dbl ask2ask @trail mountain
Dont ask to ask
Just ask your question
it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.
nope @pine jacinth
:/ ok
@slender thistle Thanks for kinda explaining it but I am getting an error:
dblpy = dbl.Client(client, token)
AttributeError: module 'dbl' has no attribute 'Client'
(Moved it to here)
When i Want to edit and then publish my server, then i get everytime error 500, i sent email's to discord bots and they didnt help me :/
oh
thats not a dev problem
log in/out
kick the bot
then wait 10-20 minutes
a shard might be restarting
I think it might also have to do with fraudulent use off MD
@pine jacinth dbl.DBLClient
Seems to be working 😄
Not helps :/





