GithubHelp home page GithubHelp logo

discord-uwu-bot's Introduction

discord-uwu-bot

A Discord bot that translates regular text into UwU-speak.

Examples

English UwU
Hello, world! Hewlo, wowld! UwU!
Lorem ipsum dolar sit amet Lowem ipsum dolaw sit amet UwU!
I'll have you know I graduated top of my class in the Navy Seals I'wl have you knyow I gwawduatewd top of my class in dwe Nyavy Seals UwU!

Commands

  • uwu*that - Uwuify a message in chat. Reply to a message to uwuifiy it.
  • uwu*this - Uwuify text. The rest of the message will be uwuified.
  • uwu*me - Follow the sender and translate everything that they say in the current channel.
  • uwu*stop [where] - Stop following the sender. Optionally set where to "channel", "server", or "everywhere" to stop following in the current channel, current server, or in all of Discord, respectively. Defaults to "channel".
  • uwu*stop_everyone [where] - Stop following everyone in the current channel or server. Optionally set where to "channel" or "server" to specify where to stop following. Defaults to "channel". Requires "Manage Messages" permission.
  • uwu*them <user> - Follow a specified user and translate everything that they say in the current channel. Requires "Manage Messages" permission. Use the command again to stop following.

Configuration

The bot can be configured through a JSON configuration file, located at /opt/UwuBot/appsettings.Production.json by default. You must add your Discord token here before using the bot. If you are using the the install script, then a default configuration file will be provided for you. To create a configuration file manually, start with this template:

{
  "DiscordAuth": {
    "DiscordToken": "YOUR DISCORD TOKEN HERE",
  },
  "BotOptions": {
    "CommandPrefixes": [ "uwu*" ]
  },
  "UwuOptions": {
    "AppendUwu": true,
    "MakeCuteCurses": true
  }
}

The following options are available to customize the bot behavior:

Option Description Default
BotOptions:CommandPrefixes List of command prefixes to respond to. [ "uwu*" ]
UwuOptions:AppendUwu Appends a trailing "UwU!" to the text. true
UwuOptions:MakeCuteCurses Replaces curse words with cuter, more UwU versions. true

Discord Requirements (OAuth2)

To join the bot to a server, you must grant permissions integer 2048. This consists of:

  • bot scope
  • Send Messages permission

You must also grant the "Message Content" intent in the Discord Developer Portal.

System Requirements

  • .NET 6+
  • Windows, Linux, or MacOS. A version of Linux with SystemD (such as Ubuntu) is required to use the built-in install script and service definition.

Setup

Before you can run discord-uwu-bot, you need a Discord API Token. You can get this token by creating and registering a bot at the Discord Developer Portal. You can use any name or profile picture for your bot. Once you have registered the bot, generate and save a Token.

Ubuntu / SystemD Linux

For Ubuntu (or other SystemD-based Linux systems), an install script and service definition are provided. This install script will create a service account (default uwubot), a working directory (default /opt/UwuBot), and a SystemD service (default uwubot). This script can update an existing installation and will preserve the appsettings.Production.json file containing your Discord Token and other configuration values.

  1. Compile the bot or download pre-built binaries.
  2. Run sudo ./install.sh.
  3. [First install only] Edit /opt/UwuBot/appsettings.Production.json and add your Discord token.
  4. Run sudo systemctl start uwubot to start the bot.

Other OS

For non-Ubuntu systems, manual setup is required. The steps below are the bare minimum to run the bot, and do not include steps needed to create a persistent service.

  1. Compile the bot or download pre-built binaries.
  2. Edit appsettings.Production.json and add your Discord token.
  3. Run dotnet DiscordUwuBot.Main.dll to start the bot.

discord-uwu-bot's People

Contributors

warriordog avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

olverts

discord-uwu-bot's Issues

Bug: bot does not function

The bot has become too outdated and no longer functions. Need to research and fix the problem. Starting point would be an update to the latest DSharpPlus.

Token errors when running under Replit

When running under Replit, with the discord token correctly placed in appsettings.Production.json, the following error is emitted:

Unhandled exception. Microsoft.Extensions.Options.OptionsValidationException: DataAnnotation validation failed for 'DiscordAuthOptions' members: 'DiscordToken' with the error: 'The DiscordToken field is required.'.
   at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
   at Microsoft.Extensions.Options.UnnamedOptionsManager`1.get_Value()
   at DiscordUwuBot.Bot.BotMain..ctor(IServiceProvider serviceProvider, ILoggerFactory loggerFactory, IOptions`1 authOptions, IOptions`1 botOptions, ILogger`1 logger, IUwuRepeater uwuRepeater) in /home/runner/discord-uwu-bot-4/Bot/BotMain.cs:line 52
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at DiscordUwuBot.Main.BotService..ctor(IServiceScopeFactory scopeFactory) in /home/runner/discord-uwu-bot-4/Main/BotService.cs:line 24
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at DiscordUwuBot.Main.Program.Main(String[] args) in /home/runner/discord-uwu-bot-4/Main/Program.cs:line 17
   at DiscordUwuBot.Main.Program.<Main>(String[] args)
exit status 134

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.