Class: DiscordBot::Client

Inherits:
Object
  • Object
show all
Includes:
Channels::Channel, Channels::CreateMessage, Channels::CreateWebhook, Gateway::GetGateway, Gateway::GetGatewayBot, Guilds::Channels, Guilds::Members, Users::CreateChannel, Users::Me, Webhooks::Execute, HTTParty
Defined in:
lib/discord_bot/client.rb,
lib/discord_bot/client/users/me.rb,
lib/discord_bot/client/guilds/members.rb,
lib/discord_bot/client/guilds/channels.rb,
lib/discord_bot/client/channels/channel.rb,
lib/discord_bot/client/webhooks/execute.rb,
lib/discord_bot/client/gateway/get_gateway.rb,
lib/discord_bot/client/users/create_channel.rb,
lib/discord_bot/client/channels/create_message.rb,
lib/discord_bot/client/channels/create_webhook.rb,
lib/discord_bot/client/gateway/get_gateway_bot.rb

Overview

Client library

Defined Under Namespace

Modules: Channels, Gateway, Guilds, Users, Webhooks

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Gateway::GetGatewayBot

#get_gateway_bot

Methods included from Gateway::GetGateway

#get_gateway

Methods included from Users::Me

#me

Methods included from Users::CreateChannel

#create_user_channel

Methods included from Webhooks::Execute

#execute_webhook

Methods included from Channels::CreateWebhook

#create_channel_webhook

Methods included from Channels::CreateMessage

#create_channel_message

Methods included from Channels::Channel

#get_channel

Methods included from Guilds::Channels

#get_guild_channels

Methods included from Guilds::Members

#get_guild_members

Constructor Details

#initialize(bot_token:) ⇒ Client

Returns a new instance of Client.



33
34
35
36
# File 'lib/discord_bot/client.rb', line 33

def initialize(bot_token:)
  @bot_token = bot_token
  @user_agent = "ComConBot #{DiscordBot::VERSION}"
end

Instance Attribute Details

#bot_tokenObject (readonly)

Returns the value of attribute bot_token.



31
32
33
# File 'lib/discord_bot/client.rb', line 31

def bot_token
  @bot_token
end

#user_agentObject (readonly)

Returns the value of attribute user_agent.



31
32
33
# File 'lib/discord_bot/client.rb', line 31

def user_agent
  @user_agent
end