#dev-log

1 messages ยท Page 69 of 1

odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: gitattributes
oak estuaryBOT
odd spireBOT
regal archBOT
#

It could lock everything and rebuild the queue without the channel, but maybe a separate data structure to keep track of which channels to skip in the queue would suffice. In any case, the implementation of this has some nuance due to race conditions, so whoever implements this will have to keep that in mind.

regal archBOT
regal archBOT
#

To clarify, I understand that RedisCache doesn't attempt to provide an identical interface to a dictionary anymore, for example update also doesn't take kwargs or no arguments at all. But this behaviour is clearly observable from the function signature.

In comparison, the empty dict behaviour is not visible from looking at the implementation unless one looks into aioredis. It feels natural to assume that update({}) no-ops. Perhaps the update could check for this case and exit early?

regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/site] New branch created: deploy\-environment
odd spireBOT
regal archBOT
#
jb3
[python-discord/sir-lancebot] New branch created: split\-build\-deploy
odd spireBOT
regal archBOT
#
jb3
[sir-lancebot] Branch split\-build\-deploy was force-pushed to `c1df836`
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

I think this is the wrong approach. It makes it impossible to have multiple instances of references to the same node. I believe what we need to do is store the path of the node that contains the reference. However, I'm currently unsure of how to get that path. It doesn't seem possible to get it from the node or loader in _ref_constructor, but I've not dug to deep.

The set of paths may have to be populated by _update_mapping since it keeps track of the path, and it goes through all node...

#

I expressed concerns before about the inability to set values being unintuitive. The argument against that could be that it'd be confusing to allow setting values since we definitely have no plans of writing set values back to the config file.

I can say with confidence that at the least, this should raise a NotImplementedError. Whether we should actually implement it is still up to debate. I believe it could be implemented by using get_node to get the parent of the stored path, ensuri...

odd spireBOT
regal archBOT
#
jb3
[python-discord/sir-lancebot] branch deleted: split\-build\-deploy
#
jb3
[python-discord/site] branch deleted: deploy\-environment
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

This may not return a 404 for a missing message. Instead, it may return a 400 (?) with a code of 10008. Try the endpoint with purposefully invalid IDs and see what the response is.

If the channel is invalid, it may return 10003. However, we can probably live with the assumption that it exists since that's how the cog deals with the categories (granted, it does make sure they were at least prese...

regal archBOT
#
[python-discord/bot] New branch created: bug/info/bot\-xr/code\-block\-null\-byte
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: bug/info/bot\-xk/defcon\-threshold\-none
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: mbaruh/channel\-activity
odd spireBOT
regal archBOT
regal archBOT
#

wait() does indeed only wait for one child. However, what we can do is keep calling wait() in a loop until it raises a ChildProcessError, indicating there are no more unawaited child processes. This is safe according to the documentation; this error would not be raised for any other reason.

I am also concerned about the implications of being a subreaper. If we somehow became the parent of a process that shouldn't be killed i...

regal archBOT
#

The perplexing thing is that nsjail seems to handle all this for us in some (if not all) situations. This is what https://github.com/google/nsjail/commit/bb4e77686dfdae72dbaf1fa626519759f03de431 aimed to fix.

When it gets a fatal signal (not exactly sure on what this means), it does kill all child processes too. It seems like it keeps the loop going until there are no PIDs remaining, which accounts for children creating new processes while it is attempting to kill all children.

https://...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: bug/info/bot\-xk/defcon\-threshold\-none
oak estuaryBOT
odd spireBOT
regal archBOT
#

Description

Add a global points leader-board, for the points/coins which are earned by users while playing a game like Trivia Quiz, Tic Tac Toe, Connect 4, etc. Currently each game has its own leader-board, and not a combined one together for all games. In short, combining all the leader-boards into one.

Proposed Implementation

  • [ ] Make a new redis cache in bot/bot.py called Leaderboard (say).
  • [ ] Make a points system in all the games which make use of a leaderboard name...
odd spireBOT
regal archBOT
#
[python-discord/forms-backend] branch deleted: ks123/role\-assigning
odd spireBOT
regal archBOT
#
[python-discord/forms-backend] New branch created: dm\-message
regal archBOT
#

Description

After seeing a constant demand of songs music channel, An idea was given in #meta to have a command that suggest songs

This command can have multiple sub commands

  • Random
  • Search
  • category

Reasoning

Helps getting more familiar by the medium of music taste <3.

Proposed Implementation

Currently I am thinking of using one of API that serves the purpose of music suggestion
Kinda similar how .movie command is made.

Would you like to implement...

regal archBOT
regal archBOT
regal archBOT
#
jb3
[python-discord/snekbox] New branch created: sigkill\-to\-sigterm
#
jb3

As of now, when an evaluation exceeds a write buffer limit we send SIGKILL to the nsjail parent process. This does not give nsjail a chance to perform cleanups such as removing generated cgroups. It also leaves child processes in a running state which then means that further removal of cgroups manually is not possible without becoming a subreaper and killing them manually (see #95).

This PR changes the signal to SIGTERM which triggers nsjail's cleanup logic such as removing cgroups and oth...

#

6b9c954 Split out help channel idle time constants - ChrisLovering
ce86169 Set a reasonable default for idle_minutes_othe... - ChrisLovering [243d465](https://github.com/python-discord/bot/commit/243d4657bfeafe31bc3ba9666b35a88eeef74a92) Update help availible footer - ChrisLovering [b3c66a6`](https://github.com/python-discord/bot/commit/b3c66a6fb07ebc92c0b53d946cf10df6c1107303) Extend close time logic to differentiate betwee... - ChrisLovering

#
[python-discord/bot] New branch created: help\-channel\-closing\-delay\-changes
odd spireBOT
regal archBOT
#
[python-discord/snekbox] branch deleted: sigkill\-to\-sigterm
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#

Since #129 is blocked by this, I decided to include a simple Easter banner as part of the PR.

It is the evergreen banner adapted to use the Easter icon & colours:

image

It was created using the evergreen banner's SVG and both the SVG and PNG will be included in the PR so that we can play with this further in the future. For now, it should suffice. I'll leave the issue open for no...

odd spireBOT
regal archBOT
#

Following the above style of overwriting the last_message by its datetime, even this should follow that.

I don't agree with these two names, as they don't show what they are assigned to:

  • last_message means the last message and not the time of the last message, last_message_time could be a better variable name here.
  • claimant means the user who claimed that channel, while the it contains the value of the their last message's time, claimant_last_msg(message)_time could be a b...
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] branch deleted: bug/info/bot\-xr/code\-block\-null\-byte
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

47ed233 Instructions to dispute an infraction vary by i... - swfarnsworth
75f2b9d Update the tests to reflect changes in expected... - swfarnsworth
96a369c Made multiline concatenated string conform to a... - swfarnsworth
b713a6c Merge branch 'master' into swfarnsworth/infract... - swfarnsworth
d498cc6 Merge branch 'main' into swfarnsworth/infractio... - Akarys42

#
[python-discord/bot] branch deleted: swfarnsworth/infraction\_message
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

Use asyncio.create_task instead. In fact, it would be even better to use scheduling.create_task since it logs exceptions. I believe that even with asyncio.create_task, any exception raised would eventually show up anyway as uncaught (typically when the bot shuts down), so it's worth handling it. In this case, we'd want to suppress the exception raised when the message no longer exists.

odd spireBOT
regal archBOT
regal archBOT
#

We have the !pypi which is useful, and I think that a !github command can be useful to share repositories with others.

Usage

!github python-discord/bot Sends info about the bot (this one) repo.
!github search discord.py Shows search results for the term discord.py
Maybe some other command(s)

Additional Details

We can use the github api for this.
I would like to implement this command.

#

@MarkKoz might need to add a condition to the old method fallback, that checks for bot uptime smaller than idle_minutes_claimant so that there is at least that much time after a restart after which channels wont be unduly closed.

that is, if i understood correctly what you were referring to.

What I was referring to is the cache not having the latest times due to the bot going offline and more messages being sent in channels. Upon going online again, the bot may prematurely...

#

Description

A .github command that shows you information about a repository in github. A subcommand called search that searches repositories for that specific term.

Reasoning

I think it would be cool to see info about a repository in discord instead of having to find it myself on github, and to be able to show it to someone else.

Proposed Implementation

Using the github api to get info about that specific repository.

Would you like to implement this yourself?

...

regal archBOT
regal archBOT
#

Yes... unless you can think of a nicer way.

Would a new utility function work since I'm using it multiple times?

Yeah, sure. See how much you can turn into a utility function. Maybe some logic in the check could be moved to the utility function too.

But I don't see why suppress the exception if scheduling.create_task logs the exception and ultimately suppresses it.

It suppresses the raising of the exception, but it does not suppress the logging of it. I...

regal archBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#

The site commands tools, resources, help and home construct embeds from mostly static strings, with only the site url being variable. The url is already referenced in other tags so this won't bring any additional maintenance in the case it does change for some reason.
Moving them to tags will also allow the more direct fuzzy matching and per channel cooldowns to take effect.
With the other commands removed the only left will be the rules command; I think we should move it to the Informatio...

regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

Making this the first argument and non-optional breaks all other uses of this function. The coroutine should be the first argument and the function should not require callers to always specify exceptions. Consider using *args for the exceptions since it'd be more convenient for callers.

But it's already using *args. How about making it a kwarg?

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

@MarkKoz as it stands currently, it will fall back to the old behavior if the cache isn't available (empty/ returns None)

I am proposing extending the fallback conditions to always use the old method for a while after startup, as it does not rely on cache. This way, instead of channels being closed prematurely they might take a bit longer to close.

Yes, that could work. It'd have to reschedule it for the maximum time.

regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

@MarkKoz as it stands currently, it will fall back to the old behavior if the cache isn't available (empty/ returns None)
I am proposing extending the fallback conditions to always use the old method for a while after startup, as it does not rely on cache. This way, instead of channels being closed prematurely they might take a bit longer to close.

Yes, that could work. It'd have to reschedule it for the maximum time.

What about clearing the caches on init, so the bot uses ...

odd spireBOT
regal archBOT
#

#ot0-psvmโ€™s-eternal-disapproval message is a good example for use cases where we may want to purge reactions on many messages in a channel. I don't think discord lets us remove reactions from a given user, but they do permit us to remove a specific reaction from a specific message.

I imagine usage similar to

!reactionclean [messages] [reaction1] [reaction2] [reaction3]

and

!rclean 10 pensive rofl clown

We should probably have a "ha...

regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
jb3

47ed233 Instructions to dispute an infraction vary by i... - swfarnsworth
75f2b9d Update the tests to reflect changes in expected... - swfarnsworth
96a369c Made multiline concatenated string conform to a... - swfarnsworth
b713a6c Merge branch 'master' into swfarnsworth/infract... - swfarnsworth
7a97eec Make the snowflake command accept many snowflakes - Akarys42

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

When on the https://pythondiscord.com/pages/resources/reading/ page, all the links are for the American amazon.
It is easy enough for a user to find their Amazon-specific, I'm from England so I just change the .com

amazon.com -> amazon.co.uk

Not a massive issue, but it may help users from other location than America find the book they can purchase etc.
There may be more cases than just Book links that this occurs with.

#
jb3
[python-discord/bot] branch deleted: mbaruh/autoreview
ocean rock
#

great PR the best PR a real good PR

#

good work everyone thank mbaruh

regal archBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/bot] branch deleted: mbaruh/review\_fix
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: reduce\-channels\-output\-in\-error\-embed
#

Relevant Issues

Closes #556

Description

Remove all default whitelisted channels from the channel kwarg before building the output string

Reasoning

Previously this would output all channels, and could result in an error. This change ensures only the main bot channel & and any overridden channels are shown in the embed. We do this before the categories block as the categories kwarg itself is an override, so we want to include those in any output.

Screenshots

...

odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: add\-nomination\-voting\-channel
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: add\-nomination\-voting\-channel
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: wookie184\-codeowners
odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: limit\-nominate\-command\-channels
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: snekbox\-SIGTERM
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Description

I don't know whether this is a feature or a bug since I didnt read the source code; but the .topic command has been spilling out a lot of topics related to Easter. I don't blame the topics (its actually pretty good), its about how frequently the same topics are being sent by the bot. I know this is a one-time-thing where topics are more likely to be about a specific celebration (in this case Easter) but.... the same topics being sent SMH. (I've been told that random module i...

regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/site] branch deleted: ks123/dewikification/event\-pages
regal archBOT
#

NOTE: This PR should target the dewikification branch!

This issue may be blocked by #393, so wait for that to be merged first.

At the top of an article in the content app, we should show an "Edit on GitHub" button which would lead to the view page for that file on GitHub - something like https://github.com/python-discord/site/blob/main/docs/configuration.md

The button should have a nice logo, maybe an edit pencil or a github icon.

See https://docs.microsoft.com/en-us/azu...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/site] branch deleted: add\-streamyard
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: move\-gunicorn\-import
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
#

@MarkKoz as it stands currently, it will fall back to the old behavior if the cache isn't available (empty/ returns None)
I am proposing extending the fallback conditions to always use the old method for a while after startup, as it does not rely on cache. This way, instead of channels being closed prematurely they might take a bit longer to close.

Yes, that could work. It'd have to reschedule it for the maximum time.

What about clearing the caches...

odd spireBOT
regal archBOT
#

I get an error upon reacting with a different user

Traceback (most recent call last):
  File "/home/mark/repos/python/bot-pydis/.venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/mark/repos/python/bot-pydis/bot/decorators.py", line 78, in inner
    await func(self, ctx, *args, **kwargs)
  File "/home/mark/repos/python/bot-pydis/bot/exts/info/help.py", line 68, in command_callback
    await self...
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: remove\-broken\-link
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
oak estuaryBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
#

I'm not a fan of relying on cache behaviour like this. It feels too fragile and implicit.

Personally i think that clearing the caches is fine, as that solves exactly the issues we would have, which is outdated caches. The code has to handle non-existent caches anyway, and treating them as non-existent after a restart seems exactly the behaviour we want.

i understand that it doesn't feel clean since we have to manually clear them. If we were to handle that data as a python only variabl...

regal archBOT
#

I'm not a fan of relying on cache behaviour like this. It feels too fragile and implicit.

Personally i think that clearing the caches is fine, as that solves exactly the issues we would have, which is outdated caches. The code has to handle non-existent caches anyway, and treating them as non-existent after a restart seems exactly the behaviour we want.

i understand that it doesn't feel clean since we have to manually clear them. If we were to handle that data as a p...

regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: lemon/frontend/update\_timeline
odd spireBOT
regal archBOT
#
jb3
[python-discord/site] branch deleted: lemon/frontend/update\_timeline
odd spireBOT
regal archBOT
#

@MarkKoz The current tests run the markdown parser and rely on filesystem access. I am thinking of using pyfakefs to mock the filesystem and do a small refactor of the tests. What do you think?

I'm not familiar with it. What advantages would it provide? I don't currently have any problems with using actual test files in a real file system. After all, the tests rely on the content in the files too, not just on their existence. How would the content be specified with pyfakefs? ...

#

The primary advantage is all filesystem setup is in a single helper.py, including file content. That way, valid/invalid content can be reused for different files, and placed right next to the expected parsed content for use in the tests.

The content is specified like so:

MARKDOWN_WITH_METADATA = """
---
title: TestTitle
description: TestDescription
relevant_links:
    Python Discord: https://pythondiscord.com
    Discord: https://discord.com
---
# This is a header.
"""
...
regal archBOT
#

Need to be careful mixing aware and naรฏve datetimes. They all need to be one or the other. I don't remember if it was for help channels that I chose to use aware datetimes somewhere. In any case, I don't believe it's strictly necessary as long as all the code is "on the same page" and using all naรฏve or all aware objects. Since it's dealing with times coming from discord.py, which gives naรฏve objects, the path of least resistance is likely to use naรฏve objects everywhere.

If you swich to n...

#
[python-discord/sir-lancebot] branch deleted: reduce\-channels\-output\-in\-error\-embed
odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: remove\-broken\-link
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
regal archBOT
#
[python-discord/site] New branch created: lemonsaurus\-patch\-1
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: lemonsaurus\-patch\-1
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/bot] branch deleted: snekbox\-SIGTERM
regal archBOT
regal archBOT
regal archBOT
#
jb3

How widespread is the dislike of this? I can't imagine people receiving more than 3 or 4 DMs per day for the heaviest help channel users, with others receiving much less.

I'm open to the idea but it's another data point to store and retain, and since we don't guarantee persistence on Redis I'm not sure of the best solution in case we lose persistence and start sending DMs again.

#

Okay okay hear me out.

Let's make a character creator (like the one on https://lemonsaur.us you ask? Yes. Like that one.) where you use a color picker to pick the color of:

  • The duck itself
  • The beak
  • The wing

And where you can also select an accessory. Our list of accessories should be taken from all our existing duck SVGs. So, stuff like, the crown from the royal ducky, the ushanka from the russian ducky, or the party hat from partyducky.

odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

This is now broken due to

        # non_claimant needs to be set too, to satisfy the condition in `_channel.get_closing_time` the first time.
        # Otherwise it will fall back to the old method if no other messages are sent.
        await _caches.non_claimant_last_message_times.set(message.channel.id, message.created_at)

The value should be None when the channel is claimed, but then you'd need to fix the fallback logic.

regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

Okay, this is a great start, and there's some pretty good code in here, but we need to figure out a few things.

@python-discord/core-developers, I want you guys to chime in on this with your opinions:

  • The last time we discussed this system, I remember people raising concerns about the name "Guides". Should it be called Guides, or something more generic? If we should call it something else, what do we call it? Maybe something like Content?

  • @ks129 How GitHub-Flavored Markdown compati...

regal archBOT
regal archBOT
regal archBOT
#

When a user opt out of metricity, the opt_out field is set to True. This field should be returned by the /bot/users/$id/metricity_data, which can be achieved by adding "opt_out" to

https://github.com/python-discord/site/blob/6d901680b6fc302096a132e1b0e486c12b48d52f/pydis_site/apps/api/models/bot/metricity.py#L34

The following docstring will also have to be modified.

https://github.com/python-discord/site/blob/6d901680b6fc302096a132e1b0e486c12b48d52f/pydis_site/apps/api/viewsets...

#

Currently we have no way of knowing if the message count isnโ€™t accurate because the user opted out of metricity. Once https://github.com/python-discord/site/issues/467 is resolved, the information will be available to the bot under user_activity["opt_out"] and can be added here:

https://github.com/python-discord/bot/blob/15c1d321ccd8ff9c7c9b7802ea732e43fcffbf9e/bot/exts/info/information.py#L392-L394

oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#

Description

When a really cool message is sent in the server, people want to bookmark it for future reference.
If many people want to bookmark the same message, the chat could be flooded with .bm 1231231231313 calls.

We should add a way for users to also bookmark the same message as another user, without having to send another command.

Reasoning

To reduce the amount of messages sent in a channel when many people are wanting to bookmark a message.

Proposed Implementa...

regal archBOT
#

My thoughts on this is to change the .dm command to have the bot output a small embed with the context along the lines of <user> has bookmarked <message> from <author>. React with ๐Ÿ“Œ to also bookmark this message..

We use redis to store these embed messages linked to the bookmarked messages and a reaction add listener which checks the cache when a pin is added to a message.

regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/forms-frontend] New branch created: sentry\-action\-test
#
[python-discord/forms-frontend] New branch created: sentry\-action
#
[python-discord/forms-frontend] branch deleted: sentry\-action\-test
#

Description

When a user tends to use a command often, either by the user manually adding it, or have the bot automatically add through command tracking, add a ".bookmarks", and it will pull up all the bookmarked commands of that user.

Reasoning

For easier use and memorization of the bot commands.

  • [ ] I'd like to implement this feature myself
  • [ x] Anyone can implement this feature
regal archBOT
#

I'm trying this out with the following config:

    idle_minutes_claimant: 2
    idle_minutes_others: 1
    deleted_idle_minutes: 1

I simply claim a channel, and it correctly schedules it to close in 2 minutes. However, when the closing task runs, it calculates a wrong time. The log timestamps on the left are in UTC-8. Converted to UTC the times would be around 2021-03-26 20:58:06. Therefore, the time it calculates is off by 7 hours.

2021-03-26 13:58:06 | bot.ext...
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: akarys/630/automatic\-linking\-everywhere
odd spireBOT
odd spireBOT
regal archBOT
#
[sir-lancebot] Branch akarys/630/automatic\-linking\-everywhere was force-pushed to `d03a41d`
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: feat/dmrelay
regal archBOT
#

The !raw command takes a link to a message in the discord, and then shows the message contents inside a code block.

This line tries to prevent the message from breaking the code block:
https://github.com/python-discord/bot/blob/76b3b5898dd4163d8bac6ff330209f27f437e3d6/bot/exts/info/information.py#L452

But consider the message: ````` (5 backticks). The first 3 will be replaced by the filter, but that's it. Finally giving this result: `` ```, and actually breaking out of the co...

regal archBOT
#

I'd also add something like this to escape mentions:
https://github.com/python-discord/bot/blob/main/bot/exts/utils/snekbox.py#L153-L157

And it looks like that's exactly what the function @HassanAbouelela suggested does:
https://github.com/Rapptz/discord.py/blob/a3f700c11f72202f6a7710ce07c7144a8b8c947d/discord/utils.py#L547

I'd submit a PR but I can't test this on actual Discord so I'll leave it

regal archBOT
regal archBOT
#

Description

This PRs wipes out the old DMRelay cog and its functionalities. We realize that relaying all DMs sent to the bot into a specific channel may come in conflict with Discord's ToS, so that feature has now been removed, along with the !reply command. I've replaced it with the !dmrelay command, allowing moderators to view DM history between the bot and a specific user when necessary.

Here is an [example message log](https://paste.pythondiscord.com/ogeromerur.txt?noredirect...

odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: ks123/goodbye\-talentpool\-channel
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

Sorry but I donโ€™t understand @Shivansh-007. Who changed what when, and what should this PR (#642) actually do?

  1. This is required by the .issue command (rework permission) PR, that is #638.
  2. It is used to restrict the command to those white listed channels and few other white listed categories.
  3. As the author of this feature, I would suggest to just remove the if...else check for channels/categories in the on_message listener.
#

@kosayoda I agree that those changes should be done, but isn't it out of scope for this PR?

My opinion is after this PR, the scope of automatic detection and linking essentially goes from 3 non-staff channels located at the bottom of the server to every single channel in the server, which is a potentially huge issue given the number of problems still present in the feature.

Sounds good, will do that this afternoon ๐Ÿ‘

regal archBOT
#
jb3

A few minor things noted in the code, as well as the below bugs.

Does not handle client user

We should gracefully reject requests to relay the bot's DM history with itself.

Incorrect "no DM history"

After booting the bot and running this without sending any messages, the bot incorrectly identified me as having no history, after I sent a message to the (existing) channel it did identify that there was a history and uploaded it.

Maybe we should instead just use an asy...

regal archBOT
#
jb3

We already use allowed mentions after the ping incident with !raw last year, rendering this vulnerability not hugely damaging. From my testing, it appears that only individual user pings work or the roles that we have whitelisted here:

https://github.com/python-discord/bot/blob/60f410e488e8212f34c56b9353df0c97912d369c/bot/bot.py#L112

Therefore:

Ping type Safe Demo
User :x: <img width="1241" alt="Screenshot 2021-03-28 at 13 01 08" src=...
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3

This looks good, however it now uses 2 API calls instead of one, which I think we can optimise down to one.

Switching around the order of "no channel" with "fetch messages" means you can do something along the lines of:

found_messages = False

async for msg in user.history(...):
  found_messages = True

if not found_messages:
  await ctx.send("... no direct message hitsory ...")

I'm fine with this implementation though, since it's an infrequently used command anyway.

regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: feat/dmrelay
oak estuaryBOT
odd spireBOT
regal archBOT
#

I'd like to give this a go. Even though this is already approved, I just want to confirm my plans.

  • When someone calls .bm on a message the bot will:
    • Send a DM as normal (with the same error embed if DMs are disabled)
    • Send 1 sentence embed explaining that you can react to the embed and also get sent a DM with a link
    • Have a 5 min wait for listening for reactions
    • On reaction, the bot will send the bookmark DM to the reactor
regal archBOT
odd spireBOT
regal archBOT
regal archBOT