#development
1 messages · Page 365 of 1
What the
if you arent willing to code and learn a language, dont code
Once again this all starts from choosing a language
can you make a bot with lua
if you don't have a base language then you're not going to get specific advice
.....
i take that as no
its possible
holy
Use that, ur friend will then be able to help you.
or join DAPI and have fun looking at libs there
If he keeps asking about lua
Or join discord.js discord.
How do you get the Discord username of someone using discord.js(Example: cbpudding#9078)
Thanks
// Get a channel by ID
client.channels.get("the channel id");
// Returns <TextChannel>```
@wispy schooner shouldn't this return any form of Channel?
dunno how d.js does internal but surely it'd be logical for that to fetch VCs as well
probably does
oh thats correct but i think he means if you put a TextChannel ID in it always returns TextChannel
ofc
yeah but it'd be logical to document that too imo
yeah it represents all kinds of channels
wait does voicechannel extend textchannel?
no pre sure both extend Channel
@scenic crest http://evie.ban-hammered.me/i/rx1xr.png
@scenic crest both extend GuildChannel which extend Channel
because you just say "get a channel by ID"
tried to get rid of it but this white line still shows https://habchy.com/captures/44167.png
so therefore by that logic you can put in a VC ID
its box-shadow
box-shadow:none !important;
and its not the image itself
its the image container
.bot-img {
background: transparent !important;
border: none !important;
box-shadow: none !important;
}```
thats my css
bot id pls
@languid dragon How do we get the admin role?
inb4: ken deletes it
get out of #development kthx
change it to .column .bot-img
that'll fix it
.column .bot-img {
background: transparent !important;
border: none !important;
box-shadow: none !important;
}


hi
Sorry for who want came for development its moved to general
mods are talking in general development stuff like 2 hours
#general bud or I'm gonna have to mute you
**thinks to self** She made a gud point Arisu did
Now a mod is gonna threaten to mute me
get the hell outta here
😦
@wispy schooner https://github.com/AnIdiotsGuide/discordjs-bot-guide/pull/9
merged
<33
at least it wasn't a whole new article, I'd have to set @clever yew to review your PR lol
He can be very... yeah...
very? strict? evil?
ah
Well if he is as picky as you make him out to be, then my PR wouldn't have been neccessary in the the first place 😉
hey i was wondering if someone could help me, i'm developing a addmod command and needed help checking if they already are mod or not
const db = require(`quick.db`);
const member = message.mentions.users.first();
const hiddensettings = require(`../external/hiddensettings.json`);
if(!message.guild.member(message.author).hasPermission(`ADMINISTRATOR`)) return message.reply("You do not have the required permission(s): **ADMINISTRATOR**");
db.fetchObject(`guildPrefix_${message.guild.id}`).then(i => {
if(i.text){
PREFIX = i.text;
}else{
PREFIX = hiddensettings.PREFIX;
}
if(!member) return message.channel.send(`Usage: ${PREFIX}addmod <@User>`);
})
db.fetchObject(`moderator${message.author.username}_${message.guild.id}`).then(i => {
})
db.updateText(`moderator${message.author.name}_${message.guild.id}`, args.join().trim()).then(i => {
const yes = Aizen.emojis.find(`name`, `yes`);
if(i.text){
message.channel.send(`:x: That user is already a server mod`);
}else{
message.channel.send(`${yes} ${member.username}#${member.discriminator} is now a server moderator!`);
}
})
}
``` code
.hasRole()
i'm not using roles
how are you making them mod?
well in that case
you would check if they had moderator in the database
have the moderator status either true or false
have you ever used quick.db?
ffs
concept is the same
i.text?
@patent reef not that hard
look at code
it's what is in the database
it's not really, you just need to get used to it
i was looking at that rn
quick.db is made by a guy named TrueXPixels
yea
made by a guy with a cancerous discord server
i'm not in his discord
and his yt vids arent that informative since his doesnt speak
i don't watch his vids
i just found it and learned
How do I go about getting the number of servers my bot is on to my website (so it automatically updates as it gets added to more servers)?
I assume I could just scrape the link of my bot's webpage off of discordbots.org but is there any other method?
every time you refresh your page you could make a request to the bot and return the server count
Or use Dbls json stats endpoint for your bot
So you don't dos yourself
rethinkdb is ehhh
its good
eeeeeeh
SQLite ftw
Whenever I run this code:
client.on("messageDelete", (Message, throwex) => {
let embed = new Discord.RichEmbed()
embed.setColor("RED")
embed.setTitle("Message Delete")
embed.setDescription("Someone has deleted a message")
embed.addField('Deleted Message', (Message))
embed.addField('Author', (Message.author))
if (Message.guild.id == "336487228228370432") {
client.channels.get("398265731176988682").send({ embed });
}
else{
Message.guild.channels.find(c => c.name == 'logs').send({ embed });
}
It works, but then throws this and crashes right after
^
RangeError: RichEmbed field values may not be empty.
at RichEmbed.addField (/Users/nayab_warach/node_modules/discord.js/src/structures/RichEmbed.js:158:34)
at Client.client.on (/Users/nayab_warach/Documents/Discord/LionBot/LionBot/LionBot/lionbot_mac.js:157:9)
at emitTwo (events.js:106:13)
at Client.emit (events.js:191:7)
at MessageUpdateAction.handle (/Users/nayab_warach/node_modules/discord.js/src/client/actions/MessageUpdate.js:13:16)
at MessageUpdateHandler.handle (/Users/nayab_warach/node_modules/discord.js/src/client/websocket/packets/handlers/MessageUpdate.js:7:34)
at WebSocketPacketManager.handle (/Users/nayab_warach/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (/Users/nayab_warach/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:330:35)
at WebSocketConnection.onMessage (/Users/nayab_warach/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:293:17)
at WebSocket.onMessage (/Users/nayab_warach/node_modules/ws/lib/EventTarget.js:99:16)```
I cant seem to figure it out
or Message.cleanContent
Same thing happened
client.on("messageDelete", (Message, throwex) => {
let embed = new Discord.RichEmbed()
embed.setColor("RED")
embed.setTitle("Message Delete")
embed.setDescription("Someone has deleted a message")
embed.addField('Deleted Message', (Message.content))
embed.addField('Author', (Message.author))
if (Message.guild.id == "336487228228370432") {
client.channels.get("398265731176988682").send({ embed });
}
else{
Message.guild.channels.find(c => c.name == 'logs').send({ embed });
}
});
Does anybody know how to get a bot to automatically accept friend requests or are bot accounts not allowed to have friends?
not allowed I think
OK I will, but I dont think that will solve this issue, will it?
probably will
oh
well then
I'll try that
So I plan on scraping data from other websites into my bot's website and I see it can be done with cheer.io (https://cheerio.js.org/) but the problem is I don't truly understand the installation process... npm install cheerio.
I understand that I'll have to install cheerio for it to work, but the problem is...
How do I do that if the site is being hosted by a company and there's no option to run a terminal or whatnot?
I could download the files and upload it to the File Transfer Protocol but would that mean when I say something such as
var cheerio = require('cheerio') in my JavaScript code, it'll function properly?
I'm sorry for asking this stupid question, but it's my first time working like this (for a website).
as long as you have node.js and a node_modules folder within your project in which the module is
require() will work
I'm confused as to what "Raw Embed Data" is??
Is it just the same tags without embed infront?
see https://leovoel.github.io/embed-visualizer/ for reference
Oh ok.
discord.js allows you to send a "raw" embed as an object like js Channel.send({ embed: { title: 'owo im an embed' } )}
The node_modules folder shouldn't contain anything right?
it should contains every module that you require
node_modules should contain all your modules
If you don't have anything in there, don't expect to require anything.
Oh! So I download the source code from https://nodejs.org/en/download/ then put that in my FTP. Then for an example, cheerio, I download that source code and put that in my node_module folder?
yes
awesome thanks!!
(for reference this is how it looks like inside node_modules)
Okay, noted. 👍
Ok. I was able to fix it, but now it spams. ( NO I WILL NOT SWITCH TO RAW EMBED. I like rich embed c: )
oh uh i maybe said yes a bit too soon, you need to install node.js, not just throw out the source somewhere in your server 
not sure you can do it without a terminal if you're doing it on ftp 
Fricking* Hell it was a simple if statement to fix it
what form is this in https://i.imgur.com/2mG1oun.png
Quick question: What do URLs in Discord embeds do?
@topaz fjord judging from the value i'd say ms
Hey, I’m coding a new bot just wondering what you guys use
@strange escarp Just a quick tip. Bots can't join Group DM's/do anything with them (if nobody told you)
I noticed that once I realized that they couldn't be friends with people
Weird
Why would you even want to be friends with a bot anyways?
why wouldn't you?
true 
That way you can use the bot via DMs and even add it to group DMs
You already can use a bot via DMs
using via dms is easy
I know
Bots aren't meant to be in group DMs though
group dms is weird though. IDK if it's possible
It isn't
what not possible
But even if there was a way to friend bots, they can't accept a request
Group DM on bot?
They need to be friends with you in order to add them to a group DM
I just confirmed you can't as the API is locked
C:\Users\owner\Desktop\Weather Bot\app.js:141
if (result.length === 0) {
^
TypeError: Cannot read property 'length' of undefined
at C:\Users\owner\Desktop\Weather Bot\app.js:141:18
at Request._callback (C:\Users\owner\Desktop\Weather Bot\node_modules\weather-js\index.js:42:41)
at self.callback (C:\Users\owner\Desktop\Weather Bot\node_modules\request\request.js:186:22)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at ClientRequest.<anonymous> (C:\Users\owner\Desktop\Weather Bot\node_modules\request\request.js:816:16)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at ClientRequest.emit (events.js:208:7)
at Socket.emitTimeout (_http_client.js:708:34)```
Any help?
result is undefined
No.
yes ?
Yes
Length is.
Cannot read property 'length' of undefined
same
same
Any help to fix it?
uh using discord.js?
Yes.
ok lemme see
We don't know what "result" is (supposed to be/where it came from)
so that's the first issue
if (result.length === 0) {
message.channel.send('**Please enter a valid location.**')
return;
}```
did you declare result as a variable?
No,
wat
uh you can't read the value of a undefined variable 
Do you even know why result is undefined
It fixed it.
Why not use ```Javascript
if(typeof result === "undefined" || result.length === 0) {
👍🏻

fucking nude
yes
So suppose I want to get node.js onto my website, I just move the files-right?
https://cdn.discordapp.com/attachments/222197033908436994/408070352615243779/unknown.png
@earnest phoenix tf is that
000webhost
is a pile of shit
and untrustworthy
Also you can't do node.js on a shared hosting service that uses apache
o darn
tell me something i don't already know :/ @elder rapids
lmfao
would heroku work? @elder rapids
pong
what do you guys use
Heroku can run node.js
awesome
any suggestions?
i use discord.js
compatible with Mac?
yes
alr ty
np
hi
Any help? I set my bots activity as Prefix: ~ but the bot is showing Prefix: -
Bot is @pseudo root
@austere meadow Any help?
says ~ for me
yes
Screenshot?
it changed back 
on my ipad it said ~ but now on my pc it says -
issa squiggle for me
its just a visual thing
Mm.
Here is the code tbh.
bot.user.setActivity(`Prefix: ~ |Servers: ${bot.guilds.size} | Website: www.WeatherBot.weebly.com`)```
weebly
xDDDDDDDd
u
no u
Well my bot is so cool that is website doesn’t even exist
why weebly out of all things uGH
^
Like just use google sites. Weebly is for people who just want to get out of paying web designers. Or better: learn HTML, CSS, and Web JavaScript and make one.
betterbe
i cant see to ctrl V in cmd prompt
what
it exploded my prompt
that's what we call verbose
it actually tells you what it's doing instead of "We're doing things please wait"
its not called a verbose, its just being verbose
english with Loris

public static HashMap<String, Command> commands = new HashMap<>();
public static void init() {
commands.put("help", new HelpCommand());
commands.put("shards", new ShardsCommand());
commands.put("donate", new DonateCommand());
commands.put("statistics", new StatisticsCommand());
}
public static HashMap<String, Command> getCommands() {
return commands;
}``` help
and it won't load
do you ever call the init function?
CommandRegistry.init();
shards = new DefaultShardManagerBuilder()
.setToken(NatsukiData.getToken())
.setAudioSendFactory(new NativeAudioSendFactory())
.addEventListeners(new EventListener())
.setGame(Game.playing("Hold on to your seatbelts! <3"))
.build();
yea
when she starts
show me your listener
public class EventListener extends ListenerAdapter {
@Override
public void onReady(ReadyEvent event) {
new Ready(event);
}
@Override
public void onGuildLeave(GuildLeaveEvent event) {
new GuildDelete(event);
}
@Override
public void onGuildJoin(GuildJoinEvent event) {
new GuildAdd(event);
}
@Override
public void onGuildMessageReceived(GuildMessageReceivedEvent event) {
new GuildMessage(event);
}
}```
show me the GuildMessage class (hastebin)
add a log in some places in that class to see if it get past some points
after line 12
on line 28 (log the command obj)
i gtg to school now, be back in like 15-20 mins
@vital lark how did you fix it?
Can somebody help me? I'm working on a help menu using reactions and how do I make so that if I react to it, it notices it directly instead of having to set a timeout? Also how do I see that the person reacting is the person is the author of the help message sent?
What langggg
Sorry completeley forgot about that... The lang is JS and the lib is d.js
Don’t know them well but i imagine they have an on reaction add event?
So then get the author of help and author of reaction and see if they match
I can try
there is reactions collectors built-in d.js
And if the message id of the reaction matches your help message id
There is?

ahh
can someone help me with a server count code for discrd.js
the superior language

Python >
brainfuck >
assembly >
mspaint >
I use MSPaint as IDE.
batch > kek
Is there a way to make the bot send a message to all the guilds it is in? (I’m a noob, I know)
basically iterate through all guilds and send a message to the first channel your bot has permission to talk in in each
^
that may result in ratelimits tho
Or default channel because thats still a thing
well check if defaultChannel is a thing in the guild first maybe yes
maybe first channel is better to do that
guilds that were existing before it was deprecated smh
i thought discord converted all guilds
no
no i know that
my bot support guild has a default channel
why would they go through the pain of converting them all tho
but yeah anyway
it may results in ratelimits if you don't add an interval
and it annoys most users
i dont recommend doing it
I know, but with the new update to my bot there is a required channel and since people don’t have it, the bot keeps throwing errors
And there are some servers that I didn’t even know it was on
why dont you just return if the bot doesn't find that specific channel?
Put it as a message in the help command?
You could just give back a return message stating how you need a new channel for it
if it throws back an error
because there isn't a correct channel
@heady zinc sorry, defaultChannel isn't a property in master and i get so used to master lmao
do they still have it in 11.3 tho
apparently
well anyway its still deprecated and a lot of guilds were created since then
so no point in using it
yeah
people using master cuz v12 is taking years to release
yes
master is pretty stable imo
it hasn't caused any issues for me
and i like the new stuff in it
still waiting for that internal caching thing 
No default channel is suppose to resolve to the default channel and if you delete it then it changes to the first channel it finds?
just returns undefined in that case
const randomcolor = '0x'+Math.floor(Math.random()*16777215).toString(16);
why this is not working ?
@austere meadow
i dont actually know if that code works or not
but i think in order for colours to work
its gotta be
color: 0xFFFFFF
not
color: "0xFFFFFF"
hidden links in enbed messages? how does it works:D
@austere meadow I'm trying to generate random color
K I'll try
@tidal laurel [text](http://spookylink) 
thanks 😄
@bitter sundial dude it's not working it's only changing that time when I'm restarting the bot.
looks like you set the variable on startup then
set it inside the command or make it into a function
Oh 😅 thanks
@bitter sundial Are you from Finland
yes
does anyone know how to do this on embeds? (discordjs) https://hrvyx.me/i/MkxUnNeD5ENB3M8OrkJDCxf2.png
idk if its new or not
but looks good
timestamps
thank you
🤔
Use UTC on that btw
@earnest phoenix
https://leovoel.github.io/embed-visualizer/
how i do host a website with A name to a subdomain
A wut
Use nginx or apache2
i use nginx
wait so you have something hosted at 12.34.56.78:90
and you want to use a domain something.com
yep
purchase the domain and set up a dns apex record
Use cloudflare...
use cloudflare for what lol
@glossy sand for ip protection u cuck
what in the world is "ip protection" supposed to mean
@glossy sand ddos n shit
when im trying use my domain
on a node processes
when trying s
use my domain
EADDRNOTAVAIL
you still just bind to 0.0.0.0
the dns handles everything and eventually tells the client to use your ip
Free CloudFlare doens't protect every protocol ^^
oh uhh
you'll want to run a reverse proxy server
I've heard nginx is pretty good for that purpose but I don't personally have any experience
thx
Does the streamOptions.seek for dispatcher even work?
It doesn't seem to seek
@glossy sand Nginx is the best choice for static serving & reverse proxy.
args.splice(0, 2)
for (let a in args) {
let role = message.guild.roles.get(args[a].replace(/[<#>]/, ''))
if (!role) {
let role2 = message.guild.roles.find('name', args[a].replace(/[<#>]/, ''))
if (!role2) {
returnMsg += `${args[a]} is not a valid role.\n`
} else {
returnMsg += `The role **${role2.name}** was deleted.\n`
role2.delete();
}
} else {
returnMsg += `The role **${role.name}** was deleted.\n`
role.delete();
}
}
am I able to get help in here???
yes
okay so the money game bot with the elephant profile pic I need help with the command call ( set-fine-amount <command> <min | max> <amount> )
the perenthace's I put in there
uhh
this is not dirext support for bots
its more like develope help with creating bots
you should ask the owner of that bot instead
and i think you mean unbelievebleBot
i think its unbelieveble
@umbral pelican
ask him in DMs or #general / #memes-and-media

does anyone know what im trying do here? im confused RN
var message11 = dclient.guild.channels.get("408336953419759617");
var Dusername = dclient.users.get("100463282099326976").tag;
client.say(channel, 'Discord: **' + Dusername + '**: ' + message11);```
i trying relay Discord to twitch
i done from twitch to discord im trying relay back from discord to twitch
🤔
do you guys have any idea how i can make a code that gets info form a website and posts something with it? with api? https://pubgtracker.com/site-api
100463282099326976 is you
You want to send a message in the "408336953419759617" channel and you want to send 'Discord: node ChisdealHD.js: ' + message11
And message11 is the channel as obj ?
@spare spruce
well firat all for example this
//relays twitch chat to discord server
var channel = dclient.channels.find('name', 'chisdealmethschat');
var username = userstate['username'];
channel.send('Twitch: **' + username + '**: ' + message);
thats how i can pull from twitch to discord
but i need way do backwords too like discord to twitch
idk
that's D.JS right ?
problem is idk how i get info out there like chat
yes
and TMI js
TMI = twitch nodjs
kinda intergrate both RN
oh to say where the discord message is from wich discord channel ?
Wich info you need from discord ? Channel name ?
client.say(channel, 'Discord: **' + Dusername + '**: ' + message11); this twitch fuction to write data
discord chat
how many times i have to say
oh
i mean discord channel = discord chat
as ya see i done for twitch dclient.channels.find('name', 'chisdealmethschat');
i need get data from chat channel
When you receive a new message you send it back to the Twitch api thing you have
yes
like anythign type sends to twitch
as back relay
as ya see works for twitch to discord but not discord to twitch
i don't use JS but you probably have a hook who get call when someone send a new message
First did ?
When the hook get call he send a obj call message in Python
So you can make message.content to have content
There is probably something like that in JS
what that bot called again coldon or what ever is
what can read all discord chats in html
like that but i need fuction call in twitch
that bot @gilded rivet
like that when thy did as HTML
but i need know how do that so i can do that to twtich as sipific channel
@spare spruce use one of the many twitch api library's on npm
Anyone need a Translator For Hungarian i can do it in Github
@spare spruce are you using the twitch api?
What is the member. tag for Discord Account Creation Time?
timestamp = (entityId >>> 22) + 1420070400000
Nevermind I'm dumb
I found it
Why does the streamOptions.seek not work
Do I have to return the dispatcher?
For what
Anyone know how to make a custom layout, kinda (for ex) this? https://freehighspeed.download/yF7WEix.png
idk if u can
ofcourse you can
why is my args.join fucking itself
it'll be pretty complicated, but you definitely can @cerulean zinc
Yea...
use process.stdout.write and process.stdin.on('keystroke', cb)
hmm. Alright
looking for a bot that post otc stock charts and share structures
events.js:188
throw err;
^
Error: Unhandled "error" event. ([object Object])
at Client.emit (events.js:186:19)
at WebSocketConnection.onError (C:\Users\owner\Desktop\Weather Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:371:17)
at WebSocket.onError (C:\Users\owner\Desktop\Weather Bot\node_modules\ws\lib\event-target.js:128:16)
at emitOne (events.js:116:13)
at WebSocket.emit (events.js:211:7)
at WebSocket.finalize (C:\Users\owner\Desktop\Weather Bot\node_modules\ws\lib\websocket.js:190:41)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)```
Any help
yes we can help with an error
xD
don't need the code
xD
what does it mean when you get "No available voice nodes"
i think i know what it means but i just wanna make sure
you may have provided the wrong details when creating the player
oh, heh that might be it
is this something i should care about "(node:13428) DeprecationWarning: ClientUser#setGame: use ClientUser#setActivity instead"
ok so if i just change setgame with setactivity the code should work
yes most likely
ok
if(client.id !== '407182079437307904')return;
let text = args.slice(0).join(" ");
message.delete();
message.channel.send(text, {
tts: true
});
}
``` what did i do wrong with if(client.id ...
ok so what i want is that if the channel is not channelID return
then you wanna get the if from the channel that message is from
yea the channel id is the 'numbers'
if (channel.id <..>)
@earnest phoenix oo what u using
Go probably
if(message.channel.id !== '407182079437307904');
message.channel.send("You can only use !say in the TTS channel.")return;
} else {
let text = args.slice(0).join(" ");
message.delete();
message.channel.send(text, {
tts: true
});
}
``` how do i get this code to work/ return and send message if the channel is wrong or send the message that the command is saying?
What the fuck is that return
your if is broken af
like first return should be before the value that is supposed to be returned
i wanted it to send a message before returning
How does it not error which is the question
second the code that should be executed if a condition is true should be inside the condition brackets 
Learn if and else statements pls
if(message.channel.id !== '407182079437307904')return;
let text = args.slice(0).join(" ");
message.delete();
message.channel.send(text, {
tts: true
});
}```
that works but it wont send a message
way better 
Because you didn't make it send a message 
i want it to send a costum message before returning
Ik
if(message.channel.id !== 'ehaterver') return message.channel.send('Your message');
@fleet mason
it didnt work. if the message was sent in the wrong channel it wouldent post a message but if i sent it in the channel i wanted it posted the message that i didnt want to post.
if(message.channel.id !== '407182079437307904') return
message.channel.send('You can only use !say in the TTS channel.');
let text = args.slice(0).join(" ");
message.delete();
message.channel.send(text, {
tts: true
});
}
ok so i have different chats in my discord. I only want !say to work in one of them. That is what the purpose of the if(message ... if the message is posted in the wrong chat the bot will say that the !say dosent work in this channel and that it only work in the other. If the message is posted in the right channel the bot will repeat the message that the user sent.
@topaz fjord
i want it to send the message to the channel to help the user
o heck
If you try to learn js then it would be better 
ok i just added a another if(... to the command and it works XD. pretty shit but i works 
How do you code a bot?
magick
You write stuff and the stuff does a thing
Mmk
with mspaint cc neko
Anyone have code for Discord.js for when the bot starts it logs a list in console of the guilds it is in.
I also use bot.on
Discord.js should have methods to list all guilds, you should be able to use a for loop to get all the names
well a basic forEach()
or a map
or anything else that lets you iterate through guilds

@topaz fjord lavalink,
@earnest phoenix did u fix it
@topaz fjord yeah it was a port thing i did on accident, now all i have is normal code errors so im nearly half way there XD
@topaz fjord what lib do you work on?
@low rivet sorry for the ghost ping, realised what i wrote was retarded
What
@earnest phoenix d.js
Bots cannot have rich presence
I wish they could 😦
why?
well gessing i have to use as streaming mode
How would one go about making a markov chain that stays on topic?
i mean you might be able to filter content for certain keywords and respond with a canned "i can't answer that!" response
but that's cheaty
I thought of something interesting
It'll store a string and a boolean for each user
The string is the last response that Analogue gave the user
The boolean was whether the user complained about the response or not
Upon Analogue's next reply
If the user didn't complain about it
It stores the old reply in the Markov chain
And replaces the "last" string with the new reply
that relies on users acting in good faith
I know
I'm used to the nature of the internet
It'll be fun to see what happens
This package I'm looking at has something interesting: https://www.npmjs.com/package/markovchain
"The start method can take in either a string str, in which case it will look to use that word to start the sentence."
mhm
I was going to add some natural langauge processing to try and make it seem a bit more coherant
i landed up not doing that because, lazy.
Heh
also, all the users of the only server i had it on complained about it.
module.js:540
throw err;
^
Error: Cannot find module 'markovchain'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\Alexander\Desktop\Discord\Analogue\analogue.js:2:16)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
RIP me
🇫
This is what happens when I forget to install a library
lmfao
One npm install later
@topaz fjord oof i eris
how would i check if the user id is equal to a user id from an array (js)
Also does limiting the volume feature to $4 patreon seem fair...
also Its hard to know what to limit to patreon, upvotes or not at all
limit EVERYTHING to patreon
kek
but have it so only 1 member per 1000 members of a server need to be on the patreon
(please dont do this)
If not limiting anything is not affordable, you should only "give additional perks" rather than "limiting features", giving a volume command (which is kinda useless) rather than restricting the whole music feature to donators seems pretty lit to me
The only thing I'm offering additionally is custom language files to integrate, it's paid because of the work required to update the files and do the support
And I post sneak peaks in chat sometimes
I personally don't believe in restricting, I believe I should offer a quality product that included all the things required to make it work as good as it can
@earnest phoenix not that much of difference
@topaz fjord aight
does anyone know stop getting feedback of my discord bot, when type in twitch feedsback from bot #SpamsLot https://i.imgur.com/uNCYJo4.png
like is there way stop that
this i got RN
dclient.on('message', function(message) {
var username = message.author.tag;
var discordname = message.guild.name;
var message = message.content;
client.say("#nate_playz14", 'Discord: ' + discordname + ': ' + username + ': ' + message);
});```
Ignore bot message
dclient.on('message', function(message) {
var username = message.author.tag;
var discordname = message.guild.name;
var message = message.content;
client.say("#nate_playz14", 'Discord: ' + discordname + ': ' + username + ': ' + message);
});
plus if you have more than one listener it will spam
so 🤷 @spare spruce
analogue.on("message", (message) => {
if(message.author.id != 390700050038390804) {
try {
// TODO
} catch(error) {
try {
message.channel.send({embed: {
"color": 0xCCCCCC,
"description": "I'm sorry, but something seems to have gone wrong. I'll inform the developer about the issue. Your ticket number is: " + errorNum,
"title": "Analogue"
}});
} finally {
console.log("Ticket " + errorNum + ": " + error.stack);
errorNum++;
}
}
}
});
Does this look stable?
try it
try it under one maybe idk
Would the ticket numbers be the same at any given time?
not sure actually
The ticket mins would retsrated if bot restarted right?
if it was multithreaded then possibly
That works
and short enough
@strange escarp why is the error send in another try
Just in case the channel is deleted when the bot is processing
The try/finally statement makes sure the console.log runs
So I get the error either way
or you could log before sending the message
also you'll want to await that if that's what you're going for
Then what would catch that error?
the top try-catch
If it errors in that portion, there is nothing to catch it
well you aren't catching anything, so
@earnest phoenix i try make so Relays Dsicord to twitch and twitch to Discord
I'm talking about this
try {
message.channel.send({embed: {
"color": 0xCCCCCC,
"description": "I'm sorry, but something seems to have gone wrong. I'll inform the developer about the issue. Your ticket number is: " + errorNum,
"title": "Analogue"
}});
} finally {
console.log("Ticket " + errorNum + ": " + error.stack);
errorNum++;
}
you're not catching anything
so like you can talk discord and twitch back
@uncut slate I will be soon
problem is message.content doing stuff
well, whatever you want to do, you'll want to await that
Aether
@topaz fjord The finally is part of a different try
Teach me something
what
Why is my args.join(" ") sucking dick
hm?
That
I have no idea what goes on before that, try console.log(args)
smells like that's not even the callsite in question
that should at least produce something prefixed with ytsearch:
regardless of what Array::join returns
Ye
yeah, so you're logging it from somewhere else, or calling it from somewhere else
Wdym
@client.command(pass_context=True)
async def mname(ctx):
mname = ['Patrick.','Jeffery.','John.','Jason.','Graysen.','Devon.','Nathan.','Eric.','Jaden.','Timmothy.','Aiden.','Aaron.','Aidan.','Connor.','Jackson.','Felix.','George.','Riley.']
maleoutput = random.choice(mname)
await client.say(maleoutput)
print(':: generated the name %s' % maleoutput)
Not working. Using discord.py
@uncut slate
That logged output isn't being called from that line you screenshotted
it's being sourced from either another console.log or another resolveTracks
Hello can someone help me with making a bot. I'm willing to pay for it.
I want to grow my community.
I have a paid section. with paid channels.
My idea:
1 invite = access to the paid channels for 1 day.
When you invite 2 it doesnt effect the day access. When 24 hours are over he loose the acces. He need to invite 1 new member to gain acces again.
1 problem:
When someone have 2 account's and leave the server and with the other server he invited himself back he have access again for the paid channels.
Some idea's about that?
Can someone make that.
when you want a nice site but you're shit at frontend
Not multiplayer yet
fuk
so can anyone help me with this
@client.command(pass_context=True)
async def mname(ctx):
mname = ['Patrick.','Jeffery.','John.','Jason.','Graysen.','Devon.','Nathan.','Eric.','Jaden.','Timmothy.','Aiden.','Aaron.','Aidan.','Connor.','Jackson.','Felix.','George.','Riley.']
maleoutput = random.choice(mname)
await client.say(maleoutput)
print(':: generated the name %s' % maleoutput)
Not working. Using discord.py
what does not working mean
just read the error
how can i get my bot to be permanently online? Currently, it is only online when I do "node bot.js".
When I turn off my computer, the bot turns off too
well uh your computer runs the bot
so of course when you turn it off, the bot also turns off, so to speak
buy a vps
ok
10/10 example for random.dog.js
const randomCat = require('random.dog.js');
const randomCatApi = randomCat.api();
randomCatApi.getDog().then((dog) => console.log(cat.url))```
xD
that was on npm
what happened to #312614469819826177? were there just so many that they decided it wouldn't need updating anymore?
Written guides for different libraries in different languages are comming to the website soon~ish, that might be why they locked the channel.
^
bit of a random question but does anyone know if its possible to get the name of a playlist from lavalink (using lavalink.js)? the videos from the playlist return just fine but it doesn't seem like theres any way to get the name of the retrieved playlist
nope
but you could just make a request to the youtube api and it should give it to you
alright cheers 👍
Does the Java/C Lavaplayer provide you with this information
im not sure i had a look at the source and it kinda seems like it https://please.zbot.me/RsrO04uO.png
boys
line 5, in <module>
url = "https://discordbots.org/api/bots/" + bot.user.id + "/stats"
NameError: name 'bot' is not defined```
bot is not defined
yes
so?
wont run
do you have access to "bot" in the current context
change it to client or whatever you are using ..?
or that ^
import aiohttp
dbltoken = "SFnfsSFJvncSDFJ1.DUjTog.MMwwFFffEW-jBOI2JeeZ_20M"
url = "https://discordbots.org/api/bots/" + bot.user.id + "/stats"
headers = {"Authorization" : dbltoken}
async def on_ready():
payload = {"server_count" : len(bot.servers)}
async with aiohttp.ClientSession() as aioclient:
await aioclient.post(url, data=payload, headers=headers)
async def on_server_join(server):
payload = {"server_count" : len(bot.servers)}
async with aiohttp.ClientSession() as aioclient:
await aioclient.post(url, data=payload, headers=headers)
async def on_server_remove(server):
payload = {"server_count" : len(bot.servers)}
async with aiohttp.ClientSession() as aioclient:
await aioclient.post(url, data=payload, headers=headers)```
right?
@austere meadow @jagged plume
@restive silo ik
^ better change that
i dont use python so im personally not sure but you probably don't have access to bot in that context
meaning you need to put that code somewhere else
either that or your client isn't called bot
i copied same what it says on #312614469819826177
do you call your client bot
mines not client its gulids
pretty sure you gotta do bot = discord.py
how sure u r
eh no don’t listen to me idk py
lol
but i know you define by doing bot =
p!info
i see
i need to fix
my counting server
wont wokr
bruh
i have lots to fix
ik

lets move to general
what does this error mean C:\Users\sande\Desktop\mybot>node mybot.js
module.js:665
throw err;
^
SyntaxError: C:\Users\sande\Desktop\mybot\config2.json: Unexpected token c in JSON at position 0
at JSON.parse (<anonymous>)
at Object.Module._extensions..json (module.js:662:27)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\sande\Desktop\mybot\mybot.js:4:16)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
you're trying to JSON.parse something that isn't a JSON object i believe
Why did you change the name
He first error said you have a syntax error in your Json file
but i have 2 config.json
Read the error
so i removed the working 1 with the 1 that didnt work
It says config2.json
ok so the token is wrong?
wat
im using that one because i used a command that had a modid
and i couldent get it to work
Why are u using config.json when it's using config.js
🤔

lol
o/
o/
how do u add favicon to website in html ?
@earnest phoenix that's because a favicon is an icon you add to your website
do i use link element ?
yes
Yes
Any python nerds here that also happen to understand dmx and usb stuff? pls dm
wat
ugh whenever im trying to change the background colour of my website, this happens ;-;
oof
It's because you're using comic sans
can you not
nice
well that was a fast ban
gg
hi i would like to know how i can send a embed in the main bot.js file
code:
```Shrug.on(guildCreate, guild => {
const log = guild.channels.find(`409024107276140575`);
const embed = new Discord.RichEmbed()
.setTitle(`New Guild Joined! #${Shrug.guilds.array().length}`)
.setThumbnail(`${guild.iconURL}`)
.setColor(0x00FF00)
.addField(`Name`, `${guild.name}`, true)
.addField(`Member Count`, `${guild.memberCount}`, true)
.addField(`Owner`, `<@${guild.owner.id}>`, true)
.addField(`ID`, `${guild.id}`, true);
log.send({embed});
})```
error:
if (typeof value === 'undefined') throw new Error('Value must be specified
.');
^
Error: Value must be specified.
at Map.find (D:\Bots\Shrug\node_modules\discord.js\src\util\Collection.js:19
3:47)
at Client.Shrug.on.guild (D:\Bots\Shrug\ShrugCore.js:9:29)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at ClientDataManager.newGuild (D:\Bots\Shrug\node_modules\discord.js\src\cli
ent\ClientDataManager.js:35:21)
at GuildCreateHandler.handle (D:\Bots\Shrug\node_modules\discord.js\src\clie
nt\websocket\packets\handlers\GuildCreate.js:17:26)
at WebSocketPacketManager.handle (D:\Bots\Shrug\node_modules\discord.js\src\
client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (D:\Bots\Shrug\node_modules\discord.js\src\c
lient\websocket\WebSocketConnection.js:330:35)
at WebSocketConnection.onMessage (D:\Bots\Shrug\node_modules\discord.js\src\
client\websocket\WebSocketConnection.js:293:17)
at WebSocket.onMessage (D:\Bots\Shrug\node_modules\ws\lib\event-target.js:12
0:16)```
@long jungle when you use find you have to define something
wrong tyler






