#development

1 messages · Page 1184 of 1

slender thistle
#

There can be multiple objects from one class but not vice versa

modest smelt
#

ok

slender thistle
#

Now, back to our Python crap.

Python is mostly OOP, so you can create different objects for a class. That's done by appending () to the class name and providing parameters inside of those parentheses

snow urchin
#

Anyone able to help me out with mongodb?

modest smelt
#

ok

slender thistle
#

Now, what would Teacher(name="Andrew", skill="Professional") tell you in Python?

modest smelt
#

basically

#

there is a teacher named andrew, and he is proffesional at teaching

#

Professional*

fervent goblet
#

A professional teacher named Andrew

modest smelt
#

right @slender thistle ?

slender thistle
#

Mhm

modest smelt
#

@slender thistle i gtg right now bc i got to eat lunch. can we do this convo through DM's?

slender thistle
#

Sure, I'll probably be asleep in a few hours though

modest smelt
#

ok

#

@slender thistle i sent u DM. Can you see it?

solemn leaf
#

is there a way to show search results from google

sudden geyser
#

I don't think Google has an official search API except for custom search (which is not for developers to get results from google searches).

#

One option would be to use scraping but it's not uncommon for requests to be blocked.

solemn leaf
#

@sudden geyser what is scrapin

sudden geyser
#

Where you get/download the HTML webpage then filter out stuff you want from the raw html

solemn leaf
#

can I send that though discord embed

#

or do I have to transfer it to markdown

sudden geyser
#

You can't just give your users raw HTML. You'd need to manually parse the content to get what you want, but I wouldn't recommend it as it's not ideal. I've seen some other APIs that try to use Google's search and parse it for you, so some Googling may help.

slim heart
#

what's the best way of going about rolling punishments? like say you can do like 3 infractions goes for mute and then if someone does it again 5 times they get kicked or sumn like that

i was thinking like

[
  {
    amount: 3,
    punishment: 0, // mute
    time: 20
  },
  {
    amount: 5,
    punishment: 1, // kick
    time: null
  }
]```
or sumn like that but then idek how i would display that on the dashboard and how i would manage that in the db
modest smelt
#

ok anyone online?

#

how do i make a bot send a message with a hyperlink

misty sigil
modest smelt
#

in discordpy

slim heart
#

just send the link

modest smelt
#

i want it to be a hyperlink

#

how do i do that?

misty sigil
#

or in embeds if you want a hyperlink its text

#

only works in description and fields iirc

modest smelt
#

wait so it would be like this:

await ctx.send(f'{[text](link)} yay')
#

oh really?

#

only works in description and fields iirc
@misty sigil how would i format it?

misty sigil
#

in embeds

#

idk embeds in py

modest smelt
#

example?

#

i tried searching it up

slender thistle
#

discord.Embed

modest smelt
#

but couldn't find it

#

no like how to get the hyperlinks

#
embed = discord.Embed("what goes here?")
slender thistle
#

it will only work in embed description and field values

modest smelt
#

ok

misty sigil
#

in a field value/the description you can do text

modest smelt
#
embed = discord.Embed(title = "great")
embed.add_field(name = 'ok', value = 'What goes here')
sudden geyser
#

embed.add_field(name = 'ok', value = '[text](link)')

misty sigil
modest smelt
#

oh so

#

the text go inside the quotes?

sudden geyser
#

Yes

slender thistle
#

yup

modest smelt
#

ok

#

thanq

#

Alright I have a question

#

so when i run the following code:

#
@client.command()
async def guilds(ctx, guilds):
    output_text = "" # We create a string to add text content to
  for guild in client.guilds: # iterate over our guilds
      output_text += f"__Name of Server__ : {guild.name}\n __Number of Members__ : {guild.member_count}\n" # in this line, we generate a string like "ServerName: 50" where 50 is the member count of the server
  embed = discord.Embed(title = output_text)
  await ctx.send(embed = embed)
#

nothing works

#

do u know why?

misty sigil
#

too long?

modest smelt
#

wdym

#

do u wanna join my bot's support server and check it out?

misty sigil
#

titles have limits of about 1024

#

iirc

modest smelt
#

oh i see

#

would this work:

#
@client.command()
async def guilds(ctx, guilds):
  embed = discord.Embed(title = "Servers!", description = "These are all the servers that the Math Bot is in:")
  for guild in client.guilds: # iterate over our guilds
      embed.add_field(name = f'__Name of Server__ : {guild.name}\n __Number of Members__ : {guild.member_count}')
  await ctx.send(embed = embed)
#

it still doesn't work @misty sigil

misty sigil
#

i dunno?

modest smelt
#

@slender thistle any clue?

#
@client.command()
async def guilds(ctx, guilds):
  embed = discord.Embed(title = "Servers!", description = "These are all the servers that the Math Bot is in:")
  for guild in client.guilds: # iterate over our guilds
      embed.add_field(name = f'__Name of Server__ : {guild.name}\n __Number of Members__ : {guild.member_count}')
  await ctx.send(embed = embed)
#

y this isn't working

faint prism
#

Is there an error message?

slender thistle
#

What's the guilds in the function

modest smelt
#
@client.command()
async def guilds(ctx, guild):
  embed = discord.Embed(title = "Servers!", description = "These are all the servers that the Math Bot is in:")
  for guild in client.guilds: # iterate over our guilds
      embed.add_field(name = f'__Name of Server__ : ``{guild.name}``\n __Number of Members__ : ``{guild.member_count}``')
  await ctx.send(embed = embed)
#

new code

#

error message:

#

discord.ext.commands.errors.MissingRequiredArgument: guild is a required argument that is missing.

slender thistle
#

Remove guild from the function parameters

modest smelt
#

running it

#

error code:

#
In embed.fields.1.value: This field is required
In embed.fields.2.value: This field is required
In embed.fields.3.value: This field is required
In embed.fields.4.value: This field is required
In embed.fields.5.value: This field is required
In embed.fields.6.value: This field is required```
faint prism
#

I feel like I am doing exactly what you are with my eval command lol @modest smelt
||+eval string o = string.Empty; foreach (var g in Context.Client.Guilds) { o += $"{g} ({g.Users.Count})\n"; } return o;||

slender thistle
#

Ah

modest smelt
#

lol

slender thistle
#

You're not setting an embed value

#

field value*

modest smelt
#

i set it outside the loop?

slender thistle
#

value =

modest smelt
#

wdym

#
@client.command()
async def guilds(ctx):
  embed = discord.Embed(title = "Servers!", description = "These are all the servers that the Math Bot is in:")
  for guild in client.guilds: # iterate over our guilds
      embed.add_field(name = f'__Name of Server__ : ``{guild.name}``\n __Number of Members__ : ``{guild.member_count}``', value = "")
  await ctx.send(embed = embed)
#

sorry forgot to put the new code

nimble vigil
#

Have a question how can I write a block function in my bot in the dm command? I search the internet the whole time I can't find anything I want my bot to block directly after a message.

modest smelt
#

do i need something insde the value = ""?

slender thistle
#

yeah

modest smelt
#

oh ok

#

wut should i put there?

slender thistle
#

You probably want to add the name of the server in the field name and number of members in value

modest smelt
#

yes that is what i did

#

running it

#

yay it worked!

#

thanks @slender thistle

#

and @faint prism and @misty sigil

misty sigil
#

I wouldn’t make it public tho

modest smelt
#

wdym?

#

the bot?

misty sigil
#

No the command

modest smelt
#

why?

misty sigil
#

against tos

modest smelt
#

oh actually?

slender thistle
#

Privacy breach, yeah

modest smelt
#

oh

misty sigil
#

make it owner only

modest smelt
#

how do i set it up like that?

#

only i can do it

misty sigil
#

idk how it works in py but in js it’s one if statement

nimble vigil
#

Have a question how can I write a block function in my bot in the dm command? I search the internet the whole time I can't find anything I want my bot to block directly after a message.

modest smelt
#

@slender thistle how do i set it so that only i can access the command?

slender thistle
#

@commands.is_owner() iirc

modest smelt
#

oh ok

modest smelt
#

@commands.is_owner() iirc
@slender thistle does this mean they are owner of the bot or owner of the server

slender thistle
#

bot owner

modest smelt
#

ok

#

but one of my programmers can't do that

#

is there any way to fix that?

#

@slender thistle

slender thistle
#

there's uhh

#

hold on

modest smelt
#

ok

slender thistle
#

you could use this

meager garnet
slender thistle
#

create a list of IDs and check if message author's ID is included in the list

modest smelt
#

where should i create the list?

#

@slender thistle is there a way to let a user use a command only with their ID?

slender thistle
#

create the list under some variable right after creating client

#

and wdym?

modest smelt
#

so how can i use thi:

#
def check_if_it_is_me(ctx):
    return ctx.message.author.id == 85309593344815104
meager garnet
#

How can I solve the problem
@slender thistle

#

؟

slender thistle
#

No idea

modest smelt
#

for?

#

me?

meager garnet
#

hmmm, thanks you

slender thistle
#

for Tarek

modest smelt
#

ok

#

so assuming this:

#
devs = [id 1]
#

what do i do with this?

slender thistle
#

@modest smelt To allow more than 2 people, either a list and then use the in operator or do stuff like authorid == x or authorid == y

#

devs = [id1, id2]

my_id in devs

modest smelt
#

so i would do

async def guilds(ctx):
  if my_id in devs:
    do the code
``` or does the if my_id part go outside the async def?
slender thistle
#

bleh

#
def predicate(ctx):
    return ctx.author.id in devs

@commands.check(predicate)
@client.command()
etc etc```
ionic warren
#

how can i make my bot repeat a command ever (2 hours) or so? even if nobody requested?

faint prism
#

Setinterval

#

For js

ionic warren
#

for example: i want my bot to tell me to drink water every 2 hours so it would be (@person, heres a reminder to drink water!)

#

setinterval?

faint prism
#

Yeah

faint prism
#

^

thin tapir
#

can someone help me with json deserialization in c#

faint prism
#

I do C#

#

Also, don't ask to ask, just say your question

pulsar flame
#

When I type "node index.js" it should immediately mean my bot is online. Instead, it says "PS C:\Users\capod\Documents\Bot Creation>".

faint prism
thin tapir
#
    class stonks
    {
        public string o;
        public string h;
        public string l;
        public string c;
        public string pc;
    }
    class stocks : BaseCommandModule
    {
        [Command("stocks")]
        [Description("Displays Stocks")]
        [Aliases("stock")]
        public async Task stock(CommandContext ctx, [RemainingText] string Reason)
        {
            string json;
            using (WebClient wc = new WebClient())
            {
                json = wc.DownloadString($"https://finnhub.io/api/v1/quote?symbol={Reason}&token=");
            }
            string content = JsonConvert.DeserializeObject<stonks>(json);
            string permalink = (string)content[0].data.children[0].data.o;
            string rImage = (string)content[0].data.children[0].data.h;
            string rTitle = (string)content[0].data.children[0].data.l;
            string rUpvotes = (string)content[0].data.children[0].data.c;
            string rDownvotes = (string)content[0].data.children[0].data.pc;

            await ctx.RespondAsync($"Open price: " + permalink );
            await ctx.RespondAsync($"High price: " + rImage);
            await ctx.RespondAsync($"Low price: " + rTitle);
            await ctx.RespondAsync($"Current price: " + rUpvotes);
            await ctx.RespondAsync($"Prev Close Price: " + rDownvotes);
            await ctx.RespondAsync(json);
        }
    }
#

it doesnt respond with the stock prices

#

@faint prism

modest smelt
#

hey anyone

#

how do i take away all the roles through discordpy

faint prism
#

it doesnt respond with the stock prices
@thin tapir It returns for me

thin tapir
#

no i mean in the response from the bot

modest smelt
#

how do i take away all the roles through discordpy
@modest smelt pls help @faint prism

earnest phoenix
#

I think an easier question to solve would be: How do I get all of a user's roles

modest smelt
#

@slender thistle can u help bobthegod78

#

he is one of my programmers i was talking about

slender thistle
#

member.remove_roles(*member.roles)

modest smelt
#

how do we get those roles?

earnest phoenix
#

wait do we need the asterix

#

typo

#

wow its like 24/7 support

slender thistle
#

Yes, you do

earnest phoenix
#

kk

modest smelt
#

oh ok

earnest phoenix
#

lemme try that

slender thistle
#

how do we get those roles?
@modest smelt member needs to be a Member object

slim heart
#

idk d.py but there ought to be a way to set member roles to an empty array

modest smelt
#

@slender thistle how would we give them back the roles then?

slender thistle
#

store the roles somewhere

modest smelt
#

where?

slender thistle
#

Ehh

modest smelt
#

i can't put them in a json file

slender thistle
#

in some sort of a bot variable/property

modest smelt
#

and i don't know how to use sql

faint prism
#

no i mean in the response from the bot
@thin tapir Oh. Content shouldn't be a string, it should be a stonks object. Then for the responce just reference the content.o, content.h, content.l, etc

modest smelt
#

@slender thistle i do that and get this

#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NotFound: 404 Not Found (error code: 10011): Unknown Role

slender thistle
#

Is member.roles empty?

modest smelt
#

do i store member.roles somewhere?

slender thistle
#

What are you trying to do, actually

modest smelt
#
async def mute(ctx, member: discord.Member):
  guild= ctx.guild
  role22 = "Muted"
  role = discord.utils.get(member.guild.roles, name= role22)
  if member == ctx.message.author:
        await ctx.channel.send('You cannot mute yourself. It\'s just not possible.')
  elif member is None:
        await ctx.channel.send('You cannot mute nobody dum dum!')
  else:
    if role in guild.roles:
      role = ctx.guild.default_role
      perms = role.permissions
      perms.send_messages = False
      await role.edit(permissions=perms)
      role = discord.utils.get(member.guild.roles, name= role22)
      await member.add_roles(role)
      for role in member.roles:
        await member.remove_roles(role)
      embed=discord.Embed(title="User Muted!", description="**{0}** was muted by **{1}**!".format(member, ctx.message.author), color=0xff00f6)
      await ctx.send(embed=embed)
    else:
      permission = discord.Permissions(send_messages=False, read_messages=True)
      role = ctx.guild.default_role
      perms = role.permissions
      perms.send_messages = False
      await role.edit(permissions=perms)
      await guild.create_role(name="Muted", colour=discord.Colour(0x0062ff), permissions=permission)
      role = discord.utils.get(ctx.guild.roles, name="Muted")
      await member.add_roles(role)    
      embed=discord.Embed(title="User Muted!", description="**{0}** was muted by **{1}**!".format(member, ctx.message.author), color=0xff00f6)
      await ctx.send(embed=embed)
#

im tryna mute someone

#

code is @above

worthy glacier
#

is it viable to use enmap over storing data in mongodb?

ionic warren
#

is there anyway to constantly repeat a command ever couple of minutes or so?

modest smelt
#

@slender thistle code is above

ionic warren
#

im trying to make a bot that will tell you to drink water every hour or so, any way i can make that command repeat constantly?

slender thistle
#

@modest smelt Right after you define client, do client.member_roles = {}

modest smelt
#

at the client.event?

slender thistle
#

That will be a dictionary, where a key will be a guild ID

and value will be another dictionary

inside of that nested dictionary, you would assign a member's ID their member.roles

#

At the top of your file

modest smelt
#

ok

slender thistle
#

where you do client =

modest smelt
#

over here:

#

?

#
@client.event
async def on_ready():
  print(f'Logged in as {client.user}')
slender thistle
#

no, that snippet of code simply creates an event

drifting wedge
#

doesnt send anything

faint prism
#

is there anyway to constantly repeat a command ever couple of minutes or so?
@ionic warren Yes with SetInterval

ionic warren
#

its so confusing aghhhh

modest smelt
#

where @slender thistle

#

im confused

faint prism
#

Well that's how you do it @ionic warren

slender thistle
#

Search for client = , bob

#

@drifting wedge any errors?

drifting wedge
#

Yes

#

Gimme some time tho

modest smelt
#

the mute didn't work @slender thistle

drifting wedge
#

@slender thistle TypeError: on_guild_channel_update() takes 1 positional argument but 2 were given

#

thats the error

slender thistle
#

@modest smelt any errors?

drifting wedge
#

is this a thin?

#

role id? in role update event?

#

didnt specify it

modest smelt
#

i'll give u teh errors

slender thistle
#

there are supposed to be before and after (2) parameters

#

where before is old version of the channel and after is the changed one

modest smelt
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NotFound: 404 Not Found (error code: 10011): Unknown Role

drifting wedge
#

yea

#

but in the bottom

#

i say like the role id

#

omega lul

#

1 sec

#

this is what i have for channel update

modest smelt
#

@slender thistle

#

i have put my error

#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NotFound: 404 Not Found (error code: 10011): Unknown Role

slender thistle
#

@modest smelt which line is causing that error

modest smelt
#

it doesn't say anything about that

#

it just says unknown role thing

#

maybe because of this:

#

client = commands.Bot('>')
client.member_roles = {}
#

?

#

@slender thistle can u please dm me anything u find

#

i gtg

thin turret
#

I dont get how thats supposed to work

#

Ah python nvm

drifting wedge
#

is there python canavacord?

slender thistle
#

PIL, I guess

#

@modest smelt idk what's erroring out in that code

drifting wedge
#

shivaco

#

TypeError: on_guild_channel_update() takes 1 positional argument but 2 were given

#

thats my error

slender thistle
#

there are supposed to be before and after (2) parameters

drifting wedge
#

yes

#

i looked

slender thistle
#

the parameters need to go in on_guild_channel_update

#

oh wait what

#

am I too sleepy to comprehend this now

#

what is your code like rn

drifting wedge
#

1 sec

#
@client.event
async def on_guild_channel_update(member):
    channel = discord.utils.get(member.guild.text_channels, name='arch-logs')

    embed = discord.Embed(
            colour = discord.Colour.blue()
        )
    embed.set_author(name=f"Channel Edited", icon_url=f"{client.user.avatar_url}")
    embed.add_field(name=f":archedit: Channel '{member}' has been edited", value=f"‎‎", inline=False)
    embed.set_footer(text=f"ID: {channel.id}")
    embed.timestamp = datetime.datetime.utcnow()

    await channel.send(embed=embed)```
slender thistle
#

why name it member

#

make it before, after

drifting wedge
#

oooh 1 sec

#

oooh

#

omfg i wasent understanding u lol

#

i thought u werew talking abt the docs

slender thistle
#

fair enough KEKW

drifting wedge
#

'{before, after}'

#

what does the message send?

slender thistle
#

Basically just rename everything that's member to after

radiant patio
#

how do I make a reaction on a specific message with the id?

drifting wedge
#

same error @slender thistle

#

embed.add_field(name=f":archedit: Channel '{after}' has been edited", value=f"‎‎", inline=False)

#

how do I make a reaction on a specific message with the id?
@radiant patio reply reaction or emoji?

radiant patio
#

no not like that to any message

#

maybe to these

#

with these

slender thistle
#

Oh

#

Empty value

drifting wedge
#

nope

#

not empty

#

its an invisivle character

#

a little trick 🙂

slender thistle
#

ehh slap \u200b to be sure 😂

drifting wedge
#

?

#

nope

#

theyres something

#

slender thistle
#

What's the error, again?

drifting wedge
#

see

#

#

i just send it

#

slender thistle
#

Yeah

drifting wedge
#

TypeError: on_guild_channel_update() takes 1 positional argument but 2 were given

radiant patio
#

how do I make a reaction on a specific message with the id?
@radiant patio ?

sweet ruin
#

Hello all, I am trying to make a command that provides song lyrics, but sometimes songs have really really long amounts of lyrics. can anyone help me with providing some embed page code pleading eyes

for instance, I created this which is a basic multipage embed.

https://gyazo.com/062a165faddc3152278457d9452d2173

but it is hardcoded and only does 2 pages. I am trying to make it sense the number of lyrics, sense paragraph breaks, and also have static pages so that if there is more than 4096 lyrics it adds a third page and so on.

drifting wedge
#

nice idea firsty

#

firstly

#

second, how do you send the characters from?

faint prism
#

You'd probably get it from genius API

#

That's what I do when I want lyrics

sweet ruin
#

i get them from a npm import

faint prism
#

@sweet ruin Just create a string, populate it with lyrics, if the length is > 2000 in length, split into a string array, check the last index for > 2000 length, if yes, repeat... etc

#

Then create pages based on elements in the array

#

You probably want a do/while loop for that btw

#

@sweet ruin

sweet ruin
#

hmm

#

me being an absolute dumby at coding that i didnt rlly understand that lmao

faint prism
#

Sound like a good approach to what you wanted?

#

hm

#

Strings (text datatype) has a length (the character count)
Discord msgs can only be 2k characters
while (myLyrics[myLyrics.Size].Length > 2000) do a split
Make a page for each element in myLyrics[]
Reply with embed

modest smelt
#

can someone help me code the mute com

faint prism
#

@sweet ruin does that clear it up a bit?

modest crane
#

you'll also have to avoid breaking the words and paragraphs

sweet ruin
#

ehhh

#

ill just show how I did it so far

faint prism
#

🤷‍♂️

sweet ruin
#
       var song = args.slice(0).join(' ');
        if (!song) {
            return message.reply("Please provide a song you would like me to get the lyrics for.\nBeing Descriptive with the author is very helpful aswell.")
        }
        var lyrics = await solenolyrics.requestLyricsFor(song); 
        var title = await solenolyrics.requestTitleFor(song);
        var songicon = await solenolyrics.requestIconFor(song);
        var author = await solenolyrics.requestAuthorFor(song);
        let lyrics1 = lyrics.slice(0, 2048)
        let lyrics2 = lyrics.slice(2048, 4096)
        let lyrics3 = lyrics.slice(4096)
        // if (lyrics.length >= 2048) lyrics = "Song has too many lyrics right now!"
        if (lyrics.length < 2048) {
        const e = new Discord.MessageEmbed()
        .setTitle(`${title} by ${author}`)
        .setThumbnail(songicon)
        .setDescription(lyrics)
        .setColor("ORANGE")
        message.channel.send(e)

        } else {

            const right = '▶'
            const left = "◀"
            const e = new Discord.MessageEmbed()
            .setTitle(`${title} by ${author}`)
            .setThumbnail(songicon)
            .setDescription(lyrics1)
            .setFooter("Page: 1")
            .setColor("ORANGE")
        let m = await message.channel.send(e);
         await m.react(left)
         await m.react(right);

    const filter = (reaction, user) => {
        return (reaction.emoji.name === right && user.id === message.author.id) || (reaction.emoji.name === left && user.id === message.author.id);
    };```
#
    const collector = m.createReactionCollector(filter, { time: 120000 });
collector.on('collect', async (reaction, user) => {
    if (reaction.emoji.name === right) {
        e.setDescription(lyrics2)
        e.setFooter("Page: 2")
        await m.edit(e);
        await m.reactions.resolve(right).users.remove(message.author.id);
    } else if (reaction.emoji.name === left) {
        e.setDescription(lyrics1)
        e.setFooter("Page: 1")
        await m.edit(e);
        await m.reactions.resolve(left).users.remove(message.author.id);
    } else return;
});```
#

that's evertyhing

drifting wedge
#

embed.add_field(name=f"Roles ({len(roles)})", value=f"‎".join([role.mention for role in roles]), inline=True)

faint prism
#

So where you have lyrics 1 2 3, just use an array

drifting wedge
#

how do i not send the @everyone

#

and not send two @ @

#

roles = [role for role in member.roles]

sweet ruin
#

arrays confuse me ngl

#

i dont get them

#

would I do like

faint prism
#

Well arrays are an essential data structure in computer science

sweet ruin
#

let lyricsarray = [lyrics1, lyrics2, lyrics3]?

modest crane
#

how do i not send the @​everyone
@drifting wedge add a zero width space (\u200b) between @ and e

drifting wedge
#

?

#

@modest crane ?

faint prism
#

Not sure how you do it in JS. Might need a js dev to help you with that.

#

let lyricsarray = [lyrics1, lyrics2, lyrics3]?
@sweet ruin the array will replace you using those 3 variables ideally

valid frigate
#

im late but is there a difference between <@ and <@! and what are they

solemn leaf
#

FFmpeg/avconv not found!

modest crane
#

im late but is there a difference between <@ and <@! and what are they
<@! is for nickname mention i think

faint prism
#

@sweet ruin I can give you an example in a different programming language that I know.
Note: This might not work. Just a quick example

string entireLyrics = SomeLyricsApi(songTitle);  // Get huge block of lyrics. Example, entireLyrics = 8k characters
string[] lyricPages = new string[entireLyrics.Length / 2000]  // 8000 / 2000 = 4 array elements
int position = 0;  // Keep track of position in entireLyrics

for(int i = 0; i < lyricPages.Length; i++)  // 4 loops
{
  lyricPages[i] = entireLyrics.SubString(pos, i*2000);  // Get section of lyrics
  pos = i*2000 + 1;  // Update position
}
solemn leaf
#

can someone help with FFmpeg/avconv not found!

faint prism
#

@sweet ruin, does that help you understand a bit?

stable hearth
#

I'm trying to export:
const udb1 = new Discord.Collection();
with
module.exports = { udb1 };
I'm calling correctly with
const { udb1 } = require("required_file.js")
however, i get this error in console:

    at Object.execute (c:\Users\realn\OneDrive\Desktop\Discord Bot\sierra\commands\balances\balance.js:13:25)
    at Client.<anonymous> (c:\Users\realn\OneDrive\Desktop\Discord Bot\sierra\sierra_rb.js:263:17)```

can anyone help me?
valid frigate
#

lmfao why tf is there a ! for nickname mention thats fucked up

sweet ruin
#

a bit yeah

stable hearth
#

can someone help with FFmpeg/avconv not found!
@solemn leaf search up on google adding ffmpeg path on windows or resolving ffmpeg/avconv not found i ran into that problem with my own music functions and looked that up for the solution.

solemn leaf
#

@stable hearth what exactly did you do

#

I have the ffmpeg installed on my c drive

stable hearth
#

@stable hearth what exactly did you do
@solemn leaf i went somewhere into the win10 environment to manually add ffmpeg

#

I have the ffmpeg installed on my c drive
@solemn leaf it's installed, but the bot doesn't know where to look for it

#

adding it in the win10 paths will solve that

solemn leaf
#

I did

#

see

#

I made the path ffmpeg

stable hearth
#

no you didn't

#

you have to manually add it

#

not in DOS prompt

solemn leaf
#

@stable hearth

stable hearth
#

@solemn leaf where's your music bot's directory?

#

ffmpeg should be in the same directory

solemn leaf
#

desktop

#

wait so

#

I should put

#

ffmpeg into the folder with my bot inside of it

stable hearth
#

@solemn leaf find your node_modules folder

#

and put ffmpeg into it

solemn leaf
#

added

stable hearth
#

try it

solemn leaf
#

FFmpeg/avconv not found!

#

should I remvoe the path?

stable hearth
#

sure

#

i don't remember the exact syntaxes though

#

i suggest you look it up

solemn leaf
#

loop up what

stable hearth
#

loop up what
@solemn leaf how to resolve it. there's plenty of forums that show exactly how to solve it

#

also, can someone help me with my problem?

solemn leaf
#

npm i ffmpeg-binaries@3.2.2-3

stable hearth
#

npm i ffmpeg-binaries@3.2.2-3
@solemn leaf i'm not very sure then

solemn leaf
#

nope

#

how uninstall npms lmao

#

@stable hearth

stable hearth
#

npm uninstall

#

@solemn leaf

solemn leaf
#

nothin I have tried has worked so far @stable hearth

earnest phoenix
#

ffmpeg-static

solemn leaf
#
(node:10188) UnhandledPromiseRejectionWarning: Error: FFmpeg/avconv not found!
    at Function.getInfo (C:\Users\Owner\Desktop\discordjs2\node_modules\prism-media\src\core\FFmpeg.js:130:11)
    at Function.create (C:\Users\Owner\Desktop\discordjs2\node_modules\prism-media\src\core\FFmpeg.js:143:38)
    at new FFmpeg (C:\Users\Owner\Desktop\discordjs2\node_modules\prism-media\src\core\FFmpeg.js:44:27)
    at AudioPlayer.playUnknown (C:\Users\Owner\Desktop\discordjs2\node_modules\discord.js\src\client\voice\player\BasePlayer.js:47:20)
    at VoiceConnection.play (C:\Users\Owner\Desktop\discordjs2\node_modules\discord.js\src\client\voice\util\PlayInterface.js:71:28)
    at C:\Users\Owner\Desktop\discordjs2\commands\play.js:46:9
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:10188) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:10188) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
#

I have ffmpeg static

earnest phoenix
#

npm i ffmpeg-static

#

reinstall

solemn leaf
#

ok ill try it

#

I installed ffmpeg from site

earnest phoenix
#

Install it using npm is easier

drifting wedge
#
async def on_member_remove(member):
    channel = discord.utils.get(member.guild.text_channels, name='arch-logs')
    role_names = [role for role in member.roles]

    embed = discord.Embed(
            colour = discord.Colour.red()
        )
    embed.set_thumbnail(url=f'{member.avatar_url}')
    embed.set_author(name=f"{member}", icon_url=f"{member.avatar_url}")
    embed.add_field(name=f":outbox_tray: {member} has been removed from the server", value=f"‎‎", inline=False)
    embed.add_field(name=f"Roles ({len(role_names)})", value=f"{role_names}", inline=False)
    embed.set_footer(text=f"ID: {member.id}")
    embed.timestamp = datetime.datetime.utcnow()

    await channel.send(embed=embed)``` thats my code, i want it to send role names and ping them
solemn leaf
#

so I dont need to do anything like requiring

drifting wedge
#

but it sends id and a bunch of other stuff

earnest phoenix
#

Yeah

#

I installed ffmpeg from site
@solemn leaf sudo npm i -g ffmpeg-static or for windumb npm i -g ffmpeg-static

solemn leaf
#

thanks that worked

trim saddle
#

@drifting wedge role.mention in roles

earnest phoenix
#

How bot turn the 20k to 20000 and if k not in the last of message it return a error message ? (discord.js)

sudden geyser
#

It's quite hard to understand what you just said. Do you mean you want your bot to convert 20k into 20000 if the user types it with the k at the end, but you want to return an error message to the user if it's not there?

earnest phoenix
#

yes

timber zodiac
#

set some kind of conditional formatting for the answer field, must be greater than 1,000? That way if you do 1 instead of 1k, you get an error message the number is too low.

earnest phoenix
#

i think use replace is better but replace will replace the k if k not at the end

#

Sorry for my bad english

solemn leaf
#

how can I check if a arg is a link :?

earnest phoenix
#

Includes ?

#

maybe

faint prism
#

check if it starts with http

#

starts with http:// to be more percise

solemn leaf
#

so I need to do that?

faint prism
#

I don't think you need to break out the regex for that

earnest phoenix
#

check if it starts with http
@faint prism are ends with is possible ?

solemn leaf
#

@earnest phoenix no?

faint prism
#

www isn't always included

#

just match by http

earnest phoenix
#

http or https

#

ye http

solemn leaf
#

I just want to check if the link has a video or mp3

faint prism
#

or maybe even an embed

#

since discord attaches http embeds on links

#

Might work better tbh @solemn leaf

solemn leaf
#

okay

#

how do I match by http

#

then

faint prism
#

Something like args[i].startsWith("http://") || args[i].startsWith("https://")
Tbh idk if JS has a startsWith so check the docs first

solemn leaf
#
if (!args[0].startsWith("http://") || args[0].startsWith("https://")) {
return;
}
faint prism
#

You forgot a !

earnest phoenix
#

how can I check if a arg end with k ?

faint prism
#

Don't forget it on the HTTPS one

solemn leaf
#

op

#

thanks

faint prism
#

Np 👍

solemn leaf
#

erm

faint prism
#

how can I check if a arg end with k ?
@earnest phoenix there's a few ways you can go about that. You could try matching the string with endWith('k) , or if that's not a thing in JavaScript you can always get the last index of a string, since it's technically a char array and compare that to 'k'

solemn leaf
#

that didnt work like we wanted

faint prism
#

Is Starts With a valid js thing? Like I said, I'm not a JavaScript developer. That's just how I typically approach things in OOP in general

earnest phoenix
#

so args[0].endWith('k') ?

faint prism
#

Read ^

earnest phoenix
#

Hmm

faint prism
#

I would look up some JavaScript docs for something that looks like that

solemn leaf
#

startswith is a thing

faint prism
#

Nice!

#

If you ever need to do something like convert a data type to something else, or do pattern matching. A lot of the times in OOP languages it's built in as a function for a string

#

So it's always a good idea to look up something in the docs for your language

solemn leaf
#

what

earnest phoenix
#

oww im read the docs and say string.endsWith()
@faint prism Thanks for ur help

faint prism
#

Np :)

solemn leaf
#

so wait

#

what do I do then

faint prism
#

You said startswith() is a thing. Go ahead and try it out

solemn leaf
#

cant I just do

    let audio = args[0]
    if (!audio.startsWith("http://"))
earnest phoenix
#

yes you can

#

but, i think better is : let audio = args[0] if (!audio.startsWith("http"))

solemn leaf
#

@faint prism found proble || => &&

earnest phoenix
#

it will turn the http and https

faint prism
#

Well that'd be impossible

#

If (true && false) will always be false

solemn leaf
#
    let audio = args[0]
    if (!audio.startsWith("http://") && !audio.startsWith("https://")) {
        message.channel.send("Need A valid link")
        return;
    }

it worked so

#

doing -play a runs the if

faint prism
#

Oh !

#

Forgot you were doing it with nots

#

Yeah that works

solemn leaf
#

wha

earnest phoenix
#

but, i think better is : let audio = args[0] if (!audio.startsWith("http"))
@earnest phoenix

solemn leaf
#

@earnest phoenix no

#

bcs then they could do

#

httpaaaaaaaaaaaaaaaaaaa

#

which isnt a link

earnest phoenix
#

Hmm

#

And yours is isnt work

#

i think use 2 if 😆 😆

frank knot
#

Hello

#

I'm new

earnest phoenix
#
if (!args[0].startsWith("https://"))return
real nacelle
#

How to add embeds in the bot?

earnest phoenix
#

@real nacelle
let embed3 = new Discord.RichEmbed()

.setTimestamp()
.setTitle ('WHATEVER TITLEW=')
.setDescription('')
.setColor("RANDOM")
.setFooter ("WHATEVER FOOTER")
message.channel.sendEmbed(embed3);
}

real nacelle
#

@earnest phoenix thanks

earnest phoenix
#

np my guy

real nacelle
#

hey

#

footer isn't working

#

Nvm

#

It worked

#

Heehee

earnest phoenix
#

aight

real nacelle
#

@earnest phoenix it's shownig message not defined

#

in the last line

#

message.channel.sendEmbed(embed3);

earnest phoenix
#

it works on mine

#

but ive had that issue before

#

discord.js ?

#

forgot how i fixed it

#

and yes

#

its look like v11

#

i use latest

#

d.js latest is v12.3

#

hmm

#

yea

real nacelle
#

i use 12.something

#

12.2.1

earnest phoenix
#

how do i check which one im using lmao

real nacelle
#

go to package.json

#

there find

#

discord.js

earnest phoenix
#

ohh i use 11.5.1

real nacelle
#

the version will be written in front

earnest phoenix
#

embed for v 12 is let embed = new discord.MessageEmbed()

real nacelle
#

@earnest phoenix i have put this statement

#

but

#

the problem is

#

message.channel.sendEmbed(embed3);

#

here

earnest phoenix
#

in v 12 message.channel.send(embed)

real nacelle
#

message not defined

#

ooh

#

thanks

#

still

#

message not defined

#

i guess

earnest phoenix
#

nope

#

embed for v 12 is let embed = new discord.MessageEmbed()
@earnest phoenix

real nacelle
#

@earnest phoenix As I said message not defined

earnest phoenix
#

ss ?

real nacelle
#

Do I have to define it?

#

ss ?
@earnest phoenix wait a second

sand skiff
#

@real nacelle woah, what app is that

earnest phoenix
#

bruh

real nacelle
#

VS-Code

sand skiff
#

Tysm

#

Wait can I get it on Mac

real nacelle
#

tysm?

#

yeah

#

surely

earnest phoenix
#

Ur define is wrong

sand skiff
#

Thx

real nacelle
#

which @earnest phoenix

#

Thx
@sand skiff np

earnest phoenix
#

exampleembed

#

change it to embed

#

oh wait

#

put it under the message

#

under bot.on

real nacelle
#

ok

#

wait

#

Btw what to put?

#

😅

#

should I try msg, as I have written it everywhere.

#

Instead of message.

#

@earnest phoenix i did some changes

#

so that is done

#

but where to define embeds?

earnest phoenix
#

Ask to another dev, sorry i have a online school 😀

real nacelle
#

ohk

#

It worked too

#

nice

#

yay

#

embed is ready

#

but the bot is spamming

hazy sparrow
#

you want to define embeds?

real nacelle
#

this is the problem

hazy sparrow
#

Can you show the code?

real nacelle
#

yeah

#

One second

#

here it is

hazy sparrow
#

This is not related to te problem but, yku really need a command handler. Can you copy and paste your relevant code here?

real nacelle
#

which code

#

all?

hazy sparrow
#

The embed

earnest phoenix
#

help

hazy sparrow
#

wrong channel

earnest phoenix
#

eh

real nacelle
#

The embed
@hazy sparrow yes, pls one second

#

{const Embed = new Discord.MessageEmbed()
.setTimestamp()
.setTitle ('')
.setDescription('')
.setColor("#00FFFF")
.setFooter ("")
msg.channel.send(Embed)
}

#

here it is

hazy sparrow
#

I dont see any problem there, any errors?

real nacelle
#

When I command the bot, it starts to spam.

fast trench
#

show your entire code in a sourcebin

novel roost
#

when i m trying to install dbus by using pip install dbus-python
this error showed up

#

can anybody help

#

feel free to ping me

real nacelle
#

You wanna install python?

novel roost
#

install dbus

#

module

real nacelle
#

Idk, about dbus.

#

I know python, a lot but never heard about dbus

hazy sparrow
#

@real nacelle paste your code in a sourcebin ans send the link here. Your entire code.

real nacelle
#

okie

#

what's sourcebin

#

😅

hazy sparrow
real nacelle
#

oh

#

Ok

#

to see my error, what should I do?

#

@hazy sparrow

hazy sparrow
#

errors will be in the terminal

real nacelle
#

I'll have to login I guess

#

or sign up whatever

hazy sparrow
#

You can .catch() errors and output it somewhere else if you want to

real nacelle
#

site glitched

#

It's saying to many requests.

#

So maybe, I'll have to do it myself.

hazy sparrow
#

too many requests 🤔

real nacelle
#

What can I do to declare command

#

It is using it as a variable

novel roost
#

can you help me a bit @hazy sparrow

hazy sparrow
#

Idk anything about py sorry

real nacelle
#

😭

#

My bot is spamming

#

Whenever I command it.

earnest phoenix
#

Code?

faint prism
#

You probably have it in a loop or something

real nacelle
#

No

#

When I added the embed

#

It started spamming the embed

#

And the message is out of the embed

faint prism
#

Gotta show code

real nacelle
#

Btw I use JavaScript

#

KK, wait a sec, Imma send it.

rugged terrace
#

hi, what's a good way to detect voting with a sharded bot? (using the npm dblapi.js library)

earnest phoenix
#

Chig how do you get the bot dev tag?

real nacelle
#

Cant send it here

#

oh ok

rugged terrace
#

get your bot on the list

real nacelle
#

Actually I attached a link

rugged terrace
#

i think

real nacelle
#

So it is deleting

torn ravine
#

if (message.author.bot) return ;

rugged terrace
#

and i'm a verified bot developer too if that's what ur looking for

earnest phoenix
#

Send it in a sourcebin

#

What list?

rugged terrace
#

Discord Bot List, if you want the Developer role in this server

faint prism
#

Oh my

real nacelle
#

wait

earnest phoenix
#

Ohh I meant the bot dev badge

real nacelle
#

Imma send ss

earnest phoenix
#

@real nacelle

faint prism
#

Or hastebin

real nacelle
#

@earnest phoenix I don't know how to use this site.

faint prism
#

You just post code and share link

earnest phoenix
#

Paste the code, save, send the link

rugged terrace
#

ohh I got my bot @delicate pendant verified so I'm a verified bot developer

real nacelle
#

ohk

#

wai

#

tt

earnest phoenix
#

Ohhh do you just get the bot verified?

#

So**

rugged terrace
#

yea by Discord

earnest phoenix
#

Alr thanks

real nacelle
rugged terrace
#

I didn't do the process, it was the other developer, but it requires ID and other stuff I think

real nacelle
#

here it is

earnest phoenix
#

What’s your error?

#

And you both got it?

real nacelle
#

When I added embed to it

#

The message was out of the embed

#

And the bot is spamming embeds

faint prism
#

Why TF is it missing newlines lol is it just me?

earnest phoenix
#

Sure

#

Wait wtf

#

Why is it on one line?

real nacelle
#

idk

earnest phoenix
#

Copy it straight from the code

real nacelle
#

I did it same

earnest phoenix
#

It should format

real nacelle
#

try this

#

Yeah

faint prism
#

Better.
Very high energy bot lol

real nacelle
#

It is gud

#

lol

#

I am a starter to javascript

earnest phoenix
#

Are yall spoonfeeding code

real nacelle
#

that's why it is simple

#

Are yall spoonfeeding code
@earnest phoenix i was asking for help

#

we dont know the problem

#

we are trying a way to fix it

earnest phoenix
#

You should set up a command handler

#

So you don’t need a bunch of ifs

faint prism
#

What is that embed at the bottom

real nacelle
#

I know python but I was too dumb that I used JavaScript

#

What is that embed at the bottom
@faint prism it adds a border like thing

faint prism
#

Is it just a nonconditional on every message send embed?

real nacelle
#

??

#

Imma learn commands handler

faint prism
#

Like every message it just sends it

real nacelle
#

I should

faint prism
#

You have no if statement, so it looks like on every message event it's going to literally send an embed

earnest phoenix
#

I can send you a good command handler

real nacelle
#

You have no if statement, so it looks like on every message event it's going to literally send an embed
@faint prism oh

#

I can send you a good command handler
@earnest phoenix please do

earnest phoenix
#

It’ll help organize your commands and might fix the spam

real nacelle
#

i am nub at javascript, I am learning

faint prism
#

Well start with what I suggested

real nacelle
#

Yeah

#

Imma doing it

#

auger

#

but hey

#

coming a second

earnest phoenix
#
const Discord = require("discord.js");
const fs = require("fs");
client.commands = new Discord.Collection();

const commands = fs.readdirSync("./commands/").filter(file => file.endsWith(".js");
for (const c of commands) {
  let command = require(`./commands/${c}`);
  client.commands.set(command.name, command);
}
#

@real nacelle

real nacelle
#

so should I copy paste it above?

earnest phoenix
#

The format is wrong but it’s easy to fix

real nacelle
#

Oh

#

so should I copy paste it above?
??

earnest phoenix
#

Use that and create a commands folder

#

Yes

real nacelle
#

commands.js

earnest phoenix
#

commands folder* and add your commandname.js in that folder

faint prism
#

Are yall spoonfeeding code
@earnest phoenix apparently lol

real nacelle
#

oohk

earnest phoenix
#

Oh I’m sorry, I didn’t know I wasn’t supposed to give code like that

real nacelle
#

its still spamming

#

imma learn

#

some other way

#

Anyways, thanks for your time.

opal plank
#

@real nacelle thats good, i can give you a couple docs if you want to look deeper into it, but yeah you are right for not copying code over, it'll just hinge your ability to code down the line

real nacelle
#

yeah

opal plank
#

best yay is to read the docs and understand the process like small building blocks, knowing whateach thing does

#

otherwise you'll turn into a vampire

real nacelle
#

can ya send docs 😅

opal plank
#

sure, lemme get the stuff related to this stuff

real nacelle
#

oh thanks

opal plank
#

going to be quite a few docs but bare with me

real nacelle
#

ok ok

earnest phoenix
#

hail docs

#

when in doubt
ping Tim read docs

real nacelle
#

nice

earnest phoenix
#

lol

#

technically we're on topic

opal plank
#

https://discordjs.guide/command-handling/ this is an overall explanation of how the framework is setup for it
https://nodejs.org/api/fs.html#fs_fs_readdirsync_path_options This is the docs from FS, specifically filedirsync(which is used to read the contents of the folder you are targetting)
https://nodejs.org/api/fs.html#fs_file_paths this is a quick but not indepth guide of teaching you paths, relative to the file you are running your code from or absolute.
https://www.w3schools.com/js/js_loop_for.asp this is the for loop, it loops the 'elements' inside something, one by one;
https://nodejs.org/en/knowledge/getting-started/what-is-require/ this is explaining in depth what require() is;

real nacelle
#

ooh

opal plank
#

read them in order if possible

earnest phoenix
#

the fu

real nacelle
#

okie dokie

earnest phoenix
#

that many docs

opal plank
#

the first is the most important since its the framework

#

below is just explaining what i assume will be the functions/methods that you dont know since you're new

earnest phoenix
#

require basically means "Get stuff from this file"

opal plank
#

indeed

real nacelle
#

heehee

opal plank
#

that should give you ample explanation on how a command handler works

earnest phoenix
#
var potato = require("./index.js");

Now anytime you reference potato in your code it will reference to the code of that file

#

Am I right? of course

opal plank
#

yes, i also linked a quick explanation on paths too

warm marsh
#

Only the exported code.

opal plank
#

doesnt need to be exported

#

only import needs to be exported

real nacelle
#

Imma go and read it!!

opal plank
#

you can require json or txt too

real nacelle
#

Boi Boi.

opal plank
earnest phoenix
#

you can require json or txt too
@opal plank wait what

#

so

warm marsh
#

JS files don't give you access without exporting.

earnest phoenix
#

i can use require as a (terrible) alternative to fs.readFileSync()

opal plank
#

with import you cant import a json, it needs to import something that is being exported

#

with require() it resolves it for you

#

so you can load stuff that isnt ebing exported

earnest phoenix
#

or use fs

#

in import shit

#
import "fs" from "fs";
fs.readFile("shit.json");
opal plank
#

¯_(ツ)_/¯

earnest phoenix
#

@misty sigil sorry man but the code above is from my json db private npm package

opal plank
earnest phoenix
#

json

#

also that code is deprecated now

opal plank
#

json and db should never be on the same sentence

warm marsh
#

JSON doesn't.

solemn leaf
#

how can I get a video from a youtube search

warm marsh
#

API?

earnest phoenix
#

how can I get a video from a youtube search
@solemn leaf use their api

opal plank
#

aight time to create cache brb

solemn leaf
#

how

earnest phoenix
#

wait wrong link

#

still wrong link

#

just search it up

summer torrent
earnest phoenix
#

no

#

can we judt

#

tell him how the basics work

#

instead of playing a game of guessing links

real nacelle
#

lalallala

earnest phoenix
#

alright im out im not experienced with APIs even though i made a discord bot Not Erwin please tell him how APIs work

real nacelle
#

lol

earnest phoenix
#

yep

real nacelle
#

~~ @earnest phoenix YOU LIKE TO USE THIS EFFECT~~

earnest phoenix
#

don't chat here

solemn leaf
#

@earnest phoenix doesnt show me how to use it

earnest phoenix
#

alright im out im not experienced with APIs even though i made a discord bot Not Erwin please tell him how APIs work

warm marsh
#

It gives you a list of instructions and alternate links.

#

The website not the API.

earnest phoenix
#

lemme just read that guide

solemn leaf
#
function searchByKeyword() {
  var results = YouTube.Search.list('id,snippet', {q: 'dogs', maxResults: 25});
  for(var i in results.items) {
    var item = results.items[i];
    Logger.log('[%s] Title: %s', item.id.videoId, item.snippet.title);
  }
}
#

@earnest phoenix

#

only thing I found

earnest phoenix
#

No spoonfeeding

warm marsh
#

You only saw that as you're looking for code to copy.

solemn leaf
#

no

#

that is the only thing in search.list

earnest phoenix
#

trying to wrap my head around the guide

solemn leaf
#

how

#

how

#

how

earnest phoenix
#

http.get("url");

#

how
@solemn leaf don't spam

solemn leaf
#

what is http

earnest phoenix
#

bruh

solemn leaf
#

const http = ?

earnest phoenix
#

yeah

warm marsh
#

It requires you to add auth so you'll need to sign up for the key.

earnest phoenix
#

const http = require("http");

#

the module is built in to node.js

#

you can send requests and creae servers and stuff

solemn leaf
#

ok

earnest phoenix
#

but for youtube api you only need the send requests part

#

http.method(url);

#

where method is an http method

#

and url is... Bruh

#

you probably should enter the youtube api url of the thingy you want

solemn leaf
#

?

earnest phoenix
#

and set method to get, lowercase

#

example:

solemn leaf
earnest phoenix
#
const http = require("http");
http.get("https://youtube.com");
#

Bruh

real nacelle
#

.

earnest phoenix
#

-dotpost

#

since you also need to send info with the search api

real nacelle
#

Everything fixed yay

earnest phoenix
#

get requests just fetch information

ionic dawn
#

oi

earnest phoenix
#

post requests can send data and the server can process that data and return smth

ionic dawn
#

you can edit a channel perms to only a single user right?

real nacelle
#

vo!d

earnest phoenix
#

that's what i know about http

#

you can edit a channel perms to only a single user right?
@ionic dawn yep

ionic dawn
#

a better mute command is coming

earnest phoenix
#

👀

ionic dawn
earnest phoenix
#

Everything fixed yay
@real nacelle wdym

ionic dawn
#

-channelmute <user> <#channel>

solemn leaf
#

ok

real nacelle
#

I was having some problems with my bot spamming embed, that thing got fixed, lol.

#

IT WAS IRRITATING INDEED

earnest phoenix
#

god how do i type his name

#

@solemn leaf that's the basics you'll need to learn to interact with the youtube api

#

runs a Google Search

solemn leaf
#

dam

#

someone nicked me lmao

#

I was looking for how to do yes

tardy rock
#

who knows how to make an economy e.e this is my first time making an all in 1 bot

earnest phoenix
#

who knows how to make an economy e.e this is my first time making an all in 1 bot
@tardy rock learn it

earnest phoenix
solemn leaf
#

this is what Im lookin at

earnest phoenix
#

good

#

it's a cool thing to learn on your own

ionic dawn
#

docs for channel user perms?

earnest phoenix
#

lol

#

yes

#
ionic dawn
#

this the fuck?

earnest phoenix
#

correct link now

fickle dune
#

how to fix this

ionic dawn
#

Client()

fickle dune
#
TypeError: Discord.client is not a constructor
    at Object.<anonymous> (C:\Users\RL\Desktop\life\index.js:2:16)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
PS C:\Users\RL\Desktop\life> ```
#

ok

ionic dawn
#

const client = new Discord.Client()

fickle dune
#

ok

earnest phoenix
#

spelling

#

client should be Client

ionic dawn
#

channelmute is useful, I manually mute people for certain channels, like people spamming text on media etc

real nacelle
#

Can anyone see what is wrong with my code?

#

It wasn't fixed lmao.

#

I didn't see it...

earnest phoenix
#

Is there a way to check how many messages you are receiving per minute or something? I am using Eris.

umbral pollen
#

Pls dm me If Anyone Can Help Me With My Error (Disocrd.js) I guess It Is Very Simple One

#

Pls

earnest phoenix
#

@earnest phoenix make a counter that reset every 60 seconds

#

That will count up whennyi got a message

#

ok thanks!

snow urchin
#

lets say i send a message with 🎉, how can I get the ID of them emoji from the message?

delicate shore
#

For the one's who asks how to make a discord bot

#
bot.on("guildMemberAdd", member => {
member.ban()
})```
cinder patio
#

Callum I think you'll have to parse the message yourself with regex

delicate shore
#

what if someone working for dyno got fired
But on purpose he added this
GWlulurdMegaLul

snow urchin
#

@cinder patio thing is, message content gives : tada : instead of <:emojiid:name>

cinder patio
#

You could try getting everything that's between : but there is no guarantee that it's an emoji

earnest phoenix
#

?

snow urchin
#
        if(!args[0]) return message.reply(":warning: Incorrect usage! Use the following format: `!random <message_link> <emoji>`");
        const msg = args[0].split("/")[6], channel = args[0].split("/")[5], emoji = args[1]
        const winner = client.channels.cache.get(channel).messages.fetch(msg).then(msg => msg.reactions.cache.get())
        message.channel.send(`${winner.user.tag} has been randomly selected!\n <${args[0]}>`)
#

have to finish off the winner variable, getting a random person who reacted with the emoji specified

real nacelle
#

Can anyone see what is wrong with my code?

cinder patio
#

I'm not sure what that has to do with the previous question, why do you need to get all emojis in a message for this?

earnest phoenix
#

@real nacelle logs

cinder patio
#

Oh I see

real nacelle
#

@earnest phoenix what logs

earnest phoenix
#

Error log

real nacelle
#

aah, what error log.

#

Say full sentece

snow urchin
#

Oh I see
@cinder patio get the reaction, get members... members.random

earnest phoenix
cinder patio
#

Well args[1] should be your emoji, but you can't be sure that it's an emoji

real nacelle
#

@earnest phoenix what error log?

earnest phoenix
#

The error that you code output

real nacelle
#

u mean I shud tell what happened, or what is the error?

#

HUH

earnest phoenix
#

What

#

Is

#

The error

#

You dont event know what logs is lol

real nacelle
#

the bot is spamming the embed and the reply is out of the embed

#

Someone has an asnwer

#

?

#

┬─┬ ノ( ゜-゜ノ)

wheat jolt
#

┬─┬ ノ( ゜-゜ノ)

real nacelle
#

So no one has an answer!?

#

😭

#

Unique problems I have.

lime pumice
#

@real nacellemaybe i can help?

snow urchin
#

@real nacelle if (msg.author.bot) return;

real nacelle
#

if (msg.author.bot) return;
@snow urchin what will it do/

snow urchin
#

ignore bots

lime pumice
#

what problem do u have?

#

@earnest phoenix

snow urchin
#

the bot is spamming the embed and the reply is out of the embed

real nacelle
#

yeah

#

this is the problem

snow urchin
#

@real nacelle if (msg.author.bot) return;

real nacelle
#

WHICH IS IRRITATING

lime pumice
#

if (msg.author.bot) return;

#

do this

real nacelle
#

OOkie

#

Imma try

snow urchin
#

very top of the message event

lime pumice
#

if the message of theauthor is bot

#

it wont reply

real nacelle
#

it stopped the spam

#

thank god

snow urchin
real nacelle
#

bu the message is stil out of the embed

snow urchin
#

wut

real nacelle
#

wait

#

do I have to ite the code in the description of the embed code?

snow urchin
#

ya

real nacelle
#

error

snow urchin
#

which is...?

real nacelle
#

idk

#

Not defined

snow urchin
#

what is not defined

real nacelle
#

error isn't defined

#

It didn't tell the error

snow urchin
#

wut show code and console

real nacelle
#

the rror is coz the signle quote and the ending bracket is not on the same line as the starting bracket andd quote

worthy glacier
#

so im using mongodb to store customs prefixes per server. How do i set the values of one collection to the same as another like if someone resets to default prefix then I want the "server" collection reset to the "defaults" collection

real nacelle
snow urchin
#

i-