Skip to content

Commit

Permalink
Upgraded to .NET 7 and updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
CPKreu committed Apr 29, 2023
1 parent 34ed07c commit 39ceb67
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ All you have to do is send a .pixi file in any channel and PixiBot will automati

# :question: About PixiBot

PixiBot is a .NET 6 console application written in C#
PixiBot is a .NET 7 console application written in C#

It uses [Discord.Net](https://github.com/discord-net/Discord.Net) to connect to the Discord API, [PixiParser](https://github.com/PixiEditor/PixiParser) to parse .pixi files and [SkiaSharp](https://github.com/mono/SkiaSharp) for rendering the files to a upscaled version png version

Expand Down Expand Up @@ -48,8 +48,6 @@ You will need a Discord bot account if you want to connect to Discord. If you al

2. Click on the "New Application" button and give your new application a name, you can just use your Bot's name

3. Now you can create a Bot by going in the Bot tab and hitting the "Add Bot" button, this will create the Bot account. This action is irreversible!

### :cd: Download and install the bot client

Just download the correct binary from the [releases](https://github.com/PixiEditor/PixiBot/releases/latest) for the machine you will use or you can build it yourself.
Expand All @@ -60,27 +58,31 @@ After the download is complete you will need to extract the ZIP to be able to us

You will need to tell the bot how it can log into Discord

1. Go back to the bot's profile in the Developer Portal, click the "Reset Token" button and hit Copy to copy the token to your clipboard.
1. Go to the Bot tab in the Discord Developer Portal and enable Message Content Intent

2. Click the "Reset Token" button and hit Copy to copy the token to your clipboard.

NOTE: Only share this token with someone you trust! Anyone with that token has full control over your bot.

2. Create a file called `appsettings.json` and open it in your favorite text editor
3. Create a file called `appsettings.json` and open it in your favorite text editor

3. Put in the following JSON data and replace the <bot-token> with your actual bot token (Do not remove any quotation marks!)
4. Put in the following JSON data and replace the <bot-token> with your actual bot token (Do not remove any quotation marks!)

```json
{
"Bot": {
"BotToken": "<bot-token>"
},
"Discord": {
"GatewayIntents": "GuildMessages, DirectMessages, Guilds"
"GatewayIntents": "GuildMessages, DirectMessages, Guilds, MessageContent"
}
}
```

The GatewayIntents tell Discord what the Bot want's to be notified about, if you don't want your Bot to respond to direct messages you can just remove the DirectMessage from the intents

You find additional configuration options, like adding a loading emoji or specifying in which channel the Bot works [here](https://github.com/PixiEditor/PixiBot/wiki/Configuration)

### :arrow_forward: Run the bot

This step depends on your OS
Expand All @@ -91,6 +93,8 @@ Just run the `PixiBot.exe`

#### Linux

Open a terminal in your Bot's directory
Just run the `PixiBot` executable file

If you can't run, you might have to mark the file as executable by opening a terminal in the bots directory and running `sudo chmod +x ./PixiBot`

Run the command `.\PixiBot` (you can also append & to the end to run the bot in the background)
You can also follow this tutorial to set up PixiBot with systemd to make managing easier [here](https://github.com/PixiEditor/PixiBot/wiki/Systemd)
2 changes: 1 addition & 1 deletion src/PixiBot.Bot/PixiBot.Bot.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>PixiEditor.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyVersion>1.0</AssemblyVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/PixiBot.CLI/PixiBot.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>PixiEditor.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyVersion>1.0</AssemblyVersion>
Expand Down

0 comments on commit 39ceb67

Please sign in to comment.