#development
1 messages ยท Page 1688 of 1
It displays the warns
ah
Not warning the user.
That is what I did?
just make it,
let user = message.mentions.users.first() || message.author;
.. and if the mention is invalid, it considers it as the author?
I don't want that.
oh
I want that if the mention is invalid, i add an if statement
I did do that, but doesn't work.
can you once console log args
.. and somehow it works for other commands.
hm, so, hmm, wait, nose bleeding, brb
๐
thx @river panther to helping me
try args[1]
Nevermind, I checked the documentation.
I used message.member instead of message.author
Somehow, now it works.
Thanks for the help, though, appreciate it! :)
np np
someone explain why typescript hates me so much
It's usually because you don't know how to use it
found the problem
repl doesnt allow deno to read .env files
๐๐๐ LITERALLY OUTSTANDING
My VPS recently crashed and I would like to know if it is possible to have the VPS logs?
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwhich one do you use
uh
my computer is on drugs
crashed how? what happened?
I want to get a random printout with percentage odds, but I just couldn't do it.
Example:
Chance of x spawn: 25%
Chance of y spawn: 75%
When you run the code, it will randomly output x or y, but it will do so according to probabilities.
How can I do that?
how do you store your probabilities?
I am on Debian.
I don't know, my bot is off and I can't connect to my vps (I have to restart it via the online panel)
in the file
show it
I just restarted it from the panel so I can connect.
Before his, when I tried to connect, he put me "Connection in progress ..." eternally
yes ssh
hmm
and after you restarted it works again?
did you change anything? like firewall
And to check if it came from the VPS, I tried to access my phpmyadmin page and it put "Connection to the lost server"
no
i havenโt firewall
yes itโs work now
hmm weird
you can find all types of loggings linux does there, with an explanation of what they do
and where to find them
but it has done it to me several times. I contacted my vps support and they told me they did the necessary
ok thx
strange, my vps never crashed like that
do you knwo how to build a website like rythm
not sure what you were expecting from a free hosting services, you've been here long enough 
somebody answer me
yea
Guys
with html and css, check vue or react for how to make websites
You'll need to do some math
Convert all the percentages to decimals
Store the decimal percentages with their x and y stuff
Do a random function that returns a random decimal between 0 and 1
Get the closest decimal value to that
Done
hey,
i donwloaded 1 module (Ofc discord.js) and i get this error
PS C:\Users\justi_8vy6ryi\Downloads\account-generator-master\account-generator-master> node index.js
C:\Users\justi_8vy6ryi\Downloads\account-generator-master\account-generator-master\node_modules\discord.js\src\client\ClientDataManager.js:81
guild.channels.set(channel.id, channel);
^
TypeError: Cannot read property 'id' of undefined
at ClientDataManager.newChannel (C:\Users\justi_8vy6ryi\Downloads\account-generator-master\account-generator-master\node_modules\discord.js\src\client\ClientDataManager.js:81:36)
at Guild.setup (C:\Users\justi_8vy6ryi\Downloads\account-generator-master\account-generator-master\node_modules\discord.js\src\structures\Guild.js:307:68)
at GuildCreateHandler.handle (C:\Users\justi_8vy6ryi\Downloads\account-generator-master\account-generator-master\node_modules\discord.js\src\client\websocket\packets\handlers\GuildCreate.js:12:15)
at WebSocketPacketManager.handle (C:\Users\justi_8vy6ryi\Downloads\account-generator-master\account-generator-master\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:108:65)
at WebSocketConnection.onPacket (C:\Users\justi_8vy6ryi\Downloads\account-generator-master\account-generator-master\node_modules\ at WebSocketConnection.onMessage (C:\Users\justi_8vy6ryi\Downloads\account-generator-master\account-generator-master\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:299:17)
at WebSocket.onMessage (C:\Users\justi_8vy6ryi\Downloads\account-generator-master\account-generator-master\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\justi_8vy6ryi\Downloads\account-generator-master\account-generator-master\node_modules\ws\lib\websocket.js:789:20)
at Receiver.emit (events.js:315:20)
``` Help me!!
update to djs v12
how to online the bots but not use ghostbot website @river panther
because its not can with music
use a programming language of your preference and find a discord library
ok
check the library's docs on how to get started
are can with node.js
sure
deno is fully locked by default
you need to use command line arguments to unlock what you need
like --allow-env
i did do that
and i also did --allow-read
and the filename is at the last so i didnt pass the argument to the script
how do you run it?
run="deno run --allow-net --allow-read --allow-env test_index.ts"
oh_and_also_im_using_snake_case_in_my_JAVASCRIPT_code_please_forgive_me
try doing it this way https://replit.com/@xxpertHacker/Deno-demo
with an sh file to start it
i saw another example that uses a bat file to start it
can somebody help me with like website to active the bots
like bot ghost website
but there cant use music
Guys, i need help with a swearing automod, i thinked it could work like this
const bannedWords =
[
'word',
'world'
]
if (message.content.toLowerCase().includes(bannedWords.some())) {
message.delete()
message.channel.send('no swearing')
}
but this doesn't work, can anyone hep me?
don't bother with a profanity filter regardless
so what do i need to add?
explained it here why your efforts are basically futile and someone is always going to bypass it
you also can't use includes() because that would expect something different
Maybe just read this... #development message
Also, like, you can't block any of these: ```
๐ฏ๐พ๐ฌ๐ด ๐๐ธ๐พ
๐ป๐๐ธ๐ ๐๐๐
๐๐ฆ๐๐ ๐ช๐ ๐ฆ
๏ฝ๏ฝ๏ฝ๏ฝ ๏ฝ๏ฝ๏ฝ
๊ฐแดแดแด สแดแด
noส สษnษ
fแตคcโ yโแตค
แถ แตแถแต สธแตแต
โโคโโ โจโโค
ลฆเธขฯะบ ืฅเนเธข
ฯฯ
ฦฦ แงฯฯ
สสฦำ สึ
ส
แฆแฌแแฆ แฉแงแฌ
สลณฦฦ แงฦกลณ
fเธยขk เธฏเปเธ
๐๐ฎ๐๐ค ๐ฒ๐จ๐ฎ
๐ง๐ถ๐ค๐ฌ ๐บ๐ฐ๐ถ
๐๐ช๐๐ ๐ฎ๐ค๐ช
๐๐๐๐ ๐ข๐๐
So why even try? 
or any combination of those ๐
you'd have to map characters to original characters and then test the string against every possible combination
sounds like fun?
and that's not accounting for any extra characters the user might put in between lol
or if we're accounting other languages as well
i dont understand why you would use a profanity filter in the first place
discord is 13+
if you're not allowed to swear, you shouldn't be on discord in the first place (implying children under 13)
both legally and for your safety
3 separate database calls 
nvm, found the error
and yeah, im fixing that with a join xD
it was just a temporary thing
you can select all 3 in the sql statement fyi
hello
uh
check the link above my mention
tell that to partnered servers

idk
frick
perfect, ty
@opaque fern ^^
track as in....?
"write your own compiler day 30"
like the moment someone votes my bot, they get an reward for example
okay thanks
np
The compiler compiles itself ๐ช ๐ฅ
inceptions ....
๐
ya know whats really cool, this actually exists, programs that program themselfs
In computer science, self-modifying code is code that alters its own instructions while it is executing โ usually to reduce the instruction path length and improve performance or simply to reduce otherwise repetitively similar code, thus simplifying maintenance. Self-modification is an alternative to the method of "flag setting" and conditional ...
high quality worms do this sort of stuff
How can I suppress mentions for specific messages, without changing the client options?
u could filter the message before hand
Does your library have that implemented?
if it meets a condition, skip or pass
its discord.js
There's allowed_mentions which Discord API provides
yes, you can set is as client options, but how can I just do it for that one message?
let's see what options allows
hey
i have made a bot that actually triggers once a specific keyword is used
why isn't it able to trigger in embeds?
if(message.embeds[0].includes(trigger)) explode()
because you are very possibly relying on message content
and excluding embed contents
yeah i am
const allItems = fs
.readFileSync("./keywords1.txt", "utf8")
.split("\n")
.map((x) => x.split(/ +/))
let filtered = allItems.filter((x) => x[1]);
let final = filtered.map((x) => x[1])
let m = final.filter(a => message.content.includes(a))
let z = final.some(a => message.content.includes(a))
console.log(m)
let filtered33 = allItems.filter((x) => x[1] == m);
let final33 = filtered33.map((x) => x[2]).join("\n");
console.log(final33)
if (z == true){
let role = message.guild.roles.find(r => r. name === `${final33}`);
message.channel.send(`${role} We need you here! Someone just used a specific trigger word! Get your ass back here now!`)
}else{return}```
how would i also include the embed messages then?
I figured out {disableMentions: "all"}, but I am having problems withh {allowedMentions:}
wow , allowedMentions is the opposite of disablementions xD
what the fuck?Are you trying to 'test' whether i will blindly copy the code?
that was meant as fun
explode() is not a function xD
yeah i kinda already figured that
๐
wtf, you tested what I say, how.....
any real suggestions on how to trigger on embeds
that was the suggestion 
iterate over message.embeds
message.content = message.content || message.embeds[0].description
then do with messsage.content what you want lol
you can do something like this @eternal osprey
this will convert a embed message to a plain once
at that point why not just stringify the whole thing?
Hi
Don't Just Say "Hello" in Chat.
Merhaba baka bilir misiniz? <@&695153281105920070>
-notr
@winter remnant
ฤฐngilizceden baลka dillerde sohbet etmek iรงin #general-int kanalฤฑnฤฑ, top.gg hakkฤฑnda (Tรผrkรงe olarak da) destek almak iรงin #support kanalฤฑnฤฑ kullanฤฑn.
Bu kanalda Tรผrkรงe konuลmayฤฑn.
Also please do not ping any staff roles for non-emergencies
@sage bobcat can help me to make cd command?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
@sage bobcat I just wanted to make a command like !cd and bot replies "Alright, I'll remind you in 1 min" and after 1 min bot replies me " your cooldown is over"
One message removed from a suspended account.
how?
One message removed from a suspended account.
One message removed from a suspended account.
ok tell me
One message removed from a suspended account.
ik
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
ok
hey i get some errors when i type const in 53 line
let guild = message.guild
let reason = args.slice(1).join(' ');
let modlog = guild.channels.find('name', 'account-log');
if (!modlog) return message.reply('account-log /* Note 2:this section can be edited*/ can't **i find channel.**');
//here i get error> ~~const~~ embed = new Discord.RichEmbed()
.setColor("#e5bd38")
.setTimestamp()
.addField('**Action Taken**', 'Account Request')
.addField('**Channel**', ` ID โ ${message.channel.id} `)
.addField('**Channel**', ` Name โ ${message.channel.name}`)
.addField('**User**', `ID โ ${message.author.id}`)
.addField('**User**', `Name โ ${message.author.username}`)
.addField('**Account Provided (MAฤฐL)**', ` โ ${mail}`)
.addField('**Account Provided (PASS)**', ` โ || HIDDEN ||`) /*Note 3:We're not sharing the password.*/
.addField('**Account Provided (TYPE)**', ` โ ${accountType}`)
.addField('**Command Used**', ` โ ${message.content.toLocaleUpperCase()}`)
.setFooter('ยฉ Charon X |', bot.user.avatarURL)
.setThumbnail(message.author.avatarURL);
return guild.channels.get(modlog.id).send(embed);
});
ping me if you finded out how to solve this
let me use my telepathic powers to read the error
Dont use v11 d.js
i use v12 d.js
RichEmbed message.author.avatarURL bot.user.avatarURL its v11
how should i change it?
Read the Discord.js docs
oh shit it's doge
Exp RichEmbed => MessageEmbed
It's sad how discord stole Ben Awads Dogehouse idea and called it "audio stage"
example: ShitEmbed builder => send({embed: {}});
Based Erwin
pog
Yeah but people doesn't give a duck since the difference is insignificant
Autocorrect moment
and that makes it right to use something awfully bad just because it works?
chaining if's as a command handler works too
Look man, I don't use it but it's convenient for some poeple
possibly even faster
It's still fast
Go create an issue and ask the devs to remove it then
rofl dont ask the djs devs for better performance
why would i bother go fixing something that is completely borked?
not like embed builders is their top priority either wya
why you think djs-light is a thing?
Is this the segue to our sponsor, Detritus?
all js libs are lol
in a way, yes
having a monolith js bot is braindead at scale
Big bots should go libless already
you can make it somewhat performant depending on how you write
but nowhere close anything like cpp or rust
or they should buy my rust microserviced solution
client libs in rust js and py pls buy
chad rust dev

lowkey tho people are also massive nerds
like theyre always v fixated on hurr durr djs caches inmemory how bad
but inmemory cache is good, and wayyyy better than redis or whatever
When using global Slash commands are they automatically added to a Server when the bot enters a new Server?
first, not every bot needs all cache
emojis
presences
messages
edited messages
d.js caches EVERYTHING
Yes, they're global
my gateway caches everything lol
K
its not much of a matter about caching is good, is about how much shit it caches
just do it smartly
They take some time to fully update though @copper sage
like there is so much bs in there
all those random properties which u never use
thats why i said d.js is a dipper-ready library
it assumes you're making a small bot
and does everything for you
regardless if you use it or not
it does not scale well
yeah well tbf all those other "performant" js libs also cache like widgetChanneId lol
which makes me even more confused
There are libraries that let you pick which property to cache, which is neat
Monkey patches
people like pre-made shit, detritus legits takes away 30% of your coding with command client, the rest is just you adding the commands
people enjoy d-js cuz its easy for them
like i said, dipper-ready
rofl ur not a performance pro if u havent ever created an enum for channel names
but detritus provides a whole pre-built command handler for you
ontop of being a better lib with more customization than djs
and yet they stubbornly stay with that trash

the day detritus put their docs and examples on par with djs, i dont doubt it'll grow real good
because at scale you need to cache
and it doesnt make djs's sharding and whatnot less trash
i recall some people getting temp banend from cloudflare
due to the sheer amount of requests
caching is good, caching all is bad
you cache more than you need
well it depends
and end up needing a 128GB rig to scale it
sometimes you do need everything cached
not everything, no
but everything meaning like everyone as in like members
but u may not need all properties of that member
the fuck you need emojis cached for? or widgets? or stream previews?
i didnt mean everything as all types
or presences?
Hi
store when they started playing it
How add bot
storing presence is too inefficient
you'll be storing a shitton of other presences along with it
yeah
presence payload can be some of the biggest payloads you recieve from discord
rofl that payloads spec is sososo bad
this is what i do
as simple as this
set the user as playing
if another presence update triggers, and if they are playing, ignore
probably alt-tabing or something
those 3 keys are what i use
why are you storing them as strings
my point still stands, you dont need most of the shit cached
cuz db
its stored as bigInt
the pgsq lib returns bigint as string
so you bigInt() yourself
i need a character advice...
ive hit the 2024 limit ive tried lower number more emojis show as the name and ID, i dramatically changed emoji names to shorten them as-well
const { MessageEmbed } = require("discord.js");
exports.run = (client, message, args,) => {
const charactersPerMessage = 2024;
const emojis = message.guild.emojis.cache
.map((e) => `${e}`)
.join(', ');
const numberOfMessages = Math.ceil(emojis.length / charactersPerMessage);
const embed = new MessageEmbed().setTitle(`Emoji List`);
for (i = 0; i < numberOfMessages; i++) {
message.channel.send(
embed.setDescription(
emojis.slice(i * charactersPerMessage, (i + 1) * charactersPerMessage)
)
)}
}
does someone have some time for me who knows css well?
I'd recommend using pagination instead. I assume you want to remove an emoji from the output if it can't fit, correct @onyx hare?
kinda, im trying to get it to show the emojis of the server, but i keep hitting blocks where a random emoji or 2 show as <:NAME:ID> i dunno how shorter of the words i need to make as the emojis, a majority start as "Panda"
Ah, I see the issue now.
I thought those were two separate commands.
But it's just two embeds in the same command use.
What do you mean?
i dont know how to use this css in the long description but wann something els than poor text
mhm. Use markdown?
...yes it is
so look
i made a bot that triggers on text.
I coded it so that it also triggers on embeds now.
But it only works for the little text.
So the Usage: Donate would work
but the 2 bold ones not. Why is that?
you made it so it reads only reads the description
Account for footer and field text...?
mhm
fields
nvm
it didn't really seem to work
const fake = message.content || message.embeds[0].description || message.embeds[0].footer || message.embeds[0].title || message.embeds[0].fields
let m = final.filter(a => fake.includes(a))
let z = final.some(a => fake.includes(a))
let filtered33 = allItems.filter((x) => x[1] == m);
let final33 = filtered33.map((x) => x[2]).join("\n");```
fields is an array of field objects
tried triggering the dm word
owh so i should iterate over it
also why do you want it to be able to read embeds? Only bots and webhooks can send embeds
which is why i want it.
For example some sneaker webhook
that has a new restock
and i want to ping others once that happens.
How would i loop throught all the fields?
Can u guys help?
I have a problem.
I tried to make the bot join stage channels.
But idk how.
map
okay
const zebr = message.embeds[0].fields
console.log(zebr)
let make = zebr.map((x) => x[1]);```
i tried this.
to just console.log the output and see whether i was going in a right direction
where you getting this from?
embeds is only used in webhooks
its embed for usual stuff
Oh, d.js splits those?
This is a webhook
owh but i am testing it on a bot
fuck
and djs doesn't split those @opal plank
it is embeds
still wouldn't work tho
the mapping
console.log(x)
I've defined a variable to the whole mapping
so i could just use console.log(make)
but for some reason i jst can't map it
x is an object
not an array
{title, value, inline}
name* instead of title
owh okay
Is there a better way to implement the client.on('ready') and client.on('message') event rather than just having it in the main file with the client.login(token) or is this just stupid to split these up in different files
it's not stupid
most people will have an event handler, basically exporting a function in another file and requireing it in the "index.js" or whatever, then you just client.on('x', func)
I now have 3 files called message.js - ready.js and login.js these three files have a module.export which exports a start function in which these events are written in.. it does work but I am curious if this is a good example on how to do it
If anyones wondering why my bots offline im letting him have a break
okay
no one really cares iirc. Just kidding. Good job!
announce that in your support server
K
Does your bot get tired or something
Well no one is in my support server
yeah it needs some rest obviously
No but i do
Do you give your bot some time to sleep?
No lol
anyways, i do have some problems with mapping this object.
so far i've only mapped arrays.
sup ppls ๐
What is it?
An hourglass, it seems like
Probably servers that are being loaded
someone donate to me, ive lost everything
noโค๏ธ
go to gofundme or smth
Servers you haven't completed the screening for yet
Ie. Servers that enforce you to read rules and accept them
electron + react is such a beaut to work with
if only electron wasnt such a ram hog
I'm wondering why there aren't any electron competitors
there's ultralight
that don't use chromium
but ultralight is nowhere near stable enough for a production app
Hey, so, you know how bots create their own role on entry to a server? My bot doesn't do that when it joins a server. Does anyone know why this is happening?
https://ultralig.ht/ seems promising enough though
Looks great
you didn't include a permissions value in the invite link
when you include one, discord automatically creates a role for it that grants those permissions
That licensing though ๐ฉ I guess you gotta make money somehow
yup :p
Yeah it does, i believe so atleast? this is my invite link:
https://discord.com/oauth2/authorize?client_id=my_bot_id&scope=bot&permissions=1949682806/
i removed the id
but those permission look correct
i did the bit math thing on discord developers page
they don't seem to be
that isn't a valid permission value
what should it be?
don't know ๐คทโโ๏ธ
That was on the bit math thingy directly copy pasted
ill redo all the perms it needs and see
Oh, it is different, but, do you know what perm i need to have to create its own role?
it looked way too large of a number to me in the first place, confirmed it when i tried inviting another bot with those same permissions and it didn't prompt me with a list of permissions it needs
use https://discordapi.com/permissions.html i guess
A small calculator that generates Discord OAuth invite links
what exactly is a "shard" and "shardId" the docs say something about websocket but what does these two things do?
they're for sharding
i now get this when i use that url
thanks lol
wait it still doesnt create the role?

sharding is splitting a large bot into a bunch of smaller pieces
make sure you're not inviting the bot into a guild it's already in
ahh okay, thanks ^^
that's the way to do it ๐ค
can you send the invite link over quickly
like with the ID?
yeah
can i delete
sure
ok i didnt wanna leave it there
it created the role for me
https://i-am-sure-that.anime-thighs-are-the.best/โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ I use this code to post stats to top.gg.. so my question is do I see the stats that are getting posted somewhere?
this autoposter is based on the top-gg/sdk
you can use that then
yeah I am already using it and it did show me the console.log that it posted the stats
not that
uh
Try pressing Refresh Data or just quite literally visiting the GET Bot URL in your browser
also, you should check out dblstatistics
they provide useful data and graphs for checking your bots growth
oh okay ๐ that sounds cool^^ thanks
okay so the GET url does show me the bot stats
is there something else i need to do get the server count displayed in the bot overview?
refresh data didnt do much
buider
just go to oauth
and it generates for you
do I have to set the bot overview to public on top.gg? when I am logged in I see the server count and the shards in the overview but when Im logged out I don't see these stats
uhm
this is odd
const Event = require("../../Structures/Event"),
izzyBotEmbed = require("../../Structures/vortexMusicEmbed");
module.exports = class extends Event {
async run(message) {
if (!message.guild || message.author.bot) return;
const attachments = message.attachments.size
? message.attachments.map((attachment) => attachment.proxyURL)
: null;
const embed = new izzyBotEmbed()
.setColor("RED")
.setAuthor(
message.author.tag,
this.client.user.displayAvatarURL({ dynamic: true })
)
.addField(`Message Deleted`, [
`**โฏ Message ID:** ${message.id}`,
`**โฏ Channel:** ${message.channel}`,
`**โฏ Author:** ${message.author.tag} (${message.author.id})`,
`${attachments ? `**โฏ Attachments:** ${attachments.join("\n")}` : ""}`,
`**โฏ Deleted Message:** ${message.content}`
]);
const channel = "828346217100607508";
this.client.channels.cache.get(channel).send(embed);
}
};
https://cdn.discordapp.com/attachments/816066190752874497/828349897014640690/unknown.png
whys it not in likne with thr rest
ik the \n is there, bu that shouldnt affect the deleted msg right
whut
ive explained it
its not inline with the rest, whys the gap there
the \n is on the attatchments line so why would it interfer wit thw deletd msg
Is the .addField method custom
Hi all,
I would like to know who is using Erlpack with his Discord bot (preferably a large bot) written in JS (not necessarily with discord.js). React with ๐ช or answer the following questions if you use it)
If you are using it [Erlpack], I would also like to know if you see a difference in performance, better or worse than before (JSON encoding vs ETF encoding)?
If you decided to use Erlpack for another reason than performance, I would like to know what interests you decided to change.
Thank you very much !
Don't give the .addField method an array because discord.js joins it with a \n by default
ty
has anyone have a good leveling (mmo style) formula ? i have good one, willing to share the code
just say the words ๐
@slender thistle @cinder patio
i sort of 'used' it from the unity forums where they developed mmorpg's
they had a basis code
i ported it
๐คฃ Nah thanks I've had enough of calculus in my first 2 years of college
hehe
well for whoever wants it
'// Settings
Public Const LevelMax As Integer = 1000
Public Const LevelFirst As Integer = 50
Public Const LevelLast As Integer = 100000000
'// This calculcates the required amount before leveling up
Public Shared Function Calculate(current As Integer) As Double
Return Math.Round(A * Math.Exp(B * current) - A * Math.Exp(B * (current - 1.0R)))
End Function
'// This will tell if current cant level up
Public Shared ReadOnly Property CanLevel(current as Integer,required as integer) As Boolean
Get
Return current >= required
End Get
End Property
'// Logarithm formula for section A
Private Shared ReadOnly Property A As Double
Get
Return LevelFirst / (Math.Exp(B) - 1)
End Get
End Property
'// Logarithm formula for section B
Private Shared ReadOnly Property B As Double
Get
Return Math.Log(LevelLast / LevelFirst) / (LevelMax - 1)
End Get
End Property
I'm currently trying to update Python properly on my VPS but failing miserably
need help shiv ?
Nah, I'll unfuck this mess on my own
Just wondering how I managed to get to this point where everything just... broke
Usually it's one thing or another, but this time it's a whole new level of "broken"
Deleted a few Python binaries, replaced them with other ones
Which in turn created some... unexpected chaos
what distro is it ?
Ubuntu 16.04
3.6 and 3.9
perhaps u didnt know, but any version, it be perl or python can have multiple versions coexist
i have it like that too
Yeah, I'm perfectly aware, but my stubborn side decided to have it attached to python3 instead of python3.9
however u can change the main binary to be a link to the primary version u want
yikes, u should aptitude arrange it
Gotta fix it first
pythonk
@sudden geyser - #development message
Sorry for the ping but is there any updates
as I see it says added stage channels
you could fork djs and merge the pr yourself
and then use your fork instead of the djs release on npm
So I made status change commands for my bot, so it can change from dnd, idle, and online and watching, listening, playing, but they are all seperate commands and a mess of extra unneeded code. I was wondering if its possible to put it in a prompt serious or somehow all in one command? Here's an example of how it could be if its even possible .statuschange <watching, listening, playing> <dnd, online, idle> <arg> arg is for what the status says like "Playing a game." Or like in a prompt serious of answers. Please ping or ping reply (discord.py rewrite)
how can i get an api for my bot
What kind of api?
Like your own API?
ya
find a HTTP server library for your language and throw it in your app with your bot
im not sure if this is the correct channel for this but:
Hey! this is my webhook code, but my vps is not receiving the requests sent by topgg tests. I have used sudo ufw allow 25569 and sudo ufw allow http Any idea how to fix this?
var path = require('path');
const { webhookPW } = require(path.resolve(path.normalize("./config.json")));
const init = async() =>
{
console.log('[EXPRESS] STARTING SERVER')
const express = require('express')
const app = express()
const Topgg = require('@top-gg/sdk')
const webhook = new Topgg.Webhook(webhookPW) // add your top.gg webhook authorization (not bot token)
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
// req.vote is your vote object e.g
console.log(req.vote)
}) // attach the middleware
app.listen(25569, () => console.log('SERVER READY'))
}
module.exports.init = init
you can also install PRs through npm
๐ฎ til
The pull request has not been accepted yet, so no. If you'd like to use it right away with the instability the PR brings, substitute Discord.js in your package.json for the pull requester's branch instead (https://github.com/amishshah/discord.js/tree/feat/stage-channels).
have you tried posting to that path manually
how would i go about this?
i noticed that when i visit the webhook url in my browser, pm2 recognises http traffic, but my express app prints nothing
The method has to be POST specifically. Browsers default to GET, so you'd have to modify the request or use an app like postman to manually send a request
What does this mean? How do I use it?
okay! thank you ๐
Nvm.
๐
turns out the Discord.net Library for dotnet is not as stable when you fire a task (await) it sometimes never finishes
and then at some point u run out of thread resource
so i added a "GetResult" to force it
๐ค
its not nice...but works
what are you talking about per se
well cry, i had a strange behavior in my bot some commands fire and then suddenly stop all together
no errros, no exceptions
the debug showed me the methods are been fire, and return just fine
so it had to be inside the library internals
that more so seems like a your code issue, you're deadlocking somewhere
yeah thats what i thought too
i've been using dnet for 3 years and i never encountered this lol
im completely there with your thinking
well i never seen it do this either
i was puzzled
it's weird how getresult should fix it when... await implicitly calls it
im puzzled lad, truly are XD
i tried everything from this point,
even weird/non-logic olsutions
anyway, when the Awatier.GetResult() was added, bot started to live up again
as desired
where is this occuring again
i got a "PASS" on this website https://apitester.com/
well bear with me for a sec, so my incoming message is latched to a processor that sets up queue's so a second thread would pop them off (lifo) to process them on a different time then the main thread
that is handled by the Task.factory
calling GetResult isn't ideal and it can cause thread pool starvation
yeah, i know i wish i knew a better way
i think i did change that later on ye
this is more than likely your underlying your issue
hmm let me check real quick
i use the same approach in a lot of my bots, never encountered an issue
hmm
anyway
so this is the secondary worker thread that does a split second check on the que
If (Me.Queue.Count > 0) Then
Await Task.Run(AddressOf Me.Queue.Pop.Start)
Me.Client.Update()
End If```
oh ffs are we really gonna do this childish shit -.-
we are not allowed to flame or start a language war
so i am not going to engage you in this
if u wanna do that, ill just mute ya
ok lol
its fine by me
i see, @slender thistle i dont think there much to learn from this one
too much emotional influenced reaction
no use ๐
but why use it
My brain is fried
ive explained this before, let me do it again for ya. dotnet vb and c# compile into the same bytecode, there is no difference. so it boils down to personal preference. now if you think you know me better then i know myself, to pick a language "i" like. u are very wrong
so move on with you life, dont be asking this question ...it doesnt make snese
other then wasting my time -.-
they do not compile to the same thing lol
where did you get this information from
they compile to the same language
IL
i love how they go offtopic just to show they're ignoring me and implying they blocked me ๐
If someone can find an invite to this server and send it to me, i will really really appreciate it!
<Guild id=758377739265900554 name='PMCO ESPORT' shard_id=None chunked=False member_count=11647>
eh ...i dont think i know that one
blocking is such a dumb feature
Nah, it's useful
if you don't like someone, ignore them
Why do you want an invite to that server anyway.
it fucks up conversations
If you don't want someone messaging you, you block them. If you're in a server and don't want to see any of their content, block them.
Okay what do you expect us to do with that information
Though more important question
Why do you want an invite to a server through your bot
how often can you update a channel's name without being ratelimited?
2/10min
no, ratelimits aren't static
the ratelimit was changed a few months ago and was mentioned in the discord developers server
that's why the exact value is known
but ratelimits for endpoints aren't documented
and they shouldn't be
follow the ratelimit headers
hardcoding bad
What if they weren't hardcoded
My English is suffering so hard I'm struggling to form a proper sentence
tfw you pressed ctrl+C on excel and ctrl+V on google sheets 15 min ago and google sheets is still frozen
check your firewall, it might have cooled down
have you tried restarting your computer?
probably should not use garbage software
so who is the worse then, the guys who made the garbage , or the guys who tries out the garbage out of better lack of knowing what should be better
hmm?
how to get the IP of my own bot?
The IP of your bot should be the IP of whatever network you're hosting it on
Ehm yeay of course, but im using proxy, and i have a list of hundreds of IPs, and one of them is connected to my bot. I want to know which one.
how did you chose which one is connected to the bot?
then console.log it or something
but that isnt the point. I want to know if my proxy is working at all.
you could monitor your traffic or something
or even run a small webserver inside your bot process to test
just ask ur question
Well I'm making a bot. I am very amateur at this and could use just a small bit.of advice with something
I have successfully made a basic bot with ..um I beleive its called ping pong...I can make my command %lootbox, or %inspire...there are others too... I have created lists and can pull from the lists and receive a random answer from the lists as well.... I am now trying to implement an economy
I'd like something such as %adventure or %work... I have the script down. But im not sure how.to integrate the new one with my old.one that uses the ping pong system
An economy where you do %work. And then a text comes up and says you have gotten 100$ or something...
no thanks
no worries
Here's my error
I have created a file named economy.json
And am trying to get it to store the currency in there
Like I said...im very new to this.. I am sorry for being such an armatur
nrn
Congratulations
Yes...but...how?
Lol
or are you learning it by making a bot?
i mean its a terrible way to start
Salutations
do databases even work on repl
yep just send code?
@thick gull i mean eventually if he;s gonna use repl ill suggest mongo to him
but its too advanced
Mongo?
heroku doesnt let you use databases
u wanna use mongodb
either
Oh geez
Can I copy what i have from repl and paste it to mongo?
heroku has their own integrated postgres database
Ugh.. can I please just show you?
but if he does get a vps or something
I worked hard and am so proud
ok so just show code
My server code? Or repl code?
repl
copy and paste
and paste it in here
and delete the token
not delete, but jsut remove it
from the code that u send here
Oh my whole script
YES
why do you hate the bin
java nerds are not needed for python help (jk)

@lyric mountain any new projects uve made?
nope
just upgrading shiro as always
I dont want to spam and get in trpuble
open the website
put code in there
and click the save button
and send us the url
yes
yes
It works great
lemme look thru it 1 sec
%lootbox is a big hit
ok so you dont need the if msg.startswith
discord.py has a built in command handler
which you can access using
async def COMMAND_NAME(ctx):```
Can I show you what I'm trying to do?
also its not a good idea to do if starts with also
bc like if someone does
%congrats urmom dumb
it would be better imo if it is just %congrats and if it has other things after it wont work
nah ur just new lol
I'm so sorry to embarrassed myself like this
lol
Ty for being kind
np
I write books and run dnd games...so I I can just get thebasic frame work down I know I can make an epic bot
Learn how to code a Discord bot using Python and host it for free in the cloud using Repl.it. Along the way, you will learn to use Repl.it's built-in database and create a Discord bot that uses webhooks to connect with GitHub.
Need help with this tutorial? You can ask questions here: https://forum.freecodecamp.org/
This course was developed by...
Here
I watched it for 10 hrs
And made what I have
Lol
You said no judgment
In this video, we will learn how to make an Economy System for a Discord bot in python using discord.py (rewrite) in 2020. We make the balance and beg command in this video.
If you have any suggestions for future videos, leave it in the comments below.
Some Useful Links -
Discord Developer Portal- https://discord.com/developers
My Disco...
In this video, we go over how to setup a discord bot in python using discord.py v1.0.1 (rewrite).
If you have any suggestions for future videos, leave it in the comments below.
GITHUB: https://github.com/Rapptz/discord.py
DOCUMENTATION: https://discordpy.readthedocs.io/en/latest/
OFFICIAL DISCORD.PY SERVER: https://discord.gg/r3sSKJJ
JOIN MY ...
I've been watching this
Ooooo whats that
an actually good video
So should I follow that and delete what I have?
for some reason the first time i write to like json file it gives me a keyerror like i try
[str(ctx.guild.id)] = {}
[str(ctx.guild.id)]["onoff] = True
But the first time i run the command it does like
Command raised an exception: KeyError: '796733556872708147'
But the second time it works
just make a new file
also isntead of using repl
use atom or vsc
and you can test it faster
are dey better
yes
o
wat do you use?
just watch the video
ignore EVERYTHING youve learned
and just follow the video
I will
btw dont you have discord on pc?
its much better to take a screenshot on pc and send it through discord
than taking photos with a phone
u could just make a new repl
Ok
just use a ide
and then follow da video
So i need to basicly start over from scratch
if you need help





