#development
1 messages Β· Page 1851 of 1
@long crow please no ads
It not even ads? it a website
ur advertising ur website π
ok then
I thought it was a nice example of what you can do with github pages but I see how it can be an ad
how am I going to ask what to improve on it then? Like the align so far left and the widget so messed up
u didnt ask for that tho it was out of nowhere
daaaaang boi π looks like jibakoma had too many bags of sugar last night π working to fix this
@solemn latch
damn
Ok, how do I make it center?
or more specifically what are the css keyword on the alignment I need to look into?
flexbox
@quartz kindle morse code translator works
I also wont be handling spaces between dots and dashes to form letters properly
As its their fault if they don't do it properly
I got it working for numbers, and punctuation as well
:o
I'm trying to get two user's nick/display name and change it, but getting the name's ends up throwing an error. On top of that, the first user is always undefined for some reason. I printed out the argument and it prints out correctly, and the bot is Admin which is strange.
Code:
var user = message.guild.members.cache.get(args[1]);
var user2 = message.guild.members.cache.get(args[2]);
message.reply("Display name of user1: " + user.displayName);
message.reply("Display name of user2: " + user2.displayName);
is args[1] and args[2] actual user ids
and if so do you have the GUILD_MEMBERS intent enabled cause it might be a caching issue
yes
oh no im dumb mb
thx
if you're using IDs might as well use members.fetch(id)
also please call it member and member2
users are different than members
isn't there a partial you need to enable as well along with fetching
I'm trying to get two user's nick/display name and change it, but getting the names just return undefined.
Code:
var user = message.guild.members.fetch(args[1]);
var user2 = message.guild.members.fetch(args[2]);
message.reply("Display name of user1: " + user.displayName);
message.reply("Display name of user2: " + user2.displayName);
Var
fetch returns a promise
did you not read what I said
It returns a promise
So you have to resolve said promise
ah alr
How do bots scan for nsfw images? nsfwjs?
nsfwjs might be too heavy to run, I don't know
Well...imagem sampling maybe? There's not really a "lightweight" option when it comes to image-related stuff
Host: 80R9 Lenovo ideapad 100S-14IBR
Kernel: 5.4.0-81-generic
Uptime: 3 days, 7 hours, 8 mins
Packages: 2061 (dpkg), 3 (snap)
Shell: bash 5.0.17
Resolution: 1366x768
Terminal: /dev/pts/0
CPU: Intel Celeron N3060 (2) @ 2.480GHz
GPU: Intel Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx
Memory: 1072MiB / 1835MiB
With these specs
Top-notch, yes I know
Headless?
Ye like, CLI-only
Oh. For some reason, I can't get WI-FI to work with Ubuntu Server. It only works with the flavors of Ubuntu. I don't know why
Gah, finally fkin done with css
You can install Ubuntu headless too
Visual interface is entirely optional
And tbf, graphical rendering takes a HUGE chunk of the processing power
nsfwjs is not that heavy iirc
"Headless" means no GUI?
Ye
I'd love to install an OS without a GUI so I can use all of the RAM
I tried purging lxqt (the desktop lubuntu uses) and that didn't go too well after a while
The message before edit was valid too
uh
probably cuz u have to set it up
also use debian for ur server please
bye
WhatΒ΄s the error?
Who knows cant even see the error
I set it up and installed it. The Wi-Fi card wasn't being detected. I'm not stupid lol
text is so small
yea sounds like a skill issue
Yeah ok
Can you not send a screenshot of shit
@wind vault complete the if statement
and send the error in the chat along with the code
at line 14
For me its extremely small
either remove it or make it an empty return
Can you relax? I have done nothing to you @earnest phoenix
Oh wait, got the wrong error
I said the solution already
that error occurs cause of the if statement not being complete I think
complete the if statement at line 14 by making it an empty return
or doing something with it
def make_comments():
#some code
make_comments()```
is this what they call recursion?
yep
is it same for every language or just for python its easy?
what should if do If I want to make a condition when someone uses a command and they don't have permission
so I want the bot to reply with : like you don't have permission
hey i am making a lockdown command.
how can i make it like instead of removing message perms from everyone role
i want it to remove from all roles
what lib
That sounds spammy
Actually yeah it would be a lil spammy
you could add a timer in between roles ig
yeah
How are you looking up the track?
all track got stuck be like this
How are you searching for the track
youtube
did you suffix your search query with yt:
yeah
Do other search providers work (like soundcloud)
no
What version of lavalink are you using?
https://github.com/freyacodes/Lavalink/releases/tag/3.3.1.1 fixes this issue
Code:
const guild = interaction.guild.id;
const role = guild.roles.cache
const perms = role.permissions.toArray();```
Error:
const role = guild.roles.cache
^
TypeError: Cannot read property 'cache' of undefined```
guild is a string
not a Guild instance
you're assigning interaction.guild.id to the guild variable
remove the .id
Yus
I'm trying to move a "large" amount of people spread across two voice channels into a common waiting room voice channel.
@bot.commands()
async def move_to_waiting(ctx, pair_number: int):
# voice_channels is a list of a pair of voice channels
# [ (vcA, vcB), (vcC, vcD), etc ]
vc_list = voice_channels[pair_number]
for vc in vc_list:
# move all members in this vc to the waiting vc
for member in vc.members:
try:
await member.move_to(waiting_room_vc)
except discord.HTTPException:
# if the bot couldn't move the person because they already left the vc
print(f"Couldn't move {member.name}")
print("Finished moving all members")
However, this only works if there are 10 or less members in the voice channels that I'm moving them from. I.e. if there are 12 members in the voice channels, then it only moves 10 members and leaves 2 behind.
Why?
Are you getting rate limited maybe?
how could i check?
I don't know python unfortunately
voice channel rate limits are very hefty I will say
i did try adding in asyncio.sleep() in between each member.move_to() attempt, but it still only moved 10 people
how to make vote forced commands
you dont
what?
yes you can I am asking how
howww
I mean the code
what programming lang are you using?
python
use the topggpy module
I am already
what is that
Provide a user ID and it'll give you a boolean
if it's True then the user has voted your bot the past 12 hours
DBLPY 
Command raised an exception: AttributeError: 'Context' object has no attribute '_ensure_bot_user'
<class 'discord.ext.commands.errors.CommandInvokeError'>
I am getting this error
Now it's abandoned, so if you need topggpy, refer to topggpy.rtfd.io 
Show code
@client.command()
async def get_user_vote(self, user_id: int) -> bool:
await self._ensure_bot_user()
data = await self.http.get_user_vote(self.bot_id, user_id)
return bool(data['voted'])
I will upgrade it later
I just want to make a command like
!voted
bot responds: yes/no
topgg_client - topgg.DBLClient(...)
@client.command()
async def your_command(ctx, user_id: int) -> bool:
voted = await topgg_client.get_user_vote(user_id)
...
thanks let me try it
can I ask one more question please
Just ask it
how do I import topgg_client and topgg.DBLClient
wdym import topgg_client
It's a variable that's declared right there at the top
You import topgg and access it DBLClient member
I have imported topgg
shouldn't it be topgg_client = topgg.DBLClient(...)?
similar to client = discord.Bot(...)
AttributeError: module 'topgg' has no attribute 'DBLClien'
DBLClien
why do I feel like making my second class math homework with my dad?
I am not crying
there is dust in my eyes
so i figured out that discord py has a bot.is_ws_ratelimited() method xd. i don't have the people to check if i'm getting rate limited rn tho
get ratelimited then/j 
still not working
Websocket will hardly if ever get ratelimited
π¦
Other than guild members fetching I don't remember what's there to it 
not sure how to proceed with my issue then
if i am getting limited -> how do i change my code to not get limited
if i'm not getting limited -> wtf?
my code
topgg_client = topgg.DBLClient
@client.command()
async def check(ctx, user_id: int) -> bool:
voted = await topgg_client.get_user_vote(user_id)
my input: !check 778662114663071765
error:Command raised an exception: TypeError: get_user_vote() missing 1 required positional argument: 'user_id'
Please learn the basics of OOP
I am trying
The (...) in my example meant that you need to instantiate DBLClient with according parameters
You're trying to blindly glue crap together until it works, not learn how OOP works
DBLClient(...) i'm assuming required some sort of key that you get from topgg website, similar to you needing a key for your discord bot. I think i remember from the DBL days that you also need to DBLClient().run() as well?
That was never a thing, you're probably confusing it with WebhookManager
hi shiv
who r u
dang
;c
I got part of the morse code translator to work
I can translate letters, periods, commas, dashes, etc as well as numbers
ye
Only issue is I have yet to figure out how to do the opposite
Translate english to morse code

dictionary look up?
what's OOP
Object Oriented Programming
what does that mean?
yes u r MistyyBoi
It's the way you're supposed to code. it's like english: the way you're supposed to structure sentences
Thing is I will have to make another map for reverse lookup
Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code: data in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods).
with go I have no idea how I would do that
-p α’α ααααΆ
My discord.py bot is online but it doesn't respond to any of the commands, any solutions?
how do i make a command for only who voted to my bot using py and replit?
I dont know but if you learn please also tell me
ok
thanks
use a db
and listen for a webhook from topgg and saved that to the db
then compare it if they recently voted the last 12 hours
i can't use it in replit.com and in the forum i can't find the command for only who voted
ever heard of replitdb ?
uh no
replit supports database wdym?
Also you can use SQLite everywhere
they have their own db
it's like quick.db but worse
i need to set-up db and to set-up it i need to run this commands but i can't in replit
just copy the code manually
use the shell tab in replit
or that
yeah
oh ok thank you
np
gutbook ?
*git
I currently use gitbook
I want some website that can help me make these type of docs but with more options - https://docs.pgamerx.com
I already use that
Pardon?
You want to make the right text big font in your Top.gg bot description? Is that it?

Use CSS
well i dont know css
you know vue-router, right?
mhm
I need to make a website that uses discord oauth2, and when I try to use the oauth link, everything works till the url, which looks something like this:
localhost:8080/?code=oauth2code#/login
And I realised that even when I go to the main page, the url changes to this: localhost:8080/#/
And I dont know about you, but I want the ?code thing at the end, near login and not in the middle of the url
well, that structure just seems wrong to begin with
Usually you'd give it a callback url to redirect to
which then processes the code to get the access token to store in cookie or smth then redirect back to the home page
e.g http://localhost:8000/oauth2/callback (then it would look like that with code at the end)
Thats how I do it at least,
that's what you set as a redirect from discord
Indeed
yes
Your login route would simply redirect to the oauth2 page and wait for them to authorize which would then redirect to the callback url to process the code given and save the access token and then redirect to the home page fully authed
Then I should probably follow that
I am not using any packages, should i?
Well
you don't have to
its completely fine doing everything yourself
but some people use passport
I typically do it myself
Yeah, I was having a look at the discordjs.guide website
you don't really need to use a package.
djs example is pretty bad
lmao, yes.
I never liked it
well I wouldn't say the best
but its usable
Passport likes to withhold some stuff
I've noticed it doesn't give you a expiration of the access token which ig isn't that important really
actually completely depends on you, if you want to cache the token, or store it as a cookie or use jwt as a base
I prefer jwt too
they are easy to use
I have no idea how to do any of that ngllll
lel
kek
It takes some learning indeed
Tbh I prefer react to vuejs
Just follow discords docs on oauth2
its rather straight forward after a while of reading
like title
how add text like this bot page
getting startes , advance like stuff
hi! ho to host my website on a vps ubuntu? can anyone send me the tutorial please?
sorry ony know about bot host
ok
You can achieve this using Markdown or HTML in your bot's description. You can ask in #development for help or use this HTML and Markdown cheatsheet for more resources: https://www.markdownguide.org/basic-syntax/
Mac can you help me?
Everytime i run the command mute <user.id> <time> <reason>, it throws an error. Can someone help me?
Code: https://starb.in/Z2nITh.typescript
with a webserver
for example nginx, apache, litespeed, node.js, flask, sanic, etc...
on my vps i host an discord bot and neet to host also a website.. can you send me the tutorial?
google nginx tutorial
?
youre checking for manage messages permission
roles require manage roles
it this work js <h1>Getting Started</h1>
Try it and see
but i need increase more hight
The bot role has Admin perms, does it still matter?
and breath
Use CSS https://www.w3schools.com/css/.
its a python lib like express or something afaik
oof
@quartz kindle
depends, you have to check which call is causing the error
console.log right before each api calls and see which one is throwing the error
anyone
GTTA G FAST
Someone should give you a windows license
ik
^
someone donate π
This man deserves one for sure
Apiary
swagger 
i'll donate you warez
@quartz kindle can i have the link for node v16.6 on replit for a friend please? They're getting into bot dev and want to run djs v13 on replit.
Thank you!
if you get disk quota exceeded, reload the page and try again
because the nix script has to download the entire nix unstable repo lol, since the built-in repo only has node 16.4
whats so special about .6
This may be your best work yet tim
so i use this to get the user for my ban command, js let user = message.mentions.members.first() || message.guild.members.cache.get(args[0]); but when i try to define userTag like this js const userTag = user.tag; it says cannot read property tag of undefined, can someone help?
I don't know it's a toss up between that and djs-light 
ALT+F4 Play
user.user.tag
Your user variable is getting a member
thats right
I'm pretty sure tag isn't a property on member iirc?
Are you mentioning the user in your test or using the id?
mention
The person you are mentioning is in the server?
yep
Try logging the user to see what comes up
may i ask, what does that help
It's undefined
Yeah it is lol
yeah but how can it be undefined
ask the discord.js gods
Are you sure you're not mentioning a role?
@vale kitejs-god
Well it can be if you use an ID, as you are using get not fetch
nope
huh
the user has been banned
lol
my client sucks
App cache
Kek
lmfao
Because of those cases, I'd actually prefer getting the user rather than member, then "hack banning" them
works perfectly now while i didnt change it
i did before, and then it freaks out whit all errors
Hmm, weird
CODE
const { MessageEmbed, Client, Message } = require('discord.js');
module.exports = {
name: 'showemojis',
description: 'Shows the emojis in the guild.',
async execute(msg, args, Discord, Client){
console.log("Emoji")
let Emojis="";
let EmojisAnimated="";
let EmojiCount = 0;
let Animated = 0;
let OverallEmojis = 0;
function Emoji(id){
return Client.emojis.cache.get(id).toString()
}
msg.guild.emojis.cache.forEach(emoji=>{
OverallEmojis++;
if(emoji.animated){
Animated++;
EmojisAnimated+=Emoji(emoji.id)
}else{
EmojiCount++;
Emojis+=Emoji(emoji.id)
}
})
let Embed = new MessageEmbed()
.setColor('#FFFFFF')
.setTitle(`Emojis in ${msg.guild.name}`)
.setDescription(`**Animated [${Animated}]**:\n${EmojisAnimated}\n\n**Standart [${EmojiCount}]**:\n${Emojis}\n\n**Over all emojis [${OverallEmojis}]`)
msg.channel.send(Embed)
}
}
ERROR
C:\Users\Mustikk\Desktop\Projects\Lxyon\node_modules\discord.js\src\rest\RequestHandler.js:298
throw new DiscordAPIError(data, res.status, request);
^
DiscordAPIError: Cannot send an empty message
at RequestHandler.execute (C:\Users\Mustikk\Desktop\Projects\Lxyon\node_modules\discord.js\src\rest\RequestHandler.js:298:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (C:\Users\Mustikk\Desktop\Projects\Lxyon\node_modules\discord.js\src\rest\RequestHandler.js:50:14)
at async TextChannel.send (C:\Users\Mustikk\Desktop\Projects\Lxyon\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:171:15) {
method: 'post',
path: '/channels/878369729331462187/messages',
code: 50006,
httpStatus: 400,
requestData: {
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined
},
files: []
}
}
what i need to do
;-;
channel.send({ embeds: [Embed] })
My Bot shows the wrong number of serving users, how can i fix? The serving users should be 60k+ but it's showing 100 only
Code: https://starb.in/mMe4oU.js
client.users.cache only contains cached users
which are users who are active after your bot starts
How can i make it show all users?
to get a grand total of all users, including duplicates and bots, you can use guild.memberCount
you need to loop over all guilds and add their memberCounts together
?
for example js let total = 0; client.guilds.cache.forEach(guild => total += guild.memberCount); or ```js
let total = client.guilds.cache.reduce((total, guild) => total + guild.memberCount , 0)
Like this here right?
yes you can do that
And what with this line?
total
is it possible to change embed background?
No
How would I generate an array with {x: x, y: y} that when looped over generates a curve?
what kind of curve?
Basically my friend wants me to generate a 2d ocean and I have no clue how to start
"maxDepth": 15, // It canβt go deeper than 15 blocks
"minDepth": { // In this example, after 10 blocks into the biome, it should be at least 5 blocks deep
"startAfterBlocks": 10,
"minDepth": 5
},
He provided me with this
Not sure why this error keeps on poping out of no where, and i don know what file is having issue
/app/node_modules/discord.js/src/util/Util.js:414
if (!allowEmpty && data.length === 0) throw new error(errorMessage);
^
RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.
at Function.verifyString (/app/node_modules/discord.js/src/util/Util.js:414:49)
at Function.normalizeField (/app/node_modules/discord.js/src/structures/MessageEmbed.js:443:19)
at /app/node_modules/discord.js/src/structures/MessageEmbed.js:464:14
at Array.map (<anonymous>)
at Function.normalizeFields (/app/node_modules/discord.js/src/structures/MessageEmbed.js:463:8)
at MessageEmbed.addFields (/app/node_modules/discord.js/src/structures/MessageEmbed.js:286:42)
at MessageEmbed.addField (/app/node_modules/discord.js/src/structures/MessageEmbed.js:277:17)
at Client.<anonymous> (/app/src/events/messageDelete.ts:16:14)
at step (/app/src/events/messageDelete.ts:33:23)
at Object.next (/app/src/events/messageDelete.ts:14:53)
at fulfilled (/app/src/events/messageDelete.ts:5:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[Symbol(code)]: 'EMBED_FIELD_VALUE'
}
[31m[nodemon] app crashed - waiting for file changes before starting...[39m
message.content is empty
You can say <string> message.content.length > 0 ? message.content : "No content found."
wait no
Nvm that won't work
wdym fill?
Its empty
You can't fill it
You have to check if it's empty or not
and if it is empty put something in there like "No content found."
I think that should work unless typescript does something weird with the as string
Hmm
yeah I use that instead of as type but they both work
yo regex masters
how to i reverse this?
it want to match all versions that are not 16.7.0
did you got it tim?
nop
why doesnt this code let people who have one of the two id's ban staff? js if(message.author.id !== '829257224181383179' || message.author.id !== '707512325740953690') { if(user.roles.cache.some(r => r.id === '831079814735200303') || user.roles.cache.some(r => r.id === '831079814735200302')) return message.channel.send(`You can't ban staff!`).then(message.delete()).then(console.log(`${message.author.tag} tried to ban a staff member!`)); }
wut
it first checks if the user doesnt have one of the two ids if they dont it checks if the victim has a staff role if they have a staff role they say you cant ban staff
@quartz kindle any ideas?
ummm, i couldn't find apps docs, can someone send it here?
yeah that is what the script do
thanks, doesnt seem to be working when using the linux find command tho, maybe i need to change the regex mode
hmm i thought it works dang
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
thanks
is it possible to use any other way to see who delete a message other then using the audit logs as they are not updating
found a solution lul
find -maxdepth 1 -type d -regex '.*node-.*-linux-x64.*' -not -regex '.*node-v16.7.0-linux-x64.*'
regex with -not regex lul
bruh
I do not think so.
can someone help?
use and instead of or in the first if statement
are you sure it should be !== and not ===
Because
if(id === "100"){
//The guy with id 100 gets in
}
if(id !== "100"){
//everyone except the guy with id 100 gets in
}
i suck at regex
fucking alien language
and even when i ask for help, i end up fixing it myself lel
btw if anyone wants, i made a repl.it project which can download and run any node.js version
https://replit.com/@timotejroiko/Latest-Nodejs-BASH
thanks
Hello can i find a example code of mute, unmute etk
Google is your best friend.
Then become friends with it.
it is now
so you're lonely
Don't worry the giant G already knows everything about you
Oh shit
In fact you're already friends at this point
0_0
so sad
No no no
github is my best friend
google hot π
GDPR walks in
Question, why is Dpy and Djs under "Language:"
because it is so necessary
I like how PHP comes before Dpy and Djs

even google knows what's better for your health
ahaha
Also, since when are Dpy and Djs languages? 
whta
who uses php unironically
what
what
not me
haha php cringe!! /s
i would write it
haha jk..
I know perfectly well that this is just a library. Why not
unless?
developers on the verge of insanity because management doesn't want to rewrite their systems

im not a dev but i think the path to /servers/new is blocked
fair enough
something may be blocking it
blockign what
works fine for me
not for me
yeah i tried that
How can you rewrite a command from cogs just to a regular command?
I need remove self ?
Or more?
Hey.. is it possible to remove the unused variable and switch it from:
const newInventory = new Inventory({
userID: interaction.member.id,
inventory: {
['upgrades']: (upgrade >= 1 && upgrade <= 10) ? 1 : 0,
['mysterybox']: received === true ? 1 : 0
},
}).save().catch(err => console.log(err));
``` to..
```js
new Inventory({
userID: interaction.member.id,
inventory: {
['upgrades']: (upgrade >= 1 && upgrade <= 10) ? 1 : 0,
['mysterybox']: received === true ? 1 : 0
},
}).save().catch(err => console.log(err));
.. since I am not using the variable anywhere but saving it.
Yeah
What??
By the way, you could pass the condition of the ternary to Number to get 1 for true and 0 for false.
Number(upgrade >= 1 && upgrade <= 10)
Ooo.. thank you!!
It's possible, confirmed though, right?
To not define a variable when creating a new class instance just to use it to .save(), right?.
Yeah, you don't need to assign it to a variable
Sweet. π
How can i rewrite a command from cogs just to a regural
I have this:
@commands.command(name='kick', pass_context=True)
@commands.has_permissions(kick_members=True)
async def kick(self, context, member: discord.Member, *, reason="Not specified"):
"""
Kick a user out of the server.
"""
if member.guild_permissions.administrator:
embed = discord.Embed(
title="Error!",
description="User has Admin permissions.",
color=0xE02B2B
)
await context.send(embed=embed)
else:
try:
await member.kick(reason=reason)
embed = discord.Embed(
title="User Kicked!",
description=f"**{member}** was kicked by **{context.message.author}**!",
color=0x42F56C
)
embed.add_field(
name="Reason:",
value=reason
)
await context.send(embed=embed)
try:
await member.send(
f"You were kicked by **{context.message.author}**!\nReason: {reason}"
)
except:
pass
except:
embed = discord.Embed(
title="Error!",
description="An error occurred while trying to kick the user. Make sure my role is above the role of the user you want to kick.",
color=0xE02B2B
)
await context.message.channel.send(embed=embed)
@earnest phoenix use regular functions. https://discordpy.readthedocs.io/en/stable/ext/commands/commands.html
i dont see not regular functions
Move it away from a cog
Apply a @<Client>.command(...) where <Client> is your client object
As opposed to @commands.command(...)
Is there a way to compare input with data? For example I have: who am I it will give an answer, and who am I? It also gives the same answer as the one above
I'm coding like the chatbot API
inpy you can do
words = ['hello', 'Hallo', 'hi', 'house', 'key', 'screen', 'hallo', 'question', 'format']
difflib.get_close_matches('Hello', words)
# ['hello', 'Hallo', 'hallo']
thank bro
np
I have a command which is !daily and every time you use it under the next 24 hours.. it increases the streak.. a streak system, but I'm having an issue whereas when it reaches 4.1, it suddenly stops increasing. π
let dCooldown = 172800000;
if (dCooldown - (Date.now() - data.dailyCooldown) > 0) {
data.dailyStreak++;
if (data.dailyMultiplier === 5) {
data.dailyMultiplier = 5;
} else {
data.dailyMultiplier = Math.floor((data.dailyMultiplier + 0.1) * 10)/10;
};
var finalReward = Math.floor(reward * (data.multiplier * data.dailyMultiplier));
} else {
data.dailyStreak = 0;
data.dailyMultiplier = 1;
var finalReward = Math.floor(reward * data.multiplier);
};
The if statement just checks if you performed it in the next 24 hours after the cooldown of the daily command is done.
if (data.dailyMultiplier === 5) {
data.dailyMultiplier = 5;
π€
you can just do if (data.dailyMultiplier !== 5) data.dailyMultiplier = Math.floor((data.dailyMultiplier + 0.1) * 10)/10;
.. a multiplier basically each time you streak.
This makes 4.9 the max?
Oh.. nvm.. it increases then checks.
uuh no it doesn't? Also did you even try out the formula with 4.1... the result is 4.1
so it'll never go above that
How tf did it work all the way to 4.1 then? π
The result should be 4.2 wtf
I'm confused.. π
It's supposed to be 4.2
What the fuck.. it works for 3.1 but not 4.1??
.. wait, neither 5.1 or 6.1
Dude.. should I make a ternary operator that adds an extra 0.1 if it was at 4 and above?
4.1 + 0.1 probably equals something veeery close to 4.2 cause precision
and Math.floor rounds it to 4.1 again
Makes no sense.. why not for all the other float numbers, then?
Tf
What are you even doing anyways...
Your formula is exactly the same thing as Math.floor(level + 0.1)
literally
thats the exact point, everyone without that id goes in. I have one of the 2 ids in my code so what could be the problem?
LOLWTF
console.log(1.1 + 0.1) // 1.2000000000000002
console.log(4.1 + 0.1) // 4.199999999999999
HOW DOES THAT MAKE SENSE
use Math.round
not floor
and also... like I said earlier, your formula boils down to Math.round(level + 0.1), *10 and /10 cancel out
No..
It is supposed to show the decimal.. without it, it won't show since I am using Math.Floor()
more sense
I bought 25k impressions lmao
floating math
it will still show the decimal...
Yup, but removing the * 10 and /10 won't show..
.. thanks for it though. π
have you tried using && ??
Where
Oh wait
Yeah good idea
Thx that should work
if(message.author.id !== '829257224181383179' || message.author.id !== '707512325740953690')
``` here
NOT or NOT doesnβt make sense at all
If both && NOT
In other words if(NOT && NOT)
if (!(!NOT || !NOT))
lmao
can you not knot?
Kuuhuukwkwwowi Troll 

What..?
I can't code so bye
I mean
This server isnβt necessarily all about coding, thatβs why thereβs other channels than this
Can anyone say me how to make my BOT notify me when someone votes the bot?
You'll need to use the webhooks API.
https://docs.top.gg/resources/webhooks/
does anyone know the problem
i dont
because it worked before
...
no weebhook msg came in the channel weebhook is created.
WHY WOULD U SEND THAT
?
That's not how webhooks work
You fucked up discord webhook and top.gg webhook
But you can use this https://webhook-topgg.com/ to easily convert a Discord webhook into a top.gg webhook. @limpid sentinel
What happnd?
Top.gg webhook is not same as discord webhook
see what mac sent
hidden chan weebhook. Will change the weebhook and pass later
Please mind your language
Thanks
yes checking
sorry mommy
i dont
why are you in the buildtools folder
w8 first lemme create a new weebhook. cause this weebhook url is leaked
this is
Oh my bad
we are in this channel lol
go home mac'n'cheese you're drunk
I'm tired
anyways, why are you in the buildtools folder, what are you trying to do?
@rose warren How can I upload a avatar here? No option for uploading files.
Oh great idea

@rose warren Didn't send the weebhook avatar. Given link of imgur.
Okay got it.
working now
Okay now the copy url in weebhook url. and copy auth in suthorization
Am I right?
Yes
idk tbh
im noob
It explains literally just above those buttons if you click on the questions
yes. Seen it just now. Thanks btw
No problem
then get out of there lol
close everything and open vsc normally
omfg
i just realized
i didnt have vscode downloaded
idk when i uninstalled it
but i did
im a dumbass
does anyone know how to fix this?
how do i do this π
whats the problem/error listed?
what are you trying to install?
this
yeah, somewhere on the page it should say what the actual issue is
this is what it says
Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
I get this error on my flask server
ive already installled everthing i need
when i hover over it it says "[typescript] '}' expected."
ah, you forgot to close a bracket somewhere
then ignore it i guess. it doesn't appear to be an error message.
const token = process.env['TOKEN']
Try this
And then put
client.login(token);
you just need to hit enter you are supposed to be answering the questions(this ones asking for the version number)
βhttps://i.woo.pics/5d8fdb4c01.webp
0.1.0 is a good early beta number for new packages
but 1.0.0 works too
you can make it do so when you run npm init run npm init -y -y meaning yes to everything default
also have u put this?
It has nothing to do with the token
Does anyone know how I can send an sms using js?
Like, any packages that are free, methods etc
did you copy and paste your code?
Show where you're declaring the intents for the client
what exactly does that mean
into what?
Are you using djs v13?
You have to include your intents https://discord.js.org/#/docs/main/stable/typedef/ClientOptions
stilll dont understand
I'd highly recommend referring to https://discordjs.guide if you're new to this / djs v13.
ok'
yea I am
^
Use the guide it explains everything and shows examples
i mean if your code is copied from somewhere
or if you actually wrote it yourself
because there seem to be a lot of problems with it
that explains it
There's no hiding from the God of djs π
Please don't ask me to explain the guide I just sent you.
i clicked this
wdym you clicked it
Yeah it's one of the first pages in the guide
it sent me here
thats not something to click on
the error says you are trying to access something that doesnt exist
in this case, the variable message does not exist
or you are trying to use it in the wrong place, where it is not accessible
sorry but im a noob so is any of this correct like im i suppoosed to but the bot id or whatπ
a bot id is not required
I mean you could always read the guide...
ok
i still have an eror
what error
That's the example you need ^
bruh
how do i directly sends an sms with my phone number using js?
The only thing i get as results on google are twillio etc, but those are all paid
I STILL DONT UNDE4RSTAND
it lead me to the black line
what dont you understand
making a discord bot requires knowledge of programming/coding
if you have none, i suggest you learn some basic coding first
what doesnt show the actual error
what doesnt help with knowing what the problem is
you likely have a missing brackets issue
for every ( or { you have in your code, you need an ) or } in the right place
you are missing them
I'm getting this from the discord oauth2 API:
{
error: 'invalid_request',
error_description: 'Missing "code" in request.'
}
how can I solve?
i looked through my code and haven't found anything that i know of
then look harder
or show you coder
otherwise we cant help
should i send you an invite link?
Finding where you need to add closing brackets is something imo you need to learn how to do.
I've had my fair share of trying to find them and failing to for awhile, but over time it gets easier.
const express = require('express')
const fetch = require('node-fetch')
const btoa = require('btoa')
const app = express()
const sercret = 'client_secret'
const id = 'client_id'
const redirect = encodeURIComponent('url')
app.get('/', async (req, res) => {
res.send(`THE BROZY CORPORATION`)
const code = req.query.code
const creds = btoa(`${id}:${sercret}`)
const response = await fetch(`https://discordapp.com/api/oauth2/token?grant_type=authorization_code&code=${req.query.code}&redirect_uri=${redirect}`, {
method: 'POST',
headers: {
Authorization: `Basic ${creds}`
},
})
const responseJson = await response.json()
console.log(responseJson.access_token)
})
app.get('/login', (req, res) => {
res.redirect('https://discord.com/api/oauth2/authorize?client_id=${id}&redirect_uri=${redirect}&response_type=code&scope=identify%20guilds')
})
app.listen('2084', () => {
console.log(`running`)
})
this is my code and i'm getting an error
error:
{
error: 'invalid_request',
error_description: 'Missing "code" in request.'
}
here's my code
it's way bigger than it appears on here
you are missing a message event
yes
oh god
#memes-and-media ,anyways copying is the worst thing you can do,it is compareable with cheating in a class test
no it's not
did i fix it
unless you're just downloading someone's git repo and submitting it as your homework
yes, but you have to put all your code that uses message inside that
for example ```js
client.on("message", message => {
if(...) { ... }
if(...) { ... }
if(...) { ... }
if(...) { ... }
if(...) { ... }
if(...) { ... }
...
})
add what?
so like this?
no
client.on("message") should only be there once, like i showed
You didn't close that first if statement
how do i do that
like this?
\
wut
did you not read the getting started part?
you have to create a js file and open it with a code editor (or any text editor)
and write on it
why do you have a bunch of files already? did you download a pre-made bot?
am i doing it right
well its not wrong
How do u overwrite permission in a channel for a specific user in djs v13.1? Fixed
idk
is there a better way to do automation tests for discord bots than using something like nightwatchjs to login to discord through the browser and run tests? will my test account get banned if it keeps doing automated stuff?
you should try to avoid using if statements to create a String->String mapping
it's really hard to unit test discord bots, your question is kind of a gray area imo. the TOS states that any kind of automation of user acounts is forbidden, but you're automating the browser
hmmm, it'd probably get banned
there's a chance
however if the account doesn't do anything crazy (i.e. dm people)
i don't see how discord would detect an automation pattern
i'd need 4 test accounts to run some of my tests. they wouldn't dm, but they would be messaging a channel
just making 4 test accounts is going to be annoying
top.gg should offer feature testing services
Why not try and simulate receiving data from Discord?
i have unit tests that mock data
that would be tricky to do with automation tests
I don't see how it would be.
I think the best solution here is to purchase discord so that you can do whatever you want to their API
that would cost money if we did.
if we did it probably wouldn't be cheap π probably cheaper to just give someone nitro to test it.
So iβm very noob with these things but I need help
I have a var that should add to its value 1 if something is said but I doesnβt sum up
I donβt have the pc now but itβs something like:
var int = 0
if message.content.includes (βyepβ) var int = int + 1
it doesnβt sum
you are redefining int every time
plus
you are missing ()
plus, just increment the variable
I installed Ubuntu Server successfully
But forgot to back up my database
So yeah there's that
you forgor
how do we make vote forced command in python
Same as any other language. Save data from the voting webhook in your database then when someone runs the command, check your db to see if they've voted in the last 12h. If so, proceed to give the response. Otherwise, give them a voting link.
why do I need a database for that
To store the data of who voted and when
hmmm
You don't want to be making an api request to top.gg every time someone runs a command or you'll get rate limited. So that's the best way.
hmm
can I use json
To store user data?
That's definitely not recommended. Json files can get corrupt.
You could use a simple persistent data store rather than an SQL database.
how
You'll need to search online for one. For example, Python has the dbm module built-in, so you could do research on how to use it online (https://docs.python.org/3/library/dbm.html).
Here's an example https://remusao.github.io/posts/python-dbm-module.html
Simplex Sigillum Veri
thanks I will try to learn it
It's like using a dictionary as a database
hey I have tried my best but couldn't make it
show the code you tried
how do i get the avatar for a user that used a slash command as interaction.author.displayAvatarURL() is not working
You sure it's not called interaction.user?
Interactions aren't messages, they don't have the author object
oh, it might be, ill check
Check in docs
it was interaction.user, thanks
i have created the worst bot known to mankind
oh to be jared, 19
Anyone here help with bot coding a error accured in my bot
Language: python
One message removed from a suspended account.
You're missing a "
I also highly recommend not leaking your token in a public discord server
Might wanna regen that token now
@earnest phoenix please Regen your token and be careful sharing it
Hi
i did before sending thsat
try mongo db

I'd rather recommend sql based solutions as a starter database since there are many which are really good like postgres. Even MariaDB is stronk
why is it showing like this?
expected;
!help [command] - The command name/alias
![alias] [command] - The command name/alias
etc.
const {MessageEmbed} = require("discord.js")
module.exports = {
name: "help",
description: "Shows the help menu",
category: "other",
usage: "[command] - The command name/alias",
alias: ["command","cmd","cmds"],
run:async(msg,args,client,cache)=>{
const settings = await cache.functions.get("getServerSet.js")(msg.guild.id)
const categories = cache.functions.get("getCateg.js")(cache,settings.prefix)
const colors = cache.jsonFiles.get("colors.json")
const cmds = cache.collections.get("cmds.js")
const emb = new MessageEmbed()
emb.setColor(colors.default)
if (!args[0]) {
emb.setTitle(`Commands for ${client.user.username}`)
for (const c of categories) {
emb.addField(c.name,c.value.join("\n"))
}
msg.channel.send({
embeds: [emb]
})
} else {
const cmd = cmds.get(args.join(" ")) || cmds.find(c=>c.alias&&c.alias.includes(args.join(" ")))
if (!cmd) return msg.reply(`It looks like this command doesn't exist!`)
emb.setTitle(`Help Memu (${cmd.name})`)
emb.setDescription(`${cmd.description||"None"}`)
let usage = cmd.usage ? `prefixHere[cmd] `+cmd.usage : `prefixHere[cmd]`
if (cmd.alias) {
for (const a of cmd.alias) {
usage=usage+`\n${settings.prefix}${a}${usage.slice("prefixHere[cmd]".length)}`
}
}
usage.replace(/prefixHere/g,settings.prefix)
usage.replace(/\[cmd\]/g,cmd.name)
emb.addFields([{
name: "Alias",
value: cmd.alias?.join(" ") || "None"
},{
name: `Usage`,
value: usage
}])
msg.channel.send({
embeds: [emb]
})
}
}
}
the regex might not like special characters in the string like [ right next to matches
You'll possibly wanna use positive lookahead iirc
i dont get what u mean
Now I'm confused
your question was so vague
what's supposed to be the intended string?
^
basically it will copy the string from the main command name and replace it with the alias.
like:
!help [command]
i want to replace help with cmds
the string should be like this:
!help [command]
!cmds [command]
found the problem
Is it possible to reply to an interaction with embed without using the discord method .editReply ?
d.js uses this.webhook.edit()
How can i get the member who deleted the message and not who the message belongs to was deleted. Right now, when someone deletes a message it says A message from Angel was deleted by Angel in (channel)
const deleteMessage = new Discord.MessageEmbed()
.setTimestamp()
// .setFooter(message.member?.user.username as string, `${message.member?.user.avatarURL}`)
.setAuthor(`<@${message.author}>`)
.setColor("RED")
.setDescription(`**A message from <@${message.author}> was deleted by <@${message.author}> in <#${message.channel}>**`)
.addField("Content", message.content as string || "No content found... Either the message was a Sticker or a Picture")
.setFooter(`ID: ${message.author?.id}`)
var sChannel = message.guild?.channels.cache.get(channel) as Discord.TextBasedChannels
if (!sChannel) return;
sChannel.send({ embeds: [deleteMessage]})
you need to poll audit logs
if there's an entry after a second or two in the audit logs - the person in the audit log deleted it
if not, the author deleted it
but how do i get the webhook token of the interaction
yea?
second?
@drowsy crag
in discord.js guide there was a section on audit logs, and it gave examples on this and some other things. (It was in v12 but they probably still ahve audit logs thing in the v13 guide too)
Using discordjs the property .webhook exists as part of interaction
Deferring your interaction reply allows you to send multiple replies to your interaction or delayed replies
What is 429?
A number?
In debug console
Ok thnx
Hello
I'm working on a twitter bot
and I'm trying to get retweets of a tweet done by a user
more like the usernames of who retweeted the tweet
I'm using python
In cookies
When i listen to the interactionCreate event, i have this code: interaction.message.edit({ embeds: [ Embed ], components: [ Row ]}), the message and buttons edit normaly, but it says Interaction failed, why?
Its an embed with a dropdown menu, when you choose an option from the menu, the message edits itself, removes the menu and adds a button
client.on("messageCreate", message => {
if (message.content == `${prefix}ping`) {
message.channel.send("pong")
}
});
djs v13 why is this not working :/
You need to provide the errors from your console. There are lots of different ways you could be rate limited.
That was me before answering my question but im all good now thanks
Ok. If you ever need help always make sure to include logs or code. It helps people help you.
nvm i got it i forgot to turn on intents



