#dev-contrib

1 messages · Page 83 of 1

dusky shoreBOT
#
Command Help

.wolfram <query>
Can also use: wolf, wa

Requests all answers on a single image, sends an image of all related pods.

Subcommands:
cut <query>
Requests a drawn image of given query.
page <query>
Requests a drawn image of given query.
short <query>
Requests an answer to a simple question.

patent pivot
#

.wa short time in florida

dusky shoreBOT
#

07:20:16 Eastern Standard Time, Tuesday, 9 February 2021

short snow
#

oh, didn't know that

surreal venture
#

RuntimeError: Session is closed Why's that? I'm using self.bot.http_session

#
async with self.bot.http_session as session:
    async with session.get(...) as response:
        ...
green oriole
#

You shouldn’t use the first with block

#

just async with self.bot.http_session.get(...) as response:

surreal venture
#

Ah I see

#

Also where is the http_session defined?

#

of the bot?

green oriole
#

Probably in bot.bot

surreal venture
#

oh yeah it's there

short snow
#

first review on mobile!!! 🙃

mossy wolf
#

i'm still waiting after a reject for changes

green oriole
#

!remind 18h Write an issue about the phan message

stable mountainBOT
#
You're the boss!

Your reminder will arrive in 18 hours!

green oriole
#

and prove f1re wrong while you’re at it :P

gritty wind
#

What PR are you looking at, I’m pretty sure I don’t know what granularity is either lmao

short snow
clever wraith
#

@green oriole would a tag on blocking/non-blocking be a good idea?

#

not an entire one on concurrency

gritty wind
#

If you can succinctly explain it, I wouldn't mind it. If you think you can, feel free to draft something up, but keep in mind if it has to be really long in order for it to achieve its purpose, we'd be better off including resources instead of explaining it ourselves

cold moon
#

I think blocking/non-blocking quick summary (show blocking and non-blocking) would be useful for #discord-bots

#

And like giving few examples about blocking libraries and non-blocking libraries.

clever wraith
clever wraith
#

ok dumb question, how do I pull from the python-discord/bot repo to my fork so its up to date?

green oriole
#
git remote add upstream https://git.pydis.com/bot
git checkout master
git pull upstream master
git push origin master```
#

You will only need to run the first command once

clever wraith
#

@green oriole was doing git pull upstream master and got this:

fatal: 'upstream/master' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
green oriole
#

Okay, try again with a space instead or a slash

clever wraith
#

ok works

short snow
#

Here is what i do

clever wraith
#

should I make a new branch, or just commit directly on master?

#

also, what's this? Don't forget to lint!

gritty wind
#

new branches is usually what's expected for fork & pull models

#

We have pre-commit which basically runs a few checks on your code/work to make sure it meets the style guide requirements

#

If you're writing a tag, you're unlikely to hit many errors, but there are still a few

#

if you have pipenv installed, you can run

#

pipenv install --dev
followed by
pipenv run lint

#

(all in the root directory of the project, so where you see the Pipfile file)

clever wraith
#

i don't have pipenv

#

how to install?

gritty wind
#

pip install pipenv

#

I would usually say it's a requirement, but if you aren't planning on contributing code often to the projects its fine to skip

short snow
#

u have pycharm?

clever wraith
#

no vscode

surreal venture
#

Pycharm warning: Package containing module 'discord' is not listed in project requirements

#

I guess it's because it's called "discord.py" in the Pipfile and not discord

gritty wind
#

Yeah it's a little funky

#

But you can mostly ignore that error for d.py

green oriole
#

Yeah, you can ignore it

#

It is a configuration error on d.py side

surreal venture
#

yeah

surreal venture
#

Is there a way to make HTML encoded content (like &quot;Hello&quot;) into a normal python string ('Hello')?

brazen charm
#

html.unescape

surreal venture
#

Thanks!

balmy sparrow
#

yeah that FAQ is what i usually link to people too there

mossy wolf
clever wraith
#

kek

balmy sparrow
#

it's a good enough explanation that's easily accessible though

clever wraith
balmy sparrow
#

it's much more approachable

gritty wind
#

I don't really like the idea of using the discord tag, because there is quite a bit of it specific to the d.py library

#

Calling this the blocking tag when it's mostly related to d.py is misleading

cold island
#

The idea of blocking seems too much for a tag

surreal venture
#

Is the format for emojis <:emoji_name:emoji_id>?

green oriole
#

Think so

gritty wind
#

I think in code you just need the name and id without the <>

#

!int e

await ctx.send("![dice_1](https://cdn.discordapp.com/emojis/755891608859443290.webp?size=128 "dice_1")")
stable mountainBOT
#
In [1]: await ctx.send("![dice_1](https://cdn.discordapp.com/emojis/755891608859443290.webp?size=128 "dice_1")")```
gritty wind
#

ah nevermind

surreal venture
#

Thanks!

#

Pycharm and Discord both don't work well with the emoji selector thing in Ubuntu

gritty wind
#

windows finally wins out? :D

surreal venture
#

nah ubuntu's the best

#

😅

#

*linux

clever wraith
#

i made a PR, and the lint test failed, anything to be worried about?

obsidian patio
#

That simply means that your code doesn't follow the required formatting. You could set up a precommit in order to avoid this in the future

obsidian patio
#

For now, simply fix the linting issues and you'll be all good

#

What project is it for?

clever wraith
#

and run pre-commit hooks failed

#

for the python bot

obsidian patio
#

Hmm, not sure how that could fail the lint. Could you link the PR?

gritty wind
#

It's probably trailing whitespace, or new lines

clever wraith
#

more specifically, Trim Trailing Whitespace.................................................Failed

#

how would I fix that?

gritty wind
#

It means you have somnthing like:
this is an example

gritty wind
#

You need to remove the extra whitespace after text or on new lines

clever wraith
#

ok

#

i removed it, but still i got the trailing-whitespace failed

obsidian patio
#

Could you link the PR?

gritty wind
#

Oh that's not what I meant

#

let me get an example from the actual code

clever wraith
#

hold on

gritty wind
#

Here for example
**Resources for Further Reading**

#

You have a space after the last star

clever wraith
#

ok

#

why does it check for whitespace?

obsidian patio
clever wraith
#

ok

#

i removed everything thinking

#

why is it giving this?

#

I removed all whitespaces

#

@obsidian patio

obsidian patio
#

I can't provide any more help if you don't send me a link to the PR

clever wraith
#

ok

#

next

#

i get this:

Fix End of Files.........................................................Failed

gritty wind
#

That's because you probably pushed with windows line endings

#

That's a whole topic, but the point is git should've automatically caught for you with a default setup

buoyant grove
#

hey

vale ibex
#

Do you have the pre-commit hook setup @clever wraith ?

vale ibex
thorny obsidian
#

If you're on windows you need to alter the pre-commit to fix it

buoyant grove
thorny obsidian
#

After troubleshooting, numerlor helped me to get to this solution

vale ibex
#

Huh, I didn't need to change the pre commit hook, just doing git config core.autoclrf input worked for me

#

I'm interested in why the pre commit change was needed

gritty wind
#

You may need to modify sometimes if you're using certain IDEs because flake8 is fucky

thorny obsidian
#

I work from vscode and don't actually use git cmd line

gritty wind
#

but they don't really need flake8 for a tag haha

vale ibex
#

Is this in notion?

thorny obsidian
#

my personal notion page

vale ibex
#

Any chance you can copy the hook code? 😄

thorny obsidian
#
if sys.platform == 'win32':  # https://bugs.python.org/issue19124
    import subprocess

    if sys.version_info < (3, 7):  # https://bugs.python.org/issue25942
        raise SystemExit(subprocess.Popen(CMD).wait())
    else:
        raise SystemExit(subprocess.run([INSTALL_PYTHON.replace('python.exe', 'activate.bat'), '&&', *CMD]).returncode)
        #raise SystemExit(subprocess.call(CMD))
else:
    os.execvp(CMD[0], CMD)
vale ibex
#

👍

brazen charm
#

Wasn't there a pr that was supposed to fix it? or was that for something else

gritty wind
#

it was already merged iirc

brazen charm
#

seems to work now after a new precommit install

thorny obsidian
#

I'm too lazy to change my set-up 😎

vale ibex
#

Yea, looks like it. Re-running pipenv run precommit and my python install path is setup for my pipenv env

vale ibex
# clever wraith no

I would suggest setting it up, as you can then run these checks on your local machine before pushing to the repo

brazen charm
#

Only non standard thing for pycharm I have now is mockign sys.stdout.isatty to get proper colored logs

vale ibex
#

Run these steps:

  1. python -m pip install pipenv to install pipenv.
    2.python -m pipenv shell from the bot root dir to enter the pipenv env.
  2. pipenv sync --dev to install project dependencies
  3. pipenv run precommit to install the hook.
brazen charm
gritty wind
vale ibex
#

Hmmm, possibly?

vale ibex
#

depends, what os are you running?

clever wraith
vale ibex
#

yea, python3

clever wraith
#

ok, so how would I fix the line ending thing anyway?

sleek steppe
#

check each line for whitespace at the end I guess

gritty wind
#

The line endings are different from the whitespace

#

The precommit hook should be able to fix both anyways

#

But..

#

Due to some git funkiness, it'll appear locally as though you changed every file in the repo

#

It shouldn't be a problem though

clever wraith
#

after doing pipenv run precommit, what should I do?

gritty wind
#

When you go to commit, it'll automatically run

gritty wind
#

If you have no changes, you can manually trigger to run pipenv run lint

clever wraith
#

ok

#

i still get Fix End of Files.........................................................Failed

gritty wind
#

Does it say changed under that?

clever wraith
#
Fix End of Files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing bot/resources/tags/blocking.md

full outpt

gritty wind
#

Right, so it failed and fixed them

#

You should be good now

#

If you'd like to be 100% sure, run it again

#

it should pass

clever wraith
#

ok

#

what's coverall?

gritty wind
#

Code Coverage, essentially how much of the codebase has unit testing

#

Doesn't matter for tags though

clever wraith
#

ok

clever wraith
#

how long does it take for a pull requests to be revied/merged?

brazen charm
#

Depends on its complexity, people's availability and how much needs to be changed

vale ibex
#

@clever wraith What editor are you using to code?

clever wraith
#

:D

vale ibex
#

Open the .md file and look at the top right of vsc

#

Clicking the second button will preview the .md file with formatting

clever wraith
#

ok

vale ibex
#

You will need to add some line breaks in between the different sections

clever wraith
#

ok

cold island
#

He's probably not available rn, no point in pinging him twice

clever wraith
#

ok

#

so how is it?

short snow
#

ok. till 18th i don't think i would be able to mention any changes on the two prs, so they would be stale for a week.

#

sorry.

#

would appreciate if someone gives reviews on the two till then

gritty wind
#

Don't worry, you're always free to step back

#

You can get back to your PRs when you have time

short snow
#

ok thanks. my finals start from 18th hence.

green oriole
#

Good luck for your finals!

stable mountainBOT
#

@green oriole

It has arrived!

Here's your reminder: Write an issue about the phan message.
[Jump back to when you created the reminder](#dev-contrib message)

green oriole
#

phan

lament hedge
#

did the way to create fake redis change? cuz doing taskCache = RedisCache(use_fakeredis=True) throws TypeError: __init__() got an unexpected keyword argument 'use_fakeredis'

vale ibex
#

Anyone know why I got a ping here?

#

Can't see a message that would have caused it

lament hedge
vale ibex
#

Yea, I replied to that one already

lament hedge
#

trying to create fake redis for testing from async_rediscache

vale ibex
#

is this for sirlancebot or bot?

lament hedge
#

bot

vale ibex
#

in config.yml set use_fakeredis to true

subtle kraken
#

RedisSession is the thing that accepts that keyword

#

fwiw

surreal venture
#

Uh I think I had accidentally reverted the Issue Regex thing using git revert how do I revert the revert?

#

Whyyy does git need to be so confusing 😦

#

Should I just manually change it?

#

git pull upstream master isn't changing it

#

WHY

vale ibex
#

git revert just creates a commit that is the opposite of the commit your reverting

#

It doesn't remove a commit from the history

green oriole
#

There is a way to obliterate a commit from existence, but I wouldn't recommend it

surreal venture
#

Yes, but how can I revert it? Should I just revert the revert commit?

rapid swallow
#

git reset (replying to akarys)

vale ibex
#

You could just commit the change back into the branch, since removing the revert commit from history isn't recommended

rapid swallow
vale ibex
#

So just make the change again and commit it

surreal venture
rapid swallow
#

yeah, that's the easiest way

#

I guess you could checkout the old commit

#

it'll still be there

surreal venture
#

isn't git checkout for changing branches?

#

Okay thanks its fixed

tawdry vapor
#

git checkout can check out arbitrary refs.

#

A ref can be any commit

#

Though it's more idiomatic to do git reset <commit sha>, possibly with the --hard option if you want to discard the revert commit entirely

#

I think if you use git checkout it'd put you in a detached HEAD

clever wraith
#

would a chatbot feature be good for @dusky shore

surreal venture
#

Chatbot as in an AI-powered chatbot?

#

or what?

clever wraith
#

there are a couple apis

surreal venture
#

I don't know, you might need to create an entirely new channel for that

#

to converse with the bot

clever wraith
#

yes

surreal venture
#

plus to just ask questions we have the wolfram-alpha command.

#

.wa

vale ibex
#

Your best bet would be to raise an issue, select feature and try to best describe your suggestion

#

It'll give us the opportunity to give feedback and keep the discussion in one place.

clever wraith
#

ok

static shale
#

i have a problem with the GitHub python-discord / bot bot

cold moon
static shale
#

but then can i do os.system("pipenv sys.executable") or something similar?

#

what?

umbral scroll
#

just wanted to create a dev group

vale ibex
vocal wolf
#

@umbral scroll this is the place to discuss the development of repos from the org of pydis.

static shale
umbral scroll
#

@vocal wolf ohh my bad i just wanted to post a project i wanted to colab. May u point me in the right direction

vale ibex
#

It explains how to get setup and run the bot

#

I think you are misunderstanding how to get it running

static shale
#

I want to do this:
The code starts itself with pipenv like ```py
os.system("pipenv (the path to the python script)")

vale ibex
vale ibex
umbral scroll
#

nope i want some contributors

#

but anyways i appriciate ur help

static shale
gritty wind
vale ibex
#

Then you'd need to set the current working directory to the root of the project, activate the pipenv shell and then run pipenv run start

static shale
#

ok

#

but i have an idea

gritty wind
vale ibex
#

You'd need the path to the pipenv python binary right?

gritty wind
#

If you want to do pipenv run directly, but if you have it installed globally it should be fine. python -m pipenv run would also work

static shale
#

i have an idea for this

gritty wind
#

I... what? Why are you not just doing pip install pipenv lmao

static shale
vale ibex
#

Why are you scripting this?

static shale
#

TO DO IT FROM THE SCRIPT

#

ok wtf happened

gritty wind
#

Alright, you don't need to be abrasive, this channel is very much not meant for what you're doing

vale ibex
#

Yea, I understand that, but what is doing it from a script gaining over just running the install from the command line?

#

As its a one time install

gritty wind
#

Eh it just runs python under the hood, so it'll open it in a different window

#

probably

vale ibex
#

That error specifically is most likely due to you missing a -

static shale
#

I created a new file to start the bot

#

oh yea

#

(in python)

gritty wind
#

a single - is usually only followed by a single letter, words are prefixed with --

vale ibex
#

You might want to look into the docker workflow if starting the bot locally is an issue

static shale
#

ok... when i use pipenv... it gives the CMD error that pipenv is not a command

gritty wind
#

Try python -m pipenv

static shale
#

oh

#

mmmmmm.................

#

Warning: Python 3.8 was not found on your system...
Neither 'pyenv' nor 'asdf' could be found to install Python.
You can specify specific versions of Python with:
$ pipenv --python path\to\python

#

(i use python 3.9.1)

gritty wind
#

What did you put?

static shale
#

but doesn't really care

#

cuz i dont have python 3.8

gritty wind
#

You need to have 3.8 to run the bot

static shale
#

or install pyenv and asdf to install py 3.8 via pipenv

gritty wind
#

pyenv will just install python 3.8 for you

#

Pipenv will insist you use 3.8, unless you manually override it

static shale
#

but i cant install pyenv for windows

gritty wind
#

You don't need to, as all it literally will do for your case is install python 3.8

static shale
#

yes i know

#

but im a bit lazy to install python

gritty wind
#

See this line?

[requires]
python_version = "3.8"
#

in Pipfile

green oriole
#

Well, you will need Python for our projects

gritty wind
#

you are free to change it

#

but we will not support any changes you make

#

If things act weird, it will be hard for us to debug and fix

gritty wind
#

The file titled Pipfile

static shale
#

i found it

#

No module named colorama

#

but its not a 3.9 error, its just that colorama was not imported

green oriole
#

Can you run py -v?

static shale
#

3.9

green oriole
#

Okay, now run pipenv --python 3.9 sync

static shale
#

python -m pipenv --python 3.9 sync

green oriole
#

Sure

gritty wind
#

colorama doesn't have binaries for 3.9 iirc

green oriole
#

Ung

static shale
gritty wind
#

I mean i'm literally looking at their pypi page, but if it works for you, it works ig

green oriole
#

Is pipenv syncing right now?

static shale
#

just the colorama was not imported (replying to Scaleios)

static shale
green oriole
#

Sweet

#

Tell us when it is done

static shale
#

not us

thorny obsidian
#

colorama's last wheel upload was oct 12, python 3.9's earliest stable release was oct 5. I don't think colorama had binaries ready that quickly

static shale
#

but i use colorama in a py code and it works but in another file it doesnt work R O T F F L M F A O
o n h u l a y u s f
l e c o u c s f
l k o g k
i i r h i
n n i n
n 😄

green oriole
#

What is that

gritty wind
#

yeet time

static shale
#

@green oriole done

green oriole
#

Let's not send such messages please

#

Okay so

#

Are you in the bot or the site?

static shale
#

in the bot with CMD open

#

And again, the circular import error

green oriole
#

Do you have the site setup?

static shale
#

what site

green oriole
#

You need to have a local copy of our site in order to get the bot working

static shale
#

BUT WHAT SITE IS THAT

green oriole
#

Can you clone that and open a new command line in it?

static shale
#
- I'll dinner now and I will not come back today but
+ I (maybe) come back tomorrow

OK?

green oriole
#

Alrighty

static shale
green oriole
#

Sure thing, be sure to ping me when you come back

clever wraith
vale ibex
#

I've given it a quick once over, I'm going to grab some dinner now though, so tag me if you have any questions.

#

Are you able to get a screenshot of what it looks like when the bot sends it? That could be useful to anyone else code reviewing it.

#

If not, I could get one for you when I'm back.

gritty wind
#

It's a bit long though, so someone can just get it for you

clever wraith
#

i installed dependencies

gritty wind
#

Ah okay

#

Did you get the site up and running?

clever wraith
gritty wind
#

Having the site (which contains the API) running is part of the requirements

#

you can either set it up manually, or use docker to run everything for you

#

that tag is still a bit long huh

#

I can barely get it in one screenshot

vale ibex
#

In what instance are we expecting this tag to be invoked?

#

If its when someone uses a blocking call and doesn't know why their process is hanging, maybe we should keep it hyper focuessed to that

#

and offer more further reading

gritty wind
#

cc @green oriole

clever wraith
#

ok

gritty wind
#

I'm not too sure about the content itself tbh. A lot of it is adapted from d.py (without proper citation hyperlemon), and is specific to the problems people face when using the library.

clever wraith
#

ok

gritty wind
#

It also doesn't explain what async is outside of the library's context, and I don't know that the d.py docs explain it outside of that context either

#

I'm tempted to say a shortened version of this will work as a d.py tag

#

but I don't think that works too well as a standalone async/blocking tag

clever wraith
#

@gritty wind so any suggestions on how to imporve??

short snow
#

@surreal venture gave a review lemon_pleased

short snow
#

@surreal venture go to #reddit , right click on the emojis, open it in a new link and download it

#

and then put it on on the emojis of your server

short snow
#

👍 .

gritty wind
# clever wraith <@!386599446571384843> so any suggestions on how to imporve??

Well you can take this one of two directions imo.

  1. You can either make this a d.py tag specifically, and entirely remove the middle third (Another example is requests... + codeblock). The how to find async modules can probably be shortened, or even removed. Do call it a d.py tag though.

  2. Alternatively, if you want a general async tag, you'll have to start explaining what it is, or what blocking is, not just what its effects are and how to get around them. Point is, that'll require a bit of rewriting. You'll also need better sources than discord.py docs which is not really focused on teaching what async is.

In both cases, I think that tag will have to be shortened to be considered.

balmy sparrow
#

@obsidian patio I've made the changes you've requested on bot#1398

dusky shoreBOT
balmy sparrow
#

Akarys had approved the PR, should I re-request review as I've made changes?

short snow
#

yes, u re-request a review

obsidian patio
balmy sparrow
#

#dev-contrib message This was what I'd been told about the try-except, I don't mind removing it though

obsidian patio
#

I think that @gritty wind would be fine with removing it, but we can check. I’m fine with it both ways

balmy sparrow
#

I split up the codeblock the way Xithrius said to avoid the need for that odd in-line comment, that's fine right?

gritty wind
#

I wanted them mentioned so we can describe more normal possibilities, but if you think it flows better without it, go for it

obsidian patio
#

Alright

#

Give it some thought and see what you think works best. I’m fine with both, as long as we make it flow well

balmy sparrow
#

Didn't see this haha I've removed the try-except reference

#

I can see it being just unnecessary fluff on there

obsidian patio
#

Alrighty👍

#

And for the record, I definitely think Xith’s suggestion is great! We all pick up on different parts, so having multiple reviews can really be beneficial

#

@vocal wolf if I want to discuss a way to increase the number of PR reviews done, should I talk to you or Ak about it? You would be best fit, right?

vocal wolf
#

ye

#

I'll be reviewing stuff later tonight, not really available at this current moment though. Finishing up Java assignment (I know, traitor).

obsidian patio
#

Hahah alright

#

I’ll just send a message here that you can ponder on whenever you want to and have time

vocal wolf
#

Don't merge that KeyError tag yet, I need to review it again I think

obsidian patio
#

Yeppers; I don’t even have the permissions

vocal wolf
#

alright

obsidian patio
#

Soo, in the media projects, we’re planning on shining some more light on the contributors—by including their names in the credits—which I think will help with drawing more contributors into the projects.

We often post about new features and mention the PR authors in #changelog, but we never care about the reviewers and not always the people who have contributed to the discussions. I think that mentioning who reviewed it, especially for larger PRs, could really help improve the visibility of reviewing and thereby getting people more interested in the topic and helping out, instead of just submitting PRs. It’s an integral part of the process, and I think we should value it as such—especially since reviews are something we really, really need

short snow
#

Well i have done few reviews till now, any comments on how i should improve them? am a doing something wrong, etc.

short snow
obsidian patio
#

(Cc @vocal wolf, whenever you’re free)

short snow
#

👀 seems like a long essay incoming

obsidian patio
vocal wolf
#

@obsidian patio I think we need to sit down together sometime and work this out. We'll be able to get more information to go between the teams.

obsidian patio
vocal wolf
#

Me and you sitting down together and discussing this out, because I'm not sure if I quite understand what needs to be done.

#

It may just me being tired

obsidian patio
#

Ah, yeah. Sure thing, that could be good

vocal wolf
#

ye

#

the keyerror tag was merged

#

bot hasn't connected yet tho

obsidian patio
#

Ah, lovely

gritty wind
#

changelog?

vocal wolf
#

changelog.

gritty wind
#

👍 I'll send it out when @stable mountain is reborn

vocal wolf
#

veri nais

obsidian patio
#

Excellent

short snow
#

triple !!!?

vocal wolf
#

!dict-get

stable mountainBOT
#

Often while using dictionaries in Python, you may run into KeyErrors. This error is raised when you try to access a key that isn't present in your dictionary. Python gives you some neat ways to handle them.

The dict.get method

The dict.get method will return the value for the key if it exists, and None (or a default value that you specify) if the key doesn't exist. Hence it will never raise a KeyError.

>>> my_dict = {"foo": 1, "bar": 2}
>>> print(my_dict.get("foobar"))
None

Below, 3 is the default value to be returned, because the key doesn't exist-

>>> print(my_dict.get("foobar", 3))
3

Some other methods for handling KeyErrors gracefully are the dict.setdefault method and collections.defaultdict (check out the !defaultdict tag).

vocal wolf
#

guess it's fuzzy enough to work here lol

short snow
#

how did it work here?

#

ah

vocal wolf
#

It just took the prefix ! and then added whatever I had

#

searched for the tag from there I guess

short snow
#

👍.

gritty wind
#

is the tag dict-get or key error?

vocal wolf
#

dict get

short snow
#

yes ig

vocal wolf
#

!keyerror

short snow
#

wasn't it originally on key error?

vocal wolf
#

not sure

gritty wind
#

the PR is key error 🦐

#

That's not the right emoji

vocal wolf
#

lol

balmy sparrow
#

it originally was on keyerrors, but akarys said I should rename it

#

after all, dict-get is the only thing being explained there

gritty wind
#

It's a nice tag

balmy sparrow
#

lemon_hyperpleased hope it'll be useful

short snow
sharp timber
#

So I broke the paginator again, I'm thinking of setting aside some time to work on it, if nobody's already got something that'd conflict?

gritty wind
#

Hmm I don't think anything is happening on @stable mountain right now

#

I think there is porting or something happening for lance though

sharp timber
#

!raw 809345696696238102

#

this, basically

stable mountainBOT
#

Sorry, an unexpected error occurred. Please let us know!

RuntimeError: Line exceeds maximum page size 1992

sharp timber
#

Ok

gritty wind
#

There is an open issue if you'd like an official assignment

#

Though mark is assigned to that

obsidian patio
green oriole
#

Haha

#

Well

#

It isn’t really a bug

obsidian patio
#

Oh wait, it’s the say Command?

#

And it thought I misspelled s?

green oriole
#

It is the site command

obsidian patio
#

Aah

green oriole
#

Yep, since a mention is a valid prefix it tried to correct you

#

@stable mountain site hom

stable mountainBOT
#
Command Help

!site
Can also use: s

Commands for getting info about our website.

Subcommands:

!site faq
Info about the site's FAQ page.
!site help
Info about the site's Getting Help page.
!site home
Info about the website itself.
!site resources
Info about the site's Resources page.
!site rules [rules]...
Provides a link to all rules or, if specified, displays specific rule(s).
!site tools
Info about the site's Tools page.

green oriole
#

hom

obsidian patio
#

Yeah. Just didn’t understand why it used that exact thing, but that makes sense

#

Could we disable it for helpers as well? I think we know the commands

gritty wind
#

Ehh it's still probably helpful, and I'd like to see it eventually become mod+ too

green oriole
#

We were actually supposed to re-enable them for mods

gritty wind
#

but I don't know that @stable mountain prefix is used

obsidian patio
#

Why?

green oriole
#

It is useful to copy paste the command when you made a typo

obsidian patio
#

Ah, makes sense

#

I guess I’ll just have to live with that

green oriole
gritty wind
#

I mean you can definitely set the prefix

obsidian patio
#

It makes sense, since people use so many different prefixes. If you don’t know the one for the current bot, you just mention it

gritty wind
#

command_prefix=commands.when_mentioned_or(constants.Bot.prefix)

#

This is our current prefix, I don't think mention is default

green oriole
#

Hmm

gritty wind
#

Removing that line

green oriole
#

Hmm okay

keen valley
#

!dict-get

stable mountainBOT
#

Often while using dictionaries in Python, you may run into KeyErrors. This error is raised when you try to access a key that isn't present in your dictionary. Python gives you some neat ways to handle them.

The dict.get method

The dict.get method will return the value for the key if it exists, and None (or a default value that you specify) if the key doesn't exist. Hence it will never raise a KeyError.

>>> my_dict = {"foo": 1, "bar": 2}
>>> print(my_dict.get("foobar"))
None

Below, 3 is the default value to be returned, because the key doesn't exist-

>>> print(my_dict.get("foobar", 3))
3

Some other methods for handling KeyErrors gracefully are the dict.setdefault method and collections.defaultdict (check out the !defaultdict tag).

keen valley
#

how to make a tag

gritty wind
#

Open an issue on the bot repository to get approved, then add it to the tags folder

green oriole
keen valley
#

how to connect the my discord account to discord

obsidian patio
#

What do you mean?

short snow
#

github account to discord?

#

!ot channels please.

stable mountainBOT
short snow
#

this is strictly for python discord projects discussion

keen valley
#

shall i add a tag

#

Its almost ready

obsidian patio
#

Feel free to comment on the discussion Akarys sent, and we’ll see if it’s something worth adding

gritty wind
#

hey @vocal wolf if you'll do the work on a new branch, mind deleting the old one?

vocal wolf
#

right now, it's the same branch

#

I un-deleted it because I was going to continue working on it

#

currently creating the PR

gritty wind
#

Ah I thought there was a different message for undeleting

vocal wolf
#

oh wait

#

god dammit

#

lmao I named the branch origin/dynamic-stuff

#

I'll uh

#

I'll delete that if I can

gritty wind
#

loool

vocal wolf
#

removed

keen valley
#

I am unable to add a md file in the tag

gritty wind
#

Did you leave a comment on the discussion thread first?

short snow
#

without a approved issue which is assigned to you, your contribution can't get merged

keen valley
#

so what should I do now

gritty wind
#

Ehh we sometimes skip the issues, but you should at least comment so we can discuss it

gritty wind
short snow
#

oh sry for the ping

gritty wind
#

oh well

short snow
#

lol double ping

vocal wolf
#

@gritty wind there, I did it correctly this time

keen valley
short snow
#

not there

vocal wolf
#

last time I accidentally did git push -u origin/dynamic-available-message-patch instead of git push -u origin dynamic-available-message-patch

gritty wind
vocal wolf
#

it's for my sanity

short snow
#

@vocal wolf can give a review on your pypi pr now

#

or should i wait

vocal wolf
#

It's a draft, so no touchy.

short snow
#

okiee

#

it regarding the return type annotations

vocal wolf
#

Will fix later, yes.

short snow
vocal wolf
short snow
#

that is a problem in many files of sir-lance

#

dunno about python

green oriole
vocal wolf
#

rip

short snow
#

kwzrd is back?

hardy gorge
#

They've been active again in the community for a while

short snow
#

but they are not in the server right?

hardy gorge
#

They are here

#

They were active this morning

short snow
#

ah yess, can see them

hardy gorge
#

In any case, I don't like discussing someone in public like that

short snow
#

yeah, sorry.

vale ibex
# vocal wolf rip

I had a look into that a few weeks ago, but I'm still on the waiting list for Codespaces, so can't do anything about it

wise oriole
#

whome

#

oh wait sorry

#

I thought a spelling mistake

gritty wind
#

hmm is sir-lancebot#575 still open

dusky shoreBOT
gritty wind
#

yes

wise oriole
#

ohk

gritty wind
#

alright, for now you should be able to specify the user

#

.bemyvalentine 785425328033103872

short snow
#

and the connect 4 one

clever wraith
cosmic moat
#

Hmm, is there any reason I would get this?

    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

This is when running pipenv run start, but docker-compose up works fine.

gritty wind
#

Can you post the rest of the traceback

#

!paste

stable mountainBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

cosmic moat
#

Yes

gritty wind
#

Alright, that's a common redis issue

#

Just set USE_FAKEREDIS to true in your env

cosmic moat
#

sounds good, what causes it?

gritty wind
#

Well you don't have a redis database running on your local host

#

When you run through docker, you get one setup for you

#

I want to clean up the errors a bit, but I don't have time for that now

#

(FWIW, you don't have to use fake redis. You can setup a local redis instance, or set the host to the one running on docker, but they are mostly the same for all intents and purposes)

cosmic moat
#

Ah, I see, I haven't done much with redis so I wouldn't know

#

thanks :D

gritty wind
#

If you need to start saving/caching things, drop in here and we can talk about redis

#

You won't need it for most things though, because a lot of things are in the momemnt type of deals

cosmic moat
#

yep, the issue I'm working on doesn't require a db

cosmic moat
#

How do we handle api keys?

gritty wind
#

.env vars on local dev

cosmic moat
#

I see that wolfram references the constants.py api key that gets it from .env

gritty wind
#

and environment variables in the code

cosmic moat
#

Do we send env vars to eachother?

gritty wind
#

Nah

#

We'll get a key for pydis, and set it up on the server

cosmic moat
#

alright

#

sounds good 👍

#

lastly, do we preference adding another dependency or using the base API?

#

e.g. google has an api package that makes it easier to search, but isn't necessary

gritty wind
#

If the setup is relatively simple without the library, then no we don't usually add

#

We really only add if the library provides really important features that would otherwise be difficult to implement, or if the cost of maintenance is higher than the cost of adding a dependency.

cosmic moat
#

Alright, thanks for the help

cosmic moat
#

alright, I wrote all of the code for the youtube command, I just have to test it and get an API key which I'll do after classes

gritty wind
#

No rush

cosmic moat
#

do we have a helper to escape markdown characters?

gritty wind
#

we use it somewhere

#

let me just

gritty wind
#

Are you trying to send markdown, or read markdown?

vale ibex
#

commands.clean_content(*, escape_markdown=True)

cosmic moat
cosmic moat
gritty wind
#

Clean content then

#

just remember to use it as a converter

vale ibex
cosmic moat
#

what do you mean?

gritty wind
#

converters are used in function type annotations, and d.py converts arguments using them under the hood

#

for example, if I had

def myFunction(a_number: int):
  ...

d.py would convert the input to int

cosmic moat
gritty wind
#

replace int there with the converter you want to use, in this case clean_content

vale ibex
#

There's also a util to escape markdown

gritty wind
#

What are you using it for?

cosmic moat
#
            for item in data["items"]:
                results.append(
                    {"title": clean_content(item["snippet"]["title"], escape_markdown=True), "id": item["id"]["videoId"]}
                )

This is the snippet in question

vale ibex
#

ahh, possibly better to use utils.escape_markdown() then

gritty wind
#

I think that's the reverse of clean_content

#

Clean content is for sanitizing received data, here you want to clean data you are going to send

#

(Though I guess you can hack it to do that)

cosmic moat
vale ibex
#

there's also utils.escape_mentions too

cosmic moat
vale ibex
#

In @stable mountain I can only see escape_markdown being used, no use of escape mentions

#

and that's all at the cog level, rather than a helper func

patent pivot
#

we use allowed mentions

cosmic moat
#
def escape_discord(message: str) -> str:
  no_markdown = utils.escape_markdown(message)
  no_mentions = utils.escape_mentions(no_markdown)
  return no_mentions
#

or something

vale ibex
cosmic moat
#

do we have that on lancebot too?

vale ibex
#

Yea

cosmic moat
#

alright, then I shouldn't need to escape_mentions, right

vale ibex
#

nope 🙂

cosmic moat
#

Can lancebot mention users though?

vale ibex
#

The bot will only be able to mention staff roles

cosmic moat
#

What happens if the youtube video is titled @Admins

vale ibex
#

Admins complain i guess? shrugR

gritty wind
#

are you not embedding the response?

stable mountainBOT
#
test

@Scaleios#8200

test

@Scaleios#8200

balmy sparrow
#

even if it wasn't embedded, I don't think it'd ping the role (the ping would actually happen only with <@admin role id>

#

the only risk would be everyone and here

#

But yeah embed outputs will look cleaner along with the added advantage of not really pinging anyone

vale ibex
sleek steppe
vale ibex
#

I don't think you'd get a ping, but it would be formatted

cold moon
#

Putting any mention into embed make this instantly not pinging

gritty wind
stable mountainBOT
#
test

@gritty wind

test

@gritty wind

gritty wind
#

embeds simply don't ping at all

cosmic moat
vale ibex
#

Nope, no pings in embeds

cosmic moat
#

oh cool

gritty wind
cosmic moat
#

oh, cool

#

thanks yet again 😅

cosmic moat
#

I'm assuming we don't have a branching guideline? (specifically for forks)

gritty wind
#

The general guideline (i think this is on the site or contributing guide) is to fork and pull

#

but for people with write perms

#

I.E staff

#

You should just push directly to the repo

#

then PR

cosmic moat
#

Also wdym by pushing and then making a pr?

gritty wind
#

We don't not really

#

Push on a new branch to the origin repo (python-discord/sir-lancebot) and PR from there

#

You can use a fork if you want to, but a lot of staff use it for convenience

cosmic moat
#

Alright, I'll do that then

#

It seems a bit cleaner to pr then make a new branch each time though, no?

gritty wind
#

Like PR from master to master?

#

You'll be making a new branch whether on the main repo or a fork

#

then it'll be deleted after its merged (at least ones on the main repo)

cosmic moat
gritty wind
#

Yeah, but creating temporary branches is fine

#

Either way, whichever repo you pick, the whole thing will look pretty identical

#

New branch from master -> PR -> delete branch

cosmic moat
#

Alright, since I already have a fork that I've been developing on, it's probably easier in this case to just pr from the fork right?

gritty wind
#

Yeah whatever you're comfortable with

#

I personally prefer working on the main repo directly because I don't have to keep merging updates into my master 👀

cosmic moat
#

alright, thanks :D

clever wraith
#

dumb question, what's the stars.json file in the bot repo?

gritty wind
#

iirc those are the names for

#

!source superstarify

stable mountainBOT
#
Command: superstarify

Temporarily force a random superstar name (like Taylor Swift) to be the user's nickname.

Source Code
cosmic moat
#

How can I allow only staff to use the command outside of the bot channel?

gritty wind
#

That's already done by default for you

cosmic moat
#

ah, awesome :D

gritty wind
cosmic moat
#

Alright

#

thanks

vale ibex
#

oh is it preferred to branch and PR directly from the repo? I've been using my fork still

gritty wind
#

I'm also still stuck on my fork for @stable mountain because of an old PR

#

but yeah, that's what is in the contributing guide

#

If you feel more comfortable with forks, that works too

vale ibex
#

I should actually read these documents properly

gritty wind
#

May need a cup of coffee, and 10-15 minutes

vale ibex
#

Got the review guide first

#

then maybe the contrib stuff

gritty wind
#

You'd need to have a general idea of the contributing guidelines to adequately review things, but the contib guide is pretty straightforward stuff you'd expect in any project

#

That is to say, you can look over it after the review guide

vale ibex
#

Yea, I skimmed them when I started for important info, but reading and understanding them is something different 😛

cold island
#

Yeah it's simpler to just open a feature branch

cosmic moat
#

i opened my pr alas

vale ibex
cosmic moat
#

What should the commits be named once I fix this?

#

I don't think one batch Reviewed is best

vale ibex
#

commands.BucketType.user

cosmic moat
#

ah, very nice, thanks :D

cosmic moat
vale ibex
#

ummm

#

i try to group my commits based of a single theme

#

So maybe 1 commit per fix, unless the two or more fixes are a similar thing

cosmic moat
#

alright,

vale ibex
#

At least that's my preference, not sure what the core team think

#
4. Make great commits. A well structured git log is key to a project's maintainability; it efficiently provides insight into when and why things were done for future maintainers of the project.
  - Commits should be as narrow in scope as possible. Commits that span hundreds of lines across multiple unrelated functions and/or files are very hard for maintainers to follow. After about a week they'll probably be hard for you to follow too.
  - Avoid making minor commits for fixing typos or linting errors. Since you've already set up a pre-commit hook to run the linting pipeline before a commit, you shouldn't be committing linting issues anyway.
  - A more in-depth guide to writing great commit messages can be found in Chris Beam's How to Write a Git Commit Message
#

fromhttps://github.com/python-discord/bot/blob/master/CONTRIBUTING.md#Rules

cosmic moat
#

@celest charm Did you delete the comment about escaping the markdown?

vale ibex
cosmic moat
cosmic moat
vale ibex
cosmic moat
#

I'm in a predicament, precommit won't let me commit YouTube for YouTube Cog setup because of the capitalization

#

But, if I change it there, I'd have to change it everywhere and that's not what we want

vale ibex
#

Load the YouTube cog. should work

#

iirc its the first word of the doc string that needs to be properly capitalised

cosmic moat
#

Alright

cosmic moat
sharp timber
#

Supposed to handle * _ and stuff, if you're talking about discord.py's escape_markdown

vale ibex
#

it looks like that's what's returned from the API, rather than being caused by escape_markdown

gritty wind
#

wow you guys hammered super haha

#

for commits, we generally follow an atomic style

#

meaning a commit is only concerned with something that can be described in one sentence

gritty wind
#

We don't particularly enforce it too much though, especially not on sir-lancebot (unless you commit your entire PR in one commit)

vale ibex
#

This looks like it needs deleting bot#1417

dusky shoreBOT
gritty wind
#

Thank you

cosmic moat
#

I did it

clever wraith
#

@gritty wind should I include an example of real life scenario of asynchrnous?

cosmic moat
#

I went through every single review comment

gritty wind
vale ibex
clever wraith
#

maybe i should just link the video

cosmic moat
#

they've all been eliminated

gritty wind
#

It'll be really difficult to merge a long tag

clever wraith
gritty wind
#

Just so we don't end up closing it, and wasting all your effort, I have to ask: is async really going to work as a tag?

#

The initial proposal was accepting it as an article, and if it can be shortened enough, as a tag

cosmic moat
#

@celest charm Did you just dissaprove the pr? lemon_sentimental

#

I can't tell if it's from before or now

gritty wind
#

lol fresh disapprovals should pop up in #dev-log unless github or discord died

gritty wind
#

I uhh.. that was targeted towards super haha

cosmic moat
celest charm
#

@cosmic moat Have you considered using TypedDict or NamedTuple or dataclass for the result type?

celest charm
#

something like

@dataclass
class SearchResult:
    title: str
    author: str
    id: str
#

if flake8 complains about id, just tell it to shut up

#

not a very useful builtin imo

vale ibex
#

What would the type hint be then? I'm curious as i've never used them

#

List[SearchResult]?

celest charm
#

yep

vale ibex
#

Cool

celest charm
#

a dataclass is just a normal class

cosmic moat
celest charm
#

because it's a TypedDict, which is a type hint for something which is a dict at runtime

#

I'd say just use a normal class

#

no need for dicts here

cosmic moat
#

I'm not entirely following

#

which is a type hint for something which is a dict at runtime
I'd say just use a normal class
no need for dicts here
TypedDict does the same, no?

celest charm
#

TypedDict is a type describing a dict with a fixed set of fields. At runtime, it's a dict

dataclass is a way of quickly creating a class. At runtime, it's that class.

clever wraith
celest charm
celest charm
cosmic moat
#

What's the difference between a dictionary and a dict?

celest charm
#

synonyms

#

i.e. no difference

cosmic moat
#

type describing a dictionary with a fixed set of fields. At runtime, it's a dict
It seemed like there was a difference here, no?

celest charm
#

no

#

sorry if the wording is confusing

#

fixed it

cosmic moat
#

ok, so you're saying you'd rather have a class that we can create and reference via item.title than a dict? (Both (dataclass and typedict) can be used as type hints it seems)

clever wraith
#

does pipenv run lint automatically modify the files?

celest charm
#

!e

from typing import TypedDict

class Point2D(TypedDict):
    x: int
    y: int

print(Point2D(x=1, y=2))
stable mountainBOT
#

@celest charm :white_check_mark: Your eval job has completed with return code 0.

{'x': 1, 'y': 2}
celest charm
#

^ this is what typeddict does

cosmic moat
#

ah okay, so, why is the class better again (sorry :c)

vale ibex
clever wraith
#

@gritty wind made a couple changes. can you check it out?

celest charm
# cosmic moat ah okay, so, why is the class better again (sorry :c)

Well, it's not a lot better. But I'd prefer dataclass because:

  1. TypedDict is much less known
  2. It's designed as more of a patch when you need to typehint a dict when you get a dict from somewhere.
  3. You don't get a clear string while debugging ({"x": 1, "y": 1} instead of Point2D(x=1, y=2)) or in error messages because again, it's just a dict
  4. You can't add methods to the class
gritty wind
#

alrighty

clever wraith
#

dumb question, what is a lint?

vale ibex
#

From wikipedia lint is a static code analysis tool used to flag programming errors, bugs, stylistic errors, and suspicious constructs

celest charm
#
@dataclass
class Video:
    """Represents one video."""

    title: str
    author: str
    id: str

Ugh. I forgot that we have mandatory docstrings.

#

That really looks ugly, together with def start

#

Video
"i wonder what this could possibly represent"
"ah yes, a video"

vale ibex
#

I mean there's always --no-verify and force merge

celest charm
#

Although @cosmic moat I would name it SearchResult or something like that. But that's up to you.

short snow
#

@cosmic moat can unget the upvotes, views count also?

cosmic moat
#

@vale ibex I made some fixes if you want to reapprove

short snow
#

We can use it like the reddit command then

#

showing upvotes and view count

cosmic moat
#

Well, I'm aiming for it to be a tool helpful to helpers or sharing videos with others and I think it would take too much space imo

gritty wind
# clever wraith <@!386599446571384843> made a couple changes. can you check it out?

Well as a start, you can definitely drop the section about finding modules. You can usually google python + async + what you want and find something that solves your problem. We don't really have space to spare, so only keep the essentials.

Without a proper explanation, saying that async is flat out faster than sync is misleading. If we can't fit in when it is faster, we can drop that part completely.

Use some line breaks here and there. Blocky paragraphs don't work too well, and people will just end up glossing over, try to limit the paragraphs to two or so lines.

Minor note: You missed Python in Real Python at the bottom.
This does not take into account grammar/spelling, those can be reviewed later.

Reference image of breaking text up, with no other changes:
before: #bot-commands message
vs after: #bot-commands message

short snow
#

lets see how it goes

#

imo reddit doesn’t much space

gritty wind
#

Are you guys speed running a PR? Very nice

vale ibex
#

I'm expecting the favour to be returned one day @cosmic moat

vale ibex
#

When you least expect it, I'll call on you

cosmic moat
short snow
#

sir-lancebot#586

dusky shoreBOT
cosmic moat
#

YOOOOOO

#

When will it be restarted?

gritty wind
#

did you merge?

celest charm
#

not yet

#

merge is purple

cosmic moat
vale ibex
cosmic moat
#

thought that meant a merge

celest charm
#

you forgot to change the docstring @cosmic moat lemon_enraged

cosmic moat
#

It represents one video

short snow
cosmic moat
#

and is a search result

cosmic moat
celest charm
cosmic moat
#

the search results are videos though pithink

vale ibex
celest charm
#

That's why it's called SearchResult, not Video. If you want to say that it represents a video, call it Video (the naming is up to you)

cosmic moat
#

Mine is cooler :c

vale ibex
#

They're already across multiple lines, so I think adding more without cutting off the line length might look weird

short snow
cosmic moat
celest charm
#

"represents a search result", I guess

vale ibex
#

Represents a search result.**

#

gotta abide by the law of doc strings

celest charm
#

I'd just leave it at "Represents a video search result" or something like that

vale ibex
#

class SearchResult: I wonder what this does?

cosmic moat
#

commit -m "more explicit docstring" <- seems like a bad commit, is there anyway to make that better somehow? lol

celest charm
#

fix docstring

#

🙂

vale ibex
#

fi doc str

cosmic moat
#

I honestly like class Video a bit more

celest charm
#

Then use Video

gritty wind
cosmic moat
#

does chris have to review again now lol

short snow
#

Why do we need the dataclass?

cosmic moat
#

and it is nicer to use a class than dict

#

I realize that now after implementing

celest charm
#

It's also better if you're going to test it or extend it with new functionality.

cosmic moat
vale ibex
#

I sense a ghost ping

clever wraith
#

lol

celest charm
sleek steppe
#

is it fine that the 8bitify command is blocking?

celest charm
vale ibex
#

There's a few things in @dusky shore that are blocking

#

I think 8bitify is the worst offender

sleek steppe
#

oops

#

.source 9bitify

#

.source 8bitify

#

oh

gritty wind
#

.source 8bitify

#

@dusky shore you there?

vale ibex
gritty wind
#

.source 8bitify

dusky shoreBOT
#
Command: 8bitify

Pixelates your avatar and changes the palette to an 8bit one.

Source Code
clever wraith
vale ibex
#

oh, i lied

celest charm
#

It's generally not fine, because, well... while it's blocking, the entire bot halts execution.

#

But for how long does it block?

sleek steppe
#

usually like 5-10 seconds

vale ibex
#

it depends on the size of the image, I've seen it take seconds before.

gritty wind
# clever wraith i don't get what you mean about breaking text?

Like instead of

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vehicula ligula eu lorem tempus malesuada. Nunc consectetur velit aliquet dui fringilla, sit amet pulvinar mi suscipit. Nulla vehicula quis arcu vitae rhoncus.

we can do

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vehicula ligula eu lorem tempus malesuada.

Nunc consectetur velit aliquet dui fringilla, sit amet pulvinar mi suscipit. Nulla vehicula quis arcu vitae rhoncus.```
celest charm
#

.8bitify

#

.source 8bitify

dusky shoreBOT
#
Command: 8bitify

Pixelates your avatar and changes the palette to an 8bit one.

Source Code
sleek steppe
#

yea that's what I was thinking

cosmic moat
#

we need one more automatic approval review 😎

gritty wind
#

Look over the latest round of feedback first 👀

cosmic moat
#

They're guaranteed to have the properties ["snippet"]["title"] because of type=video

short snow
#

All the image related commands seem to be blocking.

cosmic moat
#

?

short snow
cosmic moat
#

the link is created by getting the video id -- there is no key for the link directly

#

Also, I don't think it would be empty, since each response is guaranteed to be a valid video

short snow
#

Yeah my bad, lets take the title examlle then

cosmic moat
#

Well, it has to have a title too

celest charm
#

If you're worried about the bot going down -- it won't happen, exceptions are already handled at the top-level by discord.py

#

In this case, an exception doesn't mean a recoverable error -- if google has something unexpected going on, we can't do much about it

cosmic moat
celest charm
#

Google API not being available falls under the "alien lasers" category

#

i.e. unrecoverable error

short snow
#

not api, but the result se get is not sccording to our needs, like it didn’t have a certain key or the key was empty

cosmic moat
#

Also google won't change their api (iirc) because we're specifically using v3

short snow
#

But yeah, there shouldn’t be a chance of this

cosmic moat
#

I mean, it could happen

#

But, the chances are so infinitesimally small we don't need to account for it imo

celest charm
#

Just like someone could use forbiddenfruit to remove the append method of lists.

#

But we don't check for that.

#

or like we don't check for MemoryError everywhere

#

even though it could occur at almost every line of code.

cosmic moat
short snow
#

fix error already told it

cosmic moat
#

ah, could you send a link?

short snow
#

marked it as resolved

cosmic moat
#

ah, I see :D

#

Alright, finally, the last comment

short snow
cosmic moat
#

Anyways, we should talk about the likes/disklikes/views

#

I started discussing on the pr

clever wraith
#

@gritty wind how are the changes I made

short snow
#

@cosmic moat just give me a ping whenever you put the ss here.

clever wraith
#

@gritty wind

short snow
#

he is busy.

#

no need of two pings.

clever wraith
#

ok

sleek steppe
#

Any tutorials/guides to contributing? the contributing.md kinda confusing and I need to understand it a bit more

sleek steppe
#

sir lancebot for now

short snow
sleek steppe
#

thank you

clever wraith
#

would some image manipulation commands be a good idea?

#

for sir lancebot

keen valley
#

what is this pull request in python-discord/bot in github

short snow
keen valley