#development
1 messages ยท Page 485 of 1
oh oof
And that didn't work @west raptor
This is the code...
ie. client, bot, <botname>
module.exports.run = async (bot, message, args) => {
message.delete().catch()
bot.user.setActivity('idle');
}```
Hm
That should work
Wait
Bo
No
bot.user.setStatus
Not
bot.user.setActivity
bot.user.setStatus adding...
is that the same as idle? 
no
mega oof
const Discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
message.delete().catch()
bot.user.setStatus('idle');
}
-bots @wide ruin
@dawn lagoon
Die
Bot is new Discord.Client();
you do know idle status is just the yellow circle
It doesn't make the bot go offline
Yes I know
I want it to be yellow
But I want different statuses if it is being coded, or if there is an error being fixed
What
Like online - working well
Idle - programming
Dnd - bug fixing
Offline - broken
then set the status
But I can't as the code won't work
i mean
okay so, I got an error now, dont know why it didnt give it to me last time, but here, I'll show you the error
set the status and the activity
@meager stirrup that means your code is wrong
oof
Guys, any suggestion for the main page?
https://discordbots.org/bot/486465778103746560
what db should i use for my python bot
already tried postgres and sqlite
postgres was weird to me and sqlite kept on saying db is locked
Okay so my bot won't turn on, any suggestion on what I did wrong on this part?
i tried mongo but i didny like it
is there a error?
try mariadb then
there is no error
do you get "Bot is Ready!" in console?
i already have mysql installed on my laptop
No i don't, but I dont get an error either
can i still install it
I prefer mariadb over mysql comm
its possible there is a connectivity issue @meager stirrup
probably if you let it run for a while it'll throw an error
well sure your "friend" can hate or love anything xD
it never turns on though
it doesn't become ready so probably it just tries to login
let it run for a few minutes see if an error comes up
probably a timeout error
kk
are you running it from your pc?
yes
mariadb is a great relational database, with better performance out of the box compared to mysql comm. and some more stuff which is why I prefer it, but when picking a database system it all boils down to the use you want to make like relational vs non-relational etc
is it possible there's a firewall blocking the outgoing connection?
no, I made sure there wasnt
I remember it turning on before, but it doesnt want to anymore
forgot to say that
add bot.on("error", console.error) after you've declared bot and run it again see if anything is logged
hmm, it gives no message saying error... if there is no error, then whats making it not turn on?
the only thing I can imagine is that it tries to connect, maybe someone else have some better ideas xD leave it open for a while see if it throws a timeout error or something
Try restarting your device
rip my spelling ;-;
Really.
k.
that is a picture instead of a screenshot
anybody that could help me in voice channel regarding a vps please ?
Is there possibility to create some scheduled features (for example: updating channel name/messaging channel every 10mins) w/o need to use commands (like, some other thread running in background and sending updates, I have no clue) and keep normal bot features (I mean, just usual commands with prefix)? What is the correct approach to this problem while using discord.js?
Just use google for that
and then edit the message in that function
let r = client.channels.get("channel id").send(`Message`)
message.channel.send('message');
const t = client.emojis.get("emoji id");
r.react(t)
TypeError: r.react is not a function
pls help me
Okay so, I'm trying to set the bot's prefix, but I honestly have no clue how to, any suggestions?
like per server or the bot's actual prefix
set a prefix and check if the message they send starts with the prefix
inb4 how
the Bot's actual prefix
just explained but k
yes do what the turtle said
are u from china @meager stirrup
no?
then u have google
look up "learn <programming language>"
lmao tf
๐
lul
lol
I've seen that
The reason doesn't make sense
I don't see why it would post NSFW content in general
It isn't an NSFW bot
Could you guys at least tell me what the NSFW clntent was
It was of a girl posing nude with everything exposed
WHAT THE HECK
So yea, might wanna work on that.
Again, you might wanna work on that.
Your bot posted it, so that's why it got deleted.
I think someone's abusing the tag system
Still something you'll need to fix ๐
Might need to reset it and add some guidelines
I can't fix people adding random stuff out of my control
Might be best to not offer that command if you can't control what content it can deliver.
That token is still yours and that makes the content it can post your responsibility.
Ok, fine, I'll try to remove it for now
hey, so i want to make my bot send a message in every server it is in, anyone know how?
yeah i know how
can you tell me please ๐
๐ maybe dont do that because its api abuse
well its not going to be used like that, its suppsed to give updates on a game im making so it will be a toggelable feature :/
yeah, ik
did u consider announcing in a support server?
if(!message.member.roles.has("STAFF")) return;
```is this correct
probably not because im guessing roles is a collecton mapped by ID
so that will always be true
so you wont tell me?
...

roles is a collection -> collection.has checks for an ID -> "STAFF" is not an id
ok
got
Hab what library are you using?
We're not going to tell you something that shouldn't be done
You can figure that out for yourself and then you'll be the only one responsible for the consequences of your actions
sometimes i like to imagine what its like
not being able to figure out how to do somethign so basic on ur own
scary
Indeed
@pallid knoll
oof
Hol up, I'm gonna try to see who added the tag
And keep him from abusing it again
or maybe tags should be nsfw only 
well people are just gonna add nsfw stuff to tags 
@molten pewter you should set who created the tag name so it can be seen who created it
Also be aware that ppl can use rags to advertise like they did it o my bot's tags, which i deleted, theh put discord gg links in tags ans type in public servers just toget members
And I know who created it now
Ok, but if tags have to be nsfw, why is @wind rose on the list? It has a tag feature and I'm sure that people abuse it every day
If soemone initiates the cmd nd see nsfw stuff or so the call for mods and they delet eit
Good reason y i blocked bot usage in bot lusting servers, one guy typed in other listing server "&tag hsuper" or so and it send an ad but tyfully mods muted the bot instead of deleted it or kicked it
Kekbot has tons of nsfw tags, I'm sure, and I bet someone has used one on this server
Kekbot doesn't require an nsfw channel for tags either
obv nobody has initiated the tag?
If it gets inititated and a mod sees it it gets deleted instead of muted and idk why
anyone know how to get the cpu usage of a process in node.js?
use process.cpuUsage() to get the current cpu time used by process
then wait x number of seconds
then do process.cpuUsage(usageBefore) with whatever the usage was before
to get the difference between before and after
and calcaulte it as percentage of x number of seconds
and that is the cpu usage % 
roughly
const before = process.cpuUsage();
await new Promise(resolve => setTimeout(resolve, 5000));
const after = process.cpuUsage(before);
const cpu = (((after.user+after.system) / 1000 )) / 5000) * 100
@sick cloud
how do u mention a role using its ID
in richembeds
<@&id>
.
this allowed on https://discordbots.org/bot/486222582861791242
?
maybe ask in their support server
and not in the development channel
anybody that could help me on hasbin with a error please
send link
listen for the error event in ur bot
๐ค
maybe it is 0
what defines cpuUsage
process.cpuUsage()
ok cool
global.cpuUsage = async function() {
let before = process.cpuUsage();
await new Promise(resolve => setTimeout(resolve, 5000));
let after = process.cpuUsage(before);
let cpu = (((after.user+after.system) / 1000 ) / 5000) * 100
cpu = Math.round(cpu);
if (cpu === 0) cpu = null;
return cpu;
}
thats what i have rn
well ur are rounding
so now it gives me null, since i can handle that accordingly
yeah
so
i don't want like 70.78978391747813874214%
.trunc
print after

it should be an object i thought
with like user, sys and idle
process.cpuUsage([previousValue])#
Added in: v6.1.0
previousValue <Object> A previous return value from calling process.cpuUsage()
Returns: <Object>
user <integer>
system <integer>
should be object idk how ur getting 0
global.cpuUsage = async function() {
let before = process.cpuUsage();
await new Promise(resolve => setTimeout(resolve, 5000));
let after = process.cpuUsage(before);
let cpu = (((after.user+after.system) / 1000 ) / 5000) * 100
//cpu = Math.round(cpu);
console.log(cpu)
if (cpu === 0) cpu = null;
return cpu;
}
well
its always logging 0
oh
sry 
ya there u go mate ^
{ user: 0, system: 0 }
why do you have to do the waiting tho
i got 0 0

because
to get a %
you calculate the amount of cpu time that passed/ the 5 seconds
how even 
its borked
are u on windows?
yeah
thats why
rippers
lemme try that on my windows real quick to confirm
but im pretty sure thats why, hang on 1 sec
win 10?
yeah
why
my school doesnt support linux

do you mean like actually installing the os
no I mean the subsystem on windows
o h
nice
actually it worked for me on windows @sick cloud
idk how u get 0 
try replace ur await timeout with while loop
see if u get 100%
What's the process for re-adding a bot once you've fixed the issue?
ok
:3
ok
What hosting site do you guys recommend
don't ask in multiple channels
const Discord = require("discord.js");
module.exports.run = async (bot, message, args, admins) => {
if(message.author.id !== admins) {
message.channel.send('sorry, you can\'t use this command!').then(msg => msg.delete(3000))
} else {
message.delete().catch()
message.channel.send("done!").then(msg => msg.delete(3000))
bot.user.setStatus('idle');
}
}``` so for discord.js, what is wrong with this? it says "sorry, you can't..."
const admins = ['438733159748599813'/*pf*/, '335682119982514180'/*walrus*/, '286224826170081290' /*ff*/, '302263509289533451'/*ok lol ok*/]```
o/idle is the command
any help?
yeah?
ghostping
this code for what ?
ping ?
admins is an array and therefore you would need to use admins.includes(message.author.id)
Yes
What your basically telling the bot is if message .author.id is not equal to admin then say this. Try and make it so that the bot will do if message.author.id is not equal to an id in the admin array, then say this @wide ruin
thank you for pinging them
Np
Also instead of id, do by tag, look in the discord.js doc for that, instead asking people right away, you won't learn anything if you expect someone to hand you the answers
why do it by tag? because what if an admin changes their tag, it wouldnt work, but the id would stay the same
Admin and mod is the common tags, and this bot seems to be only for a server, not for everyone to use. So do admin if that's the case
done
figured out how to send absolutely nothing lol
Yes
i just typed space
@peak quartz what lib?
Discord.js, discord.py, eris?
i thought this was a dedicated legendary bot discord lol
well then, im an idiot lol

you can submit your bot
althought, do you knoiw of a bot thgat can assign a role based on if they have a specic role

like, give role x if they have role y
Ehm
That seems very explicit
??
Best bet is coding that yourself
ye
true
well dang, thanks yall
would anyone have any knowledge about webpack?
My webpack.config.js https://hastebin.com/cozaqidiqe.js
What happens: https://i-am.bigno.se/6yzii.png
why are you using webpack on a bot
command i use to build: webpack --mode development

because 1 file easy to manage over like 18481284
also wanna try out webpack anyway so like i might aswell try it here
Still doesn't make sense as to why you need it for a bot
If you can help us understand why you're doing this, maybe some one can help
i have sent everything u need to help, i dont see why you are acting difficult
I see a config file and a screenshot
But there's no background information listed
What exactly are you trying to do and what do you expect to work that isn't working
in the screenshot it clearly shows it doesnt work when i use the webpack generated file
but does work via the normal node .
I'm not sure what arguments you're passing and why you're passing them
lol
What you call difficult is me trying to get all of the facts
Because God forbid I say something incorrect 
Hey I had a question, How I can add the number of serveur where my bot is in on dbl ?
#312614469819826177, find the code for your language/lib
๐ค
How do I fix the Converting circular structure to JSON error?
- (node:31750) UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
- at JSON.stringify (<anonymous>)
- at save (/app/commands/music.js:52:39)
- at Object.execute (/app/commands/music.js:98:7)
- at Client.bot.on (/app/bot.js:103:13)
- at Client.emit (events.js:180:13)
@night imp
What are some other programs (Besides Discord) you can make bots on?
Slack, Twitter, YouTube and Twitch.
https://goo.gl/brWXar
JSON.stringify, avoid TypeError: Converting circular structure to JSON
Have you tried reading this?
Something you are stringifying is a circular obj which throws errors
I have, but I'm not sure how to utilize it.
What are you trying to stringify?
function save() {
fs.writeFile('./m-queue.json', JSON.stringify(queue, null, 4), (err) => {
if (err) console.error(err);
});
}
Can you send the contents of queue?
There's too much code, so I'll send an invite to the project.
or make a hastebin
const x = {}
const y = {x}
x.y = y;
that's the cause of your error
x.y -> returns y
x.y.x -> returns x
x.y.x.y -> returns y
etc
Am I needed?
dumbly enough, how do you format those embeds where the underline and text is white (and the underline is below the text), then when you hover on it it turns blue?
hi
let user = message.mentions.users.first() || client.users.get(args[0])
let users = message.mentions.users.last() ||client.users.get(args[0])
if(!user) return message.channel.send(`Mention 2 users`)
this code doesnt work
why
What about it doesn't work?
i do /fight @earnest phoenix <@someonelse> and it pops up the opposite
in the text
wdym
so
You have args[0] for both users
user is defined as first user
so @earnest phoenix
(me)
but when i mention the second user the opposite happens
it says i fight myself
;-;
let user = message.mentions.users.first() || client.users.get(args[0])
let users = message.mentions.users.last() ||client.users.get(args[1])
if(!user) return message.channel.send(`Mention 2 users`)```
like iTexlo said
you have args[0] set for both users
i was not planned
for using ids
it was for show
lol
I need to see more code than that
i forgot //
ye
one sec
message.channel.send(`Success, ${user} **VS** ${users} `)```
it pops up
with
me
twice
so
Log message.mentions.users
Success, @earnest phoenix VS @earnest phoenix
did you mention 2 people
^
my bot
hm
ok
though โค
just ask
yes will do :3
alright
tysm
np
hello
hey there
wdym
let me ask my friend
@trim saddle
look i dont python much ok
does the embed send
^
for what it looks like
not the code 
use the command and screenshot what it looks like
oh im sure that fields cant have markdown
put a description
๐ค

The description is the text shown in the embed.
By setting that it sets the text for it
its not really spoonfeed so idk what ur saying 
This is a stupid js question but if I have this:
variable(2);
function myFunction(x) {
console.log(2+x);
}```
Will it work?
Ok what don't you understand @earnest phoenix ?
should work
Thanks Samurai
Oh markdown for it kek yeah if it supports markdown that is how you do it
I recommend going ahead and trying it can't hurt
fields definitely support markdown
ok then he is doing it wrong
don't u gotta define the variable after the function has been defined?

because it seems to work on jsbin
@bright spear not in field names
and im supposed to have good eyes
@earnest phoenix you need context
it wasnt in the name according to the code @west raptor
just use js not python problem solved
@bright spear shut
i use both now
https://cdn.discordapp.com/attachments/272764566411149314/490317544700379136/unknown.png yet it puts it in the field name
Is learning react hard?
@topaz fjord not too hard but it's cool af
Hmm
owo
vue ๐ฉ
@earnest phoenix it doesnt work in the field title
If you love Java it's just like it
it works in the field value
Fuck I use js
Well it is js x java
Hint jsx
variable(2);
function myFunction(x) {
console.log(2+x);
}```
This seems to return both 4 and `undef` on jsbin
yes
@client.command(Pass_context=True)
async def invite(ctx):
embed = discord.Embed(color=0x0cf0f0)
embed.add_field(name="Invite", value="[hi](https://discordapp.com/oauth2/authorize?client_id=489935383128309770&permissions=8&scope=bot)")
await client.say(embed=embed)
So I would learn it, very cool what you can do
yeah
yes
what should I build with it tho @night imp 
something
Besides a dashboard for me bot
@topaz fjord idk remake your websites and stuff
this is async pls use rewrite
Cuz it is a lot cleaner
ikr
Twitter clone
@knotty steeple what js runtime where you using because it seems to work for me on both JSFiddle and JSBin
wyvern is supposed to eventually be a discord competitor lol
I get 4 returned
wyvern was what discord was gonna be called
im just using eval()
@bright spear pls just use py
hmmm
@night imp probs would make a Reddit clone
in async
@commands.command(Pass_context=True) to use ctx args
in rewrite
@commands.command()
read the exception
wait until you have 2k+ lines of code
@earnest phoenix but you can't reload
you'll see the truth
you have to restart the bot over and over.
and thats
very annoying
you can only login 1k times with 1 token
imagine you restart your bot 1k times
for some reason
yes
no
no
that's spoonfeeding
ugh
i'll give you a tip for embeds
https://leovoel.github.io/embed-visualizer/ this is a.. meh guide to embeds
fuckin
sigh
well if you join a server which has rules, read them
and
read the docs
for your lib
did you search for unban??
and?
try doing npm i discord.js
no I already have it installed
for some reason npm fallback was disabled but Ill figure it out
its saved so I don't know why npm isnt picking it up
worker*
npm is the one picking it up
i am just using npm fallback because node primary is not working
best java wrapper for discord's api?
yh
what's bad about D4J?
Idk
then i'd rather an opinion from someone who knows both, sorry
I'm just stating from what I've heard is the best
yeah, i appreciate that, i just want more personalized opinions
Alright
i'm prettu sure its like the whole djs to eris thing
jda is like eris i guess, since its the most popular for bigger bots
I found this somewhere on internet
May ir help someone
if (message.attachments.size <= 0) {
message.delete();
}```
It*
@austere sedge Depending on if you use an API or local storage for the pictures
It's all basically the same in all languages. Get an API -> make a request to it -> get a picture URL -> paste it in Discord channel whatever way you wish
guys is there a way to filter out if in a server there's 70% bots then make the bot leave?
cuz i don't want my bot being added to bot farms and so on
that's just a simple math, calc the % of bots and leave if above x% of your choice
@queen sentinel I Can't Do Music Commands, And I Want To Use A Ready Source Code. If I Write This In The Message: "These Commands Are Taken From The BlaBla Robot"
Is that okay with DBL?
As long as you modify your bot so that it's not a clone of the one you're using it should be fine
Then I Can Use It. Thx
but thx
Alright
dont use that
Do u mean OhGodMusicBot?
yes
somebody here?
why
So I got this regex: \\W+
And I want to replace everything matching it in a text with "".
But i want to make one exception. It also replaces dots (.) which i do not want
How would i do that?
Regular Expression Tester with highlighting for Javascript and PCRE. Quickly test and debug your regex.
how would that help me?
You can test exactly what you want.
You can create the regex there depending on what you need
I cant create it because Idk how to do it
I have the \\W+ and I only want to make an exception for the "."
Then you should probably learn
what a great help you are.
Thanks?
If you need help with regex, Google is s good resource
ooof yea
i meant the command file he/she is receiving the error from, if not specified, show the code for the latest command made
that's what I said. 
wew
RangeError: RichEmbed field values may not exceed 1024 characters. help me
954 charcters Buried
@signal saffron Maybe some stuff is encoding, meaning a character takes up 2 or more bytes. Technically it may be that you can't use more than 1024 bytes. Check the size (not length) of what you are trying to send.
im pretty sure its characters not bytes
try logging the string in the console before sending and do a letter count
Code: ```.addField("Genel Komutlar", ${prefix}yardฤฑm ยป **Beinz Bot'un Genel komutlarฤฑnฤฑ gรถsterir!** ${prefix}sunucubilgi ยป **Bulunduฤunuz sunucunun bilgilerini gรถsterir!** ${prefix}botbilgi ยป **Beinz Bot, bilgilerini gรถsterir!** ${prefix}yaz ยป **Bota istediฤinizi yazabilirsiniz!** ${prefix}ping ยป **Bot'un pingini gรถsterir!** ${prefix}davet ยป **Bot'u eklemek iรงin รถzele link atar!** ${prefix}gif (aranacak kelime) ยป **Bot, aradฤฑฤฤฑnฤฑz hareketli resmi size gรถnderir!** ${prefix}avatar ยป **Bot profil resminizi gรถnderir!**\n)
.addField("Eฤlence Komutlarฤฑ", ${prefix}espri ยป **Bot size rastgele espri รถnerir!** ${prefix}mรผzikรถner ยป **Bot size rastgele mรผzik รถnerir!** dรถnenrenkler ${prefix}dรถnenrenkler ยป **Bot, size dรถnen renklerin hareketli resmini gรถnderir.** ${prefix}ip ยป **Bot, size hareketli ip resmi gรถnderir!** ${prefix}รถzlรผsรถz ยป **Bot size rastgele รถzlรผsรถz รถnerir!** ${prefix}catgif ยป **Bot size hareketli Kedi resmi gรถnderir!** ${prefix}doggif ยป **Bot size hareketli Kรถpek resmi gรถnderir!** ${prefix}froggif ยป **Bot size hareketli Kurbaฤa resmi gรถnderir!** ${prefix}penguingif ยป **Bot size hareketli Penguen resmi gรถnderir!** ${prefix}monkeygif ยป **Bot size hareketli Maymun resmi gรถnderir!** ${prefix}parrotgif ยป **Bot size hareketli Papaฤan resmi gรถnderir!** ${prefix}paraateลle ยป **Bot sunuculardakine para resmi gรถnderir!** ${prefix}iyigeceler ยป **Bot size hareketli iyi geceler fotoฤrafฤฑ gรถnderir!** ${prefix}atatรผrk ยป **Bot size Atatรผrk'รผn rastgele fotoฤraflarฤฑnฤฑ gรถnderir!** ${prefix}รงayismarla ยป **Bot sunucudakilere รงay ฤฑsmarlar!** ${prefix}iskenderฤฑsmarla ยป **Bot sunucudakilere iskender ฤฑsmarlar!** ${prefix}pastaismarla ยป **Bot sunucudakilere pasta ฤฑsmarlar!** ${prefix}tuzla ยป **Bot sunucudakileri Nusret'in tuzu ile tuzlar!**\n)
return message.channel.sendEmbed(asdasd);
}
};```
@earnest phoenix I know that Steam has a limit of 30 bytes for steam nicknames, which in most cases is 30 characters, but there are plenty of cool symbols that people use which take up 2 bytes
@signal saffron if someone makes a really long prefix...
Don't let them do it, then
@signal saffron Yes, as I expected. Characters like รถ and รง likely take up 2 bytes, or 2 characters. You can easily just send 2 rich embed messages and you won't have to worry about this
Vooov
thats with a nine letter long prefix tho
thanks dude
np
@signal saffron I'm wrong, the limit is 1024 characters and รถ at least doesn't count as 2 characters. You could still send two rich embed messages instead, or you can also consider removing the prefix from the message completely as well as Bot. You could also just print the prefix in a section at the start of the message, and then drop it for the commands section
Just my 2 cents
Also this ```!espri ยป Bot size rastgele espri รถnerir!
!mรผzikรถner ยป Bot size rastgele mรผzik รถnerir!
dรถnenrenkler
!dรถnenrenkler ยป Bot, size dรถnen renklerin hareketli resmini gรถnderir.
!ip ยป Bot, size hareketli ip resmi gรถnderir!
!รถzlรผsรถz ยป Bot size rastgele รถzlรผsรถz รถnerir!
!catgif ยป Bot size hareketli Kedi resmi gรถnderir!
!doggif ยป Bot size hareketli Kรถpek resmi gรถnderir!
!froggif ยป Bot size hareketli Kurbaฤa resmi gรถnderir!
!penguingif ยป Bot size hareketli Penguen resmi gรถnderir!
!monkeygif ยป Bot size hareketli Maymun resmi gรถnderir!
!parrotgif ยป Bot size hareketli Papaฤan resmi gรถnderir!
!paraateลle ยป Bot sunuculardakine para resmi gรถnderir!
!iyigeceler ยป Bot size hareketli iyi geceler fotoฤrafฤฑ gรถnderir!
!atatรผrk ยป Bot size Atatรผrk'รผn rastgele fotoฤraflarฤฑnฤฑ gรถnderir!
!รงayismarla ยป Bot sunucudakilere รงay ฤฑsmarlar!
!iskenderฤฑsmarla ยป Bot sunucudakilere iskender ฤฑsmarlar!
!pastaismarla ยป Bot sunucudakilere pasta ฤฑsmarlar!
!tuzla ยป Bot sunucudakileri Nusret'in tuzu ile tuzlar!
Is counted as 1049 characters, including the `**` and a 1 character prefix. Just clarifying
i prefix b!
Do you guys think it's neccessary to queue data to be saved to a database?
Hey guys giphy send gif command, use channel nsfw but I want the message not to be used here when it is used outside the channel. How can I do it
GIPHY command: ``` exports.run = (client, message, params) => {
if (message.channel.name === 'NSFW') {
if (!message.guild) {
const ozelmesajuyari = new Discord.RichEmbed()
.setColor(0xFF0000)
.setTimestamp()
.setAuthor(message.author.username, message.author.avatarURL)
.addField('Eฤlence Komutlarฤฑ รzel Mesajlarda Kullanฤฑlamaz!')
return message.author.sendEmbed(ozelmesajuyari); }
if (message.channel.type !== 'dm') {
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
var deneme = getRandomInt(8);
let mesaj = params.slice(0).join(' ');
if (mesaj.length < 1) return message.reply('Aranacak kelimeyi girmediniz.');
var birinci = mesaj.replace("รผ","u");
var ss = birinci.replace("ร","u");
var qwe = ss.replace("ร","c");
var asd = qwe.replace("รง","c");
var zxc = asd.replace("ฤ","g");
var yuu = zxc.replace("ฤฐ","ฤฑ");
var ooo = yuu.replace("ร","o");
var jitem = ooo.replace("รถ","o");
var saaaa = jitem.replace("ล","s");
var son = saaaa.replace("ล","s");```
//code
}```
@west raptor Yes, I wrote it, I want it out of the NSFW channel where you can't use it when it's used in channels outside
speak in your native language if its easier for you
@signal saffron Do you want to use the command outside of a nsfw channel
@rustic axle No, warning when used
NSFW komutu kanal dฤฑลฤฑnda kullanฤฑldฤฑฤฤฑnda uyarฤฑ รงฤฑksฤฑn @west raptor
Yapabilirsin if (!message.channel.nsfw) return message.channel.send('burada ne olursa olsun')
Oh okay
Doฤru deฤilse google translate kullanarak รถzรผr dilerim. Gรถmme mi yoksa normal mesaj mฤฑ istiyorsunuz?
Bazฤฑ ifadeler yanlฤฑล ise รงevirmen รงok รถzรผr dilerim
tamam
Hata mesajฤฑm yanlฤฑล
Bu komuta burada izin verilmiyor! Lรผtfen bunun yerine bir NSFW kanalฤฑ kullanฤฑn.
Bunun yerine bir mesaj iรงin kullanmayฤฑ deneyin
Rule 6 people.
#memes-and-media konumuna taลฤฑ

other Lang's is #memes-and-media 
its not
no its not 
Yes, worked, thank you!
Oh ye
thanks dude

np
I'm gonna ask a third time, in case someone else is active now that knows the answer
Possible to help me to make logs (I do not arrive)
is there a way to get an id of discord.abc.GuildChannel?
maybe a user with that id doesn't exist?
its my own id
the error is self explanatory
its cause its a string ?
@junior bobcat Your id is 316639200462241792
yeah you prob got some random id or something
You probs got the message id. ๐คท
yes I think
a message id nowadays start with 48
no
no cause that id doesn't exist on discord
You have a tuto for logs code ?
oh
so idk how they got that random id in the first place
anyway, this convo has flooded away my question (โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป
You want to get id of a channel?
it's a GuildChannel
not a specific channel
discord.TextChannel is different than discord.abc.GuildChannel
whats abc supposed to be
abstract base class
discord.js? They are just class definitions of the library, the IDs are the same
im python
GuildChannel extends TextChannel, if I recall correctly
oh well, same logic in python, most likely
yeah but how do I get to it
yeah I tried that first
and then realized that .id doesn't exist there
I need this specifically
not any other channel object thing
I'm not very well versed in the python library, specifically, but GuildChannel is just an abstract class
TextChannel, VoiceChannel and CategoryChannel inherit their properties and methods from it, it's not a special type channel like you might be thinking
I mean, all I need is to get an id of a channel that gets triggered with on_guild_channel_delete
Can I see your code?
idk what is there for you to see
it's empty
all i know is GuildChannel is being returned when on_guild_channel_delete is being fired, and all I need is to get it's id
Have you tried
@bot.event
def on_guild_channel_delete(channel):
channel.id # do something
or anything similar?
the thing is, the channel parameter is defined as GuildChannel
and as you can see by the docs
the .id doesn't exist
Abstract GuildChannel class may not have an ID object, or at least that's what I am seeing from the documentation, but the returned object will be a TextChannel or VoiceChannel, both of which have ID fields
channel.id doesn't return anything as far as I tried
May I see how you tried it?
Code around wherever you tried accessing channel.id, any error, warning or unexpected behavior you got, etc
I would have already posted all that by now, it just fails silently
alright here's some context: my bot is dedicated to quoting messages, and I recently came up with "advanced quoting" where server owners allow all messages posted in chat to be stored in the db, but what I want is in order to not have a db flooded with so many messages I make it delete messages related to a deleted channel, basically
So you basically try to query an entry in database using a channel id?
in SQLite3 that'll be DELETE FROM Messages WHERE Channel = channel.id basically
c.execute("DELETE FROM Messages WHERE Channel = " + str(channel.id))
conn.commit()
```to be exact
is channel ID in the database an integer, or text type?
don't be surprised, but I mostly store everything as TEXT
c.execute("DELETE FROM Messages WHERE Channel = \"" + channel.id + "\"")
conn.commit()
try this
tried that too
mysql has an escape method
so if you use mysql as your database
you could just pass it like that
or do something like
DELETE FROM Messages WHERE Channel = '${channel.id}';
is this js?
and put that statement in template strings
thats sql
thats literally sql
does python
not have
template strings
it doesn't have $
anyway, sql isn't my problem
I just need a way to get a channel id with on_guild_channel_delete
If you're unsure, try print(channel.id) or something and see what you get
@steel drum no python doesnt have "template strings"
actually you can use {} in a normal string
I don't even know what those are 
mhm
@ruby dust have you asked the discord.py discord?
So if Iโm a small bot maker, my bot has 28 commands and doesnโt take up barely any storage which, Hosting site thatโs the most cost effective should I use?
Seems like you might have to
that's like a forbidden teritory for me
Authentication plugin 'caching_sha2_password' is not supported if i try to connect to mariadb
help
wait no i found something
now i got 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

import mysql.connector as mariadb
import json
config = json.load(open("./config.json"))
conn = mariadb.connect(user="root", password="{}".format(config["db_password"]), database="bottadata", auth_plugin='mysql_native_password')```
password is wrong, did you set the correct password in your config?
check if the password does not contain quotes when you read it from the config file
i had that happen to my connector
"db_password": "password"
ok thats fine then
auth plugin a problem then?
could be that the password generated in the setup was created with 'caching_sha2_password'
but you using the 'mysql_native_password' now
but if i use that one i get the error before
Authentication plugin 'caching_sha2_password' is not supported
are there any other plugins?
i dont think so
then i dont know, stackoverflow is your best friend then
Hey guys help me Error: TypeError: Cannot read property 'send' of undefined at Client.module.exports.member (/app/events/guildMemberRemove:4:22) at emitOne (events.js:116:13) at Client.emit (events.js:211:7) ```module.exports = member => {
let username = member.user.username;
member.send('Welcome Server');
member.guild.defaultChannel.send('');
};
defaultChannel isnt a thing anymore
More descriptive
what
@signal saffron can you program in js?
you cant use it anymore due to changes in discord api
I have to solve the mistake
the best solution is to loop through channels
and find the first channel you can send messages to
^
as soon as my bot blacklists a guild it does that saying why it was blacklisted
in a try catch
๐ค
So if Iโm a small bot maker, my bot has 28 commands and doesnโt take up barely any storage which, Hosting site thatโs the most cost effective should I use?
You can rent a server from Vultr for 2.50 a month
Discord.js, how do you check if a channel is marked nsfw?
uhh
^
^
TL;DR
TextChannel.nsfw => Boolean
So, if(message.channel.nsfw = true) {
no
Oh
So if(message.channel.nsfw) {
yes
Thanks
just do if(!message.channel.nsfw)
= is for assignment
=== is for quality
if its a boolean value
never do === true
just do if(bool)
and if(!bool)
Better do if (!msg.channel.nsfw) return
It stops if it's not
Ok
so all code below that line can be sure the channel is nsfw
Can I still use { instead of return
you can also learn js properly


