Class: ESM::Command::Community::Id

Inherits:
ApplicationCommand show all
Defined in:
lib/esm/command/community/id.rb

Instance Method Summary collapse

Instance Method Details

#on_executeObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/esm/command/community/id.rb', line 26

def on_execute
  embed =
    ESM::Embed.build do |e|
      e.description = I18n.t(
        "commands.id.embed.description",
        community_name: current_community.name,
        community_id: current_community.community_id
      )

      servers_command = ESM::Command.get(:servers)

      e.add_field(
        name: I18n.t("commands.id.embed.field.name"),
        value: I18n.t(
          "commands.id.embed.field.value",
          command: servers_command.usage(with_args: true, arguments: {for: current_community.community_id})
        )
      )
    end

  reply(embed)
end