botwayrb 0.1.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b596ce276c0822c1a429a104dedc5b4d3467376dc5824df83bf7b4f23bfbfd0
4
- data.tar.gz: fedc85bb64797cdd53fb6064e353bcaf306b25fa2bed1e41478bab924f2cdab6
3
+ metadata.gz: b54ca34ffde3ed1b7ec352e4cdd1a5b6effe551f82dcae810539bc383b794cc9
4
+ data.tar.gz: 8e013b1d840636b883d939b7c0e65d4bb53a37bd368d037ab945ad976ebb92e4
5
5
  SHA512:
6
- metadata.gz: 064e7847cc6bce1256be6bb42044619fc59053496eb5bd1ed20bcabef24a552791c926f2705839a505e5f27a3223d55134b0f98fb5ad48720a54c2f2146fdd81
7
- data.tar.gz: b06e1034016235bb8919b164d8100039d7845c5fcdf2fa2dde3584c2c63c6177f80517b52767f137cc146a7c27a86d4993ff94c656854c6e3b46c058b4870890
6
+ metadata.gz: f87272500a431e682dcafa040291ad6f0e3c00e4256f869e5df61a135ca8a08bc56fc350733033cbd0821ecd8336f24b8d2e4d2603aa6635b1602acbe1320792
7
+ data.tar.gz: 8e2c65a20c3e4632fe3bbe3bac2dabab02d5ac926bfecb371d416b7cd334fa605bb7ae71b29aa2538c7b39c592f85f7ff16012e883dff8c8eb5ec9a69d8a49e4
data/.gitignore CHANGED
File without changes
data/.rspec CHANGED
File without changes
data/.rubocop.yml CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
data/botwayrb.gemspec CHANGED
File without changes
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Botwayrb
4
- VERSION = "0.1.0"
4
+ VERSION = "0.3.1"
5
5
  end
data/lib/botwayrb.rb CHANGED
@@ -4,7 +4,6 @@ require_relative "botwayrb/version"
4
4
  require "yaml"
5
5
  require "json"
6
6
 
7
-
8
7
  module Botwayrb
9
8
  BotwatConfig = JSON.parse(File.read(File.join(File.expand_path("~"), ".botway", "botway.json")))
10
9
 
@@ -19,7 +18,7 @@ module Botwayrb
19
18
 
20
19
  def get_token()
21
20
  if get_bot_info("lang") != "ruby"
22
- raise Error, "ERROR: Botway is not running in Ruby"
21
+ raise Error, "ERROR: Your Bot language is not Ruby"
23
22
  else
24
23
  BotwatConfig["botway"]["bots"][get_bot_info("name")]["bot_token"]
25
24
  end
@@ -27,7 +26,7 @@ module Botwayrb
27
26
 
28
27
  def get_app_id()
29
28
  if get_bot_info("lang") != "ruby"
30
- raise Error, "ERROR: Botway is not running in Ruby"
29
+ raise Error, "ERROR: Your Bot language is not Ruby"
31
30
  else
32
31
  if get_bot_info("type") == "slack"
33
32
  BotwatConfig["botway"]["bots"][get_bot_info("name")]["bot_app_token"]
@@ -39,12 +38,22 @@ module Botwayrb
39
38
 
40
39
  def get_guild_id(serverName)
41
40
  if get_bot_info("lang") != "ruby"
42
- raise Error, "ERROR: Botway is not running in Ruby"
41
+ raise Error, "ERROR: Your Bot language is not Ruby"
43
42
  elsif get_bot_info("type") != "discord"
44
- raise Error, "ERROR: This function/feature is only working with discord bots."
43
+ raise Error, "ERROR: This function/feature is only working with discord bots"
45
44
  else
46
45
  BotwatConfig["botway"]["bots"][get_bot_info("name")]["guilds"][serverName]["server_id"]
47
46
  end
48
47
  end
48
+
49
+ def get_signing_secret()
50
+ if get_bot_info("lang") != "ruby"
51
+ raise Error, "ERROR: Your Bot language is not Ruby"
52
+ elsif get_bot_info("type") != "slack"
53
+ raise Error, "ERROR: This function/feature is only working with slack bots"
54
+ else
55
+ BotwatConfig["botway"]["bots"][get_bot_info("name")]["signing_secret"]
56
+ end
57
+ end
49
58
  end
50
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: botwayrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - abdfnx
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-04 00:00:00.000000000 Z
11
+ date: 2022-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yaml