4 Commits

2 changed files with 28 additions and 8 deletions
+18 -2
View File
@@ -35,12 +35,24 @@ For a sanity check, you can run `docker images` and it should be displayed in th
## Running the Docker container
Running the bot with -d runs the container in detatched mode (as in it runs in the background). If you want to see what is happening, remove that option.
Running the bot with --detach runs the container in detatched mode (as in it runs in the background). If you want to see what is happening, remove that option.
`docker run -d denbot`
`docker run --detach --name denbot denbot`
You can use CTRL+C to exit out of this command window. If you're using Windows, Docker Desktop will now show your bot under 'Containers/Apps', from where you can easily stop and start it using the GUI.
## Updating
If doing it manually, in the folder with all the files run:
```
docker stop denbot
docker rm denbot
docker image rm denbot
docker build -t denbot .
docker run --detach --name denbot denbot
```
### More information
If you want more of a sanity check here are some following commands you can run the following commands:
@@ -51,3 +63,7 @@ If you want more of a sanity check here are some following commands you can run
To access the command line inside the docker container you can run:
`docker exec -it <container id> /bin/bash`
## Future feature suggestions
* If the party want to continue with the same people and the same link code they can do !again (only in the private chat) to run again and get the party for 30 more mins (denBot would also post the link code again so people can see it without scrolling) - using something like https://stackoverflow.com/questions/36563749/how-i-extend-settimeout-on-nodejs and an array of all the queues, removing those and their deletion functions each time an adventure channel is deleted
+10 -6
View File
@@ -141,6 +141,9 @@ function checkQueue(message) {
logger.log('info', 'Emptied queue');
playerVotes = [];
logger.log('info', 'Emptied votes');
pokemonName = '';
captainInGameName = '';
logger.log('info', 'Emptied pokemon name and captain name');
}
else if (playerQueue.length === 0) {
message.channel.send('The queue is empty :(');
@@ -207,15 +210,16 @@ function makeTempChannel(message, adventureMessage) {
// Post in the channel
createdChannel.send(adventureMessage);
createdChannel.send(`Please delete this channel when you're finished with it using the ${config.prefix}dc command`);
})
.catch(logger.error);
try {
// Delete the channel after the configured amount of minutes
setTimeout(function(){ deleteChannel(message, channelName); }, (config.channeldeletetimeinminutes * 1000 * 60) );
} catch (error) {
logger.error(`Tried to delete channel ${channelName} after timeout: `, error);
}
// try {
// // Delete the channel after the configured amount of minutes
// setTimeout(function(){ deleteChannel(message, channelName); }, (config.channeldeletetimeinminutes * 1000 * 60) );
// } catch (error) {
// logger.error(`Tried to delete channel ${channelName} after timeout: `, error);
// }
}
function deleteChannel(message, channelName) {