Add .pyfacts command#596
Conversation
Co-authored-by: ChrisJL <ChrisLovering@users.noreply.github.com>
ChrisLovering
left a comment
There was a problem hiding this comment.
Looks good to me, tested locally too.
We should definitely add more facts to this list!
|
Any suggestions! |
|
https://github.com/satwikkansal/wtfpython Has some interesting facts/behaviour of python. |
Co-authored-by: Shivansh-007 <69356296+Shivansh-007@users.noreply.github.com>
Co-authored-by: Shivansh-007 <69356296+Shivansh-007@users.noreply.github.com>
Co-authored-by: Shivansh-007 <69356296+Shivansh-007@users.noreply.github.com>
…Monty Python for Fact 1
| with open('bot/resources/evergreen/python_facts.txt') as file: | ||
| FACTS = list(file) | ||
|
|
||
| COLORS = [0x4B8BBE, 0xFFD43B, ] |
There was a problem hiding this comment.
Get the COLORS from constants.py or add this there.
|
One more thing, please update the screenshot you have put while opening the Pull Request. |
| FACT_CYCLE = itertools.cycle(FACTS) | ||
|
|
||
| COLORS = [Colours.python_blue, Colours.python_yellow] | ||
| COLOR_CYCLE = itertools.cycle(COLORS) |
There was a problem hiding this comment.
Since COLORS is not being used anywhere, directly put it in the cycle, same for the facts.
There was a problem hiding this comment.
COLOR_CYCLE = itertools.cycle([Colours.python_blue, Colours.python_yellow])
Shivansh-007
left a comment
There was a problem hiding this comment.
Thanks! Looks Good To Me!
|
Just an idea, maybe make a google form for suggesting facts like for .topic? |
|
@MrKomodoDragon If we take suggestions, we should use GitHub Discussions instead. |
|
If we are going to be taking suggestions, should we add a footer to the embed with a link to the github discussion, like we do for |
|
Good idea chris! |
|
So, link to the discussion? |
|
I would like an additional command which would append a |
|
How about a background function which would send a python fact in the #python-general channel everyday ? (this would be cool if we have many facts tho) |
|
Nice Idea! |
|
How would I add it though? 🤔 |
|
I don't like the idea of sending a random fact daily, i prefer it is used periodically when people feel like it. |
Kronifer
left a comment
There was a problem hiding this comment.
This looks great, just one critique so far!
| embed = discord.Embed(title='Python Facts', | ||
| description=next(FACTS), | ||
| colour=next(COLORS)) | ||
| embed.add_field(name='Suggestions', |
There was a problem hiding this comment.
replace the above embed code with:
embed.add_field(
name='Suggestions',
value="Suggest more facts [here!](https://github.com/python-discord/meta/discussions/93)"
)There was a problem hiding this comment.
Hmmm... why do you want to take out “Want to suggest a fact?” 🤔
There was a problem hiding this comment.
Ok, i understand, a little wordy
There was a problem hiding this comment.
for consistency with .topic
Relevant Issues
Closes #587
Description
I added a text fie with some facts and made the command send an embed with the fact.
Reasoning
The text file would be simplest to edit and change.
Screenshots
Did you:
pipenv lock?pipenv run lint)?