#development
1 messages · Page 1534 of 1
except that there is nothing in the console the bot does not react
i don't know i thought it would work
a message event gives you a message object
how do i get the bot to respond to my ping?
client.on("message", theReceivedMessage => {
console.log(theReceivedMessage.content)
})
you can give it whatever name you want
but its a message object, and its only one argument
there is no type and no options
what do you not understand
@unkempt ocean help me
sorry for bothering you
and where did you copy that code from?
that has nothing to do with messages
where did you get this code from? a tutorial? youtube? guide?
have you never done any kind of coding before?
you have a lot more to learn
a tiny bit
discord sends a message to your bot, your bot receives the message, and sends it to client.on("message")
client.on("message") gives it to the first argument that you specify
client.on("message", argument here)
the argument must be a function that tells the bot what to do with the message
client.on("message", newMessage => { write here what to do with the received message })
let pref = (await db.fetch(`prefix_${message.guild.id}`)) || client.settings.prefix;
if (message.content === "help") {
message.channel.send(
`**${pref}**help`)
}
});```

ex
example ```js
client.on("message", message => {
console.log(message.content) // show the content of the message in the console
message.reply("bla") // reply to the message
etc...
})
U must work hard to give us noobs tutorials
i give up
Please see the screenshots
:/
At least u tried
11
can you please send your on-ready event?
i want the bot to say this is my prefix when i mention it
I don't want him to say blah when I send a message
@quartz kindle
you can contact me via dm by the way, if you're using translate etc.
are you saying you are not capable of logical thinking and problem solving?
i told you everything you need to figure it out yourself
@unkempt ocean Please wait 2 minutes I'm helping someone
basically i would like to mention it ex: @spectrum, he replies: hey! my prefix is:.
I can't do it
on message, you should check if the message content matches /<@!?BOTID>/ and that's all that the message content is
only checking for if it matches might prevent you from having mention prefixes which is unintentional
bla
why would you put await db.fetch in a ()
logical OR
e.x
hello, i submit my bot and saw that the bot should ask only for permission he need. however i "asked" for manage role permission because i'm using it for a personal use (no one can use this command apart of me and in my server, to be more precise the bot is sending me an sms with a link to add some roles when someone is going in my discord server, thats all) but i'm not using it for public use. is this allowed?
if it's only for your personal use only in your guild, then you don't need to include the manage role permission (since nobody is going to be using that feature except you in your own guild)
and sure, it's allowed
ah yeh you'r right (just need to give perms in my server) ok ty.
i'm little bit dumb xD😅
hello, i was wondering if you guys could help me with my subdomains
i'm sure someone can, just ask your question
well the thing is, ive never done it and i dont know where to start
do you have a domain?
yes
i know dns, but not how to make subdomains
ive configured many domains before
what DNS provider are you using?
namecheap, cloudflare
great, thank you very much
yep np
thats a very easy question but... what permission do i have to allow to the bot to make it not beeing mute in channel where no one can speak pls?😅
could you help me with something please?
allow the SPEAK permission in that voice channel. If any role allows something, you cannot deny it until it's toggled off for everything
Hi. Any of you JavaScript users? I'm new to bot coding, self-taught, and could use a bit of help with some commands. I just require a ban command and a kick command for now if anyone could help me out with that? this is probably a big ask.
ok ty @lament rock
@earnest phoenix https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=ban have a look at that to get an idea
how dare you not spoonfeed them?

question

why isnt this working?
fair argument though
thanks
it has worked
@earnest phoenix Do your username and password include any non alphanumeric characters? Similar issues have surfaced in the past with handling characters like : in passwords
check that post regardless
any idea on how to remove the reaction from client.on('messageReactionAdd'
hey mattheew
i tried that, but for some reason it removes all the reactions
how do i remove just reaction that's being added
client.on('messageReactionAdd', async (reaction, user)
like the reaction by user
any idea what should i use
i tried that
for some reason, it still removed all of them
I am currently using express, and I want it to redirect to another port on the IP,
Going to have it as app.get('mongo', (req, res) => { //redirect to the mongo port URL }) how can I get the port to display the info from the mongo DB without using redirect() because that will redirect to the IP of the PC they are on not the database page itself to use on compass
what
wouldn't you be better using nginx or something similar
^
because nginx doesn't expose IP
just proxies requests
and just a heck of a lot better of an idea
Hi i have a countdown bot and you submit answers. I have a variable called ans and i am sending it but it works some of the times and doesnt work in other times. I think the problem is that my json file with answers has it stored as "027" and "009" and "384" so all 3 digit numbers work but 2 digits/1 digit doesnt
here is some proof ig
But idk why
i did if int(ans)==int(message.content)
any clue what might cause this?
its quite annoying that the trace doesnt go as back as where it originated
discord being discord
more like d.js not throwing a good trace
actually
yeah, is there a good way to get local trace?
like, without throwing an error?
which doesnt give the full trace, but i could append another one ontop
it should be caught by try/catch or .catch wherever it originated in
Discord go brrrr
thats what i was thinking of, but without another throw
image this
try {
request('semethere');
} catch(e) {
console.log(stack.trace + e);
}
// one alternative is to
try {
request('ssomewhere');
} catch(e) {
throw new Error(e);
}
Throwing a new error with the previous stack would possibly throw the string + the trace of the current file no?
but that would be unhandled, so i was thinking of something like the previous one
where i could get a trace without throwing
should i be using sentry? 100%, but im stubborn

theres no need to rethrow the error
unless you want to modify it, or change its message, idk
but the error is thrown inside the handler, which doesnt trace back at where the request was made
it does if you catch it properly
wait rlly?
yes
yup
<3
@quartz kindle owo
uwu
hows life Tim
What about coding life, hows that
How can i mute my neighbors dog in discord.js?
I was Dice' at first but other people wanted their name there
Use mute command
can someone give me code for muting neighbors dog in discord.js? im using node 15
:^)
hilarious
no one laughed at my joke though 
and when the fuck did tim get into burning people to a crisp
I am not a hoe, I am a body pillow fyi @quartz kindle
when i do message.channel.send((![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]); why does it send 'fail'
because that spells "fail" in jsfuck
ohh
let dog = message.client.neighbors.livingBeings.get('BarkingFuckingDog');
if(dog) dog.mute({reason: 'annoying as fuck'});
else console.log('Peace and tranquil, alas');
Why this no work?
pog
okay imma stop tryhard with the starboard
clearly not working
your wifi not strong enough
and that yes
trust me, they are less than 1 m away from me, its a thinn fricking wall
you need a stargirl bodypillow to boost your wifi
i disagree
only costs 7 million dice coin
😳
;)
Smh
keep it on topic smh my head
@scenic kelp this is on topic, we talking about making a dog shut with d.js
So I've added a ton of commands to my bot do you guys think searching through the bots servers and sending a message in channels called bot-spam or bot-commands with an update message would be acceptable?
If so, you'd probably want a feature to disable them for the server owners
yeah I figure I'll do it once and allow server owners to set a channel for future updates
I don't think there are any rules that would go against that, so yeah
whoa next.js is epic
My code is in the link below
https://codesandbox.io/s/priceless-zhukovsky-tmgti?file=/home.css
I'm having a problem with my navigation bar not working can anyone help?
hiii
Anybody have an idea of what I have posted above
@quartz kindle lmao ran into this response that saved me from some hair tearing, thanks https://github.com/discordjs/discord.js/issues/3956#issuecomment-601606639
axios.get(`https://query1.finance.yahoo.com/v7/finance/quote?symbols=${ticker}`).then(function(res) {
console.log(res)
}``` I keep getting this error every time I run this code in my html document
```css
Access to XMLHttpRequest at 'https://query1.finance.yahoo.com/v7/finance/quote?symbols=aapl' from origin 'https://stockindex.glitch.me' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.```
I have a extension on chrome the enables CORS but I want to enable CORS on the server side
Hi
someone can you help me. how to fix this error?
error
Error handler caught an error:
TypeError: Found non-callable @@iterator
at C:\Users\User\Desktop\Munari Bot\MunariHeroku\src\utils\Function.js:271:25
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Code
const tosongs = {
title: Util.escapeMarkdown(dataout.title),
identifier: dataout.videoId,
author: dataout.author.name,
duration: dataout.duration.timestamp,
nowplaying: dataout.duration.seconds,
url: `https://www.youtube.com/watch?v=${dataout.videoId}`,
thumbnail: dataout.thumbnail + "?size=4096",
};
const track = await new songdata(tosongs, message.author)
const queueConstruct = {
textChannel: message.channel.id,
voiceChannel: channel.id,
guildId: message.guild.id,
songs: [],
connection: null,
loop: false,
volume: 100,
playing: true
};
const queue = client.queue.get(message.guild.id)
if (queue) {
queue.songs.push(...track) //ini line 271
}
message.client.queue.set(message.guild.id, queueConstruct);
queueConstruct.songs.push(...track);```
why?
axe

how come everyone that used my dashboard gets internal server error and has to reload
is it your internal server error or discord's internal server error
Probably an error on your own backend
idk because everyones getting it
Hi

Yeah that's about half of the people in this chat xd
🤣
I get kinda annoyed by the people who can't code nor read an error properly and were still able to get their bot accepted
I mean all you need is a basic bot that works.
And the funny thing is that they always have like "coder" or "dev" in their username but they actually have no idea what they're doing
Should be not acceptable imo
Ikr
Or in their status
Probably
They don't really have the time to make sure it's perfect ig
Ikr
Probably hundreds of people a week trying to get verified
I also saw 2 people in #support over the last year asking about what they should fill in into the Discord Official Bot Verification
lmao
Ah yeah, it's hard to know what data your bot collects
And those people get a verified bot badge, but I don't. 
Sounds pretty cool, I'm sure it'll grow eventually once you update it
It's like, at this point I have no idea what to add. And I don't get any feedback so 
Yeah it's pretty hard to know
Your users won't know what they want.
I'm waiting for discord to approve my intents request so that I can finish some new features
just in case tho
it's possible to request intents for an already verified bot right?
You're not allowed to request intents for future purposes though. Like you can't request them just in case you might need them
yeah that makes sense
@dusky sundial #support message
lmao there it is

The poor guy doesn't know what his bot does :,)

dang
Welp it's 05:09 time for sleep
It's more than 3 :D
Hey that's my schedule
pfff, imagine sleeping. You weaklings disgust me
Probably ye xd
how does npm make a folder, that it cant make another folder in 🤔
Popping some RedBulls
Cracking some cold ones
Are ya australian?
That's something australians would say
A viking, one might say
Like maxmoefoe
IKEA
Aight have a good one
o/
o/
how come everyone that used my dashboard gets internal server error and has to reload
sorry i didn’t see
do you have some kind of...
issue?
i also said im not hosting it
Internal server error -> an error happened on the backend for example
tell the guy who's hosting it to read the console
How would you be able to fix the issue if you're not the one hosting it?
the other developer is, i was going to tell him what’s wrong
Great
Well it's gonna be really hard to tell what the issue is if you don't have access to the console
I assume it happens when it makes a call to the backend yes?
https://skynet.schwitz.repl.co
does it look ok?
no
It might give a part of the reason
1 sec
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Loka2Loka is een platform waar lokale leveranciers uit de regio hun producten kunnen aanbieden aan lokale winkels.">
<meta name="keywords" content="loka2loka, lokaal, vanstreek">
<meta name="author" content="Hogeschool van Amsterdam">
<meta name="theme-color" content="#43d982">
<title>Loka2Loka</title>
<!-- Embed -->
<meta property="og:title" content="Lokale producten op één platform">
<meta property="og:site_name" content="Loka2Loka">
<meta property="og:description" content="Loka2Loka is een platform waar lokale leveranciers uit de regio hun producten kunnen aanbieden aan lokale winkels.">
<meta property="og:image" content='assets/img/branding/logo-icon.png'>
<meta property="og:type" content="website">
<meta property="og:locale" content="nl_NL">
<meta name="twitter:card" value="summary">
<meta name="twitter:title" content="Loka2Loka">
<meta name="twitter:description" content="Loka2Loka is een platform waar lokale leveranciers uit de regio hun producten kunnen aanbieden aan lokale winkels.">
<meta name="twitter:image" content='assets/img/branding/logo-icon.png'>
you site is danm good bruh
Put that part into your html
thank you
your site is so good
With your own info ofc
ty @sacred trout
lemme see your bot
But I assume you can figure that out yourself
yep yep
It's OEmbed and twitter cards
prefix?
For references
also make the bot link pop up in a new window
sure
!report
!report
What
It means your bot grew too fast in a suspicious way idk
It means Discord detected that your bot may have joined too many servers which you share with it/own or it joined too many servers with too many bots / something along those lines. Pretty sure there are more grounds in order to have your bot flagged, but those are what I remember being covered in their explanation
print all the servers and server owner IDS
and make the bot leaves each sus server
2021-01-19T06:30:13.371315+00:00 app[worker.1]:
^
2021-01-19T06:30:13.371315+00:00 app[worker.1]:
2021-01-19T06:30:13.371316+00:00 app[worker.1]: TypeError: Cannot read property 'get' of undefined```
this work properly in glitch.com
Is it possible to negate a number using a bitwise operator?
how to?
idk your language
js
The bitwise NOT operator (~) inverts the bits of its operand.
you'll need to +1 the output
idk why you would use bitwise for this though
+[5] // returns 5
4 + [5] // returns "45"
4 + + [5] // returns 9
6 - [4] // returns 2
Explain pls...
probably because js handles types.... well it doesn't
ye i'm sticking to java xd
show code
and check discord.js and node version
1st case: Array gets turned to the string "5", and then the + makes it a number
2nd case: Array gets turned to a string, 4 also gets turned into a string
3rd case: +[5] gets turned to 5, 4 + 5 = 9
4th case: [4] gets turned to the string "4", since you cannot use the minus operator on strings, it also gets converted to a number, 6-4=2
How [5] is a "5"?
Ooh! so if, an array is used in an expression it gets converted to a string. Right?
yup
same must be true for, objects, I guess 🤔
yeah, but objects get turned to [object Object]
yea
{} + [] gives 0 but, [] + {} gives "[object Object]"
in the first case, I think the interpreter treats {} as something else, not an object
and the second one is "" + {}, which is [object Object]
The HTML Inline Frame element () represents a nested browsing context, embedding another HTML page into the current one.
for the first case it should be "[object Object]0"
It's not string concatenation, so that would not be the case
but the interpreter thinks that {} is an empty scope or something similar.
it first reads the first one to determine whether to do string concatenation, or something else
if you were evaluating the expression in a string, the output would just be [object Object]
same for if you try to concatenate the expression into a string
I believe the output should be NaN since calling the Number expression on an Object returns NaN. Calling Number on an empty Array does return 0, however. Number(item) does implicitly call toPrimitive which is an "internal method"
Oh I got it. the interpreter treats {} as an empty block in {} + [], thats y it is 0
That wouldn't explain it if calling Number({}) or +{} returns NaN.
An empty Object doesn't cleanly get coerced into a number
The interpreter probably has special instructions for dealing with Objects
in discord.js v12, is there a way to get a invite object in a guildMemberAdd event without manually fetching the invite?
You have to store the state of the Guild's invites and then after each guildMemberAdd, check which Invite's use count has increased
An invite object kinda is a one-time object with a target user and inviter user
Negative
An Invite can have a single use case, but it stored on the Guild object along with the rest of them which may have unlimited uses
This is probably something special only added for 100% completion and is most likely whenever someone opens the modal to invite friends to a Guild
That's how you get a Guild's invites
Oh. The target user might actually be for Group DM invites
https://discord.com/developers/docs/resources/invite
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
I see,
Really, I'm not sure. If it is, I'm not sure why they'd add it since bots can't get added to group DMs
yeah
Oh. I needed to read the doc 1 line down
if (message.mentions.users.has(client.user.id) && !message.author.bot) {
message.reply(`\nMy prefix is: \`>\`\nSay \`>help\` to get help with my commands!\n:3318_RainbowBlobGoingCrazy:`)
};```So i have this code so it responds to people if they ping my bot but i want to make a talking system so if u say `@Bot` it responds with "my prefix is: >" and if u say like `@Bot Hello` it says it from the talking system
Check for if there is no content after the bot mention
can u just do that with if(message.mentions.users.has(client.user.id) && !message.author.bot && msg.content()) ?
@lament rock ?
msg.content is not a function, also that would always return true since msg.content would include the bot ping. You need to match the string with a regular expression for the bot's mention and then slice that out of the string and check for if there's more content
let member = await guild.members.fetch(memberID)
await member.ban({reson:`ban 1 member`})
Why i didn't get any reason
you spelled reason wrong
😅 yes thank you
okay can u help me how to do that? because im not really good with coding
The match() method retrieves the result of matching a
string against a regular expression.
thanks
A RegExp you can use to match your bot's mention is
new RegExp(`<@!?${client.user.id}>`);
Up to you if you wanna add flags to it like g or not, but shouldn't be necessary
Try writing regular expressions for error stack frames. You'll become an expert quickly
This is the worst expression I've written and it was to pick apart an error stack frame
My best guess to describe it so you can make sense of it is a method which is identifying as something else as a property of an Object
/((?:.[\w_.<>]*)? ?(?:.[\w_.<>]*)? ?\[(?:as)? ?(?:.[\w_.<>]*)\])? ?\(([^*?"<>]*):(\d+):(\d+)\)/
all black
i cant get a code to make what i wanteed can you help me?
can I define a enum as a class property? for TS
@rocky hearth try it and see
enum Something {
A,
B,
C
}
class SomeClass {
someEnum: typeof Something
constructor() {
this.someEnum = Something;
}
}
Only way I could think of
doesn't work with const enums
It's pointless imo, just export the enum along with the class
hey guys
console.log(baseStats.getByName({ name: currentMon.name }))
currentMon.stamina = Math.floor(Math.random() *300);
currentMon.hp = baseStats[0]``` How does this still return undefined in the embed?
it logs completely and all
Thanks, Feud
<% patterns.forEach(pat => { %>
<div class="row">
<div class="col-sm">
<div class="container-box text-center">
<%- <!-- i want the first elem to go here --> %>
</div>
</div>
<div class="col-sm">
<div class="container-box text-center">
<% <!-- i want the second elem to go here --> %>
</div>
</div>
</div>
<% }) %>```I have this ejs, i want it to somehow generate two columns from the current document and the next document. it will then continue to iterate through the array until there's nothing left
is this possible?
can someone solve this?
process.cpuusage gives
{ user: 4875000, system: 1546000 }
``` how to convert it in percantage and get the whole system usage?
Math.floor((usage/total)*100);
you're missing a (
<% patterns.forEach(pat => { %>
<div class="row mb-10">
<div class="col-sm">
<div class="text-center">
<h1 class="content-title">
<%- patterns[patterns.indexOf(pat)].name %>
<hr>
<%- patterns[patterns.indexOf(pat)].authorName %>
</h1>
<br>
<%- patterns[patterns.indexOf(pat)].description %>
</div>
</div>
<div class="col-sm">
<div class="container-box text-center">
<h1 class="content-title">
<%- patterns[patterns.indexOf(pat) + 1] ? patterns[patterns.indexOf(pat) + 1].name : null %>
<hr>
<%-patterns[patterns.indexOf(pat) + 1] ? "By " + patterns[patterns.indexOf(pat) + 1].authorName : null %>
</h1>
<br>
<%- patterns[patterns.indexOf(pat) + 1] ? patterns[patterns.indexOf(pat) + 1].description : null %>
</div>
</div>
</div>
<% }) } %>
```I'm back, i tried this and it turns out its not a viable solution. Is there a better way of me doing this because the elements would just repeat over and over. Headache time weeeeeee
oh thx
there's the fix
how
I w@pure lion ent
Hi. Anyone know how to run my bot 24/7?
keep the program running
smarts
Right. I have the program open and I have noded it, but the bot is still offline.
Any fix to that
whats the output?
im assuming by "noded it" you mean you ran node index.js or similar in your command line
I ran node botdev.js yes
and what was the output
It is usually ''ready''
At the moment it is showing as module not found. But it is right there
@quartz kindle can you help me?
in which folder are your bot files in?
The node_modules
??
one thing at a time please
can you do after pls LOL
Well it should be in the right folder, I haven't moved anything around so it should be in the same folder as the rest, my virtual studio code folder
Its stored on my PC hard drive (internal) in My named folder, in the extensions folder
PC hard drive, private folder, extensions
Yes
ok
as you can see in your picture
your command line is in the wrong folder
so its not finding your bot
Hmm
Thanks I'll try resolving it. I'm gonna do a sweep of my files to see which one they're meant to be in
you need to change the path of the cmd to the right folder
one way is to use the cd command
another way is to close visual studio and open it again in the right folder
tim uwu 
right click folder -> open in vsc
owo
check if the message contains any argument other than the mention
ye i know but how bcz someone helped me but that totally didn't worked
@quartz kindle how?
what did you try?
const escapeRegex = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); const prefixRegex = new RegExp(`^(<@!?${client.user.id}>|${escapeRegex(prefix)})\\s*`); if(!prefixRegex.test(message.content)) return; const [, matchedPrefix] = message.content.match(prefixRegex);``` somebody told me to do this
this didn't worked ^^
Yo guys
I'm making a music Discord bot right now, and I tried making lyrics command.
I did it and it works pretty well, except that some songs are too long for Discord to send them as a message.
And I was thinking about making it like 2 messages or so for the longer lyrics.
I tried making a for loop up to 1999 becuz 2000 is the limit. and I'm pretty stuck here so I don't know what to do.
Any help would be great, thanks.
:3
Lol
do something like js if(lyrics.length >= 1999) return msg.channel.send(embed, extraembed) //make another embed with the lyrics named extraembed for if the lyrics are too long
ikd just sending some random stuff LOL
Thanks! I was dumb, I needed to restart the software, but now its all set up
@quartz kindle this didn't worked can you tell how i can fix it?
That's where im stuck rn haha :>
ye sorry idk what package u use and stuff
discord.js
and im not advenced with the music bot
ye i mean for music
so you copy pasted that without knowing what it does?
@timber fractal why are you using regex for prefix
no i asked help and he explained what it does and he said to use this
you can do it with one line:
if (message.content.startsWith("your prefix") do something
@timber fractal that guy told you to do useless extra hardwork
the only time youll use regex is for getting arguments from the message:
const args = message.content./* remove prefix here */.split(/ +/);
thats not what i want i need to have if you say @bot it says like my prefix is > and if you use @bot hi it uses the chat function
i already have a command handler like that
nobody likes mention prefixes
no its not a mention prefix
its like u say @bot it tells the prefix
and if u say @bot something it will chat with you
i need that
you already have this right? js if (message.mentions.users.has(client.user.id) && !message.author.bot) { message.reply(`\nMy prefix is: \`>\`\nSay \`>help\` to get help with my commands!\n:3318_RainbowBlobGoingCrazy:`) }; all you need to do is check if there are any extra arguments ```js
if (message.mentions.users.has(client.user.id) && !message.author.bot) {
let args = message.content.split(" ");
if(args.length > 1) {
// message has more words than just the bot mention
}
}
"Chat with you" that is what a mention prefix is
yes
okay thank yoy
@quartz kindle Thanks!
@timber fractal minecraft themed bot interesting
nah only just a bit im making it for a minecraft server but it just has normal commands BUT it also has >achievement <text> and it will return a image of a achievement with ur text
im making a minecraft commands generator in react for bedrock users so they dont have to deatroy their hair
40 days usually
no im sure it's 2^64
Not really
hello there im trying to make my bot's top.gg page and i cannot make it has only dark theme,if anyone can help i would be very happy!
@quiet coral wdym
do you want to force people to use dark theme on your bot page?
yea
Forced themes are only enabled for creators who use custom CSS in their detailed description.
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'warnings'
we can use custom css 👀 ?
bot.warnings doesnt exist
add a style tag in your long description with nothing in it
do you wanna see the code?
yup
can you help?
im not a python user, but i understand what the error means
do you use bot.warnings anywhere?
except KeyError:
first_warning = True
self.client.warnings[ctx.guild.id][member.id] = [1, [(ctx.author.id, reason)]]```
ok thank you very much!
and did you create client.warnings anywhere?
self.client.warning = {}
def __init__(self, client):
self.client = client
self.client.warning = {}```
@quiet coral it is me who has to thank you for forcing people to use dark theme. You saved so many eyes.
you did warning not warnings
bruh
@_@
xD
Emm btw I just add the style tag.. But it does not showing my info..
waning: stpiud
It's like blank
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "/home/runner/Bot/cogs/warning.py", line 53, in warn
self.client.warnings[ctx.guild.id][member.id] = [1, [(ctx.author.id, reason)]]
KeyError: 788613513756934175
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 864, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 788613513756934175```
@quartz kindle
im pretty sure you cant add double keys
for example
you cant do something[a][b] = soomethingElse if something[a] doesnt exist
how else do i do it then?
@quiet coral you have to add the empty style tag, save the changes, then enable forcing dark theme
you have to create something[a] before you can create something[a][b]
I mean. I added `<style>' on top of the info, I pressed save and now my long desc info is blank
^^ check if key in dict, if doesn't exist, assign an empty dict to it
yo @earnest phoenix
bad
in js you would do if(!something[a]) something[a] = {}
. @earnest phoenix sad
js
but you understand what you have to do right?
yeah in a way
you need to check if something[a] exists, before you create something[a][b]
and if it doesnt exist, create it
if ctx.guild.id not in self.client.warnings: self.client.warnings[ctx.guild.id] = {}
imagine setting an object to something[a] then doing [] on it
thats not an array
so?
arrays are objects
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 864, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 755985276873998486
File "/home/runner/Bot/cogs/warning.py", line 56, in warn
count = self.client.warnings[ctx.guild.id][member.id][0]
KeyError: 755985276873998486
got it i think
How efficient is dict.get in this case?
ayy shivy entered the chat
nvm
dict.get would be useful if you're retrieving a value I guess
Nah I'm outta here
lol
Technically true yeah
if not self.client.warnings.get(ctx.guild.id): 
thanks bro

doesnt py has a falsy if evaluation?
something like if !warnings[id]
or if not warnings[id]
dict.get by default returns None
Second param in it is default value to return if nothing under key exists
yeah, so we need to use get instead of indexing it
or use in which is probably more efficient for this
yeah i guess a in b is the way for py
@earnest phoenix
wat
Also why is there a TUPLE in a LIST?
Nvm I'm too sleepy for this cya all
good night
lol
@earnest phoenix count = self.client.warnings[ctx.guild.id][member.id][0]
this ok?
I'd use a relational db for this though
aiofiles is an IO lib 
yea?
for somethings json or sometimes sqlite3
use sqlite for warnings then
i am too noob
Dont ever use json for data that changes frequently
then un-noob yourself
lol
also, you wanna use aiosqlite as sqlite3 is blocking
how to configure MongoDB database?
casually approach database
open terminal
do some hacker shit
done
took me 8 min
nice one
FR
lol wtf
wat
we shortened queue times from 2 months to 8 minutes?
LOL
normally its one week
if they keep me as bot reviewer it would be 8min every time
XD
what is the problem
i dont know the bot wont go online
i mean the dank memer xD
i think my bot is being hijacked can someone help?
Hacked?
go to dankmemer support
Maybe because someone Have Take the token. And The "Hacker" Can Control The Bot.
heart attack
also
is it possible that the commands are executing twice because of shards?
like double commands
?
it wont funktion i cant write there .-.
Join the support sever
how much gigs does replit offer, free plan ?
@tired panther 1 GB RAM and 500 mb storage
how much does 6 gigs cost?
or github education iirc
lol I have them and what is he streaming, the boy in vc?
idk he is really bad at css
and he wants help?
idk probably
is it legit to host on replit?
replit is a host why would it be illegal to host stuff on it
just dont aboose da hardware
yes, replit goes off after a time and your pinging it
They don't mind
bruh imagine thinking turning off a computer gets you in a lawsuit
lol
how do I ping them, I need a second device?
Uptimerobot
Hey
can u give the link of the tutorial
Can I set up neoumenon bot in my server
I wish I could
How to set up
Get the invite from Google
Lmao how do you not know how to use google
What a surprise, you misspelled the name apparently
lol heroku is faster xD
'help
umm
hey guys, so after sharding my bot is still up even after i stop the servers
any idea why this would happen?
ok im getting double commands after i sharded
how did you stop it?
by turning it off
pull out the plug
Ik, did u gave by manage.spawn() a value, just leave it undefined, then the error will be fixed
im not able to stop it
with open('mute.json', 'r') as f:
mrole = json.load(f)
role = mrole[str(ctx.guild.id)]
if ctx.guild.id not in mrole:
return
Is that how to check if a guild id is in a json file?
i regen the token again
nop, didnt give any number
but idk why it keeps sending double commands and then it wont stop
give the code of shard.js
const { ShardingManager } = require("discord.js");
const { logger } = require("../public/static/js/logger");
process.on("unhandledRejection", (error, promise) => {
console.log(
"Oh Lord! We forgot to handle a promise rejection here: ",
promise
);
console.log("The error was: ", error);
logger.error("UnhandledRejection: " + error.stack);
});
process.on("uncaughtException", (error) => {
console.log("Oh my god, something terrible happened: ", error);
logger.error("BOT SHARD CRASHED, FATAL ERROR: " + error.stack);
// process.exit(1);
});
const manager = new ShardingManager("./server/client.js", {
totalShards: "auto",
// token: process.env.DISCORD_TEST_BOT
token: process.env.DISCORD_BOT_TOKEN
});
manager.spawn();
manager.on("shardCreate", shard => console.log(`Shard #${shard.id} is Online`));```
and kill everything you are currenlty running
const manager = new ShardingManager('./server/client.js', { token: token });
try this @crystal wigeon
if str(ctx.guild.id) not in mrole
i should remove totalShards?
But do the check BEFORE actually using the key
ok
yes
what key
im not that good with json
str(ctx.guild.id) 😔
xd, what is ctx?
lemme check
context, discord.py thing
context
context
lol
inform me if it worked
how many guilds do u have?
didnt work
its still sending double commands
250 guilds
i tried sharding to increase performance
this will decrease it
no sense to change
hi
why
I want to set up noumenon bot in my DISCORD server
it still sending double commands
it won't
sharding won't do anything
I want to set up noumenon bot in my DISCORD server
but its a mandatory thing right?
it will maker it slower, I debuged the code
not yet for you
when u have 2,5k glds
Hey
Say my problem
I want to set up noumenon bot in my DISCORD server
But I am searching in Google not coming
well so when i reach 2.5k guilds when i shard
i will still face the same problem
double commands etc
@pale vessel @tired panther
Jesus fucking Christ
when u start the bot, does it right just Shard 0 or Shard 0 , Shard 1 ?
only shard 0
thats suspicous xD
;-;
wth
I STRONGLY hope you can figure out HOW to use it yourself
How To Invite?
🤣 He asked minimum 10 times xD
bruh
lol
yowww
it says shard 0 is online
;-;
;_;
help
ok so if i have 2 shards
both of them are trying to execute the commands
Any Idea how much time discord verification takes the bot one
and?
i mean
i see no errors
i got the shar#1
to load
but its trying to load again
basically my app is being invoked twice
@crystal wigeon thats is a libary which can do more things. Ideveloped it xD
lol
so when i start the client, it shards and then that shard is replicating the commands twice and executing them twice
Anyone?
3 - 6 weeks
Wot F sed
i have to see your fulll code to check the bug
Someone told me it was 3 days and I was happy lol
or u can try this
create shard.js
and a bot.js
bruh
discordjs
can u see if you create two clients?
Hey erwin
not urs hoax
mesiter
what the flying fuck is this
its a scam
Lol
first that linter
How much time it takes for the bot verification
this has to be the first linter ever to do shit like this
I did not update it xD
the npm libary is uptodate lol
Your took how much time lol @opal plank
hi
embed builders
omg why
.setTitle does not work in static functions lol
pls
bruh
Hi my bot hit 80 server so how much time for verification
its so bad
ask in #support
Uff
when u can do it better code it and make it opensource, lol
im 100% having a fit when someone is recommending something this bad
yow
if its for them, i wont bitch about it, but for public use?
wtf do i do with sharding
its not working as its supposed to
TwT
@solemn latch
Woo hoo
my other npm libaries had over 2k downloads, I made this one for my bot, thats way it is not so user friendly
Downloads don't mean anything
scrappers download the shit out them
just fyi
publish a 2 line code to npm and watch it have 200 downloads within the first 2 hours
thats the bot, a subtracted it
if its for your bot why publish it?
and people dm and thx that my libary is good xD
why want to use npm libaries lol
why not code yourself a handler and properly debug your code, right?

wow, one use who probably barely knows what a function is downloaded a library that they think is useful
Discord RPC
poggers package /s
no way
if (lol === undefined)
dont brag about one or two users thanking you while they barely know what a function is
nah, js is the one for that
this is literally the same convo i talked to million
i dont mind at ALL people coding their own stuff, but please dont publish this shit
well, I mean, here in brazil theres baked potato being sold in markets
I don't question anything else nowadays
mongodb-prefix check them, thats is something I made for public lol
so i have this code for my stats js let memberCount = client.guilds.cache.reduce((a, g) => a + g.memberCount, 0) let serverCount = client.guilds.cache.size
and i have this as his status: js [`WATCHING: ${serverCount} servers! | >help for help`, `PLAYING: With ${memberCount} users! | >help for help] but when it chooses one of this options it shows 0 servers and 0 users
how can i fix it?
half of this is d.js guide stuff my dude
but i did that and it works for my stats command
if THIS is your front page with this disgusting non linted code, i dont even wanna look at the backend code
the front page and readme shows the effort you put into ur stuff
that was the whole code for noobs lol
dude... do you really rely on the user having a client property named exactly "prefix"







ummmm