2 Framework Custom Events
Mrcoolgamer11 edited this page 2026-11-22 16:07:10 +00:00

This page is generated from docs/framework_events.rst - please edit the source file instead of this page.

Custom Events

Audio

Red.on_red_audio_audio_disconnect(guild)

Dispatched when a player disconnects from a channel

  • Parameters: guild (discord.Guild) -- The guild in which the player disconnected

Red.on_red_audio_queue_end(guild, prev_track, prev_requester)

Dispatched when the queue ends

Red.on_red_audio_skip_track(guild, prev_track, prev_requester)

Dispatched when a track is skipped

Red.on_red_audio_track_auto_play(guild, track, requester, player)

Dispatched when a track is auto-played

  • Parameters:

Red.on_red_audio_track_enqueue(guild, track, requester)

Dispatched when a track is enqueued

Red.on_red_audio_track_end(guild, track, requester)

Dispatched when a playing track ends

Red.on_red_audio_track_start(guild, track, requester)

Dispatched when an enqueued track starts playing

Red.on_red_audio_unload(cog)

Dispatched when the audio cog starts it's unloading task

Filter

Red.on_filter_message_delete(message, hits)

Dispatched when a message is deleted by the filter cog

  • Parameters:
    • message (discord.Message) -- The message that was deleted
    • hits (Set [str ]) -- Words which got detected in the message

Modlog

Red.on_modlog_case_create(case)

Dispatched when a new modlog case is created

Red.on_modlog_case_edit(case)

Dispatched when a modlog case is edited

RPC Server

Red.on_shutdown()

Dispatched when the bot begins its shutdown procedures.

Economy

red_economy_payday_claim(payload: redbot.core.bank.PaydayClaimInformation)

Dispatched when a user successfully claims a payday.

  • Parameters:
    • payload.member -- The member who is claiming their payday. (discord.Member)
    • payload.channel -- The channel where the payday claim is made. (discord.TextChannel, discord.Thread, discord.ForumChannel)
    • payload.message -- The command message that triggered the payday claim. (discord.Message)
    • payload.amount -- The amount of currency claimed in the payday. (int)
    • payload.old_balance -- The old balance of the user before the payday claim. (int)
    • payload.new_balance -- The new balance of the user after the payday claim. (int)
  • Method payload.to_dict: Returns a serializable dictionary representation of the payload. (dict)
  • Method payload.to_json: Returns the payload as JSON. (str)

Bank

red_bank_set_balance(payload: redbot.core.bank.BankSetBalanceInformation)

Dispatched when a user's balance is changed.

  • Parameters:
    • payload.recipient -- The member whose balance is being set. (discord.Member, discord.User)
    • payload.guild -- The guild where the balance is being set. (discord.Guild, NoneType)
    • payload.recipient_old_balance -- The old balance of the user before the change. (int)
    • payload.recipient_new_balance -- The new balance of the user after the change. (int)
  • Method payload.to_dict: Returns a serializable dictionary representation of the payload. (dict)
  • Method payload.to_json: Returns the payload as JSON. (str)

red_bank_transfer_credits(payload: redbot.core.bank.BankTransferInformation)

Dispatched when a user transfers currency to another user.

  • Parameters:
    • payload.sender -- The member who is sending currency. (discord.Member, discord.User)
    • payload.recipient -- The member who is receiving currency. (discord.Member, discord.User)
    • payload.guild -- The guild where the transfer is taking place. (discord.Guild, NoneType)
    • payload.transfer_amount -- The amount of currency being transferred. (int)
    • payload.sender_new_balance -- The new balance of the sender after the transfer. (int)
    • payload.recipient_new_balance -- The new balance of the recipient after the transfer. (int)
  • Method payload.to_dict: Returns a serializable dictionary representation of the payload. (dict)
  • Method payload.to_json: Returns the payload as JSON. (str)

red_bank_prune(payload: redbot.core.bank.BankPruneInformation)

Dispatched when a user is pruned from the bank.

  • Parameters:
    • payload.guild -- The guild where the user is being pruned. (discord.Guild, NoneType)
    • payload.user_id -- The ID of the user being pruned. (int, NoneType)
    • payload.pruned_users -- Dict of pruned user accounts {user_id: {name: str, balance: int, created_at: int}}. (dict)
  • Method payload.to_dict: Returns a serializable dictionary representation of the payload. (dict)
  • Method payload.to_json: Returns the payload as JSON. (str)

red_bank_wipe(guild_id: int)

Dispatched when a guild's bank is wiped. guild_id will be the ID of the Guild that was wiped, -1 if all users were wiped (global bank), or None if all Guilds were wiped (local bank).

red_bank_set_global(global_state: bool)

Dispatched when the global bank is enabled or disabled. global_state will be True if the Bank is being set to Global or False if the bank is being set to Local