#dev-contrib
1 messages · Page 42 of 1
It's also a place where people can ask questions if they want to become a contrib now
Just out of curiosity @woeful thorn, you decided to switch to poetry for flake8-annotations, right?
For the specific project there's no major advantage of one over the other, it's mostly a collection of minor quality of life improvements
Poetry does seem like a better fit given the stuff in that ticket
Amusingly this is coinciding with me trying to get a migration of build tools pushed through on another community, haha
for discussion on contributing to pydis projects like @stable mountain, @dusky shore, pythondiscord.com, or the other projects on pydis' github
@molten bough what change of tools are you pushing for?
Oh, gradle instead of maven
What does the update change?
A lot of things https://discordpy.readthedocs.io/en/latest/whats_new.html#v1-3-0
Mostly refinements and also 3.8 support
need approvation @green oriole ;-;
I can't I'm working on the code jam
Oh it's part of the server discovery feature, rules channels
i'm writing tests for the bot and i've written this function to help me generate arbitrary discord emojis:
def make_emoji() -> str:
"""Generate a string representing an arbitrary discord emoji.
Follows the format:
<:{5 random letters}:{10 random digits}>
"""
emoji_name = ''.join(random.choices(ascii_letters, k=5))
emoji_id = ''.join(random.choices(digits, k=10))
return f"<:{emoji_name}:{emoji_id}>"
the output of this function is then ran against DISCORD_EMOJI_RE = re.compile(r"<:\w+:\d+>") to check if it picks up all the emojis correctly
however, i'm thinking that this is forbidden fruit as it leads to non-deterministic behaviour and the test suite may pass locally but fail in CI, for example
for this reason, i will probably just hardcode a couple of strings - does it make sense to leave the function there with the test case so that if more cases need to be written, it can be reused to generate more? is my judgment here correct?
I'd say that we want to have deterministic test cases, yes. In theory, you could also do that by specifying a seed for the random number generator (which makes sure that we reproduce the same values cross-platform), but that has the effect of "hiding" the actual test cases used from people reading the code. I don't have an opinion on keeping your utility function in there, although it's a bit odd to define something you never actually use in the code base itself.
thanks for the input, i think i agree i'm just going to keep the hardcoded strings
can someone assign me on #338 ?
cuz i have to pass #339 and wanna merge both
and 339 is high priority ?
seasonalbot*
thank you @gusty sonnet
How would you host the pydis site behind nginx? I try to run it on my dev server, after 1h30 of fighting with pipenv, pip and dependencies, I'm finally able to run it, but I can't access it outside of the server itself. My current setup is to take the incoming subdomain, in this case pydis.dev.mbertucci.me and redirect an internal port, 8101 here (I use this setup because of my other services that only accept a port number). I tried dozens of options to make nginx connect to the backend, but I still get 502s. What option should I use?
I don't use docker, because of my weird install
I tried to change the PARENT_HOST but it didn't work
Anything in the logs?
Nginx log I guess?
No, the django log
It's a 502 and not a 520, right?
Yep
hm, yeah, just sounds like you got the wrong port in your nginx config I guess
what upstream are you using?
mm, I have no idea, honestly
Looks like it should work as long as the configured host within django matches
although I note you have no listen block
eg listen 80
Hmm, don't think that's the issue, it is a copy paste from another working server block
I just tried
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
Error: That port is already in use.```Okay, that's new
I tried manage.py runserver 0.0.0.0:8101 without success
Gonna probably switch to sockets
discussion time
so as requested bookmark react with 📨
and as said
I don't think it makes sense from a UX perspective to utilize the same reaction for multiple purposes when one of those purposes silently disappears after a timeout. This is already barely discoverable functionality, and with this implementation a user that does know of its existence doesn't know if it has timed out or if it's broken. A second emoji solves half of the problem, which might be sufficient.
What should be the second reaction ?
Whoever S. Co1 is
@woeful thorn Are you Mr. / Mrs. S. Co1 ?
Yes
What should be the second reaction ?
I don't know
gdude's suggestions seem reasonable
Open to other suggestions as well
@runic dune as you were the first one to point it out what do you think it should be
we can also clear_reaction once timed out
ah, an UX design issue, i must admit i didn't know much about the whole feature when i suggested the improvement, i didn't know the first reaction disappeared after some time, if adding a second one makes sense, then sure, these pins do seem to fit the requirement 🙂
The first reaction currently doesn't, but if we want to wait for a reaction then we'd probably want to have it time out rather than waiting forever
And waiting for a reaction also stops if the bot is restarted
We could do a more generic on reaction event but I think that's more complexity than it's really worth for this feature
ok, makes sense, i though the bot would get notified of events on the message, didn't think about active listening, but yeah, a timeout make sense, though the users must have some way to know if they can or can't use the reaction to also get the bm in that case.
Seasonalbot does have a mechanism for persistent storage, but there's no real good way to "garbage collect" (for lack of a better term) the entries and I don't think we want to store the message link for all eternity
Could give it a little SQLite db and have it purge old messages out of it daily or a couple times a day
If we care about persistence
Or just have it be a fixed size, but the concept is the same regardless
Right right
There is no conclusion yet
Honestly this would probably be better as its own PR rather than being tied in with the channel permissions fix
Since that part is done and there's probably more discussions to be had on this
I don't trust my machine to hold it
so.......
https://paste.pythondiscord.com/wasasibana.py
yes @green oriole, I don't make new branches, I make forks
Okay haha
Tbh, working from the inside of the repo is easier for you and the reviewers from my experience, but that's up to you ^^
I know, but I do it this way to force myself to do more things with git
not because I'm a masochistic who also hates my colleagues, but to train my brain
Haha
It mostly just accomplishes increasing the risk that the downstream master will diverge from upstream
Well, you'll learn more about github itself for sure, but I'm not really sure about git, apart from managing remotes, which is kinda a pain in the arse tbh
And adding another remote for others to have to deal with
is it to much of a pain, ELA?
I can use a branch if that's the case
I don't even know what are the chances for something like that to happen
The latter, not really, the former is a pain for you
oh okay
@clever wraith I've reset your BM PR to the original commit & implemented the suggestions made at that point. There's no reason to keep the other commits in the history since you're going to be redoing them in another PR & half of them are fixing linting errors. Since the history has been rewritten please be sure to pull down the changes if anything else needs to be done on the branch.
I opened a new issue for the reaction enhancement, but I guess I can't assign it to you until you've interact with it: https://github.com/python-discord/seasonalbot/issues/341
I remember that we were having issue with the Anti-Malware cog not filtering message hotlink, like this one, that could be a decompression bomb https://discordapp.com/channels/267624335836053506/303934982764625920/671436152871583774. I searched a bit through the gh issues, and I didn't found it, someone remember writing it down, or everyone just forgot about it?
It might be easier if there was a blurple one or something
or maybe even like a +1 one
wonder if I have one
eh, a bit small
here with me ? @molten bough
What?
(Also, it's not blurple, but I'm not sure if you knew that or you just decided not to go for it)
I would suggest blurple, since we're on Discord
they are all squares
more like rounded corner square
they all rendered as squares, if that's what you're asking
you can check that by uploading a totally solid emote
let me see if I can do something useful
ah, you mean in the shape of reactions
wait i need to rendera white one to be clear
nahh its square it was that emoji that gdude gave that was rounded
I am reading scheduling.py (https://github.com/python-discord/bot/blob/bef90dd1a625c37674d46a8d28c286a19103c8fb/bot/utils/scheduling.py), was this module written to run any task thing that could be scheduled?
I was wondering if it could be applied in the otnames module, which has:
while True:
# Since we truncate the compute timedelta to seconds, we add one second to ensure
# we go past midnight in the `seconds_to_sleep` set below.
today_at_midnight = datetime.utcnow().replace(microsecond=0, second=0, minute=0, hour=0)
next_midnight = today_at_midnight + timedelta(days=1)
seconds_to_sleep = (next_midnight - datetime.utcnow()).seconds + 1
await asyncio.sleep(seconds_to_sleep)
# ... code to run here```although I don't want to do a mess with something that already works, I need to study it a bit more
Yes, it was designed to be generic
However, I don't think there will be much benefit from using it here.
However, I don't think there will be much benefit from using it here.
certainly not, but I was looking at ideas to make the otnames module a bit reusable
It is an interval though, isn't it
also because I feel the otnames and the staff lounge name could have slightly different behaviours
The goal is to run at an exact time every day (midnight)
The interval would be relative to when the bot started
Yeah, but it's still an interval
I haven't talked about it with anyone yet, but I think it would be nice to make the lounge name rotate more frequently
If the bot starts at 21:00 then the first interval would need to be 3 hours but all subsequent intervals would need to be 24 hours
there's also an issue to have linked OTnames
so they will definitely have different behaviours
I guess then it still needs the same logic to calculate the interval, at which point all the task does is save a while True and an asyncio.sleep
If the bot starts at 21:00 then the first interval would need to be 3 hours but all subsequent intervals would need to be 24 hours
@tawdry vapor
perhaps just start the interval routine the next time it hits midnight?
ie, bot is run, otnames task does nothing until it hits exactly midnight at which point the interval will start?
bear in mind I have no idea how the bot works in general
The point is the task extension doesn't provide any meaningful gain for the OT channel name rotation
Calculating the time remaining until the OT name should start, recalculating once it hits midnight if the duration isn't 24 hours, or any combination of whatever is just a more complicated version of what we're doing already
got it, thanks ELA
Guys, is it normal that staging bot use the pydis eval service, not a local one?
@glass pecan Is going to look into it.
He has some other stuff to do currently, though
It's not that critical, I think
Yep
I found a very good tutorial about mocks, I think it would be super useful to add it in the test README https://realpython.com/python-mock-library/
Yes, chief! ^^
Doesn't seem like the bot uses many, if any, autospeced mocks
I've looked into it and it seems there isn't any nice solution for that, especially for mocking third-party code e.g. discord.py
In a perfect world, a mock could be created and would keep working without maintenance regardless of changes made to the original class.
The approach of passing instances as the spec, as is being done now, can work, but the problem with that (which actually exists even if autospec isn't used) is that it causes code to be executed of course.
And this may have unintended side effects
I do think there is value in tests catching access of non-extant attributes so if anyone has ideas for solutions lmk.
Also of note is that there is no simple way to create an autospeced mock when subclassing as all the helpers do. Probably possible with some metaprogramming.
The other solution I could think of is manually assign values to all instance attributes in the mock, but this adds maintenance overhead and can fall out of sync with the attributes of the actual class.
Guys, after almost 5 hours of trying and re-trying and re-re-trying, I give up. How on earth can I mock the bot http_session, to make sure the right request is done? I tried a lot, lot, lot of things, including creating a mock with __aenter__ and __aexit__, changing some attribute, modifying the child_mock_type, and various other things, do you have any clue for me? I’m trying to write a test for Snekbox.post_eval https://github.com/python-discord/bot/blob/eval-enhancements/bot/cogs/snekbox.py#L50
The main issue is that MagicMock doesn’t define __aenter__ and __aexit__
class AsyncContextManagerMock(AsyncMock):
async def __aenter__(self):
return self
async def __aexit__(self, *args):
pass```This was my first idea
And py bot.http_session = MagicMock() bot.http_session.post = AsyncContextManagerMock()
But I get an AttributeError: __aexit__
I also tried to add a __call__ method that return self
I found this package though, can I use it? https://pypi.org/project/aioresponses/
The point is that post is called and should return your context manager
Ignoring all the mock helpers we have, this should work:
That’s why I tried to create a __call__ method
!e
import asyncio
from unittest.mock import MagicMock
bot = MagicMock()
class AsyncContextManager(MagicMock):
async def __aenter__(self):
print("entering")
return "foo"
async def __aexit__(self, exc_type, exc, tb):
print("exiting")
bot.http.post = MagicMock(return_value=AsyncContextManager())
async def main(bot):
async with bot.http.post() as something:
print(something)
asyncio.run(main(bot))
@hardy gorge :white_check_mark: Your eval job has completed with return code 0.
<AsyncMock name='mock.__aenter__()' id='140145824951312'>
That's interesting, locally I get:
entering
foo
exiting
[Finished in 0.1s]
Hmm
oh, wait
@stable mountain now runs Python 3.8 for eval/in snekbox
While we run the bot itself on 3.7
3.8 will make this much easier, but the code should work for our bot
since it runs on 3.7
Another problem is that in your example, instead of doing print(something), the bot is doing print(await something.json()), but I get a traceback about MagicMock not awaitable
I tried to return an AsyncMock, and to change the baseclass
import asyncio
from unittest.mock import MagicMock
bot = MagicMock()
class AsyncMock(MagicMock):
async def __call__(self, *args, **kwargs):
return super().__call__(*args, **kwargs)
class AsyncContextManager(MagicMock):
def __init__(self, return_value):
super().__init__()
self._return_value = return_value
async def __aenter__(self):
print("entering")
return self._return_value
async def __aexit__(self, exc_type, exc, tb):
print("exiting")
bot.http.post = MagicMock(return_value=AsyncContextManager(AsyncMock(return_value="hello")))
async def main(bot):
async with bot.http.post() as something:
print(await something())
asyncio.run(main(bot))
Try that, @green oriole, but with the appropriate helpers we've already got
Hmm
Works for me
11:18 $ python playground.py
entering
hello
exiting
It is await something.json(), it is still going to work, right?
You need to provide with the appropriate value to return
You can replace AsyncMock(return_value="hello") in
AsyncContextManager(AsyncMock(return_value="hello"))
with any kind of mock you want to return
Silly example:
import asyncio
from unittest.mock import MagicMock
bot = MagicMock()
class AsyncMock(MagicMock):
async def __call__(self, *args, **kwargs):
return super().__call__(*args, **kwargs)
class AsyncContextManager(MagicMock):
def __init__(self, return_value):
super().__init__()
self._return_value = return_value
async def __aenter__(self):
print("entering")
return self._return_value
async def __aexit__(self, exc_type, exc, tb):
print("exiting")
something = MagicMock()
something.json = AsyncMock(return_value="Hello")
bot.http.post = MagicMock(return_value=AsyncContextManager(something))
async def main(bot):
async with bot.http.post() as something:
print(await something.json())
asyncio.run(main(bot))
It doesn’t work
I did something similar, but I get a MagicMock coming out of nowhere
mocked_post = MagicMock()
mocked_post.json = AsyncMock(return_value={})
self.bot.http_session.post = MagicMock(return_value=AsyncContextManager(mocked_post))```
And I get
not really sure what's going on here
oh... needed to do pipenv install
maybe this should be documented in the wiki :) it only has pipenv run start
pipenv sync --dev should do
It will sync from the Pipfile.lock with the versions specified in there
But, yeah, that needs to be in the wiki
aye, that's what the install subcommand did as well, is there any functional difference between the two?
install will relock first I think, meaning that you may end up with different versions than seasonalbot is actually using
ah, that's not good
It is in the wiki
Well, on the site. I don't know if the GH wiki has it but that is not being maintained anymore
Right, step 2 of the Development Environment section
yep, i'm blind
I'm looking to solve a business-oriented problem or a problem related to this discord that has available data with a machine learning solution. If you provide information regarding a business-oriented problem I would prefer data related to vehicles or possibly customer service and data that is publicly available. If you do have a problem that needs solving, I do request that it be capable of solving reasonably within a 2 week timeframe and you are comfortable with it being presented internally within a company as I have to present the problem, data, and solution of whatever project I choose.
Thank you ahead of time if you have any ideas, suggestions, feedback, or data to provide.
@crude gyro apologies for the ping, but does this channel exist? #414574275865870337
er...
#devtest, id 414574275865870337
There doesn't appear to be one
Oh you know what, there is in our test server
Different id than that, however
used to exist.
<@&267629731250176001> <@&295488872404484098> see @stiff ice's question above. Anyone got any ideas for a good way to apply ML to our repos?
I don't understand
customer service and data that is publicly available
Or anything in general if you have data sources or ideas
You want this servers data to be used for some ML thing...?
i mean....isnt most of the data the pydis related projects generate GDPR protected anywazs
Scan for messages by helpers in the help channels and the context around them and teach the bot to answer common questions :)
That was an original idea of mine however I spoke with Frank previously and they do not keep data like that. Scanning it myself also requires breaking ToS
I can't really think of ways to apply ML here since I'm not too familiar with it
we would need to provide the data, I suppose?
That's preferable yes, but if you think I can gather the data in a reasonable time I can do that as well
mm I can't think of anything, maybe a way to detect at what moments #python-discussion or the help channels go off topic? that would give a lot of false positives probably but it would be fun if it kinda worked
not sure how feasible it would be, sorry
Yeah like I meantioned to Ava though they don't collect that kind of data for the server so I wouldn't have access to the messages sadly. That was originally one of my first ideas as well. Thanks for the idea though
who's Frank? 
Ves Zappa, I just noticed his new nick and used it
ohh right, I'm dumb
@crude gyro i could see it being used for security purposes too
when you ban someone you could load in a corpus of their messages and have it warn staffchat if someone with a high confidence of being that person joins
i absolutely wouldnt have it autoban because who actually trusts ML but
I was curious of that too and it doesn't sound like a bad idea
We can write an email bot that replies to emails automatically(common q) or a spam detector in discord
Or let's make a chat bot
We currently don't store a lot of information; in fact, we don't want to. We do want to collect some summary data, like average channel activity per hour/day, in the future and display it on our site, but that's a project we want to tackle somewhere during the year.
So, the amount of data we have for a proper model is meager and I'm not sure if we want to collect/make data available that could in some way be considered private or personal. (I'm not staying that would be the case for this project.)
Hmm, we can probably do a question detection and auto suggest going to a free channel / adjust the amount of channels should we have high traffic ( basing on number of messages to see how active, not storing the content )
we have already designed a much simpler solution for that problem that requires no ML
We could use it to detect people that post their question across multiple channels or advertise their question and trigger a mod alert, but yeah, we would need to collect some data
I don't really want to automate that
Maybe a model to predict after what time without message a help-channel can be considerate free? Something more evolved than the !free command today (which is already great)
if we're looking at this as an NLP task, you would need a lot of good data, that we don't have
your best shot would be annotating hundreds of help sessions manually, and the result wouldn't work in practice anyway, since sessions that just end very clearly at one point aren't that common, often once one problem is resolved the conversation just flows towards another problem / user that needs help
i don't think this is a good use case at all
i'm not sure if we have a good use case
again, solving the help channel system with ML is not interesting. We already have a much simpler plan for this that I believe will work well.
and if there's one place I don't want needless complexity it's in the very core of the community, in our help channels.
Yes, I don't think it will work well in any case. The model will either be overly complex, require a lot of manual tagging, and probably won't even work that well or it would be a simple system that basically just estimates some kind of "no activity" period (which is something we've already rejected because of the high variability and the undesirable effect of having a lot of the shorter "short question, short answer" conversations hogging a channel for a far longer time out).
Anyway, like lemon says, we do have a system in mind that doesn't even need those measures
I'm very curious about this new help channel system, can we have any hint about how it is going to work? ^^
maybe we should start a new project? discord bot has become kinda boring these days. Maybe starting an app
I wonder if we have the right group of people to write our own Python tutorial
@green oriole Sure, it's not a very complicated system and some of the details have to be worked out, but the general gist is that we want to have two visible help channel categories, one with "free" channels and one with "in use" channels, and a third "invisible" category with temporarily archived channels.
The "free" category will always have a fixed number of channels available (say two or three), with a message at the bottom explaining how it works. As soon a someone start talking in a "free" channel, it will be moved to the "in use" category just below it. When the activity in an "in use" channel dies down (and we may add a "mark as done" command), it will be moved to the third "invisible" category of archived channels. That last category will not be invisible, just at the very bottom of the channel list so the Discord search will still bring up older activity for those who want to read something back.
Oh nice
To reach 100% coverage, I guess I need to write tests for excepts like this one, right? https://github.com/python-discord/bot/blob/master/bot/cogs/snekbox.py#L69
Are you using pycharm pro?
If you set it up to run your tests, there's a "run with coverage" button in the top toolbar (looks like a green circle grid kind of thing for me)
it'll show you exactly what your tests don't cover
you can also pipenv run coverage html to get a simple html report including partials
it will go in project root dir htmlcov by default
Yup, that's a great option if you don't have pro
I have a github education pack, so I have pro for free
Should be fine
error: corrupt patch at line 103
Thanks git
It is a pretty cool tool
Hey folks - I know this is really low priority, but would any of you be able to review my PR (https://github.com/python-discord/site/pull/322) sometime? It's been a few weeks and I'd like to have it finished and behind me. Thanks!
Is this a good channel to look for contributors or project ideas?
and if not, where should i look?
Hey @lapis hull, I'll have a look tomorrow
@valid quest This channel is really for discussion of the Python Discord Project (so the bots in this server, and the pythondiscord.com site).
Assuming you're not asking for paid contributors, the #303934982764625920 channel might be a good place to show what you're working on and seek help.
@hardy gorge Thanks Frank! Ves... Frank? Frank.
Ah, yeah, I'll change that back
Neither Ves nor Frank are names I have in real life.
hi @tawdry vapor , would you mind if I grab your attention for a minute
i'm having a little bit of trouble implementing the feedback you've given to me yesterday
the cases that pass (allowed messages) are easy to implement, and running them through a helper function is definitely useful, but there's the problem that in order to use the subTest context manager I need to pass the entire unittest.TestCase instance into the function, which is ok I suppose
but the amount of information that I need to bundle in order to pass a disallowed case out of the unittest itself is pretty big - the printout string is different, the way the relevant messages are generated differs (although as you pointed out, this is just a tuple of all recent_messages in roughly half the rules)
at the end, I found myself writing a get_expected_output function and passing it outside of the unittest, but this function essentially ends up being a replication of the rule itself, so I end up saying check the output of the rule and my own re-write of the rule
Subclass TestCase, probably defined in __init__.py, and define the method there. Make all test cases then subclass the new class.
yeah I've already gone in this direction, I subclassed TestCase to annotate a bunch of extra instance variables, and the in the unittest itself I just assign self.config, self.rule, self.allowed_cases, ... and pass self into the function
but I didn't think to go this far
interesting, thanks I'll give it a go
I'm just worried of writing too much boilerplate to replace boilerplate and end up creating unnecessary indirection as you mentioned
I looked at three test cases and they were very similar
role mentions, discord emojis, and chars
At a glance it didn't seem that complicated to make something generic
yeah the good thing about those is that relevant_messages = tuple(msg for msg in recent_messages if msg.author == culprit) holds for all
the only thing that differs in the expected output is the "template" string
so that's good, but for example if i then have
relevant_messages = tuple(
msg
for msg in recent_messages
if (
msg.author == last_message.author
and len(msg.attachments) > 0
)
)
i'm having trouble figuring out where to hide this
i figured i'd pass in a is_relevant predicate lol
but then i might as well pass in something that also generates the output string
and then i've basically rewritten the rule
Is this not adequate, besides the output message issue? https://paste.pythondiscord.com/wafikaqori.py
Oh I forgot to make relevant_messages a function
To be clear this isn't final
If you find this to be more harm than good then you can abandon the idea
no i definitely want to play with this a little more
i think i'm just still figuring out good practices for testing, so im being a bit of a pain
at the very least, i can make the test_allows function generic
If you wish you could either make config an arg too or go the other way and make func an attribute as well.
Another idea is to have an abstract method for the relevant messages, which subclasses can implement
@abc.abstractmethod
def get_relevant_messages(self, recent_messages):
raise NotImplementedError
and test_disallows will call that method
for the output message you could consider just checking parts of it
like if f"sent {total links}" in output
and if f"in {interval}s" in output
Or use regex
I don't really see value in testing the exact value of a string
Not in this case anyway
i thought that maybe the rules could have a template string in module namespace
that that could be imported in the test cases
this way if the message should ever change the test cases won't need to be adjusted or at least not as much
new review request system is live for bot and site
it's a trial system for now just to see how things go
yep
How would I invoke that
so it's now on seasonalbot, bot, site, snekbox
from now on adding a new commit to any existing PR does it
and any new PR will receive them
so on my prom PR
we now have codeowners files which dictate all files belong to core devs
Thanks. I was wondering if I could do it for an existing PR
you can just do this @tawdry vapor
I'll try it
_And what for non-core reviewers? _
@green oriole the site changes for https://github.com/python-discord/bot/pull/630 have already been merged, and this is creating a critical bug with mod alerts. It probably should not have been merged, but the easiest solution now is for us to get the bot side PR merged ASAP.
How fast can you get this merged?
Not now, sorry, I'm at school
I can try in 6h
I have a little patch if someone want to test it
I don't have access to any computer
How complicated is it?
@hardy gorge maybe you got an opinion, but I think this will be okay if it's merged today.
You have to deep down in the code
I'll be available later today, @green oriole, to work with you for reviews and getting it merged, as long as you've got time to get the requested changes developed
Okay nice
Alright, excellent. Then we have a plan.
thanks
ping me with reckless abandon when I can be of use.
@green oriole If I understand you correctly, the field will also be missing if a message has no attachments? As in, the request will not contain an empty list in that case?
If that's the case, we either need a clever default value (if the rest of the code requires that field to be non-null in the database) or just allow null values
Yes, master does not provide an empty list
It should
Last time I worked on it, it did, but mark worked on it in the meantime, and it looks like he reverted it, but that's not a problem
@crude gyro @hardy gorge It was actually easier than I expected, I managed to do it from my dev server, it should be good to go https://github.com/python-discord/bot/pull/630/
yeah okay, let's get this reviewed.
@green oriole build seems to be failing
one of the tests is failing.
It is named attachment_repost in the config file, but the entry is called attachment_log
It runs fine, but the tests doesn’t like it
yeah. will you push a fix for that?
Done!
cool cool.
will have a look now
okay, approved, requested changes dismissed since they appear to have been addressed
@hardy gorge @glass pecan @tawdry vapor can one of you do another review of this so we can get it merged? it's causing a problem with our mod-alerts at the moment, so slightly urgent. https://github.com/python-discord/bot/pull/630
ill have a look
cool, thanks
Hey guys, I wanna discuss about the emojis for the reddit command
https://github.com/python-discord/seasonalbot/issues/267
I liked the emojis in the pic sent by @glass pecan (in his comment) , maybe we can use those
those were a basic sample, i have not done any checks on our ability to use them regarding licensing
it was so long ago, i don't even think i have a reference to where i used them
oh
@crude gyro we're able to use Font Awesome icons as emoji's right?
yep
just use it then, ezpz
most of our emojis are just that
we even have a pro license available if we absolutely need to use it
we should add it to the server?
although we're not currently using it and would prefer not to, if possible
ohk
lol whoops i'm using pro ones
right right.
well, @molten bough has made a license available for us to use
but we may need to somehow add some stuff to the repo or whatever to indicate that we're making use of that
I don't know exactly how that works
didn't bother looking into it yet because we haven't used any pro icons until now
I don't think they have any particular requirement for print or web use attribution
pretty sure pro actually encompasses less attributions than free
yeah but I'm not sure if we've got access on the site because we may be using the django-simple-bulma fontawesome free stuff right now?
It doesn't even really have a domain lock anymore
it's enabled with a specific js thingo and the control panel
interesting
yeah, that's how i remember it too
and then you just embed the JS they give you and it works
cool
enforcing rights can often be bad for business. it's not uncommon for businesses to realize that these days. Microsoft has been saving millions on that for years.
You might be right
makes sense
They did enforce with the old CDN but I suspect that was more trouble than it was worth
https://fontawesome.com/icons/image?style=solid
https://fontawesome.com/icons/reddit?style=brands
https://fontawesome.com/icons/video?style=solid
https://fontawesome.com/icons/align-left?style=solid
https://fontawesome.com/icons/long-arrow-alt-up?style=solid
https://fontawesome.com/icons/comment-alt?style=solid
These are free ones and will work, I will have to paint them tho @glass pecan @crude gyro
I mean, it's expensive to enforce strictly, and sometimes it might not have a net positive effect on the bottom line
yeah that's fine
so we just download those and add them?
@eternal owl do you have some sort of image editing software?
gimp
it's preferred if it's a vector
maybe you wanna make the emojis then?
These are the settings I have for you by the way, in case you want any changes
no, I mean use the stuff you just found to create the pngs we need
yea i can
no drawing involved
lol that redact
haha
But I should be able to download those emojis right?
svg?
They provide a TTF/OTF font
yeah, that's by far the easiest way
get the otf, install it, and then use the copy glyph feature on the page, and just paste into a font field in gimp
it will magically appear
okay its a bit confusing, tell me how I can get them on my machine 😅
then crop it up the way you want it, make it.. I don't know, white? and we're good to go.
okay, thanks!
make pngs, make money, get famous, get laid.
👍
like the rest of us.
too young
most of the rest of us. haha
if you do end up needing a pro glyph, let me know, Iceman
don't undermine my secret to success, guys
to be clear, they need to be at least 128x128
okay
we usually go 512 I think?
Lemme take a video tutorial on how to use gimp first 😹
Power of 2, yep
wait.. 256?
so not 512?
512 is for non-emoji elements we make
or higher
like logos
usually we make a proper svg too alongside for those assets
usually
so i have to go from svg to png?
even a 4k phone wouldn't really make use of an emoji higher than 256 though
the easiest one is copying the glyph from the font-awesome site, going to gimp, using the text tool and pasting the glyph into it
if you hate yourself, you could also open the SVG in inkscape, edit it there, and export it as a PNG
but I assure you that is far more of a pain in the ass
lemme open gimp, guide me then
but goddamn if the tooling isn't hard to get used to
imma do this review
@molten bough stick around, I need you to guide me through gimp
I mean it's really just a case of
open gimp, make an image the size you want
layers -> transparency -> add transparency (if it isn't greyed out)
select the text tool on the side, pick the FA font you hopefully just installed
pick a colour, click somewhere in the image, paste the glyph, modify the font size until you're where you want, then position it with the alignment tool
there's a tools menu at the top if the awful greyscale icons confuse you
are you attempting to ask a question?
is it transparent?
yes, that's what the checkerboard background is
the black and white checkboxes behind it
transparency
okay
when you're done, you can export it in the file menu
how to add custom font
right-click the font file, install
that's it
(you may have to restart gimp)
@crude gyro @glass pecan I just read the license, and yep, there's no attribution or enforcement requirements
so go nuts
thanks for checking
there is no install
extract it from the zip first
nvm i had to double click not right click
Oh right, did they move it to the previewer?
oh, linux
Yeah, that
You may have to restart gimp but it should be in the font selector now
otf
and you restarted gimp?
yes
I'm not sure then, check the fonts app
Try installing the TTF instead then
There is no ttf
I googled it
I have to add the location to system fonts
any idea where the system fonts are located?
found it
now its working !!!!!!!!
\o/
Well find the icon you want to use on the font-awesome site
copy it, and paste it into the text input
I downloaded the icons
yes, I know
where to put the text box
Wherever you want it
yup
so it should be in your image, right
modify the font size until it's big enough, set a colour, then use the align tool to center it
well it's black so that's gonna be hard to see
that the one you wanted?
Ok then
what does that thing do
What thing?
I mean why do I have to copy paste it and then export
why not use the transparent image directly
do you have an align left key on your keyboard?
What transparent image?
the icon
The icons are in SVG format though
you paste it as a normal letter which is then rendered from the vector
GIMP can convert from vector to raster actually, now that I think about it
i dont have that key @brazen charm
well you gotta copy it then
well that glyph doesn't look like the one you wanted
but I don't think you've entirely been following the instructions given
if you've opened some transparent image - and I have no idea where you got it from - that isn't what we're trying to do
I got it from the extracted zip file
No, you got an SVG from the zip file
yes yes
Where did you get an image?
svg = image?
OK, so you imported the SVG into gimp?
yes
yes, but not in the sense you're thinking
okay
well why didn't you start by telling us that?
I mean I told you to make a new blank image, it looked like you'd just followed all the instructions
well, it needs formatting, doesn't it
I assume you don't just want a black image
is this right?
-_-
Don't give me that face, you didn't follow the instructions I gave you
haha
I'm not sure if your emoji is going to need to have space around it or not
why is it so hard to change the color
no tool with the name colourize
You need it to be exactly 512x512
So, go to image and set the canvas size to something larger than what you have
basically so you can make it a square
and then you can scale it down
how to move it
its 512x512
you're not listening to me
you can just scale the icon down though 
how
but yeah you gotta follow gdudes instructions, he's painstakingly assisting you bro
1min
what gdude was saying is to:
- undo the canvas change so it's back to what it was before
- change the canvas size to be largest-side x largest-side
- make sure everything is centred and looking pretty
- scale the canvas down so everything is 512x512
yup
largest-side x?
when you change the canvas size, gimp has a thing for aligning the image as well, so you can center it there
your original size was 512 x 585, so largest-side x largest-side means 585x585
yep, so get it so it's centre
im sure there's some alignment tool around in gimp too
There is, yeah
You can use the "select by colour" thing to select the actual pixels
and then the align tool will centre it for you
I think that amount of padding looks nice
Anyway, you can use the image menu again to scale it down to 512x512
canvas size again?
no, scale
done
so it's now 512x512? Then you can export it
PNG
if these have something to do with a PR or issue, you can drag and drop them into the comment area
okay
...red?
I'm not crazy about that color tbh
@glass pecan how do you feel about this traffic light red
I know you used some sort of red in your mockup
but personally I think maybe just making all the icons white is gonna look the best
reddit logo also white?
no i'd make reddit the colour of the actual logo
okay
#FF4500
all g
@crude gyro actually on second thoughts, we can't do just white
it needs a backdrop of some kind if it is
bc light theme
could do it a middling grey 
yeah, nothing looks good on light theme
i'd rather red over blurple because of the reddit theme
yeah but not traffic light red
yeah i'd just go grey probs
I guess orangered might look okay, yeah
it needs to be reddit orangered then
I think I'd prefer gray
and orangered for the reddit icon itself
probs
wheres that from
reddit.com, if you can believe it
its a bit big, maybe
yeah but that's not the point
not that exact image
but that style instead of making a FA icon in orangered
since that's what reddit tends to use
isn't that the fa icon style
Their SVGs do support layered colours, but I don't think you could actually set them without inkscape or a browser
yeah, I kinda feel like it should be white, not transparent. but maybe I'm wrong.
you always see it like this
where it is clearly filled
It should be white, yeah
FA prefers you to layer SVG icons for stuff like this, so the branding icons often don't have the dual tone icons
not that you even get those on free FA anyway
Oh, I know, just explaining why it's transparent above

Haha, yeah, it does
I will add these icons/emoji/pictures in my reddit command and send ss soon
good.
if anyone gets a chance to do a quick lame review on my unbleach pr, feel free
merged.
nice of you to make a PR anyway
I will send the emojis tmw
ok
can we have this white or is it fine as grey?
maybe change this line to something like "Python 2 is now officially deprecated"
Python 2 is being sunset and will reach its end of life in 2020. It will not be maintained past 2020.
https://pythondiscord.com/pages/frequently-asked-questions/
I wonder if you're able to edit it yourself
If you sign into the site with discord
I don't remember if helpers were given permissions to edit
i don’t think we can
i signed in a few days ago but i don’t think it gave any permissions
you would see this if you did
Hey guys, in my reddit command, some images are really huge and take a lot of time to get displayed, what should I do for those?
could you lower the res on them?
also, should i edit that line on the site, and if so, what should i edit it to
how @sullen phoenix
should I use something like pillow
(btw by images, I mean images in the posts)
@sullen phoenix Don't think about it too hard just have confidence in your writing. I'm sure whatever you come up with is fine.
how does it look?
oh the emojis
after a bit, we settled on gray being the preferred choice for the emojis yeah
i think white is cool, I thinking making the text, image and video emoji red will look cool
thought you were there still, sorry
I will give gray a try
lol
so if you can regen them in grey, it'll be for the best. it also means they don't stick out too badly, so it should work ok
your text needs some serious buffer between the icons btw
don't use tab, no
then how to add spaces in embed desc
a normal space will give at least something, but i'm thinking you'll want an en space on the left side of the value and an em space on the right
their codepoints are 2002 (en) and 2003 (em)
how to use them
with unicode codepoint formats. hang on
okay
em is a full width space, en is half width
better.
the post types should probably be contained in the title
I think they look good where they are, I will give them a different color, then it will look better
mm dunno if i agree. the numbers are also unnecessary
also it seems you're using inline links instead of field titles here, meaning the titles don't stand out
if you do that, you should at least use bolding on the post titles
Hey guys I am using the buttons lib for the reddit command. So I wanna if I allowed to use that or not.
https://pypi.org/project/buttons/
I don't think it's necessary to add a new dependancy for this. I'd just implement it normally for now and when dpy's ext.menus releases at a later date it can be refactored to use the helpers it provides.
I will share a ss by today of the command when implemented with the paginator we have
Do you guys use the meetup website? (or any other similar website).
I was wondering maybe we can have a command which will get us upcoming meetups.
example:
.meetup [place] [topic]
then the bot sends an embed containing all meetups(as much as the embed can fit)
what do you guys think
I was also thinking about generalising the movie commands, I mean the commands which suggest a movie to watch, we have the following commands currently:
.romancemovie
.scarymovie
insted of having 2 for each season, we can have a general commands which will take an argument called genre and fetch the movie(s)
I like the latter idea a lot; it's something that will fit in nicely with the removal of the season manager from Seasonal Bot.
I'm not quite sure about the former utility, but I haven't thought about for it for long.
I kinda feels outside of the core of what typically have, although there are quite a few Python-related meetups
not only python-related meetups, but people can ask for anything
should I open an issue for the movie thing?
Sure, but make sure to check if there isn't already one; I know that some people have floated ideas similar to this one (but maybe for quizes).
okay
https://github.com/python-discord/seasonalbot/issues/278
this can be merged with .recommendgame
This can also be merged with upcoming general movie command
https://github.com/python-discord/seasonalbot/issues/213
https://github.com/python-discord/seasonalbot/issues/136
this can be closed
Does anyone here have experience with SoloLearn's Python 3 course? It's been suggested as an addition to our resources.
I've seen a lot of people recommending it over time
I've heard good things but I have no direct experience
I've used SoloLearn for other languages and it's tolerably useful
its strength is in its simplicity - it's basically a quiz that you can do while on the go. a good way to scrape the surface of what a language has to offer, to get a taste.
so not really a course?
but that's all it does. it scrapes the surface. barely. it frequently disregards best practices, every quiz features a comment section of extremely varying quality (sometimes useful, sometimes a total cesspool of misinformation), and once you've completely finished everything SoloLearn has to offer, you're still a beginner.
but I do think it might be a healthy way to expose someone to what a language looks and feels like
so long as they continue on to a real beginner resource afterwards
these things in reasources
University of Toronto: Learn to Program
MIT: Introduction to Computer Science and Programming
University of Michigan: Programming for Everybody
are these formal courses?
they involve video lectures, quizes, assignments with hand in deadlines..
basically a full class.
yeah, these dudes i'm making sure are in the courses page then
and can award certificates of dubious value once finished.
any others we could consider?
those are the three major ones that I'm aware of, but it's been years since I did python courses
we could include the automate the boring stuff one?
al's course on udemy
oh the udemy one is a good idea
basically the same content as the book, but under his tutelage.
probably a very good option for some.
that leaves Code Combat, exercism.io and Python Morsels left for interactives
does that sound right?
the first two, absolutely.
python morsels is.. well I guess so
you get emails with tasks to complete
it falls somewhere inbetween the two categories, I suppose.
doesn't feel very interactive 
Codewars is kind of like that, I guess
the ongoing stimili sounds good, but i'm not sure if it's what i'd take as "Interactive" like the gamified ones
code combat is literally a game, so that's a perfect fit. python morsels may be more like a course than a game, though
it's lectures delivered in small installments, you know?
I have done the MIT one
complete with assignments
but it's not a formal course either
I am actually auditing the current one
it is not a formal course, no.
structure wise
that's why I'm saying it kinda falls between categories
hmm
The MITx course is somewhere around introductory academic level and, unfortunately, it's now instructor-paced.
@woeful thorn has been involved with morsels a bit - which category would you say it falls in out of the new ones scrags has been mapping up that you may have seen in #admins ?
It may even be slightly below academic levels; it's not difficult.
lol "unfortunately". i feel that pain ves
self-paced is nice
It's not a great couse for beginners not on an academic thinking level (of willing to put in that kind of effort)
but structure-wise it's similar?
I like self-paced, but the main issue with instructor-paced is not the tempo, but the availability
The course is now only available while it's being given, unless you sign-up and pay before February 20
You can audit it for free and do all the assignments/exercises (but not the midterm/exam), but it will unavailable after March 22.
makes sense
Does it only cover beginner topics or does it go intermediate?
I'm still trying to find a useful Python cert
The MIT one? It's an okay course. It's an "Introduction to Computer Science and Programming Using Python", so it's not a "learn Python" course.
Oh, I see
Still, the content is solid and they do teach a lot of Python
it's probably below my level, but a lot of companies here don't know what github is
At the same time, they also use it as a tool to explain CS concepts (recursion and the like) that you normally wouldn't really use in Python
yes
I'd say that you probably know a lot of that course already. They do spend some time on basic theory about algorithms and complexity in the second half
Most people without CS experience usually haven't learned a lot about that
Anyway, the course is now part of a larger block of 5 or 6 courses given over the course of the entire year, I think
Solo Learn honestly doesn't look too bad. I think this could likely be included. @crude gyro was there any major qualms when you were dealing with the other ones. It appears to be nicely structured modules. The usefulness of the cert can be disregarded, as long as it's genuinely helpful going through it.
I may do them all
@glass pecan no major qualms. I found it to be more or less a pleasant experience, and a useful scratching of the surface. gave me enough SQL basics that I could feel a little bit more confident in an interview that expected SQL experience.
it's just important to clarify that it's not really a full course, or even a beginner tutorial.
it's just a taste.
most of these free course things are mostly just the tip of the knowledge base required for further learning though, no?
or is this entirely different to the others
I think many of the free resources in our list are more exhaustive beginner resources.
like A Byte of Python is pretty in-depth.
even Automate The Boring Stuff, if you work through the whole book, will have taught you faaar more about the versatility of Python. SoloLearn just teaches basic syntax.
specific to courses though
but all of that said - it's probably the best app of its kind
Automate does at least have the udemy and you said it goes through it pretty extensively, so that's fair
and I don't have any big issues with us adding it
ok. then in your opinion would it mostly suit as a nice interactive exercise thing or as a structured course thing
hard call to make. it really wants to be the latter, but might be more accurately described as the former.
I think I'd lean left.
knock yourself out
what should we do with the PRs that are stalled
https://github.com/python-discord/seasonalbot/pulls
if it's not impacting your own prs, just leave it to core devs to deal with
okay
final output of the reddit command using seasonalbots paginator
https://streamable.com/l1swm
(dont worry about the emoji color, I will change them soon)
@glass pecan
I am sorry for the bad quality, idk how to make it better 😅
I need feedback, everyone
screenshots and showing things is good. but if you feel it's ready for getting feedback, then make a PR so feedback can be left on the ticket
okay, I will change the colour of those emojis by tonight
what do you think of the color(I have only applied it to the image emoji)
looks good
okay
I like that
You mean of a pixel?
yea


