#development
1 messages · Page 676 of 1
want me to paste it in
omg
the last guy who tried to help me put like into it and then logged off
Line 0-10
i just found it
Okay
lemme try run it again
Just takes those extra few seconds to look over your code. 😂
its still saying like is not defined
even tho i removed it
and saved and restarted cmd prompt
Code
what
We need to see your code..
want me to copy and paste it
Well I mean how else would we see it 😛
-_-
Use code blocks and remove the token
I deleted that so no one knows the token
im new to this idk what code block is
@sterile quarry Your token has been exposed. Please reset it in the bot developer tab.
We cannot help you until afterwards.
So I am creating a moderation bot, and trying to add a ticket create command. Code: ```js
const Discord = require('discord.js');
const client = new Discord.Client();
const {prefix,token} = require('./config.json');
client.once(ready,() => {
console.log(${client.user.username} has started up!);
client.user.setActivity(ess help | Watching ${client.guilds.size} servers!, {type: LISTENING})
});
client.on(message, message => {
if (message.content === ${prefix}ticket) {
guild.createChannel('ticket',{type: 'text'})
}
)};
client.login(token);
It says that 'guild' is not defined, how do I define it?
message.guild
lmao
no problem
Did one of your commands make the bot reply 'hi'?
i dont have that set yet
someone went on it before i reset token and got it working and made it say hi
@hoary helm Also, how would I make it so the author of the message can only view the channel?
Like.
like when someone runs a command, it locks the channel so that only they can view it?
No like, the command creates a new channel, but how do I make it so only the person that ran the command can view the new channeL?
message.guild.createChannel(name) creates a new channel with the name you want to set
I have that.
This is what I have in the command:
if (message.content === `${prefix}ticket`) {
message.react('✅')
message.guild.createChannel('ticket',{type: 'text',permissionOverwrites: [{
deny =
}]
})
}
It is in client.on('message'), etc..
That's a weak command handler
I don't recommend using if (message.content === blah blah) it will make your code less clean
What would I do?
However I have a good tutorial you may want to follow in order to have better settings
Cleaner code = Better quality
And not the opposite
hold on, i'm just scanning the documentation right now as I haven't really dealt with channel permissions in a long time
since i'm guessing you're using discord.js, here is the documentation https://discord.js.org/#/docs/main/stable/class/PermissionOverwrite
Even if Rythm is one the greatest bots to ever exist, we'll still have to rate its code
@manic geode The tutorial I'll send you isn't easy but I'll help you through it since I myself used and still using it now
In DM's obviously
I would use if else command handler for a non public bot

less hassle, but again that depends on your use case
then use a special command handler
but tbh you can use frameworks
Klasa, Akairo, or Discord.js-Commando
all achieve what that tutorial does but with better features
Ok so I can't seem to find anything that works. I want to call a separate PHP file from my HTML file. How can I do that?
In the HTML file I want to call the php file
I'm not sure if I know how but try this
<link rel="stylesheet" href="pama.php"> <!--You may want to change stylesheet-->
What would I change stylesheet to?
i dont use php, but i think this is exactly what you need
@alpine lark good question
first of all you make a variable to require the file
const pama = require("../pama.json/")
The dots depend on your file's location, the more dots there are the further you go out of the command's location in the project
Then let's make a variable requiring the file's object
let prototye = pama.name;
message.channel.send(prototype) //returns PAMA for example.
How can I keep my bot online for a long time? Do I just have the terminal running until I want the bot to go offline?
yes
Oh.
Never close the terminal
Well, that makes things way easier!
I can just buy a computer and keep it on forever, with some autoclicker so it doesn't turn off. With the terminal on it.
This is what i have do @manic geode
dont give him bad advice...
I host my bot on my old pc
It isnt.
How?
But you need to have a good internet connection
I have good internet.
The only issue if you self host is it will go offline when you shut your pc down, which is why it's recommended to get a vps
my $3 vps runs like 6 bots 24/7
What is a VPS?
Virtual proxy server
a virtual private server
Private*
Can you use other users VPSs?
You can also get a Raspberry Pi if you really want to self host
they'd need to let you.
Ok.
If you dont want to pay money, host it on a free service, or host it on your computer
Alright, thanks!
free services are trash usually
db.prepare("CREATE TABLE IF NOT EXISTS guilds (id TEXT, prefix TEXT, log_toggle FALSE, log_channel TEXT, guild_premium FALSE, case_counter 0")
I also want to add in individual toggles for each event there is like, guildMemberAdd, guildMemberRemove, messageUpdate, roleUpdate, etc, but that seems to be a bit messy so I wanted to know if there was a better way to do it
What?
It’s pretty simple I want a true false toggle for each event ima use but that seems messy
And long asf
uh
Why are you storing log channel as text
well disabling events are discord.js client options
@manic geode not all bot hosts paid, and not all free bot hosts bad
Cause IDs aren’t ints
^
oh in my lib they are rip
@winged thorn they're above max safe in js
IDs are numeric or smth
By that I meant that there are some free bot hosts that aren't bad because they're free 
Oof
What hosts are those
and get something working
👁🗨
Free hosting is always a bad choice unless your friend is allowing you to host on their vps
the $3 a month for a GG vps is worth more than the 40h of trying to get a free host to work like you want it to lmao
and yeah agreed with panda
But things like Heroku, glitch, etc are bad options
i mean heroku kinda
Nah
but the free version is still garbo
Wanna give me one Jkjk
lol
speaks for my competency but, I spent days trying to get GCP working and gave up
I don’t like raspberry pi
gcp is cool
Heroku had my nodejs going in 30 minutes
but complicated as fuck
why don't you like rpis
Eh
arm devices are meh
Just don’t like it can’t handle music bots well
I couldn't vouch for that as my bot doesn't do music stuff
I had a raspberry pi and it was so butt hurt cause of music functions lmao
lol I felt so bad, GCP even emailed me multiple times "Don't give up, give the tutorial another try"
rpis are still dope
Ye for non music purposes it’d be bomb asf
i asked the owner of GG for an rpi4 cluster
but the power/networking costs are too high to sustain it
Rip
yes
I mean yes
Mainly cause none of my bots get past 30-40 servers lmao
rpis are really useful for making a home server for iot devices ngl
Anyway does anyone know a way I could fix my problem well not really a problem but to avoid a mess of code
I was going to try arrays but better-sqlite3 doesn’t support array data types
I gave him the advice that would last the longest and performs the best.
Amazon offers a 1 year trial
you can use GitHub student to get a ton of credit and discounts if you are in school.
There's many options
For shits and giggles I used balena to do a 10 pi cluster with each pi running 1 shard
It worked, but was just for shits and giggles. Not super viable imo
anyone know how to get a channel mention in d.js
message.mentions.channels.first() didnt work for me
yes
can you show the code?
sure give me a sec
const discord = require("discord.js");
module.exports.run = async (bot,message,args) => {
let row = await bot.serversConfig.findOne({
where: {
"serverID": `${message.guild.id}`
}
});
if(!row) return message.channel.send("error could not find this server in the database please contact the developer in the support server");
let log = message.mentions.channels.first()
if(!log) return message.channel.send("please specify a channel for logs to be sent in")
row.update({
"log": log.id
}).then(message.channel.send(`updated log channel to ${message.mentions.channel.first()}`))
};
module.exports.help = {
name: "setlogs",
aliases: ['sl']
}
not the 2nd one
mentions.channels
let log = message.mentions.channels.first()```
oh
thats the part that errors out
positive? because that looks fine
Do if(message.mentions.channels.first()) {log = blah}
just try adding the s to the second one, because that one for sure wont work
and its fixed now
code is like a girl with me
one min it works the next it complains then its fine
lol
Do you use sql?
if you don't ur gay
sqlite
I’m having better-sqlite3 problems
Since it doesn’t support array data types I’m trying to find a work around
im not the best with sql but ill try my best
Just do DROP ALL TABLES. Always works
I don't actually really know SQlite3 tho so sorry
What are some good bot stats to list?
Servers, users, total points, total levels, total xp, what else?
total command usage
Ooo
number of codes, for example 17000+ codes
most used commmand
yeah number of lines if youre into that
I need to make an eval command. How can I do that?
Was thinking of this:
let arr = ["guildMemberAdd FALSE", ”guildMemberRem FALSE”]
let str = arr.join(” , ”)
db.prepare(`CREATE TABLE IF NOT EXISTS guilds (blah blah, blah blah, event_toggles ${str}))
I'll just run cloc xxxx everytime lol
But idk if .join would turn it into a string or leave it as an array
console.log it 🙂
@abstract crow i have an example eval and exec command at https://github.com/cyber28/exeggutor perhaps you would find that helpful
Thx mate
just please please please secure it properly
Are you not able to put numbers in an sql statement?
Not sure, I only use numbers in prepared statements
That’s what I’m doing
Can I have some tips on anything or suggestions? https://moosecorp.xyz/i/noted-grain-7592.png different colors? what should I add/change
Its bland rn ik
the Stats color doesnt stand out much
Yeah... I wish there was a color palette picker based on a color or 2 u give
Like if I give that dark grey background, I want it to give similar looking colors
don't hardcode your help command
w d y m
I just loop through my commands and split them up based off the category they are in lmao
do i make it embed??
Yes
You put it in an embed
no
ok
What why
can you tell me how you make an embed?
it's unnecessary
its cool tho
Sending it out just like it is, is ugly
it's unnecessary and it doesn't fix the issue of it being static text
Well yea, but it’s an option
what are you blabbing about
would it look good if i used code blocks
it's irrelevant to the issue
?
Now it’s relevant cause he asked
What should I use if I want to fork a child and then communicate with it, but like request => response and not that clunky ipc channel node gives you?
(node)
shut up, please, you aren't contributing to the issue
as for @manic geode you should dynamically generate your help command, get all of the commands, including their names and descriptions, and then generate a string based on that
Lmao
static text for a help command is very bad practice
You shut up
why so
He asked a question I’m answering
2019/08/16 22:18:44 [warn] 497#497: "ssl_stapling" ignored, host not found in OCSP responder "ocsp.cloudflare.com/origin_ca" in the certificate "/etc/nginx/ssl/gofven-cloudflare-cert.pem"
Can any gods explain what i've ran into?
you aren't contributing to any issue at all, stop being low iq
Lmao okay bud
js
What lib Eris or d.js
if you're using discord.js i believe you can use commando which provides you with a full command framework
Or use d.js and just do Discord.RichEmbed() for stable and Discord.MessageEmbed() for master
alr
why not to use static strings for help commands is simple, you're required to update the string with every command you add, delete or update and it will eventually get so large to the point where it's unreadable
wdym
based on that, dynamically generate your help command
Why make it more trouble for em when d.js offers a method of created an embed
how
embeds are irrelevant to static help commands, how does that not go inside of your brain
they asked is this good for a command list - a static string is not
and you then gave them a faulty advice (thanks ac)
You’re still being the idiot here lmao
hey guess whos back for help
like i said - you gave them a faulty advice; "oh just put it in an embed" does not fix an issue of having a static string as a help command
after you gave them a faulty advice
which is why i keep noting it
Satan
; "oh just put it in an embed" does not fix an issue of having a static string as a help command 
What's happening here boi
I said loop through your commands
Limaaa
No arguing please
So cry shut the fuck up
Both stop arguing
Stay calm @lusty dew
honey you're being low iq
Oi cry stop arguing smh
Limaaa
to be fair, this argument isnt helping anyone here. hardcoding your help command is a bad idea if you have many commands, and plain strings dont always look the best. insulting each other isnt beneficial to either of you
cyber
ask your question
Cry stfu lmao
?
@lusty dew stop
@sterile quarry yes?
how tf do i make my bot actually use the commands
in which library
are you the guy who posted on r/discord_bots earlier about commands not running or is this a coincidence
Talking about I have low iq when you ignore the fact they asked a separate question cause you’re too afraid to admit you were wrong about something
@lusty dew can you stop
coincidence
Take arguments elsewhere
rtfm
Meh fuck it I’m done with the dirty ass hoe
ah okay, so whats the problem exactly?
i cant figure out how to make my bot run like -kick -ban ect
in which library
if you don't know what a library is - https://discordapp.com/channels/264445053596991498/502193464054644737/555644686199422976
pls dont watch a yt tutorial and then complain something isnt working..
Yt tutorial can be good
nah
youtube tutorials aren't ever good
the first and most important question is, did you write any code for your bot? if yes, which library did you use? if you know which one, post the code with things like tokens and api keys removed
Depends of the youtuber
YouTube tutorials can be useful if you learn by watching it happen
the only youtube tutorials i approve of are from officials; e.g microsoft dev teams reviewing changes etc.
most are outdated
I learn best by watching others sometimes
Same
so people with the question "wHy Is ThIS NOT WOkIng"
learn by watching is an excuse for "im lazy to read and think for myself"
atleast in programming
Some people just copy/pasta code and then complaining about that
what's even more ironic is that most of the times the code in youtube tutorials is absolute spaghetti
that guy probably doesnt even know what a library is so they just ignore
more than likely
nah, im trying to help him in dms
So, how would I make it so when my bot replies to the command it uses code blocks?
oh
a bot can send the same shit as you can
what?
does anyone here use weeb.sh, i'm coming back to my old wrapper and i'm wondering if the endpoint for deleting images just returns 200 or does it return an actual response, docs state neither
https://github.com/cryyy/Akame/blob/master/Akame/Akame.Toph/TophExtensions.cs#L169
@topaz sphinx ocsp stapling needs a third file thingy; it's basically pre-fetching the root ca to improve speed
it's not a required thing though
so just comment it out
@alpine lark wdym
also are you running a bot in pterodactyl lmao
So I want to make a div that is a box. The box contains 4 more sub boxes, but I want 2 on the left and 2 on the right. How can I do that?
https://moosecorp.xyz/i/gaping-floor-7500.png I get this using float: right; but I want them even with each other
npm install 2-boxes-on-the-right-and-2-boxes-on-the-left
lol
@abstract crow grid or float? I'm fairly bad at css but try that.
😔 i did it mom get the camera will add youtube url in Discord message too
damn, that looks sick
Thanks i've been working on some nice updates for my bot this is a bit of an experiment
So the Discord Oauth2 docs show this
API_ENDPOINT = 'https://discordapp.com/api/v6'
CLIENT_ID = '332269999912132097'
CLIENT_SECRET = '937it3ow87i4ery69876wqire'
REDIRECT_URI = 'https://nicememe.website'
def exchange_code(code):
data = {
'client_id': CLIENT_ID,
'client_secret': CLIENT_SECRET,
'grant_type': 'authorization_code',
'code': code,
'redirect_uri': REDIRECT_URI,
'scope': 'identify email connections'
}
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
r = requests.post('%s/oauth2/token' % API_ENDPOINT, data=data, headers=headers)
r.raise_for_status()
return r.json()
But how do I put this into JS forms?
You'll need to make an OAuth url, E.g.
https://discordapp.com/oauth2/authorize?client_id=client_id_goes_here&scope=identify+guilds&response_type=code&callback_uri=ip_address/auth
Something like that might work.
Right but how do I convert all of this(the code above) into JS terms?
a wut
Nvm, I think that's the wrong name all you need to know is you need it.
Do you know how I can do this with Passport.js?
const cred = btoa(`client_id:client_secret`);
post(`https://discordapp.com/api/oauth2/token?grant_type=authorization_code&code=${code}`)
.set('Authorization', `Basic ${cred}`)
.then(response => res.redirect(`/guilds`))
.catch(console.error);
that's how it's done with snekfetch
I've no clue about passport never used it.
Ok
Oh, You'll need to use the auth token so response.body.access_token and add to variable or in url params like res.redirect(`/wheretogo?token=${response.body.access_token}`);
Well right now I have the Oauth2 pop up that you sign in with, then it redirects you to another page. All I have is the code
Although that's only if you're using express.
I am
Ok.
What do I do after getting the code tho?
Create more requests to discord.
get('https://discordapp.com/api/v6/users/@me/guilds')
.set('Authorization', `Bearer ${userToken}`)
.then(response => {
res.json(response.body);
})
.catch(console.error);```
Make the Access Token Exchange right?
I guess?
K
I'm still fairly new to OAuth so I'm probably doing stuff wrong but what I've sent seems to work for me.
-bots
-bots
-bots
Does anyone know how to change the image hash into an actual format?
OAuth - Discord.js@12.0.0
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
-bots
finally done with nowplay command with album info for a list of songs in the album too it's very nice https://cdn.discordapp.com/attachments/297305772243812353/612116013068189697/unknown.png
Does anyone know how I can pass Express.JS variables to the script side in an EJS file? I know I could do <%=var %> but that doesn't work with just javascript, only HTML
How do u tell if a user is using GET/POST/PUT/DELETE with Node.js's http module?
you should just be able to parse the request headers
according to mdn it's the first thing the client sends
You can if you reference the variable as if it were HTML iirc @abstract crow
Idk I haven't used EJS in years
test it first
what im asking is how tf do i make my bot run -kick -ban ect can anyone tell me
lol moreinfo
Please provide as much information as possible to get the most efficient assistance as soon as possible; state the library, language, the specific part of the code in question, and what you are trying to do and/or what you think may be causing the error.
Hey everyone, what setup will I need to reward the user when they vote without having them run the command twice?
For now its command1, they vote, command2, the bot rewards them if they have voted
But I'd like it to automatically reward them the moment they vote
Hello guys i want help for my script when i run command i save item and i let the random script choice the item mined but after the random script i want adding the item +1 in my data array how i can do it with my actually script ?
Is it possible to send data to webhook as using the get method?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Hey everyone, what setup will I need to reward the user when they vote without having them run the command twice?
For now its command1, they vote, command2, the bot rewards them if they have voted
But I'd like it to automatically reward them the moment they vote
@earnest phoenix webhooks
Check the docs
@earnest phoenix
@dusky mist wrong. Please if you dont know how to help dont
(They seem to be offline
)
Ok srry
it's python
p!daily
i prob sound dumb as fuck asking this but how to u define args
you learn javascript properly before making a bot 
you have your arguments defined..
well when i run it says args are not defined
you put arges
because you are defining it as arges
how do i update the server count
?
can it be manual?
or it has to update every da
^
just did this yesterday
or day before that
it should be done automatically if you have the discord bot website -token (not the discord dev portal token) and library (dbl) installed and setup correctly @earnest phoenix
no
it's automatic
if you already have server count posting worked, it should update by itself
@sterile quarry wtf is dis
How to activate members count...
Activate? Not sure what you mean here
Hello I have a question if we are working on the bot when we submit it on the bot does moderators will accept? I have just a few commands but usefull ones so idk if I can submit now or if I have to wait
It doesn’t matter how many commands you have, just that they perform the main function of you bot
Okay and if I change the bot concept I should ask for an audit again?
in php what is the difference between GET and POST
@hollow saddle how to add member count
@manic geode GET and POST are not related to php at all
they're HTTP methods.
and the names are pretty self-explanatory
usually you'd use a GET request to get data from a webserver
and a POST req to post data to it
that's the point of the naming convention
in theory it's possible to do it differently
but you rarely should to avoid confusion
@earnest phoenix no
@wispy cove DBL.postStats(serverCount)
I suggest you do it periodically
see the docs for the rest at https://discordbots.org/api/docs
i remember using GET or POST in php forms
@tight heath were to type this... DBL. poststats
this is the code for the js library
perhaps you should take your time to introduce yourself with the libraries before asking questions here
who?
const embed = new Discord.RichEmbed()
.setAuthor(`Ban`)
.setColor(color.green_light)
.setDescription(`I just joined ${guild.name}!`)
message.channel.send(embed)
});```
`message` is undefined
arent you supposed to have a semi colon after the last embed property edit??
you add it here
.setDescription(I just joined ${guild.name}!)
uh no
oh i know why (i think)
why
tell it
well you dont have 'message' as an argument but that may not be the case wait nvm
@stray garnet on a guildCreate event there is no message
what message is it supposed to pass
when you join a server
i think its when the bot joins the server
Yea
:D
i think you need message argument
i am not very experienced with the guild argument tho
you don't get a message with guild join events
so
is there a event in client/bot that detects when the bot joins??
that would be helpful
you get a GUILD_CREATE event
if the id in that event wasn't sent with the READY payload, you know it's a guild join
But, how can i define message?
you don't
in a guildCreate event, you dont
get the channel with another method
^
@inner jewel Which
maybe if there was like guild.systemchannel
or something
that would work
depending on the usage

@tight heathok thanks
not anymore
yup
used to be a systemChannel
but still
there's no message arg
because why tf would there
you could get all the channels and pick one from random
or just DM the owner of the server if what you want to send is help commands
what's gone is the default channel
well no
the system channel used to be unchangeable
but its always been the system channel
the system channel property is new
as far as the discord api goes
idc whatever libraries called it
the system channel field in guilds was added when the join message channel feature became a thing
the default channel was the channel created along with the guild that shared it's id and couldn't be deleted
ye ik about the shared ids
might also wanna use that for your join message @stray garnet
test if there is a default channel since some guilds still have it
as in
have a channel same id as the guild
which probably has some importance as the first one
and if not, just pick guild.channels.first()
should give the oldest one if its are ordered chronologically
idr if they are
what where do you press start
visual studio
You should be using node mainfile.js
library?
.net
How could we help with that? @earnest phoenix
yes
i dont know uwu
We don’t know either
download better internet
BetterInternet.dmg
Ok so I have no clue what's going on but both Cloudflare and Digital Ocean have separate DNS settings and I don't know if I need to connect them or wut
Well I have CF directed directly towards my VPS IP
But not Digital Ocean
@earnest phoenix disconnect all of your devices from internet 
So do I direct all traffic to DO from CF?
where can i download free internet no registration no sms no virus 100%m
?
Download free internet??
Not possible
Read what @abstract crow have said
Read #general and also #502193464054644737
@earnest phoenix you would need to pay for it. That kind of thing isnt free.
@abstract crow ok so
where do you have your domain registered
and more importantly
where do your NS records point
@dense cipher ok, so wait. it can take up to a week
I don't have any
you very much have NS records and they point to cloudflare
so you manage your DNS at cloudflare
Srry lol
¯_(ツ)_/¯
Correct
DO is outta the game
My email
I just got approved for Github student, so I tried out sendgrid lol
FUCK MY ADRESS
you're an owner huH
lol


haha
Same here
ok
I didn't even notice lol
tell what tell me

lol
Do any of you have any ideas how I can get my bot to play a certain sound byte from a file, NOT from youtube?
Just for sound effects like applause, ding, spinning wheel, boo, drum roll etc
All the guides seem to redirect you to youtube-dl
What lang
since retrieving the bytes from that file can be used, you can play audio from the bytes. Same thing for images and text
google will
what am I looking for specifically?
11.5.1
my linux server won't do 12
The guy who owns it insists Centos is cool and hates arch
np with 12 on my arch at home, but beggars can't be choosers
but why doesn't it do 12
lik
it's not different from 11.5.2 in the install process except requiring git
anyways
something to do with a windows library that centos hasn't get plugged
voiceChannel.join().then(c => c.play('/path/to/file.mp3'))
c being a VoiceConnection object
requires node-opus iirc
thanks
the d.js docs can tell you quite a lot
possibly also an if statement to see if it's already joined that channel
:)
yeah I mean you could store the voice connection somewhere
and yeet it upon leave()
but personally idk about voice in d.js
only used lavaplayer so far
and even that rarely
lavaplayer?
how do I get the voiceconnection, the bot returns a map of voice connections
What?
&ts
You mean user in a channel?
Try with console.log(bot.channels.get('id')) its returning a collection
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'playFile' of null That's the error
??
if(vcChannel!=null) {
if(bot.guilds.find(g => g.id === message.guild.id).channels.find(c => c.id === vcChannel).members.has(bot.guilds.find(g => g.id === message.guild.id).me)==true) {
bot.guilds.find(g => g.id === message.guild.id).channels.find(c => c.id === vcChannel).join();
} else { console.log(`ALREADY IN VOICE CHANNEL!`); }
let c = bot.guilds.find(g => g.id === message.guild.id).voiceConnection;
await c.playFile("/home/humansheeple/bot/sounds/FlatIntro.mp3");
} else {console.log(`ERROR NO VOICE CHANNEL!`);}
This is what I put
What did I do wrong?
VOICE CONNECTION: null
I Want Use The Bad Word Blocker
But I Have Err
TypeError: db.fetch(...).then is not a function
I can help you make one
what is this
don't waste your time on word filters, they'll be bypassed no matter how hard you try
Yeah I didn't do it the db mehtod I did it the json methon
how
well you'll need a swearlist.json
You'll need the to get the index of the swear in the message
@earnest phoenix bUt MuH Ai
check the precedign character for wildcards and the succeeding character for wildcards if its found and both the prefix char and suffix char are wildcards then delete the message
that way you can distinguish between
ass and assistant
ravyToday at 6:51 PM
cry bUt MuH Ai
if(...) {
if(...) {
....
}
}
🙃
lmao
@earnest phoenix well if the preceding character has a wildcard
bass would trigger the filter *ass*
wouldn't it
also in general filtering words is bad
context is always better
and not giving a direct feedback, but instead profiling
so they don't try finding a bypass
¯_(ツ)_/¯
no you're wrong because "b" isn't a wildcard
what
wildcards are "", " ", "!", ".", ",", "?", ":", ";"
So you have them in an array
do you know what a wildcard is
lol
wildcard (plural wildcards) (computing)
A character that takes the place of any other character or string that is not known or specified.
so long as the succeeding or preceding characters are one of those it will trigger the message.delete() and the message.channel.send(${message.author.name} stop bloody swearing!)
even if, ravy already said that context is more important than profiling
I have an array called wildcards, maybe it's the wrong name to call it, but that's what it does
@earnest phoenix
yup
you can mix and match space characters to bypass filters anywhere
a<zws>ss should bypass that whole thing altogether
and if you completely remove spaces
you get something like
speechWidCards, i made an array
as speaking is not my strongest suite
So if you typed !ass! it would work
and too many false positives
but if you typed bassed it would not
but if I typed
as speaking
it wouldn't right
but
if I type as s
it wouldn't either

and if you went to that level of measure, you'd get too many false positives to the point the filter would be unusable in a casual conversation
@earnest phoenix do you have a server with that bot
I want to show you something
^ this wonderful character
there's two types of zws
normal and no-break
so it's even harder to detect
two servers
the two bots are coded slightly differently
some of these bypass discord's internal api filter
so you can have text channel names with spaces
yes I have a command for that lol
that lets you do
-channelname <name with spaces>
and replaces the spaces with 2 half-width spaces
lmao
works quite the well
can you copy/paste the correct type of space
wdym
when i do that i get a -
likely because discord only checks for certain types of spaces
yes
ty for the tip
I know this is gonna be a stupid question, But can discord bots listen to voice?
it's undocumented
it depends on the lib you're using
some implement it some don't
dIsCoRd.Js
i feel like you could use a voice to text plugin to circumvent most of the hastle of setting up a vc bot. but i could be completely wrong.
wat
@warm marsh Discord has two gateways, the textchannel gateway is easy to work with. The voicechannel gateway is an entirely different beast I'm working on that issue myself right now
wdym by vc bot
voice command bot
well that's because you use d.js
there's no textchannel gateway and voicechannel gateway 
you need to have a voice recognitioner on for each user stream, very expensive
@earnest phoenix are you any good with voicebots and node.js?
i don't do js
python?
nope
i mainly work with .net
Is there stuff .net can do that .js can't?
that's a very wide question
they both implement stuff differently
but i rather prefer working with .net (c#) than js
c# is windows
I hate windows
there's .net core
which is cross plat
i managed to get a speech to text bot working once with GCP speech to text and discord.net
What did you do decrypted packet assembly?
me?
yeah
discord.net handles the entirety of voice, including receiving and sending packets through the udp connection
you can read user streams and send a stream through the connection freely without hassle
Is this impossible in js or just a pain?
i have no idea
i've never tried
I tried ages ago it was a pain
one thing worthy to note is that you need to send to receive
.net is a pita to work with for me
I perosnally microservice in langs good for it
contextual message scanning in py because easy to understand
bot&ws in js because weblang
soundboard with lavaplayer
imagegen in C++ (used to be Go)
i mostly process my audio through soundtouch
i mostly pipe youtube audio through it to get it to a PCM float
Anyone good with node's Nan api?
Im trying to get a number value from a js array into a double, but object->get(key) is deprecated, and im having trouble figuring out how to use Nan::Get()
Yes but you cant assign them directly in c++
i thought your question was about node...
Yeah, i need to pass js arguments to a C function
Anyone can help me with my web dashboard?
@chrome olive what I meant by that was actually state your problem here, not just repeat your question :p
Error: Media must be provided
at Function.verifyOptions (/home/humansheeple/bot/node_modules/discord.js/node_modules/prism-media/src/transcoders/ffmpeg/Ffmpeg.js:13:31)
at FfmpegTranscoder.transcode (/home/humansheeple/bot/node_modules/discord.js/node_modules/prism-media/src/transcoders/ffmpeg/Ffmpeg.js:34:59)
at MediaTranscoder.transcode (/home/humansheeple/bot/node_modules/discord.js/node_modules/prism-media/src/transcoders/MediaTranscoder.js:27:31)
at Prism.transcode (/home/humansheeple/bot/node_modules/discord.js/node_modules/prism-media/src/Prism.js:13:28)
at AudioPlayer.playUnknownStream (/home/humansheeple/bot/node_modules/discord.js/src/client/voice/player/AudioPlayer.js:97:35)
at VoiceConnection.playArbitraryInput (/home/humansheeple/bot/node_modules/discord.js/src/client/voice/VoiceConnection.js:458:24)
at bot.guilds.find.channels.find.join.then.connection (/home/humansheeple/bot/triggers/flat.js:36:34)
at <anonymous>```
Any ideas?
code?
ok
const soundFile = fs.readFile("/home/humansheeple/bot/sounds/FlatIntro.mp3");
if(vcChannel!=null) {
if(!(bot.guilds.find(g => g.id === message.guild.id).channels.find(c => c.id === vcChannel).members.has(bot.guilds.find(g$
bot.guilds.find(g => g.id === message.guild.id).channels.find(c => c.id === vcChannel).join()
.then(connection => {
console.log(`CONNECTION: ${connection}`);
const dispatcher = connection.playArbitraryInput(soundFile);
})
.catch(console.error);
} else {console.log(`ALREADY IN ${vcChannel}`);}
} else {console.log(`ERROR NO VOICE CHANNEL!`);}
Help?
I get an error when I'm trying to fetch the user guilds
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
wouldnt soundFile contain a buffer then, which is something it cant handle? why dont you just use connection.playFile() instead?
https://discord.js.org/#/docs/main/stable/class/VoiceConnection?scrollTo=playFile
- Code
fetch('https://discordapp.com/api/users/@me/guilds', { method: 'GET', headers: { authorization: `${response.token_type} ${response.access_token}` }, })
.then(res2 => res2.json()).then(guildResponse => {
req.session.guilds = guildResponse;
res.redirect('/');
})
Alright Ichanged the code now the bot joins the channel but is SILENT
Any ideas?
@mossy vine
Bare in mind this linux server has no on board gui or sound card it's a terminal
Who might ?
so can anyone help me?







