Skip to content

Commit

Permalink
Development (#6)
Browse files Browse the repository at this point in the history
* Bugfix

* Php Stan fix

* Updated dependencies

* * Added possibility to specify channels names by client
* Updated dependencies

* * Allow customizing created channel names via environment variable

* * Allow customizing created channel names via environment variable

---------

Co-authored-by: Dominik süßenbach <dominik.suessenbach@compleet.com>
  • Loading branch information
Domenikus and Dominik süßenbach authored Aug 29, 2023
1 parent ed9b6b5 commit 40b651a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ LOG_CHANNEL=stack
# Default is 'info' if you want to debug the application may you want to change this to 'debug'
LOG_LEVEL=info
# (Optional) Default is empty. Allow customizing the list of channel names by providing additonal ones. Variable need to be json encoded string.
# e.g. { "cities": [ "Munich", "London" ], "software": [ "Word", "Excel" ] }
CHANNEL_NAMES_CUSTOM_LISTS=
# (Optional) Default is empty. Allow client specific channel names by providing the identity ID and a custom list. Variable need to be json encoded string.
# e.g. { "YzablyuJuYIE7ogxTorhImGdA01=": [ "Berhain", "Sisyphos" ], "YbablyuJuYIE7ogxTorhImGdA01=": [ "Foo", "Bar" ] }
CLIENT_SPECIFIC_CHANNEL_NAME_LISTS
```

### Necessary bot permissions in ts3 server
Expand Down
23 changes: 18 additions & 5 deletions config/channel-names.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
<?php

return [
'default' => 'countries',
$config = [
'default' => env('CHANNEL_NAMES_DEFAULT_LIST', 'countries'),

'lists' => [
'countries' => [
'Afghanistan', 'Albania', 'Algeria', 'Andorra', 'Angola', 'Antigua and Barbuda', 'Argentina', 'Armenia', 'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bhutan', 'Bolivia', 'Bosnia and Herzegovina', 'Botswana', 'Brazil', 'Brunei', 'Bulgaria', 'Burkina Faso', 'Burundi', 'Côte d\'Ivoire', 'Cabo Verde', 'Cambodia', 'Cameroon', 'Canada', 'Central African Republic', 'Chad', 'Chile', 'China', 'Colombia', 'Comoros', 'Congo', 'Costa Rica', 'Croatia', 'Cuba', 'Cyprus', 'Czechia', 'Democratic Republic of the Congo', 'Denmark', 'Djibouti', 'Dominica', 'Dominican Republic', 'Ecuador', 'Egypt', 'El Salvador', 'Equatorial Guinea', 'Eritrea', 'Estonia', 'Eswatini', 'Ethiopia', 'Fiji', 'Finland', 'France', 'Gabon', 'Gambia', 'Georgia', 'Germany', 'Ghana', 'Greece', 'Grenada', 'Guatemala', 'Guinea', 'Guinea-Bissau', 'Guyana', 'Haiti', 'Holy See', 'Honduras', 'Hungary', 'Iceland', 'India', 'Indonesia', 'Iran', 'Iraq', 'Ireland', 'Israel', 'Italy', 'Jamaica', 'Japan', 'Jordan', 'Kazakhstan', 'Kenya', 'Kiribati', 'Kuwait', 'Kyrgyzstan', 'Laos', 'Latvia', 'Lebanon', 'Lesotho', 'Liberia', 'Libya', 'Liechtenstein', 'Lithuania', 'Luxembourg', 'Madagascar', 'Malawi', 'Malaysia', 'Maldives', 'Mali', 'Malta', 'Marshall Islands', 'Mauritania', 'Mauritius', 'Mexico', 'Micronesia', 'Moldova', 'Monaco', 'Mongolia', 'Montenegro', 'Morocco', 'Mozambique', 'Myanmar', 'Namibia', 'Nauru', 'Nepal', 'Netherlands', 'New Zealand', 'Nicaragua', 'Niger', 'Nigeria', 'North Korea', 'North Macedonia', 'Norway', 'Oman', 'Pakistan', 'Palau', 'Palestine State', 'Panama', 'Papua New Guinea', 'Paraguay', 'Peru', 'Philippines', 'Poland', 'Portugal', 'Qatar', 'Romania', 'Russia', 'Rwanda', 'Saint Kitts and Nevis', 'Saint Lucia', 'Saint Vincent and the Grenadines', 'Samoa', 'San Marino', 'Sao Tome and Principe', 'Saudi Arabia', 'Senegal', 'Serbia', 'Seychelles', 'Sierra Leone', 'Singapore', 'Slovakia', 'Slovenia', 'Solomon Islands', 'Somalia', 'South Africa', 'South Korea', 'South Sudan', 'Spain', 'Sri Lanka', 'Sudan', 'Suriname', 'Sweden', 'Switzerland', 'Syria', 'Tajikistan', 'Tanzania', 'Thailand', 'Timor-Leste', 'Togo', 'Tonga', 'Trinidad and Tobago', 'Tunisia', 'Turkey', 'Turkmenistan', 'Tuvalu', 'Uganda', 'Ukraine', 'United Arab Emirates', 'United Kingdom', 'United States of America', 'Uruguay', 'Uzbekistan', 'Vanuatu', 'Venezuela', 'Vietnam', 'Yemen', 'Zambia', 'Zimbabwe', 'Tashkent', 'Port Vila', 'Vatican City', 'Caracas', 'Hanoi', 'Sana\'a', 'Lusaka', 'Harare',
],
],
'clients' => [

],
'clients' => [],
];

/** @var string $channelNamesCustomLists */
$channelNamesCustomLists = env('CHANNEL_NAMES_CUSTOM_LISTS');
/** @var string $clientSpecificChannelNameLists */
$clientSpecificChannelNameLists = env('CLIENT_SPECIFIC_CHANNEL_NAME_LISTS');

if ($channelNamesCustomLists) {
$config['lists'] = array_merge($config['lists'], json_decode($channelNamesCustomLists, true));
}

if ($clientSpecificChannelNameLists) {
$config['clients'] = json_decode($clientSpecificChannelNameLists, true);
}

return $config;

0 comments on commit 40b651a

Please sign in to comment.