Skip to content

Commit

Permalink
remove end of the line anomalies
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaddat committed Jul 23, 2021
1 parent b5a47b1 commit b1605e3
Show file tree
Hide file tree
Showing 56 changed files with 189 additions and 189 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
ports:
- 5432:5432
env:
POSTGRES_DB: red_db
POSTGRES_DB: edu_db
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
steps:
Expand All @@ -78,7 +78,7 @@ jobs:
- name: Tox test
env:
TOXENV: postgres
PGDATABASE: red_db
PGDATABASE: edu_db
PGUSER: postgres
PGPASSWORD: postgres
PGPORT: 5432
Expand Down
12 changes: 6 additions & 6 deletions docs/autostart_mac.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ Paste the following and replace the following:
<false/>
</dict>
<key>StandardOutPath</key>
<string>/tmp/red_out.log</string>
<string>/tmp/edu_out.log</string>
<key>StandardErrorPath</key>
<string>/tmp/red_err.log</string>
<string>/tmp/edu_err.log</string>
<key>UserName</key>
<string>username</string>
<key>InitGroups</key>
Expand Down Expand Up @@ -100,10 +100,10 @@ To stop the bot and set it to not start on boot anymore, run the following:

sudo launchctl unload -w /Library/LaunchDaemons/red.plist

To view Edu's log, run the following (:code:`red_out.log` is for the console output, and
:code:`red_err.log` for the error logs):
To view Edu's log, run the following (:code:`edu_out.log` is for the console output, and
:code:`edu_err.log` for the error logs):

.. prompt:: bash

nano /tmp/red_out.log
nano /tmp/red_err.log
nano /tmp/edu_out.log
nano /tmp/edu_err.log
8 changes: 4 additions & 4 deletions docs/changelog_3_4_0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ Edubot 3.4.0 (2020-08-17)
| :ghuser:`Dav-Git`, :ghuser:`DevilXD`, :ghuser:`douglas-cpp`, :ghuser:`Drapersniper`, :ghuser:`flaree`, :ghuser:`jack1142`, :ghuser:`kablekompany`, :ghuser:`Kowlin`, :ghuser:`maxbooiii`, :ghuser:`MeatyChunks`, :ghuser:`mikeshardmind`, :ghuser:`NeuroAssassin`, :ghuser:`PredaaA`, :ghuser:`Predeactor`, :ghuser:`retke`, :ghuser:`SharkyTheKing`, :ghuser:`thisisjvgrace`, :ghuser:`Tinonb`, :ghuser:`TrustyJAID`, :ghuser:`Twentysix26`, :ghuser:`Vexed01`, :ghuser:`zephyrkul`
|
| **Read before updating**:
| 1. Edu 3.4 comes with support for data deletion requests. Bot owners should read `red_core_data_statement` to ensure they know what information about their users is stored by the bot.
| 1. Edu 3.4 comes with support for data deletion requests. Bot owners should read `edu_core_data_statement` to ensure they know what information about their users is stored by the bot.
| 2. Debian Stretch, Fedora 30 and lower, and OpenSUSE Leap 15.0 and lower are no longer supported as they have already reached end of life.
| 3. There's been a change in behavior of ``[p]tempban``. Look at `Mod changelog <important-340-1>` for full details.
| 4. There's been a change in behavior of announcements in Admin cog. Look at `Admin changelog <important-340-2>` for full details.
Expand All @@ -966,7 +966,7 @@ Core Bot
- Guild owners can enable/disable cogs for their guild using ``[p]command disablecog`` and ``[p]command enablecog`` commands
- Cogs disabled in the guild can be listed with ``[p]command listdisabledcogs``

- Added support for data deletion requests; see `red_core_data_statement` for more information (:issue:`4045`)
- Added support for data deletion requests; see `edu_core_data_statement` for more information (:issue:`4045`)
- Edu now logs clearer error if it can't find package to load in any cog path during bot startup (:issue:`4079`)
- ``[p]licenseinfo`` now has a 3 minute cooldown to prevent a single user from spamming channel by using it (:issue:`4110`)
- Added ``[p]helpset showsettings`` command (:issue:`4013`, :issue:`4022`)
Expand Down Expand Up @@ -1034,7 +1034,7 @@ Breaking changes
- `Context.maybe_send_embed()` now supresses all mentions, including user mentions (:issue:`4192`)
- The default value of the ``filter`` keyword argument has been changed to ``None`` (:issue:`3845`)
- Cog package names (i.e. name of the folder the cog is in and the name used when loading the cog) now have to be `valid Python identifiers <https://docs.python.org/3/reference/lexical_analysis.html#identifiers>`__ (:issue:`3605`, :issue:`3679`)
- Method/attribute names starting with ``red_`` or being in the form of ``__red_*__`` are now reserved. See `version_guarantees` for more information (:issue:`4085`)
- Method/attribute names starting with ``edu_`` or being in the form of ``__red_*__`` are now reserved. See `version_guarantees` for more information (:issue:`4085`)
- `humanize_list()` no longer raises `IndexError` for empty sequences (:issue:`2982`)
- Removed things past deprecation time: (:issue:`4163`)

Expand All @@ -1053,7 +1053,7 @@ Core Bot

- Added data request API (:issue:`4045`, :issue:`4169`)

- New special methods added to `commands.Cog`: `red_get_data_for_user()` (documented provisionally), `red_delete_data_for_user()`
- New special methods added to `commands.Cog`: `edu_get_data_for_user()` (documented provisionally), `edu_delete_data_for_user()`
- New special module level variable added: ``__red_end_user_data_statement__``
- These methods and variables should be added by all cogs according to their documentation; see `recommendations-for-cog-creators` for more information
- New ``info.json`` key added: ``end_user_data_statement``; see `Info.json format documentation <info-json-format>` for more information
Expand Down
2 changes: 1 addition & 1 deletion docs/cog_guides/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,7 @@ mydata

Commands which interact with the data Edu has about you.

More information can be found in the :doc:`End User Data Documentation.<../red_core_data_statement>`
More information can be found in the :doc:`End User Data Documentation.<../edu_core_data_statement>`

.. _core-command-mydata-3rdparty:

Expand Down
4 changes: 2 additions & 2 deletions docs/framework_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ extend functionalities used throughout the bot, as outlined below.

.. automethod:: format_help_for_context

.. automethod:: red_get_data_for_user
.. automethod:: edu_get_data_for_user

.. automethod:: red_delete_data_for_user
.. automethod:: edu_delete_data_for_user

.. autoclass:: redbot.core.commands.Command
:members:
Expand Down
2 changes: 1 addition & 1 deletion docs/guide_cog_creators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ While not required for approved Cog Creators, they are still recommended in orde
- Utilize the data deletion and statement APIs

- See `redbot.core.commands.Cog.red_delete_data_for_user()`
- See `redbot.core.commands.Cog.edu_delete_data_for_user()`
- | Make a statement about what data your cogs use with the module level
variable ``__red_end_user_data_statement__``.
| This should be a string containing a user friendly explanation of what data
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Welcome to Edu - Discord Bot's documentation!
cog_guides/streams
cog_guides/trivia
cog_guides/warnings
red_core_data_statement
edu_core_data_statement

.. toctree::
:maxdepth: 2
Expand Down
2 changes: 1 addition & 1 deletion docs/version_guarantees.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ excluded from being guaranteed.

Method names and names of attributes of classes, functions, extensions, and modules
provided by or provided to the bot should not begin with
``red_`` or be of the form ``__red_*__`` except as documented.
``edu_`` or be of the form ``__red_*__`` except as documented.
This allows us to add certain optional features non-breakingly without a name conflict.

Any RPC method exposed by Edu may break without notice.
Expand Down
2 changes: 1 addition & 1 deletion edu.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async def on_red_api_tokens_update(
elif service_name == "audiodb":
await self.api_interface.global_cache_api.update_token(api_tokens)

async def red_delete_data_for_user(
async def edu_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
Expand Down
2 changes: 1 addition & 1 deletion edubot/cogs/admin/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(self, bot):
async def cog_before_invoke(self, ctx: commands.Context):
await self._ready.wait()

async def red_delete_data_for_user(self, **kwargs):
async def edu_delete_data_for_user(self, **kwargs):
""" Nothing to delete """
return

Expand Down
2 changes: 1 addition & 1 deletion edubot/cogs/alias/alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self, bot: Edu):
self._aliases: AliasCache = AliasCache(config=self.config, cache_enabled=True)
self._ready_event = asyncio.Event()

async def red_delete_data_for_user(
async def edu_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
Expand Down
6 changes: 3 additions & 3 deletions edubot/cogs/audio/apis/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ async def spotify_enqueue(
)
player.add(ctx.author, single_track)
self.bot.dispatch(
"red_audio_track_enqueue",
"edu_audio_track_enqueue",
player.guild,
single_track,
ctx.author,
Expand All @@ -659,7 +659,7 @@ async def spotify_enqueue(
)
player.add(ctx.author, single_track)
self.bot.dispatch(
"red_audio_track_enqueue",
"edu_audio_track_enqueue",
player.guild,
single_track,
ctx.author,
Expand Down Expand Up @@ -1007,7 +1007,7 @@ async def autoplay(self, player: lavalink.Player, playlist_api: PlaylistWrapper)
)
player.add(player.guild.me, track)
self.bot.dispatch(
"red_audio_track_auto_play",
"edu_audio_track_auto_play",
player.guild,
track,
player.guild.me,
Expand Down
4 changes: 2 additions & 2 deletions edubot/cogs/audio/core/commands/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async def command_disconnect(self, ctx: commands.Context):
)

await self.send_embed_msg(ctx, title=_("Disconnecting..."))
self.bot.dispatch("red_audio_audio_disconnect", ctx.guild)
self.bot.dispatch("edu_audio_audio_disconnect", ctx.guild)
self.update_player_lock(ctx, False)
eq = player.fetch("eq")
player.queue = []
Expand Down Expand Up @@ -286,7 +286,7 @@ async def command_prev(self, ctx: commands.Context):
}
)
player.add(player.fetch("prev_requester"), track)
self.bot.dispatch("red_audio_track_enqueue", player.guild, track, ctx.author)
self.bot.dispatch("edu_audio_track_enqueue", player.guild, track, ctx.author)
queue_len = len(player.queue)
bump_song = player.queue[-1]
player.queue.insert(0, bump_song)
Expand Down
8 changes: 4 additions & 4 deletions edubot/cogs/audio/core/commands/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ async def command_bumpplay(
player.queue.insert(0, single_track)
player.maybe_shuffle()
self.bot.dispatch(
"red_audio_track_enqueue", player.guild, single_track, ctx.author
"edu_audio_track_enqueue", player.guild, single_track, ctx.author
)
else:
self.update_player_lock(ctx, False)
Expand All @@ -330,7 +330,7 @@ async def command_bumpplay(
)
player.queue.insert(0, single_track)
player.maybe_shuffle()
self.bot.dispatch("red_audio_track_enqueue", player.guild, single_track, ctx.author)
self.bot.dispatch("edu_audio_track_enqueue", player.guild, single_track, ctx.author)
description = await self.get_track_description(
single_track, self.local_folder_current_path
)
Expand Down Expand Up @@ -835,7 +835,7 @@ async def _search_menu(
)
player.add(ctx.author, track)
self.bot.dispatch(
"red_audio_track_enqueue", player.guild, track, ctx.author
"edu_audio_track_enqueue", player.guild, track, ctx.author
)
else:
track_len += 1
Expand All @@ -848,7 +848,7 @@ async def _search_menu(
)
player.add(ctx.author, track)
self.bot.dispatch(
"red_audio_track_enqueue", player.guild, track, ctx.author
"edu_audio_track_enqueue", player.guild, track, ctx.author
)
if not player.current:
await player.play()
Expand Down
2 changes: 1 addition & 1 deletion edubot/cogs/audio/core/commands/playlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@ async def command_playlist_start(
}
)
player.add(author_obj, track)
self.bot.dispatch("red_audio_track_enqueue", player.guild, track, ctx.author)
self.bot.dispatch("edu_audio_track_enqueue", player.guild, track, ctx.author)
track_len += 1
player.maybe_shuffle(0 if empty_queue else 1)
if len(tracks) > track_len:
Expand Down
2 changes: 1 addition & 1 deletion edubot/cogs/audio/core/events/dpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ async def cog_command_error(self, ctx: commands.Context, error: Exception) -> No

def cog_unload(self) -> None:
if not self.cog_cleaned_up:
self.bot.dispatch("red_audio_unload", self)
self.bot.dispatch("edu_audio_unload", self)
self.session.detach()
self.bot.loop.create_task(self._close_database())
if self.player_automated_timer_task:
Expand Down
18 changes: 9 additions & 9 deletions edubot/cogs/audio/core/events/lavalink.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async def lavalink_event_handler(
guild_data = await self.config.guild(guild).all()
disconnect = guild_data["disconnect"]
if event_type == lavalink.LavalinkEvents.FORCED_DISCONNECT:
self.bot.dispatch("red_audio_audio_disconnect", guild)
self.bot.dispatch("edu_audio_audio_disconnect", guild)
self._ll_guild_updates.discard(guild.id)
return

Expand Down Expand Up @@ -114,7 +114,7 @@ async def lavalink_event_handler(
player.store("prev_requester", requester)
player.store("playing_song", current_track)
player.store("requester", current_requester)
self.bot.dispatch("red_audio_track_start", guild, current_track, current_requester)
self.bot.dispatch("edu_audio_track_start", guild, current_track, current_requester)
if guild_id and current_track:
await self.api_interface.persistent_queue_api.played(
guild_id=guild_id, track_id=current_track.track_identifier
Expand All @@ -130,11 +130,11 @@ async def lavalink_event_handler(
)
if event_type == lavalink.LavalinkEvents.TRACK_END:
prev_requester = player.fetch("prev_requester")
self.bot.dispatch("red_audio_track_end", guild, prev_song, prev_requester)
self.bot.dispatch("edu_audio_track_end", guild, prev_song, prev_requester)
player.store("resume_attempts", 0)
if event_type == lavalink.LavalinkEvents.QUEUE_END:
prev_requester = player.fetch("prev_requester")
self.bot.dispatch("red_audio_queue_end", guild, prev_song, prev_requester)
self.bot.dispatch("edu_audio_queue_end", guild, prev_song, prev_requester)
if guild_id:
await self.api_interface.persistent_queue_api.drop(guild_id)
if player.is_auto_playing or (
Expand Down Expand Up @@ -211,7 +211,7 @@ async def lavalink_event_handler(
if notify_channel and notify and self._has_notify_perms(notify_channel):
await self.send_embed_msg(notify_channel, title=_("Queue ended."))
if disconnect:
self.bot.dispatch("red_audio_audio_disconnect", guild)
self.bot.dispatch("edu_audio_audio_disconnect", guild)
await self.config.guild_from_id(
guild_id=guild_id
).currently_auto_playing_in.set([])
Expand Down Expand Up @@ -255,7 +255,7 @@ async def lavalink_event_handler(
[]
)
self._ll_guild_updates.discard(guild_id)
self.bot.dispatch("red_audio_audio_disconnect", guild)
self.bot.dispatch("edu_audio_audio_disconnect", guild)
if message_channel:
message_channel = self.bot.get_channel(message_channel)
if early_exit:
Expand Down Expand Up @@ -411,7 +411,7 @@ async def _websocket_closed_handler(
)
self._ll_guild_updates.discard(guild_id)
elif not has_perm:
self.bot.dispatch("red_audio_audio_disconnect", guild)
self.bot.dispatch("edu_audio_audio_disconnect", guild)
ws_audio_log.info(
"Voice websocket disconnected "
"Reason: Error code %d & Missing permissions, %r",
Expand All @@ -426,7 +426,7 @@ async def _websocket_closed_handler(
guild_id=guild_id
).currently_auto_playing_in.set([])
else:
self.bot.dispatch("red_audio_audio_disconnect", guild)
self.bot.dispatch("edu_audio_audio_disconnect", guild)
ws_audio_log.info(
"Voice websocket disconnected Reason: Error code %d & Unknown, %r",
code,
Expand Down Expand Up @@ -491,7 +491,7 @@ async def _websocket_closed_handler(
)
self._ll_guild_updates.discard(guild_id)
elif not has_perm:
self.bot.dispatch("red_audio_audio_disconnect", guild)
self.bot.dispatch("edu_audio_audio_disconnect", guild)
ws_audio_log.info(
"Voice websocket disconnected "
"Reason: Error code %d & Missing permissions, %r",
Expand Down
4 changes: 2 additions & 2 deletions edubot/cogs/audio/core/utilities/formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ async def _search_button_action(
player.add(ctx.author, search_choice)
player.maybe_shuffle()
self.bot.dispatch(
"red_audio_track_enqueue", player.guild, search_choice, ctx.author
"edu_audio_track_enqueue", player.guild, search_choice, ctx.author
)
else:
return await self.send_embed_msg(ctx, title=_("Track exceeds maximum length."))
Expand All @@ -196,7 +196,7 @@ async def _search_button_action(
)
player.add(ctx.author, search_choice)
player.maybe_shuffle()
self.bot.dispatch("red_audio_track_enqueue", player.guild, search_choice, ctx.author)
self.bot.dispatch("edu_audio_track_enqueue", player.guild, search_choice, ctx.author)

if not guild_data["shuffle"] and queue_dur > 0:
songembed.set_footer(
Expand Down

0 comments on commit b1605e3

Please sign in to comment.