#development
1 messages · Page 1294 of 1
IM 13 AND IM STUPID IM A PEANUT BRAIN IDK HOW TO MAKE A BOT I NEVER HAVE MADE A BOT
jeez
can you like
Just leave me one
type normally
dude you don't make a bot by adding it to a bot list
^
you make it by learning the language
that you wanna make it in
inb4 they say they already know english
First, calm down. Second, you need to learn a programming language. Once that's done, feel free to use a library for the programming language you learned.
A powerful asynchronous, flexible, and scalable ecosystem of Rust libraries for the Discord API.
wait i don't think that'll work
rust
HAH, randomly, I looked up if there was an Oxidize library for Rust. Of course there is. https://docs.rs/oxidize/0.2.1/oxidize/
First, calm down. Second, you need to learn a programming language.
Should have told him, secondly go to school and learn something useful.
Programmers and our puns, man. 😂
yea thats amazing
yeah there's a bunch of those
there's a time lib that has a couple cool hidden features
API documentation for the Rust two_timer crate.
specifically the end of time stuff
I mean I was specifically talking about how Rust is caused through Oxidizing of iron
nope. Just noting that we have things like coffeescript, mocha, and chai, for JAVAscript libraries
now im wondering of there's a rust game lib for rustlang
javascript
Scripted Java
How can I get 2 inline embeds ontop of another 2 instead of 3 on 1

Callum could you elaborate on what you mean
If I set 4 embed fields to be inlined, it would do 3 on the top line and 1 on the bottom. I want 2 on top, 2 on bottom
I don't think that's possible due to the way Discord renders it to the client
F
Maybe you could use a little hack by making a blank field then adding your two fields below it.
Keep in mind that it probably won't look good on mobile as every field is on a separate line.
embeds can't be inlined are you thinking of fields lol
also
you're at the mercy of screen resolution
however you can fake the effect with people who don't have ooga booga monitors
create 6 inline fields in total
3 at the top, 3 at the bottom
set the title and the value of the one in the middle to a zero width space
I have a problem with this command its shows the stats??
@snow urchin doing the thing i said above you can achieve this effect
that bot name
@compact oriole lol its AnimeMovieN'SerieFinder
and how can I get the 0 width space value, as they cant be empty
google it
didn't talk to you @autumn aspen
@autumn aspen I don't see a problem. The bot is showing stats, what else were you expecting?
Again: learn to phrase your questions with information that's useful, dammit
hey is this true
@autumn aspen I don't see a problem. The bot is showing stats, what else were you expecting?
@umbral zealot it was a joke that wasnt even funny
1+1 = 2
??
well it is not true if you run it in a lang
nope
1+1 is 1 
no its 11
boolean's logic
10
@autumn aspen This is a support channel not a meme channel man. You've already shown enough help vampirism that any stupid question you ask is going to be assumed as a stupid question, not a joke.
slowly getting off-topic though
is there any way to make my page aproved faster cause ive been waiting for a while or all i can do is just wait
more
ok
You submitted your bot like 10 days ago right
@violet mesa you only added it a few weeks ago
wait 10 days
wait another 43 days+
Siri, whats 53 divided by 7
7.5
How can I make a role when I join a server called Muted, and change all the channel's permissions so that Muted can't talk? (in discord.py)
@modest smelt well first off you need to create the role (duh) using Guild.create_role. then iterate over all channels and use TextChannel.set_permissions to alter the permissions for the muted role to send_messages=False. And dont forget to move the role higher in the role hierarchy to above all roles you want to be able to mute
@earnest phoenix when i try creating the role it doesn't work
try:
role = discord.utils.get(ctx.guild.roles, name="Muted")
except Exception:
role = await ctx.guild.create_role(name="Muted")
role = discord.utils.get(ctx.guild.roles, name="Muted")
@modest smelt that doesn't work because utils.get doesn't raise an exception when no role is found. It'll just return None
So what should i do?
Try to get the role usinf utils.get and check if what is return is None. Then create role
ok
- Bot doesn't react to any message, that includes these words
- No message in the terminal
const Discord = require('discord.js');
const client = new Discord.Client();
const token = "top secret info";
const bot = new Discord.Client({disableEveryone: true});
client.login(token);
bot.on("ready", async () => {
console.log('${bot.user.username} jest gotowy');
bot.user.setGame("na siłowni w piwnicy");
});
client.on('message', async message => {
if(message.author.bot) return;
if(message.channel.type === "dm") return;
let randomMessages = [ `bo tak`, `ja tam nie wiem`, `spytaj się boga ojca wszechmogącego`, `w internetach poszukaj`, `a co ja jakaś encyklopedia jestem?`, `bo ja tak powiedziałem i tak ma być`, 'nie chcesz wiedzieć...', 'no bo wiesz no... :sunglasses::call_me:'];
if(message.content.includes("sikorze" & "czemu"))
message.channel.send(randomMessages[Math.floor(Math.random() * (randomMessages.length - 1))])
});
Is anybody able to help me? 🥺
isn't login blocking
Yes
you also mix and match between client and bot
where did you copy that code from
Login is blocking and mixing bot/client will indeed only cause more.issues 
@earnest phoenix does it return "None" or None
None
this is also not how programming works lol
from a youtube tutorial 😃
what should i do then
a single ampersand is a bitwise and
It never returns None as a string
this is also not how programming works lol
@earnest phoenix what you mean?
role = discord.utils.get(ctx.guild.roles, name="Muted")
if role == None:
role = await ctx.guild.create_role(name="Muted")
role = discord.utils.get(ctx.guild.roles, name="Muted")
else:
return
is that ok?
oh
double ampersand then?
still not how it works
aaaaaa
@modest smelt yes and no. Preferably use if role is None. Also, you dont need the 2nd utils.get
Hi. my bot is logged in but no responding? when i tried changing the token it works perfectly
@modest smelt yes and no. Preferably use
if role is None. Also, you dont need the 2nd utils.get
@earnest phoenix i got it to work

create_role returns the created role, no need to get it again
now how do i set all the channel's permissions so Muted role can't talk?
Iterate over the channels and use TextChannel.set_permissions
@slender thistle any other lazy dev suggestions? 
hahaha none so far, I'll tell you if I have any 😂
ok

Anyone can give an idea to make a web dashboard
it's more complex than what you think
you need to know most IT technologies listed for frontend and backend here https://github.com/kamranahmedse/developer-roadmap
what does ... mean in JS
It's called the spread operator.
It's used for iterables and passing arguments. Read here for more info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax
thanks
I need help with reactions,
async def on_raw_reaction_add(self, payload):
on_raw_reaction_add doesn't seem to have a emoji count...
but on_reactrion_add doesn't work on uncached messages..
My bots in development and always rebooting.. how to do i get the count of a emoji on a old message?
Fetch it?
yo
so im tryna remove all roles from a user but one
and I can seem to be able to do it
i get
data.roles.map is not a funciton
nvm
i gave it an var
i need to give a array
thanks
nvm
so im tryna remove all roles from a user but one
@zenith knoll can you explain your question better?
lol
yea
so
i did
victim.roles.set(communityRole)
should have done
victim.roles.set([communityRole])```
@zenith knoll wait are you looping over every single member and assigning them the role if they aren't the user you said you don't wanna give a role to?
no
one member only
victyim is a member
the one u @ ed
it works
lmao im not a copy paste dev
smh
you can just loop over every single role of the user and remove everything except that one role
better than removing all roles then adding back the one you want
you'll save yourself 2 API requests
.set only uses 1 API request.
you didn't get it
let's say i have 10 roles
if he removes all roles then adds back one role he'll first send 10 API requests to remove roles and 1 more for adding back one
if he just removes everything except the one role then he'll only send 9 API requests
isn't that what they're doing already
set is setting the roles to whatever array was provided in the arg
you can modify all roles with a single api request
Yet they're using victim.roles.set([communityRole])? That works by sending one single API request to set what roles the user has, making it 1 request. Unless I'm missing something.
Does mongoose updateOne require you to save the document again?
I don't see how it was explained poorly: "I want to be able to remove all roles from a member except for one" and proceeds to show their snippet on how they're accomplishing it.
bruh if I knew you were gonna ask here I would’ve asked here myself
afaik it should pass silently if there's no document that fits the filter
U can github doe
What program does Notum Erwinum use to see the cached stuff in discordum.jsum
what, the stats?
yesum
message.content.replace('um', '')
can you send the code?
you might be just calling the constructor but not throwing the error
@earnest phoenix it's grafana
@dark kestrel you're just creating an object
uh
you need to throw the error object
throw throws whatever object you're passing
so throw new Error() will work
why are you making errors?
just testing the error logs function
oh ok
why are you making errors?
@earnest phoenix there is a purpose for everything
i was just asking
i was just explaining
ok
ok
why thank you i was about to ask
does anyone why the bot doesnt reply with "yrs" even when i mention a channel
or send
why
does it reply at all
no
is the first if condition failing (admin check)
administrator perms for just mention a role???
yes i have admin perms and i did mention a channel
message.content == "setmschannel"
why do you need admin perms for "Mention a channel"
it would only response if you sent setmschannel
you need to add .startsWith()
if (message.content == "setmschannel" || message.content.startsWith("setmschannel") {}
it's fixed
msg.react('❌');
const filter = (reaction, author) => {
return ['❌'].includes(reaction.emoji.name) && author.id !== client.user.id;
};
msg.awaitReactions(filter, { max: 1, time: 30000, errors: ['time'] })
.then(collected => {
const reaction = collected.first();
if (reaction.emoji.name === '❌') {
msg.delete().catch(error => {
})
}
})
.catch(collected => {
const autorReactions = msg.reactions.cache.filter(reaction => reaction.author.cache.has(client.user.id));
try {
for (const reaction of authorReactions.values()) {
reaction.author.remove(client.user.id);
}
} catch (error) {
console.error('Failed to remove reactions.');
}
});
// message.channel.send("❌ Sorry, this command is currently disabled. For more information please contact **Support Server**")
};
I want it to only delete the message who requested it not any user. someone help?
what the hell are you even trying to do pls explain
Instead of checking if the author ID is equal to the client user, check if the original message author ID is equal to the user being filtered
what the hell are you even trying to do pls explain
@earnest phoenix I want it to delete when author reacts not any user wich it does rn
If it's just a static website, open your main html file
if it's a server, like express for example, open your browser and go to localhost:portYouSet
Maybe you aren't importing it correctly
how are you importing it currently?
well idk lol
Your css won't magically work, use the link tag
ah thanks
no it wasent tha
it was linked
i just named it style
not stylesd
styles*
im not too good with that stuff
i have someone workibng with me so dats why
i accidently replaced the wrong file
state your issue
fuck
me ?
Yes
OK
i have developed an global chat bot in python
and i will host it on repl . it
but i need an keep_alive file and i must import flask for that
Can't you just ping the project every X minutes?
Traceback (most recent call last): File "main.py", line 8, in <module> from keep_alive import keep_alive ModuleNotFoundError: No module named 'keep_alive'
thats the error
Can't you just ping the project every X minutes?
@slender thistle no
uhh why do you need a keep_alive
look
`from flask import Flask
from threading import Thread
import random
app = Flask('')
@app.route('/')
def home():
return 'Online'
def run():
app.run(
host='0.0.0.0',
port=random.randint(2000,9000)
)
def keep_alive():
'''
Creates and starts new thread that runs the function run.
'''
t = Thread(target=run)
t.start()`
that is my code in keep_alive
and idk from what the error comes
huh
no
@next glade repl.it kills ur bot if it’s inactive after a certain period of time
@earnest phoenix imao my bot is not inactive
I know, manny
There's no keep_alive module though
@next glade Can you send the full traceback you get?
yeah
its only that form
Traceback (most recent call last): File "main.py", line 8, in <module> from keep_alive import keep_alive ModuleNotFoundError: No module named 'keep_alive'
here
you're importing a module that doesn't exist apparently
must i do import keep_alive ?
no
i mean where are you trying to import
keep_alivefrom
@jovial void idk
then you should get rid of it
idk what you're trying to do with keep_alive since its not anything you've made or on PyPI
I can't help you with that since idk how to do it, google is your best friend there. But you can't just import random things, they have to actually exist, so go look at some PyPI packages and see which ones you want to do
preferably ones that are async since dpy is an async library
I need some help with configuring this, I don't really understand how to do it. Any help on it?
https://ramblings.fred.moe/2020/3/tunnelbroker-with-lavalink
in node.js how can i check if x/y returns a full number? (not double)
Number.isInteger(x)
thanks
case "numberguess":
var embed = new Discord.MessageEmbed()
.setTitle("Number Guess Started")
.setDescription("Please pick a number 1-100")
.setFooter("Say 'end' to leave the game")
.setColor(color);
message.channel.send(embed);
var rnumber = Math.floor(Math.random() * 100) + 1;
bot.on("message", message => {
if (message.channel instanceof Discord.DMChannel) return;
if (message.author.bot) return;
if(message.content > 100) return message.channel.send("Please choose a number below 100")
if ((message.content) == rnumber && message.author == message.author) { message.channel.send(`Correct, the number was ${rnumber}`);
} else if ((message.content) > rnumber && message.author == message.author) {
message.channel.send(`Your number was too high, try again`);
} else if ((message.content) < rnumber && message.author == message.author) {
message.channel.send(`Your number was too low, try again`);
}})
break;``` whenever the person guesses the number right it keeps going
uh
this is dumb but help
I-
lol
how can i finish this so it sends a msg to the channel
also shouldnt i be doing (`id`, channelID)?
client.channels.cache.get(channelid).send(message)
oh right lmao
doesnt work
whats the error
ok
bot developer perm pls
@gentle lynx reminder that cache.get() might not always return
if guild doesnt return you'd be doing undefined.channels which would throw error
use conditional or check for it
How can I configure the Lavalink to have more IPs? I already used tunnelbroker but I don't understand what to add to the code
you dont
server:
# ...
ratelimit:
ipBlocks: ["1234:1234:1234::/48"]
strategy: "LoadBalance"
searchTriggersFail: true```
add that to the config file but with the correct block
I use a .env
lavalink config
That's where like the Lavalink_host goes
not your bots config
So make a lavalinkconfig?
Yeah
you should have a application.yml file
server: # REST and WS server
port: 2333
address: 0.0.0.0
lavalink:
server:
password: "youshallnotpass"
sources:
youtube: true
bandcamp: true
soundcloud: true
twitch: true
vimeo: true
mixer: true
http: true
local: false
bufferDurationMs: 400
youtubePlaylistLoadLimit: 6 # Number of pages at 100 each
youtubeSearchEnabled: true
soundcloudSearchEnabled: true
gc-warnings: true
#ratelimit:
#ipBlocks: ["1.0.0.0/8", "..."] # list of ip blocks
#excludedIps: ["...", "..."] # ips which should be explicit excluded from usage by lavalink
#strategy: "RotateOnBan" # RotateOnBan | LoadBalance | NanoSwitch | RotatingNanoSwitch
#searchTriggersFail: true # Whether a search 429 should trigger marking the ip as failing
#retryLimit: -1 # -1 = use default lavaplayer value | 0 = infinity | >0 = retry will happen this numbers times
metrics:
prometheus:
enabled: false
endpoint: /metrics
sentry:
dsn: ""
# tags:
# some_key: some_value
# another_key: another_value
logging:
file:
max-history: 30
max-size: 1GB
path: ./logs/
level:
root: INFO
lavalink: INFO
which looks a bit like this
Possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit Hmm, how can ı set the limit of events?
I know
you only need one for your commands
so i want to add a role to a member with this code
nvm
or
how
like i cant do .addRole
.roles.add(`Role ID`)
Yeah
.roles.add(role)
Hello
Question
I want to make my bot delete messages that has bot invites.
Am I supposed to make an event or what?
For the server part and password, it's on the .env I don't have an application.yml
You use a normal message event and delete anything starting with https://discord.com/api/oauth2/authorize?client_id= or something like that @feral aspen
I'm using a command handler, do I create a command and what I do then?
@still merlin ?
if guild doesnt return you'd be doing
undefined.channelswhich would throw error
@opal plank what about in this case?
Create a normal file and do stuff ok, I'm not gonna spoonfeed you
Like Im trying to make a settings command to disable link blocker and enable
Create a normal file and do stuff ok, I'm not gonna spoonfeed you
@still merlin Rude, didn't ask for spoonfeeding, just asked in summary
You need a database for that
You need a database for that
@still merlin Alright? I know..
so message event, alright then.
Just do your normal command files, Check if the guild has disable bot invites true/on or whatever your using and delete anything starting with the bot invite things (https://discord.com/api/oauth2/authorize?client_id=)
Hi can I get help?
There a error getting my bot online using discord.js
but i can try to help u
friends*
send the error
firstt
It says "error token not reconzied"
u dont have a login
don't show us that Token
you leaked your token, regenerate it as soon as you can
I use a different langauge for my bot with me having a databse I had to change the whole scripts for blacklisgt
are u using discord.js or it just discord.io
because, it seems has some different things
can i get help with an nsfw api
i want to add more things to my bot
so im ading nsfw
I can't help you for that NSFW. but, for api, please ask it here #topgg-api
.js
oh right
@knotty quartz show me the code, and the error
don't leak your token again.
then where it the api
find one
yes, googling
i was searching on npm
frick
Error 503 Backend fetch failed
Backend fetch failed
Guru Meditation:
XID: 15410069
Varnish cache server
what's the guild member join event called
@knotty quartz show me the code, and the error
@open rune I just change my token well discord did can you go to DM's please?
i found this
guildMemberAdd?
@slender thistle is that allowed 
lieke if u put on browser doesnt work
so how does the bot do
@slender thistle is that allowed
@thick gull ucant acces
This isn't the server for NSFW API suggestions
Read the rules first
i did
What does rule 12 say
server rules, all the way up
there are so many rule 12's
ok
No NSFW content within the server
but that wasnt nsfw
since u cant acces with a browser
it will just spam u a line of code
Screenshots of NSFW content don't redirect users to NSFW websites. Does that make it more compliant with the rules?
dude
it wasnt nsfw
sice there was nothing there
since*
just go to logs and click the link
it will just apear acces: something
i forgot
but u got it
You're literally linking a resource that's intended to be used to receive NSFW content
okay let me set the auth header and I might get what, a pic of a random cat that's totally child-friendly?
whats a auth header
oh thats why only bots can acces that
oh sorry then im the wrong one
lol
i admit
im wrongº
browsers can access apis too
you just need to set the header
it didnt for me
You can access it yourself if you have a client that can send HTTP requests with custom headers
brain.exe stoped working
you either inject headers with js or use an addon to modify the headers (on browsers)
You can literally inject headers with vanilla JS?
ah yeah I guess
can u help me with api
i just want my bot to be special
it isn't and it won't be
or have a lot of functions
your bot will never be special, that's a fact all bot devs have to deal with
it isn't and it won't be
@earnest phoenix stop being pessimist
the market is oversaturated with huge bots that already do what your bot does, but better
your bot will never be special, that's a fact all bot devs have to deal with
@earnest phoenix what if you code your own api

your bot will never be special, that's a fact all bot devs have to deal with
@earnest phoenix why can't bots be special?
Anything wrong??
inviteblock[guild.id] = {
name: bot.guild.cache.get(guild.id),
value: false
}
fs.writeFile("../../settings/inviteblock.json", JSON.stringify(inviteblock), (err) => {
if(err) console.log(err);
});
}```
so for him
Doesn't seem to writeFile
everything is equal
i've been a senior full stack dev for 3 years
apply water to the burned area
i know more than you do
lol
when a member joins
being optimistic isn't bad so why are u so pessimist @earnest phoenix
i did
dude
u have to dream big to actually make something big
when a member joins he does something
@gentle lynx
@old latch i'm not, i'm stating facts. if you ask anyone with more than 2 brain cells here about bots, they'll tell you that the market is oversaturated
For Lavalink music I don't have a application.yml but I have this inside the .env
@gentle lynx It's only member. To access the guild the member joins, see member.guild
np
I don't know what to do if half of the stuff is inside the .env
what
I have more than 2 brain cells and yes there are many many bots but there still are ideas that haven't been coded by anyone
.env
trust me, there are
It's a secret folder that nobody can access
not everything.
i know what .ulf and .alf files are
no bot is original anymore
do you @earnest phoenix
every single bot is a shallow copy of one another lol
you can't know because it doesnt exist now
i need kick ban command pls
except it does
i need kick ban command pls
@earnest phoenix just do member.kick
or member.ban
@earnest phoenix Rule 8, we don't spoonfeed code here
and u good to go
you will get there
ok sory
sorry
@earnest phoenix Rule 8, we don't spoonfeed code here
@slender thistle yes but you can give a litle had like i did
hand*
this was a huge problem back in 2017 when i was still doing public bot deving and it's even a bigger issue right now
do you really think your bot is original among hundreds of millions of others lol?
dude
this dude has no braincells
what if u code your own api

Keep it civil
its not special
if u did
"code your own api"
it is
do you understand what that means
@earnest phoenix maybe we should drop the topic, I just wanted to say that there are ideas that haven't been created, and if you come here and tell the people that every bot is a copy from another you don't help anyone making those special bots
do you understand what that means
@earnest phoenix yes what you dont do
an API is an umbrella term
wow noshris sherlock
you don't know what an umbrella term is
i know
Keep this discussion civil or drop it as a whole.
you don't understand half of what i'm saying so you're being aggressive lol
Keep this discussion civil or drop it as a whole.
@slender thistle okay then
an API doesn't make your bot special
It makes the project more complex though
i can have an API that exposes how many coins each user's got in my bot's database
So how can I transfer some stuff to the application.yml? Cuz idk if lavalink_host, lavalink_port and lavalink_password should be in there
it doesn't make my bot special
Looks like a good amount
you shot yourself in the foot lol
this proves my point that no idea is original
every idea you come up with is/has existed
no idea is original
Maybe so. But the implementation of an idea can often be novel
are you implying these guys are capable of that
well, depends from what you say the idea is. if you say that no idea is original because all bots are discord bots, true, then all are copies. but do you know how many different stories there can be? how many ways of implementing them into a discord bot? you can make something unique just with this simple idea, I'm sure
Yeah
I meant it more fundamentally though.
For example, an Idea like Time Travel or something
Implementation of that would be completely unique and new. But the idea has existed long before.
For a story bot, the stories and flow would be novel (hopefully)
Yeah
I meant it more fundamentally though.
For example, an Idea like Time Travel or something
Implementation of that would be completely unique and new. But the idea has existed long before.
@faint prism I agree
and if you get that one super cool way of bringing your idea alive with a discord bot, your bot can be special
and that's all I have to say
have a nice day y'all :)
@gentle lynx same thing
check if your .get() is returned before you run the rest of the command
everything’s been done; it’s how can I improve X, not how can I copy X,
there are sill unique things out there
but they are quite niche and not for everyone
for example bots for specific platforms
or for a specific subject
@opal plank lol nvm i fixed it already but thanks
yeah, but most likely the ideas been done tbh
often you can improve it
that’s what i find /shrug
you have to dig deeper xD
fair thank you goodbye
I've read a lot of things about Discord Channel Positions.
I was basically trying to order channels, but some times Discord would put the channels in an absolute random spot.
It seems like if there isn't consistency when setting a position of a channel?
Can someone confirm me that this is an API issue and not an issue of the library I'm using (discord.js)
Is there a way to order channels even with this strange Discord behaviour?
Discord channel ordering was a clusterfuck for me. It was very inconsistent with a few channels on my private server between multiple devices
But yeah u‘re able to edit its position
it's an API issue
You guys ever investigated that?
i couldn't ever figure out how it works
i couldn't ever figure out how it works
me neither
Just always set the position when creating a channel.
@boreal iron I give the positikn to the channel when I create it + I manually set it again after creating it. This fixes most of the problem but there still are cases where it doesn't work correctly
🤔
How do I send a channel to dm?
<#ChannelID> I suppose
Ah ok
send a channel to dm
what
I wane to make channel in dm
of course you have to replace channelID with the actually channel ID
Oh
The bot doesn't send any reply, why tho?
const Discord = require('discord.js');
const client = new Discord.Client();
const token = "<token>";
client.on("ready", () => {
console.log('${client.user.tag} jest gotowy');
client.user.setActivity("na siłowni na strychu");
});
client.on('message', async message => {
if(message.author.client) return;
if(message.channel.type === "dm") return;
let randomMessages = [ `bo tak`, `ja tam nie wiem`, `spytaj się boga ojca wszechmogącego`, `w internetach poszukaj`, `a co ja jakaś encyklopedia jestem?`, `bo ja tak powiedziałem i tak ma być`, 'nie chcesz wiedzieć...', 'no bo wiesz no... :sunglasses::call_me:'];
if(message.content.includes("sikorze" && "czemu")) {
message.channel.send(randomMessages[Math.floor(Math.random() * (randomMessages.length - 1))])
}
});
client.login(token);
&& can't be applied to a string like that as the first one always returns truthfully.
If you want to see if it starts with X or Y, you should do the expression twice: if (includes("one") || includes("two")) {...}
Also message.author.client points to the client user just so it's easy to access.
If you want to block bots, use message.author.bot to see if the user's a bot instead.
Hey guys I have one fast question.
what is it
Can a bots prefix be set to &
yes
i think so
okay, thanks!
I had some problems in the past where I couldn’t use alphabetical characters.
ohh
could i do somthing like this instead?
if(message.content.includes("sikorze") {
if(message.content.includes("czemu") {
//rest of the stuff
}
}
A bots prefix can be anything, you're just checking if a string has a string
Yes, but that's just another form of writing: if (message.content.includes("sikorze") && message.content.includes("czemu"))
so it wouldn't work either?
It would work.
I worked on this for a while and I finally made my scripting language be able to make commands without arguments.
I made the scripting language like Skript:
on message:
if "%args%" is "test":
send "hi"
hehe
But there are two issues in your code I spotted
The second one being if (message.author.client) return;
Do you use Python's is
yeah, already fixed this
or is it your equivalent of Python's ==
Yes
Why
The is keyword is used to test if two variables refer to the same object.
Yes, it's just a shortcut for: if id(obj1) == id(obj2)
well, what if i want my bot to respond to these message even if they are uppercase?
rely on lowered message content
make the content lowercase
Make it lowercase
what is the text stuff called like `${stuff}blahblah`?
string interpolation
I was playing with my scripting language's code and I made it so you can actually have arguments now.
on message:
if "%args 1%" is "!test":
send "%args%"
i have no idea how i made the limits actually work (im gonna make this scripting lang in a public bot) but it works so ill take it it doesnt work...
Can I use py with html? And mongo?
what do you mean can you use py with html?
Yes
Right?
Yes
You can't use Python in frontend
theoretically you can with WASM
and i have to manually do the > because for some reason i got the inline replies update but i can't send inline replies lol
lmao
Let's switch places you give me inlines
anyone know a good, stylish and colourful logger for nodejs
Why not just use chalk for the color thing
chalk i see
Chalk is great, but do you really wanna write all your logs on the driveway?
what if it rains?
joking btw ;p
Bro Chalk++, better for the environment and easier to use
I'm getting this error after I added application.yml
Error: Request failed with status code 503```

Yeah Ik, but after I add it and try to play a song it'll throw an error
But when I delete it, it'll work fine
:BC_AmongUsPepe:
@ancient nova #memes-and-media or general cuz mods will prob warn
This was the first time
Ah, ok ok, lemme re phrase... databases make me want to neck, i don't understand them one single bit.
what dont you understand
Yeah
40333 / 60 = 672.2166666666667
how do i make it happen? 40333 / 60 = 672.22
use .toFixed
Ok someone got a comand idea?
game commands are fun
What is your bot about
general purpose
@solemn latch every fucking part of them, Honestly been sat here for a whole day trying to figure out how to 1) get it to work, and 2) how to put it into the command
hmm then I can't give a good one
Something tells me it's SQLite?
Lol
If you're having a hard time with databases you can use an ORM to make your life easier.
@slender thistle Run “avioshivaco” in testing please
But learning how to use them rather than reading for the alternative is a better choice.
:p
i did look at Mongo @slender thistle but then decided to just go about doing it in i think the worst way possible because now i'm more confused than when i first started -_- i'm like a kitten with a yarn ball...
eh
dont know mongo at all tbh
mongo is fairly easy to set up
they have a whole amazing set of guides on their website iirc
even video tutorials if that helps
no clue on it,
i'm at this stage and honestly i just realised it only works if i have a db to put into it
@client.event
async def on_message(message, ctx):
amountofmessagesper5seconds(message.author.id) += 1
start = time.time()
time.clock
elaped = 0
while elaped < 5:
elaped = time.time() - start
amountofmessagesper5seconds(message.author.id) = 0
if amountofmessagesper5seconds(message.author.id) == 5:
await ctx.message.delete()
await ctx.message.delete()
await ctx.message.delete()
await ctx.message.delete()
```why does thing not work (discord.py)
whats not working
Error^
or, if no error, whats supposed to happen, and whats not happening
1 sec
this is the error
does it think amountofmessageper5seconds(message.author.id) is a function and if it does how do i fix
well is it a function
Then why are you calling it like one
thing(otherthings)
is typically a function layout afaik
cause i want it to be for the same user and not for all users
Okay, can you show us what it's defined as
amountofmessagesper5seconds(message.author.id) = 0
also on_message doesn't have a second parameter, so the ctx parameter does not make sense
message
some of your code just doesn't make sense, like the declaration of that variable
message.delete()?
some of your code just doesn't make sense, like the declaration of that variable
@sudden geyser im stoopid please let me know of any mistakes
most people consider bots not a first project type of thing
Am I doing something wrong?
https://ramen.is-inside.me/rAgCy6f4.png
https://ramen.is-inside.me/oICkFjXb.png
mongoose op
im trying it compared to my normal enmap
@violet mesa,
- You can't declare a variable like a function call. You define them as
my_variable = my_value, soamountofmessagesper5seconds(message.author.id) = 0makes no sense. - When you use the
+=operator, you're usually assigning a new value to a variable, method or something that implements one of the magic methods. - What is
time.clocksitting around there for?
If you're new to Python, i recommend you take the time to learn it, as there are several errors in your code that only take a few seconds/minutes to debug.
enmap is basically persistent collections
oh that i didnt know that
How would I set the @everyone permissions?
message.guild.channels.create(`${message.author.username}-vs-${found_user.username}`, {
reason: `a match has started between ${found_user.tag} and ${message.author.tag}.`,
type: "text",
parent: client.channels.cache.get(config.matches_category),
permissionOverwrites: [
{
id: message.author.id,
allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'EMBED_LINKS', 'ATTACH_FILES']
},
{
id: found_user.id,
allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'EMBED_LINKS', 'ATTACH_FILES']
}
]})
I'm trying to set channel permissions for @everyone but I can't seem to figure out how to do it
I tried finding the role with .find but when adding it to the permissionOverwrites array it said that it has to be a role ID
the role id is the guild id
hwo to see if a user unreacts in msg collector djs?
in any message in the collector?
Why is my bot offline
Who is then
if (reaction.emoji.id === "758896673023590471") {
console.log(object);
return;
} else if(reaction.emoji.name === '1️⃣') {
object[1] = true;
} else if(reaction.emoji.name === '2️⃣') {
object[2] = true;
} else if(reaction.emoji.name === '3️⃣') {
object[3] = true;
} else if(reaction.emoji.name === '4️⃣') {
object[4] = true;
} else if(reaction.emoji.name === '5️⃣') {
object[5] = true;
} else if(reaction.emoji.name === '6️⃣') {
object[6] = true;
} else if(reaction.emoji.name === '7️⃣') {
object[7] = true;
} else if(reaction.emoji.name === '8️⃣') {
object[8] = true;
} else {
}
ive got this
if the user unreacts how to make it so the object becomes false
im confused, you said message collector?
Look at pic
How long will it take
Nooooooooòooo
@silver lintel might be this https://discord.js.org/#/docs/main/stable/class/ReactionCollector?scrollTo=e-remove
o thanks
var member = message.mentions.users.first() || bot.users.cache.get(args[0]);
let joinedON = member.joinedTimestamp
joinedON is returning the current date, but i joined the server wayyy before today
not sure why it would give you anything at all though tbh
user doesnt have .joinedTimestamp
hm
when i use mentions it returns the current date/time
but when i use id with what you told me it says cache isn't defined 
yeah, Client.members doesnt exist since it doesnt know what members to get from what guild.
youd want to use guild
not sure what version of mongo you have https://api.mongodb.com/python/current/tutorial.html
nope
oath2
oauth should be looked into on the discord site
wut does that do/mean?
its pretty complex stuff imo
ok
theres not really any discord specific tutorials afaik, just general oauth2 tutorials
and for scopes, i can use them for like seeing if my bot is on the user's servers
and like a list so they can join them?
yeah, you can do that with oauth2
So as i made functions on my npm package, this is the JSDoc of the createProgressBar() function and as you can see, the data type for the third parameter is ?Object which means optional object, but if you try to use the function, it says any, what's the issue here?
Everything in JS is an object
At least I assume that's the reason it says any.
One solution would be to use @typedef to document how the object's keys and values should be passed, which will be a better experience when reading documentation.
Oh k, thanks
JDABuilder JD = new JDABuilder();
Package pkg = JD.getClass().getPackage();
String version = pkg.getSpecificationVersion();
Shouldn't this give me the package version? 
It should, have you tried it?
{
"response":{
"game_count":4,
"games":[
{
"appid":400040,
"playtime_forever":0,
"playtime_windows_forever":0,
"playtime_mac_forever":0,
"playtime_linux_forever":0
},
{
"appid":252490,
"playtime_forever":0,
"playtime_windows_forever":0,
"playtime_mac_forever":0,
"playtime_linux_forever":0
},
{
"appid":700580,
"playtime_forever":0,
"playtime_windows_forever":0,
"playtime_mac_forever":0,
"playtime_linux_forever":0
},
{
"appid":730,
"playtime_forever":0,
"playtime_windows_forever":0,
"playtime_mac_forever":0,
"playtime_linux_forever":0
}
]
}
}
I'm pulling data from the json above. I passed it to a for loop, but I get an error.
const derece1 = [];
for (var i = 0; i < oyunlar.response.games.length; i++) {
const xxx = `https://store.steampowered.com/api/appdetails/?appids=${oyunlar.response.games[i].appid}&l=turkish&cc=TR`;
let haha = await fetch(xxx).then(url => url.json()) derece1.push(`${haha[oyunlar.response.games[i].appid].data.name}`)
}
embed.addField('Oyunlar', derece1.length ? derece1.join('\n') : "Yok.",false)
my goal is to get a name based on the appid number.
TypeError: Cannot read property 'name' of undefined
It should, have you tried it?
@sudden geyser returnsnull

im just reading this now https://stackoverflow.com/questions/2712970/get-maven-artifact-version-at-runtime

hi guys how to fix code 500 on glitch??
5xx errors are server related
what would be the best os to create a bot in?
you should probably just wait
@native folio there is no "best" os, it comes down to your preferences and needs
ok, thanks
@earnest phoenix you have an invalid app id
everything seems right
Hiya!!-Question: Do welcome messages need server member intents?
@earnest phoenix
@green vale without the members intent you will not receive guildMemberAdd events
however its still possible to make welcome messages by listening to the built-in system welcome message in the message event
Fair, fair. I'd just like to make sure, as I'm applying for whitelists and I'd like to keep it straight-forward. Thank you!
My codes are not working
Help me
I am coding on glitch.com
It's the link join and see my errors
One message removed from a suspended account.
@earnest phoenix you can ask for help with your code but you cannot ask someone to just join your page and fix it for you
you can share snippets here by copy and pasting and putting things in codeblocks (with three ` on either side)
be aware as per #rules-and-info we do not spoonfeed here, which means that we do not give you code, we are here to gently guide you in the right direction
You also might want to regenerate your token now.
@earnest phoenix might unless they're too dumb to follow simple instructions
@oak cliff read that again I have just asked to see the errors not to fix it that's all
@oak cliff ok
@oak cliff const Discord = require("discord.js");
const { prefix, token } = require("./package.json");
const client = new Discord.Client();
client.once("ready", () => {
console.log("Ready!");
});
client.on("message", message => {
if (message.content === ${prefix}goodmorning) {
message.channel.send("Good morning @everyone Stay Happy!.");
} else if (message.content === ${prefix}goodnight) {
message.channel.send("Good night @everyone Stay Safe.");
} else if (message.content === ${prefix}server) {
message.channel.send(
Server name: ${message.guild.name}\nTotal members: ${message.guild.memberCount}
);
} else if (message.content === ${prefix}user-info) {
message.channel.send(
Your username: ${message.author.username}\nYour ID: ${message.author.id}
);
}
});
I'm not going to help you
@oak cliff ok
but someone else might, so please stop pinging me
I didnt say to ping me
is it pointless to use D3.js for a game
can anyone teach me how to use Electron?
Formatting Guide:
```<short name of the language>
code
```
-> For JS:
```js
console.log('Hello world!');
```
->
console.log('Hello world!');
Basically it works with any 2/3 charaters long language names which exists. there are few exceptions: for example you need to use csharp instead of c# for C# code formatting.
Isn't it cs for c#?
what the hell is happening with my reactions
Isn't it cs for c#?
@cinder patio it's an alias
nice but where's json database 
WHY DOES GOOGLE KEEP MAKING ERRORS ON LOGINS
hehehe
document.getElementsByTag is not a function smh
TagName
i used npm i haileybot/captcha-generator
but still getting error
Cannot find module 'haileybot/captcha-generator'
try @haileybot/captcha-generator
is it installed in the node_modules of the CURRENT directory?
look in your node_modules folder and see if it's even there
HI
try installing it again and make sure you're in the directory node_modules is in
ok
ok
@pale vessel Cannot find module 'C:\Users\gamin\OneDrive\Desktop\captcha bot\node_modules\@haileybot\captcha-generator\dist\index.js'. Please verify that the package.json has a valid "main" entry
setInterval ain't working on browser javascript
ah nevermind explicit variable stuff inside the callback which gets executed with no arguments
what do you guys think of this waste of firebase's resources: https://this-is-a-cool.web.app
target.addEventListener(type, listener [, options]);
target.addEventListener(type, listener [, useCapture]);
target.addEventListener(type, listener [, useCapture, wantsUntrusted ]);
what the hell is wrong with the commas MDN we need to discuss smth
how do i make uptime command so i can see how long the bot has been online?
@earnest phoenix there is a way to check the uptime of the client in discord.js
client.uptime
it returns a Date
not a String
keep that in mind
okay
@earnest phoenix actually it's a number
sounds weird for a date
because it's the number of milliseconds the bot has been up not like hours days or smth
it's inside [] since it's optional, what's wrong with it?




