Class: Botwayrb::Core
- Inherits:
-
Object
- Object
- Botwayrb::Core
- Defined in:
- lib/bwrb.rb
Instance Method Summary collapse
- #get_app_id ⇒ Object
- #get_bot_info(value) ⇒ Object
- #get_guild_id(serverName) ⇒ Object
- #get_signing_secret ⇒ Object
- #get_token ⇒ Object
Instance Method Details
#get_app_id ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/bwrb.rb', line 23 def get_app_id() if get_bot_info("type") == "slack" BotwatConfig["botway"]["bots"][get_bot_info("name")]["bot_app_token"] else BotwatConfig["botway"]["bots"][get_bot_info("name")]["bot_app_id"] end end |
#get_bot_info(value) ⇒ Object
13 14 15 16 17 |
# File 'lib/bwrb.rb', line 13 def get_bot_info(value) data = YAML.load_file(".botway.yaml") data["bot"][value] end |
#get_guild_id(serverName) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/bwrb.rb', line 31 def get_guild_id(serverName) if get_bot_info("type") != "discord" raise Error, "ERROR: This function/feature is only working with discord bots" else BotwatConfig["botway"]["bots"][get_bot_info("name")]["guilds"][serverName]["server_id"] end end |
#get_signing_secret ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/bwrb.rb', line 39 def get_signing_secret() if get_bot_info("type") != "slack" raise Error, "ERROR: This function/feature is only working with slack bots" else BotwatConfig["botway"]["bots"][get_bot_info("name")]["signing_secret"] end end |
#get_token ⇒ Object
19 20 21 |
# File 'lib/bwrb.rb', line 19 def get_token() BotwatConfig["botway"]["bots"][get_bot_info("name")]["bot_token"] end |