Class: Discordrb::Events::ServerDeleteEvent

Inherits:
ServerEvent show all
Defined in:
lib/discordrb/events/guilds.rb

Overview

Server is deleted, the server was left because the bot was kicked, or the bot made itself leave the server.

Instance Attribute Summary collapse

Attributes inherited from Event

#bot

Instance Method Summary collapse

Methods inherited from ServerEvent

#initialize

Constructor Details

This class inherits a constructor from Discordrb::Events::ServerEvent

Instance Attribute Details

#serverInteger (readonly)

Returns The ID of the server that was left.

Returns:

  • (Integer)

    The ID of the server that was left.


64
65
66
# File 'lib/discordrb/events/guilds.rb', line 64

def server
  @server
end

Instance Method Details

#init_server(data, _bot) ⇒ Object

Override init_server to account for the deleted server


67
68
69
# File 'lib/discordrb/events/guilds.rb', line 67

def init_server(data, _bot)
  @server = data['id'].to_i
end