Skip to content

Commit

Permalink
feat: add status explaining usage
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbooth committed Jul 26, 2023
1 parent 949c432 commit 91c807f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.6.2] - 2023-07-26

### Added

- Added status which explains bot usage.

## [1.6.1] - 2023-07-24

### Added
Expand Down
9 changes: 9 additions & 0 deletions SuggestionBot/Services/BotService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.Reflection;
using DSharpPlus;
using DSharpPlus.Entities;
using DSharpPlus.EventArgs;
using DSharpPlus.SlashCommands;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -66,6 +68,13 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken)
slashCommands.RegisterCommands<SuggestCommand>();
slashCommands.RegisterCommands<SuggestionCommand>();

_discordClient.Ready += OnReady;
return _discordClient.ConnectAsync();
}

private Task OnReady(DiscordClient sender, ReadyEventArgs args)
{
var activity = new DiscordActivity("/suggest to make suggestions", ActivityType.Playing);
return _discordClient.UpdateStatusAsync(activity);
}
}

0 comments on commit 91c807f

Please sign in to comment.