if (message.content.toLowerCase().startsWith(prefix + "avatar")) {
const user = message.mentions.users.first() || message.author;
const avatarEmbed = new Discord.RichEmbed()
.setColor(0x333333)
.setAuthor(user.username)
.setImage(user.avatarURL());
message.channel.send(avatarEmbed);
}
``` like this?
#development
1 messages · Page 1622 of 1
Reading the docs on something really is helpful
someone should write a bot that just sends in the matching Lib docs for a question someone ask here.
and then apply to get it added next round
One message removed from a suspended account.
just invite danny r 😉
is danny R some knock off Tim?
One message removed from a suspended account.
One message removed from a suspended account.
Danny R. doesn't do too much
One message removed from a suspended account.
One message removed from a suspended account.
R daddy the bot does alot, but you cant get it 
you can
it's open-sourced
unless you self host
correct
cant you just invite it
it's not verified
ok and
what the hell is R daddy
you can still invite it
which means its either at the guild limit
or it uses privileges that require verification
which means you can't invite it.
danny simply didn't want to verify
if it was at limit or close it would hve stopped working
no...
it would just not be able to be invited anymore
invite limit w/out verification =/= bot turns off
General Mod bot + utilities on steroids
emphasis on generic for mod capabilities
R. Danny's strongsuit is utilities in every way
best to not let ignorance get the upper hand of you then
there can be people reading this chat and will take your words for granted with something like that, and think that their bots will suddenly fail to work when they reach 75 servers
would be quite a dick move to just kill bots if someone invites the bot while you are at the verification limit, so many people would abuse it
my bad
?
console.log(`Ready on ${client.guilds.cache.size} servers, for a total of ${client.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()} users`);
client.on("ready", () => {
client.user.setPresence({
game: {
name: '~help',
type: 'LISTENING'
},
status: 'idle'
})
})```
issue
SyntaxError: Unexpected end of input
what i do
async
?
You don't know basic js syntax? Yikes. Also, your IDE should tell you for syntax errors
i know
unless you're using notepad++ or something
notepad++ good
my bot is online but Presence not work wtf
client.on("ready", () => {
client.user.setPresence({
game: {
name: '~help',
type: 'LISTENING'
},
status: 'idle'
})
})
what i do
anyone there?
for some reason in redis Auth its passing info as command
command: { name: 'info', args: [] }
with no args
ReplyError: NOAUTH Authentication required.
at parseError (/home/rm6305639/discord-bot/izzi-bot/node_modules/redis-parser/lib/parser.js:179:12)
at parseType (/home/rm6305639/discord-bot/izzi-bot/node_modules/redis-parser/lib/parser.js:302:14) {
command: { name: 'info', args: [] }
this the whole error
it's asking for authentication
yeah
probably means you may have written the command setup wrong, but i'm not too exactly sure about it sicne it's dJS
That’s redis tho
const client = redis.createClient(REDIS_PORT, REDIS_HOST, { no_ready_check: true });
client.auth(pwd);```
im literally setting the auth pass
im not sure why its trying to execute a info command with no args
Don't u need to pass auth during creation?
same thing tho
same error if i put password in the createClient
there are 3 methods
to auth
passing in the createClient options directly
or setting the .auth on client
Idk then
uh so? I am new lol
What do I have to change to make it work
dont work why i am sooooo confused message.guild.owner.user.username
Owner might be null
Like how Dank Memer sends out a message whenever you vote for it, I want to do the same with my bot. Does anyone know how to program this in discord.py?
works for me message.guild.owner.user.username
tysm, ill check over that
hm
i thought its just the guild intent?
from what I believe, one of the intents help to get the guild owner
i think u can still do message.guild.owner_id tho
As I said before, owner might be null
It'll not be always cached
nupe
rip
well not js, could be other ones just realised
Guild.owner is a getter for Guild.members.cache.get(Guild.ownerID)
You need the presence intent for the guild owner to be there guaranteed. Otherwise, they'd need to be fetched, send a message, be mentioned or join a voice channel
You need the presence intent for guild owners? That makes no sense
im pretty sure the intent does not guarantee the owner will be cached, only if they are online
the gateway sends the owner_id only for GUILD_CREATE
yes
and the presence intent sends online members
doesnt guarantee the owner will be among them
thought it sent offline as well. Oh well
Owner is never guaranteed to be cached, no matter what intents u have
I think it doesn't send offline if the guild is large only
it used to be that way
not sure if its still like that
you can set what you consider to be "large" at identify as well
although you can only set between 50 and 250
wait what?
what what
Heyo
how would i make the User Tags field go to the section i boxed
i tried inline false/true, doesnt work with either
inline true for inventory and user tags
doesnt work
where am i wrong
yes you can do that
you need to use zero-width spaces
here
client.on('message', message => {
if (message.content.toLowerCase() === 'espiri') {
var Espiri1 = [
'Çalar saatin çalmasına 30 saniye mi var, çeker yorganımı uyurum. Ben prensipleri olan birisiyim',
'Ulan Muhittin diye bebek ismi mi olur 2 aylık çocuğun elini öpesim geliyor'
];
var Espiri2 = [
'Millet uyurken sevdiğini düşünüyor, ben eve hırsız girse ne yaparım diye taktik geliştiriyorum. Yalnızlık damarlarıma işlemiş.'
'Birde sabah uyanınca sevdiğin insandan gelen uzun mesajın verdiği mutluluk var. Varmış yani ben bilmiyorum da duydum.'
];
var espiri1 = Math.floor(Math.random()*Espiri1.length);
var espiri2 = Math.floor(Math.random()*Espiri2.length);
cont embed = new MessageEmbed()
.setTitle('komik espiriler')
.addField('komik espiri1',eniyiespiri1)
.addField('komik espiri2',eniyiespiri2)
message.channel.send(embed);
}
});
o
"\u200B"
where am i wrong
It used to only show two inline fields when a thumbnail is set but they fucked it up
add an empty one between balance and job occupation
oh
left \u200b right
left \u200b right
looks like you set cont embed instead of const embed
tenks
i would never those though. they don't look good on mobile, unless you don't care since discord is shit on mobile anyway
aembed.addField('Balance', " Wallet: " + userbal + "\n:bank: Bank: " + userbank, true)
aembed.addField("\u200B", "\u200B", true)
aembed.addField('Job Occupation', job, true)
aembed.addField("\u200B", "\u200B", true)
aembed.addField('Inventory', inventory, true)
if(userbadges) aembed.addField('User Tags', userbadges, true)```
addField(left)
addField(\u200b)
addField(right)
this is all a single row
which means you need to repeat that block of code to get the same effect on the second row
also i wouldn’t recommend having variables that you can only tell apart by one capital/lowercase letter
client.on('message', message => {
if (message.content.toLowerCase() === 'espiri') {
var Espiri1 = [
'Çalar saatin çalmasına 30 saniye mi var, çeker yorganımı uyurum. Ben prensipleri olan birisiyim',
'Ulan Muhittin diye bebek ismi mi olur 2 aylık çocuğun elini öpesim geliyor'
];
var Espiri2 = [
'Millet uyurken sevdiğini düşünüyor, ben eve hırsız girse ne yaparım diye taktik geliştiriyorum. Yalnızlık damarlarıma işlemiş.'
'Birde sabah uyanınca sevdiğin insandan gelen uzun mesajın verdiği mutluluk var. Varmış yani ben bilmiyorum da duydum.'
];
var espiri1 = Math.floor(Math.random()*Espiri1.length);
var espiri2 = Math.floor(Math.random()*Espiri2.length);
const embed = new MessageEmbed()
.setTitle('komik espiriler')
.addField('komik espiri1',eniyiespiri1)
.addField('komik espiri2',eniyiespiri2)
message.channel.send(embed);
}
});
I fixed it, brother did not work
please use code blocks
and give the error
// code here
1 hour and 30 mins is 90 minutes, 90 * 60 * 1000 = 5400000
Brother did not work?
also you aren’t putting the Espiri length inside the math.floor
just do 1000 * 60 * 60 * 2
not even sure what the math.floor is doing here
lol
that would work
if (author !== null && timeout - (Date.now() - author) > 0) {
let time = ms(timeout - (Date.now() - author));
let timeEmbed = new Discord.MessageEmbed()
.setColor("#FFFFFF")
.setDescription(`:Cross: You have already worked recently\n\nTry again in ${time.hours}h ${time.minutes}m ${time.seconds}s `);
message.channel.send(timeEmbed)
}```
so basically this prevents regular non-premium users from working from another two hours
now, i want it so if the user is premium, to make the cooldown a bit less
1 hr 30 min for premium, 2 h for non premium
i tried setting premiumtimeout to 1 hr 30 min, checking if the user is premium, then sending an embed with premiumtimeout - date.now but that doesnt work
let timeout = 1000 * 120 * 60; //
let premiumtimeout = 90 * 60 * 1000
let premium = db.fetch(`premium_${user.id}`)
let premiumauthor = await db.fetch(`premiumwork_${user.id}`)```
when they work a job
db.set(`premiumwork_${user.id}`, Date.now())
now timeout broke completely it lets me work w out timeout
o
is that quickdb?
better-sqlite
I don't recall better-sqlite3 having a fetch method.
Are you sure that's not quick.db
wait wha
because it sure as hell looks like quick.db
if it's quick.db then it doesn't return a promise, afaik
oh wait, im using both
weird
yeah cause quick.db uses better-sqlite3
quick.db does not returns promises, it`s sync.
So is better-sqlite3 itself.
That's the entire selling point of that module.
well,
if(premium === true) does work
ok so what`s the problem because you're talking about a timeout
but there's no timeout here
you're not using any setTimeout
let timeout = 1000 * 120 * 60; //
let premiumtimeout = 90 * 60 * 1000```
uh
im using ms
Ok so when are you using it
if (premiumauthor !== null && premium === true && premiumtimeout - (Date.now() - premiumauthor) > 0) {
let premtime = ms(timeout - (Date.now() - premiumauthor));
let atimeEmbed = new Discord.MessageEmbed()
.setColor("#FFFFFF")
.setDescription(`:Cross: You have already worked recently\n\nTry again in ${premtime.hours}h ${premtime.minutes}m ${premtime.seconds}s `);
message.channel.send(atimeEmbed)```
well, both cooldowns dont work
regular cooldown;
if (author !== null && timeout - (Date.now() - author) > 0) {
let time = ms(timeout - (Date.now() - author));
let timeEmbed = new Discord.MessageEmbed()
.setColor("#FFFFFF")
.setDescription(`:Cross: You have already worked recently\n\nTry again in ${time.hours}h ${time.minutes}m ${time.seconds}s `);
message.channel.send(timeEmbed)```
what is ms()?
parse-ms
a package that generates milliseconds
then theres no timeout
Have you tried actually logging those values to know what they are?
setTimeout() is the function to make a timeout happen
🤨
oof i forgot about that
Just basic debugging
thats a discord id?
hmmm
db.set(`work_${user.id}`, Date.now())```
this is what work is being set as
and its basically doing Date.now - the time out to find out how long theyhave left for cooldown
and if its > 0, send time out embed, if not, let them work
i assume its smart enough to be passing a string
actually, nvm, date isnt bigint
even precision wouldnt be an issue
Your variables are very confusing, so is premiumauthor the milliseconds?
let premiumauthor = await db.fetch(`premiumwork_${user.id}`)```
premiumwork in the DB is Date.now
it might be easier to make it one variable, then multiply/divide by the standard time
or tenary it
how would tenary work in this case
all i want to do is set a different cooldown for premium users
const delay = premium ? premium delay time : standard delay time;
i havent looked at how your cooldown system works, but you can do this before or after creation of the cooldown depending on how your cooldowns work
hm
i think i have to incorp it in here
if (author !== null && timeout - (Date.now() - author) > 0) {```
not sure how exactly itd work

How to use the reply feature through the bot [.js v12.5]
Did you try using message.reply
Nope that will do <@User>, <Text>
It does but I don't exactly remember which version
Not sure I have not seen it. That is why asking 🙂
Make sure you're using the latest version
make sure you're using the latest verison
version*
Maybe it's not implemented yet
I forgot I'm using master
client.api.channels(message.channel.id).messages.post({
data: {
embed: {description: "test"}, message_reference: { message_id: message.id }
}
});```@heavy marsh @cinder patio
this should work
SHOULD
It's implemented in master but not on the latest stable
Seems to work
i would personally turn that into a method
You can use master
Na I use 12.5.1
message.prototype.reply = (data:Discord.Message) => {
this.client.api.channels(this.channel.id).messages.post({
data: {
data
}
});
}
you could do some janky ass shit like that
or just extend the class and override reply()
or add your own function onto message
that works too
Does mee6 have tons of expenses for being in over 10m servers?
probably
definitely
yea I don’t think 1 small vps would quite fit the job
That's not information that's given to you by the API, unfortunately.
Not possible?
not really no
Ohk thx bro
you need audit log permissions though
Add audit logs permission and hope the user accepts, optionally adding cookies if granted
anyone know if theres a nodejs package that can render a custom page based on what is in the url? Like if someone where to go to https://example.com/something, it would render a custom page, taking that "something" text and replacing text in the page with it. (the actual file to go to that page doesn't exist, it should be rendered using some nodejs code)
express...?
I never try to make pages with js, i usually use css or html
express for sure but for web pages you could use anything such as angular or even plain
Anyone know where I can get cowsay >:|\ I tried everywhere but it failed to work
The cowsay.js from the npm three random errors when I tried it a while back I wanna get back to attempting it
Throwing*
yeah try again and show what happens
e is prob the eyes, T is the tongue, and text is what the cow says
i get that, but like, why 👀
Idk
Hmm, idk if I explained it correctly. I know how to do something similar using url parameters, and I know how to render specific webpages that are defined in the index.js file, but I want to make something so that someone could replace that something text with anything they wanted, and it would display a webpage that says whatever they put for the something text
from the url parameters?
or like, user settings from a users page?
or something else
Yeah
Like let’s say I wanted to get someone discord tag by their username
I would type https://example.com/discordid
And it would display their tag using the Id provided
As an example
in js(in the actual page) you can get the path with window.location.pathname
so just discordid
then you can place that value anywhere
Ah, thx.
you can use parameter urls in express, you said you know how to use them, well they do exactly what you want
hi, my bot of youtube is not notifier my uploads
do you have an error? and/or what code are you using?
i use a youtube bot and this bot is not notifier my uploads in youtube
wrong server
is a error for a bot
we do not provide support for bots
you should get on the bots support server, or contact the developer of the bot
this is de suport server in the webpage
Well, I've had this error many months ago, although I forgot how I resolved it.
root@vmi486668:~/SaveMoney# pm2 log main
[TAILING] Tailing last 15 lines for [main] process (change the value with --lines option)
/root/.pm2/logs/main-out.log last 15 lines:
/root/.pm2/logs/main-error.log last 15 lines:
1|main | /root/SaveMoney/node_modules/discord.js/src/client/Client.js:42
1|main | } catch {
1|main | ^
1|main |
1|main | SyntaxError: Unexpected token {
1|main | at createScript (vm.js:80:10)
1|main | at Object.runInThisContext (vm.js:139:10)
1|main | at Module._compile (module.js:616:28)
1|main | at Object.Module._extensions..js (module.js:663:10)
1|main | at Module.load (module.js:565:32)
1|main | at tryModuleLoad (module.js:505:12)
1|main | at Function.Module._load (module.js:497:3)
1|main | at Module.require (module.js:596:17)
1|main | at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:80:39)
1|main | at require (internal/module.js:11:18)```
This is inside a dependency, I can't add a simple (e) between the catch and {
lmk if you guys have anything
One message removed from a suspended account.
One message removed from a suspended account.
oh
well shit
it worked
i hate my life, ty
or alternatively
update node
you're running on a version that's 3+ years old
try {
} catch (e) {
}
well, if that doesn't work idk what will
she said it's inside a lib
what node version could they be using
14 prob
V8 v6.6 includes optional catch binding, extended string trimming, several parse/compile/runtime performance improvements, and much more!
so you can use it in node 10
so their version is earlier than node 10
it's in v15, but it's already fixed
just cded in to the discord.js dir and nanoed the (e) into it.
tf did she come from
Object object happens when converting an object to string correct?
well it obviously isn't using v15 if it's erroring on that 👁️ 👄 👁️
yeah.
sure..
you're fucking something up, probably with pm2 🤷♂️
idk "person" is feminine
One message removed from a suspended account.
well I said it was in a lib
One message removed from a suspended account.
One message removed from a suspended account.
just always use they/them and ur good
i mean they're not wrong
my error trying to do cowsay
DiscordAPIError: Cannot send an empty message
heres the code i used
const request = require('node-superfetch');
exports.run = async (client, message, args) => {
try {
if (!args.length) {
return message.reply("Command Usage: `cowsay <Text>`")
}
const { body } = await request
.get('http://cowsay.morecode.org/say')
.query({
message: args.join(' '),
format: 'json'
});
return message.channel.send(null, body.cow);
} catch (err) {
return message.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
yea because you're trying to send null
someone help me i ogt an error with this code and the code says that load_dir is not defined
const fs = require('fs');
module.exports = (client, Discord) =>{
const load_dir = (dirs) =>{
const event_files = fs.readdirSync(./events${dirs}).filter(file => file.endsWith('.js'));
for(const file of event_files);
const event = require(`../events/${dirs}/${file}`);
const event_name = file.split('.')[0];
client.on(event_name, event.bind(null, Discord, client));
}
}
['client', 'guild'].forEach(e => load_dir(e));
I think your issue is JavaScript placing semicolons for you and missing braces.
Firstly, you should add braces with your event files loop (for (const file of event_files) {...}).
Secondly, try adding a semicolon after the last brace in the load_dir function you defined.
hey devs! this is a question fowarded from: <#general message>. can someone walk me through adding CSS to my bots page. its so confusing
One message removed from a suspended account.
One message removed from a suspended account.
ya
thats the thing
ik its easy
my dumb ass cant figure it out lol
i have this:
body{
background-color: rgb(50, 101, 134);
}
</style>```
am i being dumb?
@sage bobcat do i put in in a <head>?
i think i do but im not sure
hey guys can someone help me?
I wanna set the number of guilds my bot is in in as his LISTENING status so it says "Listening to # servers"
Read your library docs
Tip: search for presence
client.on("ready", () => {
console.log(${client.user.username} ready!);
client.user.setActivity(for music requests!, { type: "LISTENING" });
});
i have this
do i do "to ${client.guild.size} servers!"
nah that doesnt work
You would have to put that on guildCreate and guildDelete events
Nope guild actually isn’t an existing method of the client
Wasn’t for you
I want to learn how to make a bot, where can i start?
Well picking your language and reading the docs if you wanna use a library for example
for anyone wondering it is ${client.guilds.cache.size} to get number of servers the bot is in
though it probably wont update
if I dont restart
in djs*
there are many libraries, not just discordjs
also, i would suggest updating it on the guildadd event

Hi, so I have the following js code:
let txt = "no";
let json = JSON.parse(`{"title":${txt}}`);
console.log(json);
It should turn a string into a json array, yet it'll say something like this:
Error: Unexpected token h in JSON at position 10
Anyone know what's wrong with it?
"${txt}"
hmm, let me try that
ah, it works
You can just use { title: txt }, no?
yeah, ik, I meant json object
Guys I have a problem and #support said not to ask and they said it's fixed but it's not so I don't know what to do
It's not fixed, you'll have to wait and there is no ETA
do you even know the problem?
whats the problem 👀
Life
lol
because the problems are ever changing
i'll briefly explain in hopes of not getting banned.
lol
Makes sense
i mean if it says its fixed, and its not we need to know
if its listed as not fixed and your asking about it though
@solemn latch Is it my browser? is it my device?
one sec
Oh thx
I recently added a bot, but it doesn't appear in my list of bots, that is, I can't access it ...
and your sure that site works?
votetracker isnt made by us, and ive never seen that specific url used before.
it does
I joined their discord and asked them.
They said that topgg was currently experiencing problems.
well, test webhooks seem to work
First. Delete the image. That info is dangerous in the wrong hands. Also I think it is a webhook problem. Maybe try again?
@static trench Ok
Done.
I'll try again shall I?
I don't mind screen sharing too
It’s ok
If it works cool if not maybe get help in the support server
I think unless it’s a DBL thing it is a bot problem
The
Tbh
Oh hold on.
Is ur bot in the queue?
If it is than webhooks won’t work until it’s accepted
Yes
When I click the webhooks button, nothing happens, no reload, no nothing no confirmation.
no
That’s why it’s not working
i want a server
I'm trying to add a webhook to a server
hmm
Nah sry. I gtg
All good
Why is the webhook test button almost like it's unresponsive?
I'll re read chat, see if anything helps, thanks for your time @static trench
Idk if this is something you'd want to look into
but I followed all the setup steps and it didn't work 
if you have a chance. try https://top.gg/479688142908162059
I joined thier discord and the owner actually told me that topgg had a problem
oh okay, is that another bot for me to try?
perfect, I'll give it a spin
lol
lol
there we go
whaa
ping me if u need help
is this a different bot?
or the same one?
different
Lol why do they look so similar lol
bc they all do th same thing
i see
imo this is the best one
its easy to use
also there support server is fire
ping me if u need help
Okay thanks. I'll set it up right now
kk cool
im going to bed. ping me if u need help. ill respond in morning if u have issues
bc if it doesnt work its u. it works fine with me
turns out its just the test webhook thats broken, the proper webhooks do infact work.
what?
dedicated machine
so, you mean, self host the app?
no, I personally would co locate something with storage requirements like that.
i see.. im going to try another bot
wtf ever weights 6TB?
are you self-hosting the internet?
bruh, my father owns an institute, he needs to host the app
bruh, still 6TB is unrealistic af
idk, i said the same thing
I bet Reddit weights less
in fact, it does weight less
oh, ok ok
bruh you tell me where to host it
he was hosting it on vmeo
or whatever it is
first of all, what are you going to host?
but they ask many money
static sites? video content?
an app, which has courses on it
yes, it has video
and pdfs
and other shit
what kind of app? android? iOS? react?
android
cloud hosting is not for you if your content is that size
ok, your android app weights 600gb?
ig
or that's the total size of the site + files?
yes
this conversation is an oxymoron
well, I gotta assert the scenario
so let me see if I got it right:
You want a server to host a site and server static content (app installer, images, videos, etc), without needing to use a database (no user login, dynamic content or other non-static stuff).
The site needs to have a high bandwidth capacity and high storage, not necessarily requiring fast I/O (data reads and writes).
right?
we need a database too
because the people who will buy the course
their data and stuff
and login id and details
ok, so user login
both galaxy gate or contabo would suffice for your needs
galaxy gate has somewhat faster download and upload times, and generally people say good about it
contabo has very large storage plans, and is generally cheaper
but on our app, the traffic per minute was something like 500-1000
I'd say contabo will be cheaper depending on what plan you need
galaxy gate uses nvme as storage, idk if they have hdd plans
oh, okok okok ok
do give both a check
mhm, oak
generally speaking when you reach a size like this custom hardware is cheaper then VPS's or premade dedicated machines.
well, as long as he doesn't try to host a 6TB app everything will be fine ¯_(ツ)_/¯
does ts has any shortcut for declare a type like this?
type Nums = 1 | 2 | 3 | ..... | 99;
Hmmm, may I ask why?
So I dont hv to write this long declaration, type Nums = 1 - 99
An array with a loop perhaps? I don't do TS but- might be helpful 
array.from?
thats in ts right?
const N = 5;
const arr = Array.from({length: N}, (_, index) => index + 1);
console.log(arr);
/*
Output: [ 1, 2, 3, 4, 5 ]
@rocky hearth
so a type of specifically 1-99?
yes, I want to create a type that has numbers from 1 to 99
Sure ^^
<a herf="https://cartero.cf/commands.html" target="_blank">click here</a>
This is what I've written, but it isn't taking me to the link when I click on it.
No worries, sometimes you just don't see it :)
Yeah
doesnt ur ide complains about typos??
I didn't use ide just for writing a description
Who else here loves that rare, beautiful feeling when you write some new code, go to run it, and it just works without any debugging?
I think you misspelled "rare" for impossible
How do I check my bot queue?
You can't
if it runs perfectly in first try. I still suspect, that y it is running fine. 😆
anyone else’s d.api being buggy
I have some guild where the guild.me object is returning null and crashing the bot
umm, for now the bot is only taking the emoji in the guild, how do i make it search for the emoji in all the guilds it is in
bot.emojis is a collection of all emojis across guilds
i rea
If there are 2 emojis with the same name, find is going to return the first one it finds
but the bot is not using the emoji from other guilds it is in
to get all, use filter
oh, ok ok
Oh you mean that
ooooooooooh,
so my command is like,
you do .poor :the animated emoji:
the bot will send that emoji
Do you want your bot to not send emojis from the guild in which you're doing the command
i mean, for example there are 2 guilds, 69 and 420
the bot is in both the guilds,
420 has an emoji named :polishbop:
and the command run in 69 is .poor :polishbop:
so the bot takes the emoji from 420 and sends it in 69
you get what i mean?
yeah
you don't really have to use filter for that, though? I don't understand how find doesn't do what you want here
do i show the whole code?
First of all is the emoji cached
mhm
All emojis are cached
Did you uh
i was always using .find
ok
@cinder patio yo quick question
ye
Does emoji object return <:thing:id>
Then it should work
no it isn't
Show me your code
and everything else is just replacing the emoji in the message
this is the only main emoji part
You mean m.name?
perfectly wrong
Because that's :<:id:name>:
if(emoji && !msg.split(" ").find(x => x === emoji.toString()) && !msg.includes(`<a${replace}${emoji.id}>`)) msg = msg.replace(rexreplace, emoji.toString());
this is where i replce
Both of em
ok
Keep x.name === m and change `:${m}` to `:${emoji.name}:`
again, perfectly wrong
Wait flax
done
oh
Post it on like pastebin or smth
oh
eh
ok ok
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@earnest phoenix there you go
what is this supposed to do again?
msg = msg.replace(rexreplace, emoji.toString());? You mean msg.content?
ah
msg is content
no, it can send the emoji from the same guild right now
but not from other guilds it is in
do we have the developer of NQN here?
what you think?
where did you put m
Consolelog*
Actually
Just do console.log(replace);
Put it below replace
AttributeError: 'DBLClient' object has no attribute 'get_bot_votes' uh
Stinky
??????
Js right?
python
fuck
Ight good luck man
thank you :')
get_bot_upvotes was renamed to get_bot_votes since v1 and it's not out yet afaik, so use the first one instead.
Finally holy shit
I've literally needed this so many times before in Atom instead of having to hunt down the code manually in my project files
finally a clean python code
hey my python code is usually clean 
was pointing to someone else
who lmao
you've talked about it back then 
😂
Im programming in Java with the JDA API, does anyone know a way to send a bufferedimage in an embed without having to save it as a file first? 
don't feel bad, my code isn't exactly that "clean"
I have a few messy parts in my bot
Not as messy
tbh I don't feel bad as I don't give a shit about it 
by doing some 1liner shit 
you really have an interesting way to define "1liner" here
people who write 1liners drive me mentally insane
It was like table = [a for i in [zip_longest(*[get_chunks(str(x), 16) for x in (_id, textwrap.shorten(message, width=65, placeholder="..."), human_timedelta(expires))], fillvalue=None) for _id, expires, message in records] for a in i ]
anon? lambda?
lambda and anon functions are the same thing
lambda is just looking for a value or set of values from a specified function range
anonymous functions are functions created within an instance or variable
here is one of the very few anonymous functions i wrote for my bot
wait what? how is that an anonymous function? am I misunderstanding of what an anonymous function is?
anonymous functions are functions created within an instance or variable so
But you're not creating a function there
there are two ways i could have went doing this:
Anonymous function:
options = "".join(f"&{opt[0]}={opt[1]}" for opt in types)
print(options)
Or the other method:
_list = []
for opt in types:
_list.append(f"&{opt[0]}={opt[1]}")
print("".join(_list))```
Well, the programming lingo is a "function" because it functions outside of context of an instance/var
you can program anonymous functions in python either with or without lambda usage. Lambda is just supposed to act as the arguments filter if you think about it that way, while in this case it lacks args.
isn't (f"&{opt[0]}={opt[1]}" for opt in types) just a generator
which eventually will be casted as list by join function
What should I do to avoid doing this.
I've a this code in index.ts, I want to export some classes from other file as well as use them in current file too.
or is it ok, to do so
2021-03-01T08:24:04.844555+00:00 app[Worker.1]: TopGGAPIError [Top.GG API Error]: 401 Unauthorized (You need a token for this endpoint) 2021-03-01T08:24:04.844574+00:00 app[Worker.1]: at Api._request (/app/node_modules/@top-gg/sdk/dist/structs/Api.js:74:19) 2021-03-01T08:24:04.844575+00:00 app[Worker.1]: at runMicrotasks (<anonymous>) 2021-03-01T08:24:04.844575+00:00 app[Worker.1]: at processTicksAndRejections (internal/process/task_queues.js:93:5) 2021-03-01T08:24:04.844576+00:00 app[Worker.1]: at async Api.postStats (/app/node_modules/@top-gg/sdk/dist/structs/Api.js:94:9) { 2021-03-01T08:24:04.844576+00:00 app[Worker.1]: response: { error: 'Unauthorized' } 2021-03-01T08:24:04.844577+00:00 app[Worker.1]: } 2021-03-01T08:24:05.025634+00:00 app[Worker.1]: Posted stats to Top.gg! why is this happening?
pretty sure my token is in there
you will love to see my codes
are you sure you didnt regenerate your token?
The site is broken right now so maybe that's why
uh im not sure if this is the right channel for this but
one of top.gg's requirements for a bot to be accepted is Your bot is tested using permissions=0, you should ensure that your bot functions without permissions., but my bot HAS to have permissions for certain commands
do I submit it without permissions
and say which one is the one with perms?
like 2 links, one real and one no perms
Then you need to have an error msg with the perms needed
2021-03-01T09:19:26.206030+00:00 app[worker.1]: ^
2021-03-01T09:19:26.206031+00:00 app[worker.1]:
2021-03-01T09:19:26.206031+00:00 app[worker.1]: ReferenceError: Discord is not defined
ight thanks
If you require admin, dont or youll be declined immediately
go do
const Discord = require("discord.js");
Manage users or whaever it is
No commands NEEDS admin
oh ight
Ty 😂
ight so then another question
I have a prefixset command, how do I get the owner of the server
so only he can use it
or would that
What language
Pretty certain you can grab the owner of a server.
already bro
if(message.guild.id != message.guild.owner.id)
ight thanks
Hey please tell me why this code is not working for me
if(message.content.startsWith("5!edit")) {
let editm = args.slice(18).join(" ")
if(!editm) return message.channel.send("Correct usage is `<MESSAGE_ID> <NEW_MESSAGE>`")
message.channel.edit(editm)
}```
bruh, how can a bot edit message?
Its not possible?
no?
Bots can edit messages, but only their own
^
oh
ooye hemanth, tu itna jaldi verify kaise ho gaya?
Nhi yaar
Use #general-int for other languages please
msg is undefined. Please show how you get the msg variable
show your code
module.exports.run = async (bot, message, args) => {
const msg = bot.snipes.get(message.channel.id)
const embed = new Discord.MessageEmbed()
.setAuthor(msg.author.id, msg.member.user.displayAvatarURL())
.setDescription(msg.content)
.setFooter('Get Sniped lol')
.setTimestamp();
message.channel.send(embed);
}
module.exports.config = {
name: "snipe",
aliases: []
}```
(node:4) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'author' of undefined
What does it say if you log the value of msg?
bro, do message
not msg
wait
nvm
is bot.snipes a thing?
module.exports.run = async (bot, message, args) => {
yes
client.snipes = new Map();
Well, somehow bot.snipes.get(message.channel.id) is returning undefined.
I don't have enough experience with js to help you any further. Someone else is gonna have to take it
umm
thats not the main thing
@earnest phoenix did you write the code on your own?
Yes I'm still up
say the truth
open source
bro, understand the code first
kind of
@earnest phoenix i need help
Please kindly explain the issue, Please note that i only do Javascript and Java.
quick db wouldn't come in my code
Have you install & import it in your code?
Ah
i can screenshare and show you the shower of errors
QuickDB recommend this link for troubleshooting.
https://github.com/JoshuaWise/better-sqlite3/blob/master/docs/troubleshooting.md
Let not get off-topic and focus on solving your problem.



