#development
1 messages · Page 1359 of 1
function funTranslation(text, emoji){
if(text == "" || text == null || text == undefined || text.includes("<!DOCTYPE")) return msg.channel.createMessage("Translation failed.");
if (text.length > 200) { return msg.channel.createMessage(text); }
msg.channel.createMessage({ embed: {
color: 0xFFFFFF,
description: emoji+" "+text - message.member.mention
}});
?
add a " " around the - and add + around the minus
description: emoji + " " + text + " - " + message.member.mention
:///////////////////
if(text == "" || text == null || text == undefined || text.includes("<!DOCTYPE")) return msg.channel.createMessage("Translation failed.");
if (text.length > 200) { return msg.channel.createMessage(text); }
msg.channel.createMessage({ embed: {
color: 0xFFFFFF,
description: emoji+" "+text + "-" + ${message.member.mention}
}});```
code?
if(text == "" || text == null || text == undefined || text.includes("<!DOCTYPE")) return msg.channel.createMessage("Translation failed.");
if (text.length > 200) { return msg.channel.createMessage(text); }
msg.channel.createMessage({ embed: {
color: 0xFFFFFF,
description: emoji+" "+text + " - " + message.member.mention
}});
}```
Does the property message.member.mention even contain the <@! ... > code?
did u save?
Is the object name really message.member.mention or probably msg.member.mention ?
what?
i dont think mention is a thing
to grab a member mention you'd have to member.user.toString()
Looks like he defined
msgas const, notmessage
@boreal iron it can be whatever u want it to be, if he doesn't understand it then thats his problem
I know since the basic question for the object name seems to be to hard to understand...
how to use discord webhooks with axios post method?
var axios = require('axios')
var url = "https://discord.com/api/webhooks/.../...."
var content = "ok"
axios(this, {
method: "POST",
url,
headers: {
"Content-Type": "application/json"
},
data: {
content
}
})```
people who are new to programming usually have trouble understanding variable names and how to work with them
as they think these names are somehow hardcoded globals
aye but posting the result will not really bring them forward
There a error
Anyone code in .NET core and could help me with something?
@wicked pivot r u trying to send a webhook?
yes
@wicked pivot #topgg-api But what do wanna do? Sending server_count ?
My bot is saying 1+1=3 but the math code should make the bot do 1+1=2
/channels/<channelID>/webhooks
I
Ugh
Ugly
i didnt change anything apart from msg to message and made emoji and text a string
My bot is saying 1+1=3 but the math code should make the bot do 1+1=2
@earnest phoenix help
code?
bad bot
Why
agreed
😦
because like ever other bot has all countries and some have countries and states for free lol
because like ever other bot has all countries and some have countries and states for free lol
@digital ibex lol but I want to get money
@wicked pivot remove the this from axios
That’s useless without money
lmfaooo
@earnest phoenix nobody needs a covid19 bot..
Do a CoRonny Bot
@earnest phoenix nobody needs a covid19 bot..
@indigo flax if they do
Do a CoRonny Bot
@halcyon pecan what is Coronny bot
@earnest phoenix if you're making a bot for money, you're gonna have a bad time lmao, there are plenty of bots that do the same thing for free
CoRonny is Corona
Can someone tell the code for a function which tells how much hours , minutes and seconds remain for a specific time to come @quartz kindle
Lmao
@earnest phoenix if you're making a bot for money, you're gonna have a bad time lmao, there are plenty of bots that do the same thing for free
@quartz kindle lol no I make them for fun nothing alse
making money from bots arent worth it
my bot is in 1,000 servers
ive only made
$20-50
making money from bots arent worth it
@indigo flax lol
Pog
thats pretty good already
@acoustic veldt https://www.npmjs.com/package/human-duration
nah
SolDeveloper#7124 is a kid want make money with his bot to buy vbucks
$20-50
@indigo flax isn’t that a good
hey
SolDeveloper#7124 is a kid want make money with his bot to buy vbucks
@carmine magnet lol no
I hate Fortnite
im broke as shit
@boreal iron hes using py lol
for discord.py please
oh...
how can I know if you didn't mention?
I hate Fortnite
@acoustic veldt google how to work with timestamps and how to do math with dates in python
@digital ibex anyways can u help me
its not hard, just requires a bit of logic
SolDeveloper#7124 is a kid want make money with his bot to buy vbucks
@carmine magnet lol I think it’s you because I hate Fortnite
I make bots with heart, not for money
I guess with love u mean, lmao
@digital ibex 265156286406983680-772127376528113704
im like the total opposite
show ur code
ok
I make bots with heart, not for money
@carmine magnet I said I make bot for fun no thing alse but my Covid bot has api that’s host me money for hosting
wait
You can have cheap vps
i own a host company :)
so i get free hosting
i use my own host
to host my bots
big brain
I have a really good vps for 3,95€/month its a really good offer for all the performances given
but we still pay $100 a month to keep the host money sooooooooo
best cheap vps is ||your own PC
||
90% of all hosting services out there are basically resellers
@carmine magnet what's the hosting name? And with Linux?
rent a big host, split it into smaller hosts, rent them out
Yeah sounds about right
you use what?
lol
The open-source server management solution.
@earnest phoenix no https://pterodactyl.io
The open-source server management solution.
@carmine magnet thats pretty good
Lmao
providing more and more VM to anyone without any knowledge, flooding the net with more and more bot server... thanks
so small problem, js const obj = { user: '', timestamp: 0, content: '' }; for (const message of messages) { obj.user = message.member.user.id; obj.timestamp = message.timestamp; obj.content = message.content; } when i log obj it just logs the first message
any ideas?
I used to own a hosting business too
@digital ibex you're creating 1 object
@halcyon pecan its a french company called inovaperf, you can install every os you want on ur vps
yeah but shouldn't it be making loads?
then on every iteration of the loop, you are replacing the object's properties
lmao
@carmine magnet that's hot let me check that out
yes
array of objects
@digital ibex 2020-10-31T16:05:06.505481+00:00 app[worker.1]: ReferenceError: message is not defined 2020-10-31T16:05:06.505501+00:00 app[worker.1]: at /app/app.js:81:66 2020-10-31T16:05:06.505502+00:00 app[worker.1]: at processTicksAndRejections (internal/process/task_queues.js:97:5) 2020-10-31T16:05:16.830590+00:00 app[worker.1]: ReferenceError: message is not defined 2020-10-31T16:05:16.830620+00:00 app[worker.1]: at /app/app.js:81:66 2020-10-31T16:05:16.830622+00:00 app[worker.1]: at processTicksAndRejections (internal/process/task_queues.js:97:5)
obj.user[thishere] = message.member.user.id;
Conspiracy theory: GNU stands for GNU's Not Unix. If this is the case, then the meaning of GNU's Not Unix should stand for GNU's Not Unix Not Unix. With this recursive pattern, how could GNU stand for GNU's Not Unix 🤔
change message to msg @indigo flax
ok
how can i send attachment file with embed its not working
any ideas tim?
you can usejs const objects = []; for (const foo of bar) objects.push({ name: foo.name });
2020-10-31T16:07:26.309336+00:00 app[worker.1]: at /app/app.js:81:77
2020-10-31T16:07:26.309358+00:00 app[worker.1]: at processTicksAndRejections (internal/process/task_queues.js:97:5)```
oh yeah ty
officiallylost
2020-10-31T16:07:26.309336+00:00 app[worker.1]: at /app/app.js:81:77
2020-10-31T16:07:26.309358+00:00 app[worker.1]: at processTicksAndRejections (internal/process/task_queues.js:97:5)```
show ur code
If you aren’t using JSON to communicate between nodejs files and you even coding
function translateFunction(lang, string, flag){
if(string == "" || string == null || string == undefined) return msg.channel.createMessage("Nothing to translate!");
translate(string, { to: lang }).then((res)=>{
if (res.text.length > 200) {
return msg.channel.createMessage(`${flag}\n${res.text}`);
}
msg.channel.createMessage({ embed: {
color: 0xFFFFFF, description: `${flag} ${res.text} - ${msg.member.mention}`
}});
}).catch(err => { console.error(err) });
}```
@digital ibex
@quick ridge attachment:attachment, name: "attachment://spotify_idhere.png"
idk console.log(msg.member)
wait no
change msg.member to msg.author
it might work idk
i got this err mate @quartz kindle
im guessing its working?
np
yes
if you want it inside them embed, then you have to .setImage("attachment://file name here")
this photo is missing lol @quartz kindle 😄
Guys I need help. I wrote a message that will say how many users there are: message.channel.send(bot.users.cache.size) and it doesn't work, all it shows is 17 users when there are over 54 guilds and I remember there are 1200 users. I turned intents on, but nothing happened. Please help.
File "bot.py", line 212
elif now.hour >= 18 and now <= 19:30:
@quartz kindle it gives this error
@client.command()
async def current_event(ctx):
now = datetime.now(IST)
if now.hour >= 15 and now.hour <= 16:
await ctx.send(f'Current event is Compete With us')
elif now.hour >= 16 and now.hour <= 17:
await ctx.send(f'Current Event is Pictionary')
elif now.hour >= 17 and now.hour <= 18:
await ctx.send(f'Current Event is The GodLike Radio Show')
elif now.hour >= 18 and now <= 19:30:
await ctx.send(f'Current Event is Team Up With GodLike')
elif now >= 19:30 and now <= 21:00:
await ctx.send(f'Current Event is Talent Show')
elif now.hour >= 21 and now <= 21:30:
await ctx.send(f'Current Event is Poetic Night')
elif now >= 21:30 and now <= 10:15:
await ctx.send(f'Current Event is Talkshow With Team GodLike')
this is my code
you cant use 19:30
you need to either check if hour equals 19 AND minute > 30
or convert the date to a timestamp
19:30 is not a valid mathematical number
then what do I type
yes
hey tim what can i do bro
but that's not making much sense because yo have conflicting times there
its not sending the photo
@quick ridge what is the problem
you removed the file
now.hour >= 18 and now.hour == 19 and now.minute <= 30
this will not work u mean ?
i cant do anything its module
can you put ./ in attachment://
if its equal do 19, then it is automatically bigger than 18, so that bigger than 18 is useless
@quick ridge you should only give your file a name, not a path in the MessageAttachment constructor (i think)
@quick ridge to send attachments in embeds you need both the file and the embed
before you had the file
you just had to add it to the embed
but you removed the file
and then attach it with the attachFiles method
you dont even need to use attachFiles
oh i didnt know that-
he was doing this before #development message
which is using a raw embed instead of the embed builder
its still not working @pale vessel
@quick ridge you are mixing things up
doing half one thing half another thing
what do you want t use? the MessageEmbed or a {embed:{}}?
its just a module i do not anything
you are lol
module its doing this photo i don't know canvas ¯_(ツ)_/¯
the problem is not the module
is what you are doing
do you want to use MessageEmbed or {embed:{},files:[]}?
both will work
I want to embed the picture I created with canvas.
you're not answering my question
then use .attachFiles([attachment])
@quartz kindle so how do I put it like its between 18 to 19 30
whats the exact statement
its just simple math
Your statements doesn't make sense anyway
await ctx.send(f'Current event is Compete With us')
elif now.hour >= 16 and now.hour <= 17:
await ctx.send(f'Current Event is Pictionary')```
its sending like this now
if hour == 18 or (hour == 19 and minute < 30)
did u ask yourself what happens if it's for example 16 o'clock
@boreal iron I was going with 24 hour clock
I'm gonna try to explain it again...
if now.hour >= 15 and now.hour <= 16:
elif now.hour >= 16 and now.hour <= 17:
Both statements check if hour == 16 (and if < and >)
ty you soo much mate ❤️
@acoustic veldt what he means is that if the time is 16:00, then both lines are true
<= means smaller and/or equal
sorry that i am bad my english is not very good
16 is bigger than 15, and equal to 16, yes, but 16 is also equal to 16 and smaller than 17
same happens for the next hours, too looking at your elseif statements
@quartz kindle Don't u get exhausted by dealing with this kind of issues "every" day?
help
my status isnt working
it always worked
bot.editStatus("online", {
name: !t help | Watching ${bot.users.size} users.,
type: 0
})
})
name: `!t help | Watching ${bot.users.size} users.`,
type: 0
})
})```
how is it not working
@boreal iron surprisingly not really
2020-10-31T16:42:39.817027+00:00 app[worker.1]: from pytz import timezone
2020-10-31T16:42:39.817044+00:00 app[worker.1]: ModuleNotFoundError: No module named 'pytz'
@quartz kindle it is not importing modules
you need to install it using pip
I did
where are you hosting?
hey
can someone help me
module.exports = {
name: 'suggest',
category: 'Utility',
description: 'does suggestions',
usage: '!suggest',
run: async (client, message, args, member) => {
let Suggestion = args.join(" ");
if(Suggestion.length > 2048) return message.reply("Suggestion to big.")
let embed = new MessageEmbed()
.setColor('BLUE')
.setAuthor(`${member.user.tag}`, message.guild.iconURL({type: "png", dynamic: true}))
.setDescription(Suggestion)
.setTimestamp()
let Suggestionschannel = message.guild.channels.cache.get('772122849669808178')
Suggestionschannel.send(embed).then(message => {
message.react('👍'),
message.react('👎')
})
}
}
it says user cannot read property 'user' of undefined
idk what i did wrong
define member
its working without the ${member.user.tag}
define member
okay
Do what flaze told ya
@pale vessel
thx
how could this happen to me lol
i just put message.member.user.tag

how to make the list of guilds where the bot has permission to send a message
@wicked pivot by filtering the guild array
@stable eagle that I know well but to proceed? js console.log(bot.guilds.filter(r => r.members))
bot.guilds.cache.filter(r => !r.me.hasPermission('SEND_MESSAGES'))
@quartz kindle heroku
@stable eagle thx
@acoustic veldt do you have a requirements.txt file?
yes I added that to it and now it worked
@hollow sedge but I have a new error now
it says that module date time does not have any attribute as now
how to locate a certain information example: "hi, how are you?" retrieve what has before the ","
how to make the bot to remove a specific role when a specific reaction removed ?
@clear elbow .py ?
I mean are u using discord.py ?
Remove from a member or a server
this is my code
i want to remove the role of the member that takes the reaction back
how to locate a certain information example: "hi, how are you?" retrieve what has before the ","
@wicked pivot string.indexOf(",")
Python: string.index(",")
@acoustic veldt that's because it's datetime.datetime.now()
oh okay
@slender thistle js
@hollow sedge and also
can you tell how to make a function where the user can make its on embed
library developer
I didn't code discord.py so your sarcasm is irrelevant
how bot's presence isnt working
@slender thistle it's a joke but ok
it always work
I know how to add message and title for the embed , but I dont know how can I set it to a channel
@hollow sedge
can you tell how to make a function where the user can make its on embed
@acoustic veldt yes one sec
You mean users sending their own customizable embeds?
@acoustic veldt take the arguments for the embed as command arguments
And use this: https://discordpy.readthedocs.io/en/latest/api.html#embed
@slender thistle yes
You could possibly use a separator instead of relying on command arguments
yes I took
@client.command()
async def announce(ctx, title : str, message : str)
``` @hollow sedge
It's already a str lol
and force users to use the command like .embed title="etc etc" | description="qweqwe"
That should work though
I neet help.
with
@slender thistle sadly I use discord.py 
@acoustic veldt yes so just use the variables title and message and create your embed with them
I too use discord.py
making the bot only with out me having to neet the script open.
and I can literally write a script to handle that no problem
So what's the problem?
like this right ?
Well no need for the f-string
No need for the f-string
and definitely no need for title = ... if you don't modify it
I want to take the input as channel
and send it to that channel
if it is possible
channel: discord.TextChannel in command arguments
hi anyone know why this doesnt giv the corect count ? message.guild.users.cache.filter(m => !m.user.bot).size
Yeah just use what @slender thistle said
@hollow sedge yeah
hi anyone know why this doesnt giv the corect count ?
message.guild.users.cache.filter(m => !m.user.bot).size
@earnest phoenix How incorrect is it?
okok
totaly not corect
iv 10 users in server and it says there are only 2
m.bot
channel.send(embed=embed)
not m.user.bot 🤔
okok
actually wtf is that
Because otherwise it will just send it to the channel that the command came from
IDK but I always forget a "," after title and description 😅
was messing a bit
Oh, so it's guild.members in your code?
message.guild.members.cache.filter(m => !m.user.bot).size
@acoustic veldt those are just arguments lol
yh this doesnt work
You always need a , to separate them
it givs i hve 2 users in my server
Try outputting size of the member cache and compare it
Are you sure you have the guild_members intent enabled?
i only get my (message author) and bot info
@client.command()
async def announce(ctx, title : str, message : str, channel : discord.TextChannel):
embed = discord.Embed(
title = '{title}',
description = '{message}',
color = discord.Color.orange()
)
channel.send(embed=embed)```
it only count me and the bot
final code ?
The variable is already holding a string
oh okay
(Also PEP8 please)
anything else ?
yeah I realised that and changed it
It shall be done
does this look right at all ?
sql = "DELETE FROM BlacklistedUser_IDs WHERE User_IDs = VALUES(?);"
cursor.execute(sql, (member.id))```
Is your column named User_IDs?
yes
Then it should work unless your package requires you to also commit the changes
The discord servers on the left 😆
Is there a way to tell how much time is left for a specific time to come (in discord.py)
like a countdown thing
Use the datetime module
I have it imported 
You can subtract the later time by now
datetime object +- timedelta object = new datetime object
+-?
lol
either + or -, whichever you need
Today I have a Halloween horror story for you all:

Oh
lol
from datetime import datetime, timedelta
>>> datetime.now() * timedelta(minutes=5)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for *: 'datetime.datetime' and 'datetime.timedelta'
>>> datetime.now() / timedelta(minutes=5)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for /: 'datetime.datetime' and 'datetime.timedelta'
>>> datetime.now() - timedelta(minutes=5)
datetime.datetime(2020, 11, 1, 0, 7, 0, 397258)
>>> datetime.now() + timedelta(minutes=5)
datetime.datetime(2020, 11, 1, 0, 17, 2, 250035)
@Client.command()
async def current_event(ctx):
now = datetime.datetime.now(IST)
if now.hour >= 15 and now.hour <= 16:
await ctx.send(f'Current event is Compete With us')
elif now.hour >= 16 and now.hour <= 17:
await ctx.send(f'Current Event is Pictionary')
elif now.hour >= 17 and now.hour <= 18:
await ctx.send(f'Current Event is The GodLike Radio Show')
elif now.hour >= 18 and (now.hour >= 19 and now.minute <= 30):
await ctx.send(f'Current Event is Team Up With GodLike')
elif (now.hour == 19 and now.minute <= 30) and now.hour <= 21:
await ctx.send(f'Current Event is Talent Show')
elif now.hour >= 21 and now.minute <= 30:
await ctx.send(f'Current Event is Poetic Night')
elif (now.hour == 21 and now.minute <= 30) and now.hour <= 10:
await ctx.send(f'Current Event is Talkshow With Team GodLike')```
whats wrong in this
what's IST?
its Indian standard time
I used it to define time
IST = pytz.timezone('Asia/Kolkata')
IST.zone```
I am an Indian 😅
oh fuck off Python, where's my country's timezone
@acoustic veldt what's the error?
no error
it just doesnt work
and it also spoils the whole code without letting anything else also not work
@Client.command
Is this capitalized in your variable declaration?
Is client capitalized
when I type _current_event
it doesnt show anything
and when I check heroku logs
it doesnt show anything too
That doesn't make sense
Your bot must be starting improperly
Could you send your file where you are starting your bot?
you mean the procfile ?
No I mean bot.py or main.py
ok I will send file without the TOKEN
In discord.js, how can I check that a user entering a server has not already entered before?
because NaN is not a number
@balmy knoll the only way to do that is if you save in a database every user who enters it
Ok I regenrated token
np :)
@acoustic veldt ok good im still looking for the error rn
bot.channels.cache.filter(r => r.me.hasPermission('SEND_MESSAGES')).size```
```(node:26068) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'hasPermission' of undefined```
@acoustic veldt found the problem
you're trying to use something that requires a number but is not getting a number, likely because of trying to do math with non numbers, or having undefined or null vaiables
you have an on_message event and you are not processing commands after running everything there
but you have to find it out yourself, there is no indicator whatsoever on where the problem may be from those logs alone
@acoustic veldt
maybe if you post your code, i can try to find it
@acoustic veldt you need to add client.process_commands(message) at the end of the on_message event
because you are overwriting the default event
at what line
at the bottom of on_message
@wicked pivot channels have no .me
im not going to tell you exactly which line lol
@acoustic veldt at the end of this function
r.hasPermission('SEND_MESSAGES') ?
@hollow sedge can you tell the exact line of code
@hollow sedge that's the most asshole move ever
@hoary hill if i was an asshole, i wouldnt have helped this guy as much as i did
@wicked pivot channels dont have permissions
@hollow sedge aWAIt IT
295014158771159040 that's the most asshole move ever
@hoary hill we are here to help people, not do everything for them
@hoary hill i already told you what to do
... and you say they're an asshole?
but you have to find it out yourself, there is no indicator whatsoever on where the problem may be from those logs alone
@quartz kindle
maybe if you post your code, i can try to find it
@quartz kindle
dude why are you even in this channel then
lmao
Oh good luck getting help with those
nobody here uses discord bot maker
You might wanna ask in the DBM server instead
go look for help elsewhere
No one who is actually good at using it
no one who is good at anything actually uses it
What does DBM syntax look like
But do you have custom code in your bot
Or really, access to the part of the code where you think the error occurs
well, the least you can do is show us something, like what changes you made
otherwise there is nothing we can do to help
do you have any custom code in some event listener?
like on message, or on presence update
keep removing things until it stops
then add them back one by one
inb4 removes everything and it still occurs
(forgets to save after all changes ftw)
not as hard as trying to guess whats going on for someone else who provided 0 information
guys can i ask a question?
P.S. you already did
Ask away
P.P.S. just ask your question instead of asking if you can ask one
can you disable these plugins instead of disabling your commands?
and see if it stops
P.P.P.S. it's easier and saves time for everyone
do these plugins have code in them that could be edited?
Abolish bot makers kek
does dbm have any way to configure events or intents?
do you know if presenceUpdates are being received and processed?
do you have presences intent enabled in your bot's dev portal?
do you have some kind of loop or some function that does something a lot of times at once, or to a lot of people at once?
do you have stuff that runs as soon as the bot logs in?
does anybody here use pm2 or nodemon?
i use pm2
hey
anyone having issues with discord-player?
there seems to be compatibality issues
i keep getting errors from "Player" token '??' is missing
@quartz kindle i tried using both pm2 and nodemon and both cause my bot to not display a status that i set. when i just start it regularly with node . , it works perfectly
do you have the same issues?
nope
i think that's the point
@crystal wigeon whats your node.js version?
12.16.3
@quartz kindle
and ytdl says every yt url i provide is not available >.>
but if i directly paste the url in ytdl it works but if i send it as args it doesnt work like wtf??
if i pass the same link to ytdl(url, {filter: "audioOnly" })
it works
like wtf?
One message removed from a suspended account.
One message removed from a suspended account.
me too
lmao
i remade microsoft.extensions.dependencyinjection in typescript because i love oop 
One message removed from a suspended account.
let stat = client.guilds.cache.get("734707332163829780").members.fetch("735147814878969968").presence.status
``` this is giving the error
yeah i can't find it
One message removed from a suspended account.
how to resolve it?
that's what i used to do during quarantine lol
One message removed from a suspended account.
hello
take a guess @tired panther
i want help in discord.js
capture the flag @sage bobcat
One message removed from a suspended account.
message.client.users.resolve(mystatus);
no no
The Hacker101 CTF is a game designed to let you learn to hack in a safe, rewarding environment. Hacker101 is a free educational site for hackers, run by HackerOne.
how i can make guess game?
One message removed from a suspended account.
literally just await it lol @tired panther
there's a ton of CTFs like this, browse around for some
i want make guess game like dank memer how?
literally just await it lol @tired panther
@earnest phoenix does not work
what's your code
hey I'm fairly new to discord bot programming, I've wrote a bot with the JDA API and want to host it now. Can anybody suggest me a way or a service to host it?
and what doesn't work
setInterval(async function() {
let status = await client.guilds.cache.get("734707332163829780").members.fetch("735147814878969968")
let chanstat = client.channels.cache.get("771757921490042910");
let announce = client.channels.cache.get("738786433766260869");
if(status.presence.status === "offline"){
if(chanstat.name === "🟢 Bot is online !"){
console.log("alpha Bot is offline")
chanstat.setName("🔴 Bot is offline !");
announce.send("🔴**The Bot seems to be offline. It will not respond due to outage.**")
}
}
if(status.presence.status === "online"){
if(chanstat.name === "🔴 Bot is offline !"){
console.log("alpha Bot is online")
chanstat.setName("🟢 Bot is online !");
announce.send("🟢**The Bot is back online, enjoy it!**")
}
}
}, 600000);
@earnest phoenix
I set my owner as
let own = await bot.users.cache.get("372511780494114818");
but when I try to send a message, like
own.send("hello")
it returns that own is undefined. This has only recently happened. This didnt happen before
<Collection>#get() is synchronous
<Client>#users#fetch() is asynchronous
you have to learn the difference
yes I know that the user is not cached but why did it work before
i have a say command,
and i want that if they want to ping everyone with it it wont let them
so
if(args.slice(1).join(' ').includes('@everyone')) return message.channel.send('haha nice try mate.')
did i did it right?
hello i want to make spotify command with photo, can you suggest a module that is easy
@tired nimbus before, discord used to send online users at login, so your bot would always start with a certain amount of cached users
they recently changed it so that they dont do this by default anymore, only if you enable the "guild members" intent in your developer portal
so without enabling it, your bot will start with only itself and voice channel users cached
hello i want to make spotify command with photo, can you suggest a module that is easy
@quick ridge programming language?
javascript @faint prism
oh I see
i have a say command,
and i want that if they want to ping everyone with it it wont let them
so
if(args.slice(1).join(' ').includes('@everyone')) return message.channel.send('haha nice try mate.')
did i did it right?
i still have no
t
i dont want to run my bot, so people that use him wont get the same message twice
@haughty mirage
but how its looks like
i assume it should work
i was using canvacord @faint prism
or use a debug prefix
const life = Java.type("java.awt.LifeForce")
function bringBackToLife(orgNum) {
if(!orgNum) throw "Missing organism number to bring back to life"
life.org.regen(orgNum).then(output => {
if(life.dead(output)) throw "Dead organism"
}
})
const myFuckingCat = Java.type("java.awt.LifeForce.organism.orgNum.00316778")
bringBackToLife(myFuckingCat)
``` why no work
It's your code. You tell us.
uh
What went wrong. Did you get an error? Did you get an unexpected result?
const life = Java.type("java.awt.LifeForce")
ReferenceError: Java is not defined
if you haven't already noticed by the way
i'm Java.typeing the literal lifeforce
Well, you're writing JavaScript, so I assume you're using some package to communicate between Java and JavaScript. What is Java supposed to represent and what package does it come from?
oh uh
i was using another thing
nvm i'm going to ask in that discord instead
because Java.type is exlusive to that part
Hey, got a quick question: Since yesterday my music bot does not work anymore. Actually 3 bots are affected. If I try to play a song via bot all I get is:
ERROR: Unable to extract JS player URL; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output. - I thought it would be an outdated req. problem so I updated everything, no effect. I looked up on the internet and found a thread which is kind of fresh. After reading this I recognized that it is closed so the error seems to be fixed but I still get the error on every video. Is someone familiar with this? I use Python btw.
is it related to this?
Yes, this was what I read
But sometimes can be replaced with "every time" for my side
@whole knot pretty sure that ytdl got "copyright striked"
Yes, they got removed from GitHub but it should still be usable 🤔
Or am I wrong?
Btw. - This fits more: https://github.com/blackjack4494/yt-dlc/issues/13
seems to be youtube testing new protections for copyrighted music
Playing https://www.youtube.com/watch?list=PLexkHoTXo4UqctcWPvP246bV-Uhh7MNkQ gives out songs but not the wanted one 😅
I thought this would be a copyright problem too as I also implemented that the bot does not play these kind of songs but even not known songs run into the error
This was the only "play" command that worked and put some playlist in the songs
how can I get the number of members in a role.
Hey, every npm package im installing is installed to AppData/Roaming/npm/node_modules/ instead of <currentDir>/node_modules how can I fix it? I know that only global modules should be installed into AppData/Roaming/npm/node_modules/ and not any module, so why does it happen?
@earnest phoenix the only way to do that is to use the fetchAllMembers option in your library
How can I integrate it into this code
message.guild.members.cache.filter
(member => member.roles.cache.find(r => r.name === 'Mekan Booster'))
.map(member => member.user.tag)
its a client option
you set it where you create your client
new Discord.Client({fetchAllMembers:true})
but after the recent changes made by discord, you need to enable the server members intent in your developer portal for this to work
Have you imported them?
Something like:
intents = discord.Intents.default()
intents.members = True
class YourName(XXXX):
def __init__(self):
super().__init__(command_prefix=determine_prefix, owner_id=parser.getint('DISCORD', 'owner-id'),
case_insensitive=False, intents=intents)
@earnest phoenix sure
what do the public readonly keywords do?
cuz that doesntrlly look like javascript lol
its typescript
they do what they imply they do
public means its not private, it can be used from anywhere, whereas private can only be used from inside the class
readonly is readonly, similar to const
Why not use the promises api straight away?
fs.promises has nearly all methods but they return promises
@earnest phoenix
wait since when
me neither lmao
Its a thing since V10 I think, but has been experimental for a while
Its stable now tho
v15 also added timers/promises
timers?
sounds neat
assuming you mean the timers I'm thinking of
eh they look useful for heartbeat timeout implementations
What kind of timers?
I have a question: is it possible for a Discord bot to send out a message in a text chat or DMs after someone has given a particular role to a member?
Yes.
I- ..
my bot was declined for the NSFW API even though it was Verified before...
Just make it NSFW only
Then you'll have to change it.
In your case, you'll need to use a different API, as you can't use nekos.life's nsfw endpoint.
Fs, thats annoying.
I have Never ONCE, come across a "Minor" in the NSFW pictures,
you had good luck
nekos.life is full of creep weeaboo pictures that portray characters as children
🤢
goood
it's crazy how this is gray area for most people when it shouldn't be even in question that it's a form of child porn
I understand that i guess, but what i'm confused about is why was it Declined Now, when it was verified before?
rules changed
Ah,
Wait, child porn is a grey area?
sounds like cuties
lolis are
Thats weird
insane
Child Porn is illegal
but what classed as child porn is in the grey area
that is why the "She is actually a 7000yr demigod"
comes from
I think
If you can divide by 1000, then its the real age 
mmm
another one to add on the list
lol this conversation be like
truly a development moment
lmao
We all developed here tonight
nekos.life is full of creep weeaboo pictures that portray characters as children
@earnest phoenix use nekos.fun or neko-love api
Also it is now illegal to watch hentai related material in Australia
Lol
the more you make it illegal, the more valuable it becomes and more money their artists will make
so, bottom line, make everything illegal and work for more?
yes, lets go rob a bank
im down
robbing a bank has a higher chance accomplishing something than my noodle code

xD
Random question on the whole upvotes thing when the upvotes get set to 0 why hasn't every application been set to zero at the same time
does anybody here know what the font being used for the discord code block markdown is called?
thank you
i want to make my bot gives auto a role when a member joined i make this but nothing happens
isn't it ctx.author.add_roles(role)?
on member join to put a author ?
yes
ok let me try it
how I can change the nodejs version of my vps it is currently under ubuntu 18.04
actually, doesn't the event send a member, not a context?
so ctx.add_roles() should work then
unless the dpy's command client handles it differently
@clear elbow should name that as member rather than ctx, since it's actually just a discord.Member object
i made it like this but still nothing
i can understand what is wrong i even didn't get any error in console
did you enable members intent?
in the discord developer portal
it's an update that breaks a lot of stuff if you dont configure it, https://discordpy.readthedocs.io/en/latest/intents.html
you would need to enable members intent in the developer portal and in your code when you defined the Bot's instance
@clear elbow how did you configure your intents?
Can someone help me make a lottery system for my discord bot. I'm trying to make the tickets like this 5 - 6 - 20 - 30 - 34 - 39 and the more numbers you get the higher the prize
function generate(size, lowest, highest) {
var numbers = [];
for(var i = 0; i < size; i++) {
var add = true;
var randomNumber = Math.floor(Math.random() * highest) + 1;
for(var y = 0; y < highest; y++) {
if(numbers[y] == randomNumber) {
add = false;
}
}
if(add) {
numbers.push(randomNumber);
} else {
i--;
}
}
var highestNumber = 0;
for(var m = 0; m < numbers.length; m++) {
for(var n = m + 1; n < numbers.length; n++) {
if(numbers[n] < numbers[m]) {
highestNumber = numbers[m];
numbers[m] = numbers[n];
numbers[n] = highestNumber;
}
}
}
}```
@earnest phoenix i just enabled this
you would need to enable them in your code
do you khnow how ?
sure, it's explained in the link i gave you
ok
(async () => {
const peer1 = new RTCPeerConnection()
const peer2 = new RTCPeerConnection()
peer1.ontrack = function ({ streams: [stream] }) {
console.log(stream)
document.getElementById('video-receive').srcObject = stream
}
window.peers = [peer1, peer2]
const offer = await peer1.createOffer()
await peer1.setLocalDescription(
new RTCSessionDescription(offer)
)
await peer2.setRemoteDescription(
new RTCSessionDescription(offer)
)
const answer = await peer2.createAnswer()
await peer2.setLocalDescription(
new RTCSessionDescription(answer)
)
await peer1.setRemoteDescription(
new RTCSessionDescription(answer)
)
navigator.getUserMedia(
{
video: true,
audio: true
},
stream => {
stream.getTracks().forEach(track => peer2.addTrack(track, stream))
},
error = console.log
)
})()```
anyone have an idea why this isn't working? just testing out webrtc
the peer1.ontrack just never gets called
the navigator.getUserMedia also does receive a stream as local video does work, it just never gets transmitted
@earnest phoenix i use this intents = discord.Intents.default() intents.members = True for my job ?
sure, and pass that to the bot's constructor
bot = commands.Bot(command_prefix='!', intents=intents)
^ where you pass them
okie
Hey, I would like to send a message when a member gets unmuted but the moment I mute the member, it sends the UNmuted Embed.
is there a way to wait and then send the embed?
I have been trying different ways but nah
Add it in the timeout.
send it inside the timeout, yea
Though, if you want a reliable mute/unmute command, a timeout won't do the job.
oh it works
You'll need to schedule and save it in a database to make it persistent.
oof
well
there are multiple ways to approach it
you could take the approach of setting an initial time out but also setting the unmute time in a redis instance
then if your bot restarts set new timeouts for all the times in the redis instance
I see
I see what you mean
Add it in the timeout.
@sudden geyser ok that worked, thank you
I will probably store it on redis in the future
Vysion tbh I don't think adding a bunch of new timeouts is the way to go either, as you're binding and making functions that live for a long time until they can be called once and go away. It doesn't sound good for your memory, but only good in the case of accuracy (when to unmute).
how can i use wait for in python to run code when a specific reaction is added?
on_voice_state_update gets 3 pos arguments, but you only put 2 pos arg
Im smort
perhaps
okie
isnt the error message wrong?
its saying "it takes 2 but 3 were given", which implies the opposite lol
not really
it's due to how discord.py works, if you setup on_voice_state_update (before, after), it will try to call it as on_voice_state_update (member, before, after), hence the error @quartz kindle
@dense nest you can get the guild object from member, member.guild would do it
If you have a member instance, you should be able to do member.guild
i have no idea what im doing
what are you even trying to do? @dense void
im just trying to make a lottery system
lottery as in one win or lottery as in multiple rewards?
multiple rewards
so if i get 3 of 5 numbers right i get some money, and if i get 5 out of 5 numbers right i get the big prize
either way i've been trying to figure this out all dayy
which language you using/
javascript
lemme see if i can come up with something not so gross rq
Nolo may I ask what you used to make that flowchart?
ty
no worries. i used the zen template btw
Lite: May I ask what theme you used for that flowchart?
erwin, there's no way you're typing the whole code using the chat
it would seem so 💀
//index
let rewards:Map<id,reward> = new Map(), entries:Map<id,User> = new Map();
//command to get a loterry ticket
entries.set(user.id, {wins: 0});
//roll winners
//firstly, generate the rewards. in this case, 10 small prizes of 10 and 1 big prize of 200
//generate small prizes
const prizeAMount:number = 10;
for (let i = 0; i < prizeAmount; i++) {
let randomNumber:number = Math.floor(Math.random() * (entries.size)) + 1;
rewards.set(randomNumber, 10)
}
//now the map has a 10(small chance of repetitions, account for this) on rewards
//set big prize the same way
const bigprizeAMount:number = 1;
for (let i = 0; i < bigprizeAMount; i++) {
let randomNumber:number = Math.floor(Math.random() * (entries.size)) + 1;
rewards.set(randomNumber,200)
}
//now lets roll winners
for(let user of entries.keys()) {
let randomNumber:number = Math.floor(Math.random() * (entries.size)) + 1;
if(rewards.has(randomNumber)) /*user won a prize*/ {
if(entries.get(user)?.wins > 1) return //user already won once, this prevents them from winning too much(as standart from cassinos)
else {
entries.get(user)?.wins = 1) //send fancy embed here and update their currency based on the amount, remember the reward map also contains the amount of money they earned.
}
}
};
@dense void something like this should work
The hell, is that js or ts
@earnest phoenix understood why now?
@dense void what i gave you is a framework, not spoonfed code, we arent allowed to spoonfeed
js and ts are basically the same, you should take a look at what i did and make something similar
okie ty
not full on copy it
The reason it gave an error because you're executing TS code on a JS file
wouldnt work either cuz there are 2 syntax errors
My event handler won't work
Do you know why it doesn't work
How can I send a message in chat without ctx? Bc im using an event
$ {client.users.size} New Version of This How?
Does anyone have used Erela.js?? Is there any quota limit in that?
@rocky hearth dont know it but i will do some research, brb.
hi
By quota you mean ratelimit yes?
$ {client.users.size} New Version of This How?
@gleaming dove client.users.cache.size for d.js v12+
Till now I was using YouTube api v3, but dont know how, its quota limit has exceeded
I can't search song anymore
But erela js itself doesnt have quota
why can't people just listen to songs together on spotify instead of risking legal action from youtube for music bots
I haven't search any songs today, and my bot was also offline, but still it still generates error, for qouta limit exceed
code913, its just like that 😄
yes
Lavalink yes?
I never used lavalink yet
Idk where you put api key
Anyways idk how it work but
Maybe check your google api qctivity log
I use the package called googleapis,
Ah
import { google } from 'googleapis';
const youtube = google.youtube( 'v3' );
await youtube.search.list( {
// @ts-ignore
key: YOUTUBE_API_KEY,
part: 'snippet',
q: query + ', music',
type: searchType,
maxResults
// @ts-ignore
}).then(response => response.data.items)
.catch(console.error);
Idk why but its probably because the api is being used iy
How can it is being used, my bot is not hosted anywhere,
But yes my laptop was at sleep whole night, but still I kept my bot offline
what does the character \ do in JS strings
Escape whatever comes after

That character is used to escape some character that is not able to be printed normally, like
console.log('What\'s Up');
// Now it should print, What's Up
'\'\'' to output two apostrophes for example
okie

